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->is_haswell) {
   133152          return 0;
   133153       } else {
   133154          return 0;
   133155       }
   133156    case 6: return 13;
   133157    case 5: return 0;
   133158    case 4:
   133159       if (devinfo->is_g4x) {
   133160          return 0;
   133161       } else {
   133162          return 0;
   133163       }
   133164    default:
   133165       unreachable("Invalid hardware generation");
   133166    }
   133167 }
   133168 
   133169 
   133170 
   133171 /* INSTDONE_2::FT Done */
   133172 
   133173 
   133174 #define GEN6_INSTDONE_2_FTDone_bits  1
   133175 
   133176 static inline uint32_t ATTRIBUTE_PURE
   133177 INSTDONE_2_FTDone_bits(const struct gen_device_info *devinfo)
   133178 {
   133179    switch (devinfo->gen) {
   133180    case 10: return 0;
   133181    case 9: return 0;
   133182    case 8: return 0;
   133183    case 7:
   133184       if (devinfo->is_haswell) {
   133185          return 0;
   133186       } else {
   133187          return 0;
   133188       }
   133189    case 6: return 1;
   133190    case 5: return 0;
   133191    case 4:
   133192       if (devinfo->is_g4x) {
   133193          return 0;
   133194       } else {
   133195          return 0;
   133196       }
   133197    default:
   133198       unreachable("Invalid hardware generation");
   133199    }
   133200 }
   133201 
   133202 
   133203 
   133204 #define GEN6_INSTDONE_2_FTDone_start  10
   133205 
   133206 static inline uint32_t ATTRIBUTE_PURE
   133207 INSTDONE_2_FTDone_start(const struct gen_device_info *devinfo)
   133208 {
   133209    switch (devinfo->gen) {
   133210    case 10: return 0;
   133211    case 9: return 0;
   133212    case 8: return 0;
   133213    case 7:
   133214       if (devinfo->is_haswell) {
   133215          return 0;
   133216       } else {
   133217          return 0;
   133218       }
   133219    case 6: return 10;
   133220    case 5: return 0;
   133221    case 4:
   133222       if (devinfo->is_g4x) {
   133223          return 0;
   133224       } else {
   133225          return 0;
   133226       }
   133227    default:
   133228       unreachable("Invalid hardware generation");
   133229    }
   133230 }
   133231 
   133232 
   133233 
   133234 /* INSTDONE_2::GAM Done */
   133235 
   133236 
   133237 #define GEN6_INSTDONE_2_GAMDone_bits  1
   133238 
   133239 static inline uint32_t ATTRIBUTE_PURE
   133240 INSTDONE_2_GAMDone_bits(const struct gen_device_info *devinfo)
   133241 {
   133242    switch (devinfo->gen) {
   133243    case 10: return 0;
   133244    case 9: return 0;
   133245    case 8: return 0;
   133246    case 7:
   133247       if (devinfo->is_haswell) {
   133248          return 0;
   133249       } else {
   133250          return 0;
   133251       }
   133252    case 6: return 1;
   133253    case 5: return 0;
   133254    case 4:
   133255       if (devinfo->is_g4x) {
   133256          return 0;
   133257       } else {
   133258          return 0;
   133259       }
   133260    default:
   133261       unreachable("Invalid hardware generation");
   133262    }
   133263 }
   133264 
   133265 
   133266 
   133267 #define GEN6_INSTDONE_2_GAMDone_start  31
   133268 
   133269 static inline uint32_t ATTRIBUTE_PURE
   133270 INSTDONE_2_GAMDone_start(const struct gen_device_info *devinfo)
   133271 {
   133272    switch (devinfo->gen) {
   133273    case 10: return 0;
   133274    case 9: return 0;
   133275    case 8: return 0;
   133276    case 7:
   133277       if (devinfo->is_haswell) {
   133278          return 0;
   133279       } else {
   133280          return 0;
   133281       }
   133282    case 6: return 31;
   133283    case 5: return 0;
   133284    case 4:
   133285       if (devinfo->is_g4x) {
   133286          return 0;
   133287       } else {
   133288          return 0;
   133289       }
   133290    default:
   133291       unreachable("Invalid hardware generation");
   133292    }
   133293 }
   133294 
   133295 
   133296 
   133297 /* INSTDONE_2::GS Done */
   133298 
   133299 
   133300 #define GEN6_INSTDONE_2_GSDone_bits  1
   133301 
   133302 static inline uint32_t ATTRIBUTE_PURE
   133303 INSTDONE_2_GSDone_bits(const struct gen_device_info *devinfo)
   133304 {
   133305    switch (devinfo->gen) {
   133306    case 10: return 0;
   133307    case 9: return 0;
   133308    case 8: return 0;
   133309    case 7:
   133310       if (devinfo->is_haswell) {
   133311          return 0;
   133312       } else {
   133313          return 0;
   133314       }
   133315    case 6: return 1;
   133316    case 5: return 0;
   133317    case 4:
   133318       if (devinfo->is_g4x) {
   133319          return 0;
   133320       } else {
   133321          return 0;
   133322       }
   133323    default:
   133324       unreachable("Invalid hardware generation");
   133325    }
   133326 }
   133327 
   133328 
   133329 
   133330 #define GEN6_INSTDONE_2_GSDone_start  2
   133331 
   133332 static inline uint32_t ATTRIBUTE_PURE
   133333 INSTDONE_2_GSDone_start(const struct gen_device_info *devinfo)
   133334 {
   133335    switch (devinfo->gen) {
   133336    case 10: return 0;
   133337    case 9: return 0;
   133338    case 8: return 0;
   133339    case 7:
   133340       if (devinfo->is_haswell) {
   133341          return 0;
   133342       } else {
   133343          return 0;
   133344       }
   133345    case 6: return 2;
   133346    case 5: return 0;
   133347    case 4:
   133348       if (devinfo->is_g4x) {
   133349          return 0;
   133350       } else {
   133351          return 0;
   133352       }
   133353    default:
   133354       unreachable("Invalid hardware generation");
   133355    }
   133356 }
   133357 
   133358 
   133359 
   133360 /* INSTDONE_2::ISC Done */
   133361 
   133362 
   133363 #define GEN6_INSTDONE_2_ISCDone_bits  1
   133364 
   133365 static inline uint32_t ATTRIBUTE_PURE
   133366 INSTDONE_2_ISCDone_bits(const struct gen_device_info *devinfo)
   133367 {
   133368    switch (devinfo->gen) {
   133369    case 10: return 0;
   133370    case 9: return 0;
   133371    case 8: return 0;
   133372    case 7:
   133373       if (devinfo->is_haswell) {
   133374          return 0;
   133375       } else {
   133376          return 0;
   133377       }
   133378    case 6: return 1;
   133379    case 5: return 0;
   133380    case 4:
   133381       if (devinfo->is_g4x) {
   133382          return 0;
   133383       } else {
   133384          return 0;
   133385       }
   133386    default:
   133387       unreachable("Invalid hardware generation");
   133388    }
   133389 }
   133390 
   133391 
   133392 
   133393 #define GEN6_INSTDONE_2_ISCDone_start  25
   133394 
   133395 static inline uint32_t ATTRIBUTE_PURE
   133396 INSTDONE_2_ISCDone_start(const struct gen_device_info *devinfo)
   133397 {
   133398    switch (devinfo->gen) {
   133399    case 10: return 0;
   133400    case 9: return 0;
   133401    case 8: return 0;
   133402    case 7:
   133403       if (devinfo->is_haswell) {
   133404          return 0;
   133405       } else {
   133406          return 0;
   133407       }
   133408    case 6: return 25;
   133409    case 5: return 0;
   133410    case 4:
   133411       if (devinfo->is_g4x) {
   133412          return 0;
   133413       } else {
   133414          return 0;
   133415       }
   133416    default:
   133417       unreachable("Invalid hardware generation");
   133418    }
   133419 }
   133420 
   133421 
   133422 
   133423 /* INSTDONE_2::IZ Done */
   133424 
   133425 
   133426 #define GEN6_INSTDONE_2_IZDone_bits  1
   133427 
   133428 static inline uint32_t ATTRIBUTE_PURE
   133429 INSTDONE_2_IZDone_bits(const struct gen_device_info *devinfo)
   133430 {
   133431    switch (devinfo->gen) {
   133432    case 10: return 0;
   133433    case 9: return 0;
   133434    case 8: return 0;
   133435    case 7:
   133436       if (devinfo->is_haswell) {
   133437          return 0;
   133438       } else {
   133439          return 0;
   133440       }
   133441    case 6: return 1;
   133442    case 5: return 0;
   133443    case 4:
   133444       if (devinfo->is_g4x) {
   133445          return 0;
   133446       } else {
   133447          return 0;
   133448       }
   133449    default:
   133450       unreachable("Invalid hardware generation");
   133451    }
   133452 }
   133453 
   133454 
   133455 
   133456 #define GEN6_INSTDONE_2_IZDone_start  17
   133457 
   133458 static inline uint32_t ATTRIBUTE_PURE
   133459 INSTDONE_2_IZDone_start(const struct gen_device_info *devinfo)
   133460 {
   133461    switch (devinfo->gen) {
   133462    case 10: return 0;
   133463    case 9: return 0;
   133464    case 8: return 0;
   133465    case 7:
   133466       if (devinfo->is_haswell) {
   133467          return 0;
   133468       } else {
   133469          return 0;
   133470       }
   133471    case 6: return 17;
   133472    case 5: return 0;
   133473    case 4:
   133474       if (devinfo->is_g4x) {
   133475          return 0;
   133476       } else {
   133477          return 0;
   133478       }
   133479    default:
   133480       unreachable("Invalid hardware generation");
   133481    }
   133482 }
   133483 
   133484 
   133485 
   133486 /* INSTDONE_2::MT Done */
   133487 
   133488 
   133489 #define GEN6_INSTDONE_2_MTDone_bits  1
   133490 
   133491 static inline uint32_t ATTRIBUTE_PURE
   133492 INSTDONE_2_MTDone_bits(const struct gen_device_info *devinfo)
   133493 {
   133494    switch (devinfo->gen) {
   133495    case 10: return 0;
   133496    case 9: return 0;
   133497    case 8: return 0;
   133498    case 7:
   133499       if (devinfo->is_haswell) {
   133500          return 0;
   133501       } else {
   133502          return 0;
   133503       }
   133504    case 6: return 1;
   133505    case 5: return 0;
   133506    case 4:
   133507       if (devinfo->is_g4x) {
   133508          return 0;
   133509       } else {
   133510          return 0;
   133511       }
   133512    default:
   133513       unreachable("Invalid hardware generation");
   133514    }
   133515 }
   133516 
   133517 
   133518 
   133519 #define GEN6_INSTDONE_2_MTDone_start  24
   133520 
   133521 static inline uint32_t ATTRIBUTE_PURE
   133522 INSTDONE_2_MTDone_start(const struct gen_device_info *devinfo)
   133523 {
   133524    switch (devinfo->gen) {
   133525    case 10: return 0;
   133526    case 9: return 0;
   133527    case 8: return 0;
   133528    case 7:
   133529       if (devinfo->is_haswell) {
   133530          return 0;
   133531       } else {
   133532          return 0;
   133533       }
   133534    case 6: return 24;
   133535    case 5: return 0;
   133536    case 4:
   133537       if (devinfo->is_g4x) {
   133538          return 0;
   133539       } else {
   133540          return 0;
   133541       }
   133542    default:
   133543       unreachable("Invalid hardware generation");
   133544    }
   133545 }
   133546 
   133547 
   133548 
   133549 /* INSTDONE_2::PL Done */
   133550 
   133551 
   133552 #define GEN6_INSTDONE_2_PLDone_bits  1
   133553 
   133554 static inline uint32_t ATTRIBUTE_PURE
   133555 INSTDONE_2_PLDone_bits(const struct gen_device_info *devinfo)
   133556 {
   133557    switch (devinfo->gen) {
   133558    case 10: return 0;
   133559    case 9: return 0;
   133560    case 8: return 0;
   133561    case 7:
   133562       if (devinfo->is_haswell) {
   133563          return 0;
   133564       } else {
   133565          return 0;
   133566       }
   133567    case 6: return 1;
   133568    case 5: return 0;
   133569    case 4:
   133570       if (devinfo->is_g4x) {
   133571          return 0;
   133572       } else {
   133573          return 0;
   133574       }
   133575    default:
   133576       unreachable("Invalid hardware generation");
   133577    }
   133578 }
   133579 
   133580 
   133581 
   133582 #define GEN6_INSTDONE_2_PLDone_start  6
   133583 
   133584 static inline uint32_t ATTRIBUTE_PURE
   133585 INSTDONE_2_PLDone_start(const struct gen_device_info *devinfo)
   133586 {
   133587    switch (devinfo->gen) {
   133588    case 10: return 0;
   133589    case 9: return 0;
   133590    case 8: return 0;
   133591    case 7:
   133592       if (devinfo->is_haswell) {
   133593          return 0;
   133594       } else {
   133595          return 0;
   133596       }
   133597    case 6: return 6;
   133598    case 5: return 0;
   133599    case 4:
   133600       if (devinfo->is_g4x) {
   133601          return 0;
   133602       } else {
   133603          return 0;
   133604       }
   133605    default:
   133606       unreachable("Invalid hardware generation");
   133607    }
   133608 }
   133609 
   133610 
   133611 
   133612 /* INSTDONE_2::PSD Done */
   133613 
   133614 
   133615 #define GEN6_INSTDONE_2_PSDDone_bits  1
   133616 
   133617 static inline uint32_t ATTRIBUTE_PURE
   133618 INSTDONE_2_PSDDone_bits(const struct gen_device_info *devinfo)
   133619 {
   133620    switch (devinfo->gen) {
   133621    case 10: return 0;
   133622    case 9: return 0;
   133623    case 8: return 0;
   133624    case 7:
   133625       if (devinfo->is_haswell) {
   133626          return 0;
   133627       } else {
   133628          return 0;
   133629       }
   133630    case 6: return 1;
   133631    case 5: return 0;
   133632    case 4:
   133633       if (devinfo->is_g4x) {
   133634          return 0;
   133635       } else {
   133636          return 0;
   133637       }
   133638    default:
   133639       unreachable("Invalid hardware generation");
   133640    }
   133641 }
   133642 
   133643 
   133644 
   133645 #define GEN6_INSTDONE_2_PSDDone_start  18
   133646 
   133647 static inline uint32_t ATTRIBUTE_PURE
   133648 INSTDONE_2_PSDDone_start(const struct gen_device_info *devinfo)
   133649 {
   133650    switch (devinfo->gen) {
   133651    case 10: return 0;
   133652    case 9: return 0;
   133653    case 8: return 0;
   133654    case 7:
   133655       if (devinfo->is_haswell) {
   133656          return 0;
   133657       } else {
   133658          return 0;
   133659       }
   133660    case 6: return 18;
   133661    case 5: return 0;
   133662    case 4:
   133663       if (devinfo->is_g4x) {
   133664          return 0;
   133665       } else {
   133666          return 0;
   133667       }
   133668    default:
   133669       unreachable("Invalid hardware generation");
   133670    }
   133671 }
   133672 
   133673 
   133674 
   133675 /* INSTDONE_2::QC Done */
   133676 
   133677 
   133678 #define GEN6_INSTDONE_2_QCDone_bits  1
   133679 
   133680 static inline uint32_t ATTRIBUTE_PURE
   133681 INSTDONE_2_QCDone_bits(const struct gen_device_info *devinfo)
   133682 {
   133683    switch (devinfo->gen) {
   133684    case 10: return 0;
   133685    case 9: return 0;
   133686    case 8: return 0;
   133687    case 7:
   133688       if (devinfo->is_haswell) {
   133689          return 0;
   133690       } else {
   133691          return 0;
   133692       }
   133693    case 6: return 1;
   133694    case 5: return 0;
   133695    case 4:
   133696       if (devinfo->is_g4x) {
   133697          return 0;
   133698       } else {
   133699          return 0;
   133700       }
   133701    default:
   133702       unreachable("Invalid hardware generation");
   133703    }
   133704 }
   133705 
   133706 
   133707 
   133708 #define GEN6_INSTDONE_2_QCDone_start  14
   133709 
   133710 static inline uint32_t ATTRIBUTE_PURE
   133711 INSTDONE_2_QCDone_start(const struct gen_device_info *devinfo)
   133712 {
   133713    switch (devinfo->gen) {
   133714    case 10: return 0;
   133715    case 9: return 0;
   133716    case 8: return 0;
   133717    case 7:
   133718       if (devinfo->is_haswell) {
   133719          return 0;
   133720       } else {
   133721          return 0;
   133722       }
   133723    case 6: return 14;
   133724    case 5: return 0;
   133725    case 4:
   133726       if (devinfo->is_g4x) {
   133727          return 0;
   133728       } else {
   133729          return 0;
   133730       }
   133731    default:
   133732       unreachable("Invalid hardware generation");
   133733    }
   133734 }
   133735 
   133736 
   133737 
   133738 /* INSTDONE_2::RCC Done */
   133739 
   133740 
   133741 #define GEN6_INSTDONE_2_RCCDone_bits  1
   133742 
   133743 static inline uint32_t ATTRIBUTE_PURE
   133744 INSTDONE_2_RCCDone_bits(const struct gen_device_info *devinfo)
   133745 {
   133746    switch (devinfo->gen) {
   133747    case 10: return 0;
   133748    case 9: return 0;
   133749    case 8: return 0;
   133750    case 7:
   133751       if (devinfo->is_haswell) {
   133752          return 0;
   133753       } else {
   133754          return 0;
   133755       }
   133756    case 6: return 1;
   133757    case 5: return 0;
   133758    case 4:
   133759       if (devinfo->is_g4x) {
   133760          return 0;
   133761       } else {
   133762          return 0;
   133763       }
   133764    default:
   133765       unreachable("Invalid hardware generation");
   133766    }
   133767 }
   133768 
   133769 
   133770 
   133771 #define GEN6_INSTDONE_2_RCCDone_start  27
   133772 
   133773 static inline uint32_t ATTRIBUTE_PURE
   133774 INSTDONE_2_RCCDone_start(const struct gen_device_info *devinfo)
   133775 {
   133776    switch (devinfo->gen) {
   133777    case 10: return 0;
   133778    case 9: return 0;
   133779    case 8: return 0;
   133780    case 7:
   133781       if (devinfo->is_haswell) {
   133782          return 0;
   133783       } else {
   133784          return 0;
   133785       }
   133786    case 6: return 27;
   133787    case 5: return 0;
   133788    case 4:
   133789       if (devinfo->is_g4x) {
   133790          return 0;
   133791       } else {
   133792          return 0;
   133793       }
   133794    default:
   133795       unreachable("Invalid hardware generation");
   133796    }
   133797 }
   133798 
   133799 
   133800 
   133801 /* INSTDONE_2::RCPBE Done */
   133802 
   133803 
   133804 #define GEN6_INSTDONE_2_RCPBEDone_bits  1
   133805 
   133806 static inline uint32_t ATTRIBUTE_PURE
   133807 INSTDONE_2_RCPBEDone_bits(const struct gen_device_info *devinfo)
   133808 {
   133809    switch (devinfo->gen) {
   133810    case 10: return 0;
   133811    case 9: return 0;
   133812    case 8: return 0;
   133813    case 7:
   133814       if (devinfo->is_haswell) {
   133815          return 0;
   133816       } else {
   133817          return 0;
   133818       }
   133819    case 6: return 1;
   133820    case 5: return 0;
   133821    case 4:
   133822       if (devinfo->is_g4x) {
   133823          return 0;
   133824       } else {
   133825          return 0;
   133826       }
   133827    default:
   133828       unreachable("Invalid hardware generation");
   133829    }
   133830 }
   133831 
   133832 
   133833 
   133834 #define GEN6_INSTDONE_2_RCPBEDone_start  22
   133835 
   133836 static inline uint32_t ATTRIBUTE_PURE
   133837 INSTDONE_2_RCPBEDone_start(const struct gen_device_info *devinfo)
   133838 {
   133839    switch (devinfo->gen) {
   133840    case 10: return 0;
   133841    case 9: return 0;
   133842    case 8: return 0;
   133843    case 7:
   133844       if (devinfo->is_haswell) {
   133845          return 0;
   133846       } else {
   133847          return 0;
   133848       }
   133849    case 6: return 22;
   133850    case 5: return 0;
   133851    case 4:
   133852       if (devinfo->is_g4x) {
   133853          return 0;
   133854       } else {
   133855          return 0;
   133856       }
   133857    default:
   133858       unreachable("Invalid hardware generation");
   133859    }
   133860 }
   133861 
   133862 
   133863 
   133864 /* INSTDONE_2::RCPFE Done */
   133865 
   133866 
   133867 #define GEN6_INSTDONE_2_RCPFEDone_bits  1
   133868 
   133869 static inline uint32_t ATTRIBUTE_PURE
   133870 INSTDONE_2_RCPFEDone_bits(const struct gen_device_info *devinfo)
   133871 {
   133872    switch (devinfo->gen) {
   133873    case 10: return 0;
   133874    case 9: return 0;
   133875    case 8: return 0;
   133876    case 7:
   133877       if (devinfo->is_haswell) {
   133878          return 0;
   133879       } else {
   133880          return 0;
   133881       }
   133882    case 6: return 1;
   133883    case 5: return 0;
   133884    case 4:
   133885       if (devinfo->is_g4x) {
   133886          return 0;
   133887       } else {
   133888          return 0;
   133889       }
   133890    default:
   133891       unreachable("Invalid hardware generation");
   133892    }
   133893 }
   133894 
   133895 
   133896 
   133897 #define GEN6_INSTDONE_2_RCPFEDone_start  23
   133898 
   133899 static inline uint32_t ATTRIBUTE_PURE
   133900 INSTDONE_2_RCPFEDone_start(const struct gen_device_info *devinfo)
   133901 {
   133902    switch (devinfo->gen) {
   133903    case 10: return 0;
   133904    case 9: return 0;
   133905    case 8: return 0;
   133906    case 7:
   133907       if (devinfo->is_haswell) {
   133908          return 0;
   133909       } else {
   133910          return 0;
   133911       }
   133912    case 6: return 23;
   133913    case 5: return 0;
   133914    case 4:
   133915       if (devinfo->is_g4x) {
   133916          return 0;
   133917       } else {
   133918          return 0;
   133919       }
   133920    default:
   133921       unreachable("Invalid hardware generation");
   133922    }
   133923 }
   133924 
   133925 
   133926 
   133927 /* INSTDONE_2::RCZ Done */
   133928 
   133929 
   133930 #define GEN6_INSTDONE_2_RCZDone_bits  1
   133931 
   133932 static inline uint32_t ATTRIBUTE_PURE
   133933 INSTDONE_2_RCZDone_bits(const struct gen_device_info *devinfo)
   133934 {
   133935    switch (devinfo->gen) {
   133936    case 10: return 0;
   133937    case 9: return 0;
   133938    case 8: return 0;
   133939    case 7:
   133940       if (devinfo->is_haswell) {
   133941          return 0;
   133942       } else {
   133943          return 0;
   133944       }
   133945    case 6: return 1;
   133946    case 5: return 0;
   133947    case 4:
   133948       if (devinfo->is_g4x) {
   133949          return 0;
   133950       } else {
   133951          return 0;
   133952       }
   133953    default:
   133954       unreachable("Invalid hardware generation");
   133955    }
   133956 }
   133957 
   133958 
   133959 
   133960 #define GEN6_INSTDONE_2_RCZDone_start  20
   133961 
   133962 static inline uint32_t ATTRIBUTE_PURE
   133963 INSTDONE_2_RCZDone_start(const struct gen_device_info *devinfo)
   133964 {
   133965    switch (devinfo->gen) {
   133966    case 10: return 0;
   133967    case 9: return 0;
   133968    case 8: return 0;
   133969    case 7:
   133970       if (devinfo->is_haswell) {
   133971          return 0;
   133972       } else {
   133973          return 0;
   133974       }
   133975    case 6: return 20;
   133976    case 5: return 0;
   133977    case 4:
   133978       if (devinfo->is_g4x) {
   133979          return 0;
   133980       } else {
   133981          return 0;
   133982       }
   133983    default:
   133984       unreachable("Invalid hardware generation");
   133985    }
   133986 }
   133987 
   133988 
   133989 
   133990 /* INSTDONE_2::SC Done */
   133991 
   133992 
   133993 #define GEN6_INSTDONE_2_SCDone_bits  1
   133994 
   133995 static inline uint32_t ATTRIBUTE_PURE
   133996 INSTDONE_2_SCDone_bits(const struct gen_device_info *devinfo)
   133997 {
   133998    switch (devinfo->gen) {
   133999    case 10: return 0;
   134000    case 9: return 0;
   134001    case 8: return 0;
   134002    case 7:
   134003       if (devinfo->is_haswell) {
   134004          return 0;
   134005       } else {
   134006          return 0;
   134007       }
   134008    case 6: return 1;
   134009    case 5: return 0;
   134010    case 4:
   134011       if (devinfo->is_g4x) {
   134012          return 0;
   134013       } else {
   134014          return 0;
   134015       }
   134016    default:
   134017       unreachable("Invalid hardware generation");
   134018    }
   134019 }
   134020 
   134021 
   134022 
   134023 #define GEN6_INSTDONE_2_SCDone_start  12
   134024 
   134025 static inline uint32_t ATTRIBUTE_PURE
   134026 INSTDONE_2_SCDone_start(const struct gen_device_info *devinfo)
   134027 {
   134028    switch (devinfo->gen) {
   134029    case 10: return 0;
   134030    case 9: return 0;
   134031    case 8: return 0;
   134032    case 7:
   134033       if (devinfo->is_haswell) {
   134034          return 0;
   134035       } else {
   134036          return 0;
   134037       }
   134038    case 6: return 12;
   134039    case 5: return 0;
   134040    case 4:
   134041       if (devinfo->is_g4x) {
   134042          return 0;
   134043       } else {
   134044          return 0;
   134045       }
   134046    default:
   134047       unreachable("Invalid hardware generation");
   134048    }
   134049 }
   134050 
   134051 
   134052 
   134053 /* INSTDONE_2::SF Done */
   134054 
   134055 
   134056 #define GEN6_INSTDONE_2_SFDone_bits  1
   134057 
   134058 static inline uint32_t ATTRIBUTE_PURE
   134059 INSTDONE_2_SFDone_bits(const struct gen_device_info *devinfo)
   134060 {
   134061    switch (devinfo->gen) {
   134062    case 10: return 0;
   134063    case 9: return 0;
   134064    case 8: return 0;
   134065    case 7:
   134066       if (devinfo->is_haswell) {
   134067          return 0;
   134068       } else {
   134069          return 0;
   134070       }
   134071    case 6: return 1;
   134072    case 5: return 0;
   134073    case 4:
   134074       if (devinfo->is_g4x) {
   134075          return 0;
   134076       } else {
   134077          return 0;
   134078       }
   134079    default:
   134080       unreachable("Invalid hardware generation");
   134081    }
   134082 }
   134083 
   134084 
   134085 
   134086 #define GEN6_INSTDONE_2_SFDone_start  4
   134087 
   134088 static inline uint32_t ATTRIBUTE_PURE
   134089 INSTDONE_2_SFDone_start(const struct gen_device_info *devinfo)
   134090 {
   134091    switch (devinfo->gen) {
   134092    case 10: return 0;
   134093    case 9: return 0;
   134094    case 8: return 0;
   134095    case 7:
   134096       if (devinfo->is_haswell) {
   134097          return 0;
   134098       } else {
   134099          return 0;
   134100       }
   134101    case 6: return 4;
   134102    case 5: return 0;
   134103    case 4:
   134104       if (devinfo->is_g4x) {
   134105          return 0;
   134106       } else {
   134107          return 0;
   134108       }
   134109    default:
   134110       unreachable("Invalid hardware generation");
   134111    }
   134112 }
   134113 
   134114 
   134115 
   134116 /* INSTDONE_2::SI Done */
   134117 
   134118 
   134119 #define GEN6_INSTDONE_2_SIDone_bits  1
   134120 
   134121 static inline uint32_t ATTRIBUTE_PURE
   134122 INSTDONE_2_SIDone_bits(const struct gen_device_info *devinfo)
   134123 {
   134124    switch (devinfo->gen) {
   134125    case 10: return 0;
   134126    case 9: return 0;
   134127    case 8: return 0;
   134128    case 7:
   134129       if (devinfo->is_haswell) {
   134130          return 0;
   134131       } else {
   134132          return 0;
   134133       }
   134134    case 6: return 1;
   134135    case 5: return 0;
   134136    case 4:
   134137       if (devinfo->is_g4x) {
   134138          return 0;
   134139       } else {
   134140          return 0;
   134141       }
   134142    default:
   134143       unreachable("Invalid hardware generation");
   134144    }
   134145 }
   134146 
   134147 
   134148 
   134149 #define GEN6_INSTDONE_2_SIDone_start  8
   134150 
   134151 static inline uint32_t ATTRIBUTE_PURE
   134152 INSTDONE_2_SIDone_start(const struct gen_device_info *devinfo)
   134153 {
   134154    switch (devinfo->gen) {
   134155    case 10: return 0;
   134156    case 9: return 0;
   134157    case 8: return 0;
   134158    case 7:
   134159       if (devinfo->is_haswell) {
   134160          return 0;
   134161       } else {
   134162          return 0;
   134163       }
   134164    case 6: return 8;
   134165    case 5: return 0;
   134166    case 4:
   134167       if (devinfo->is_g4x) {
   134168          return 0;
   134169       } else {
   134170          return 0;
   134171       }
   134172    default:
   134173       unreachable("Invalid hardware generation");
   134174    }
   134175 }
   134176 
   134177 
   134178 
   134179 /* INSTDONE_2::SO Done */
   134180 
   134181 
   134182 #define GEN6_INSTDONE_2_SODone_bits  1
   134183 
   134184 static inline uint32_t ATTRIBUTE_PURE
   134185 INSTDONE_2_SODone_bits(const struct gen_device_info *devinfo)
   134186 {
   134187    switch (devinfo->gen) {
   134188    case 10: return 0;
   134189    case 9: return 0;
   134190    case 8: return 0;
   134191    case 7:
   134192       if (devinfo->is_haswell) {
   134193          return 0;
   134194       } else {
   134195          return 0;
   134196       }
   134197    case 6: return 1;
   134198    case 5: return 0;
   134199    case 4:
   134200       if (devinfo->is_g4x) {
   134201          return 0;
   134202       } else {
   134203          return 0;
   134204       }
   134205    default:
   134206       unreachable("Invalid hardware generation");
   134207    }
   134208 }
   134209 
   134210 
   134211 
   134212 #define GEN6_INSTDONE_2_SODone_start  7
   134213 
   134214 static inline uint32_t ATTRIBUTE_PURE
   134215 INSTDONE_2_SODone_start(const struct gen_device_info *devinfo)
   134216 {
   134217    switch (devinfo->gen) {
   134218    case 10: return 0;
   134219    case 9: return 0;
   134220    case 8: return 0;
   134221    case 7:
   134222       if (devinfo->is_haswell) {
   134223          return 0;
   134224       } else {
   134225          return 0;
   134226       }
   134227    case 6: return 7;
   134228    case 5: return 0;
   134229    case 4:
   134230       if (devinfo->is_g4x) {
   134231          return 0;
   134232       } else {
   134233          return 0;
   134234       }
   134235    default:
   134236       unreachable("Invalid hardware generation");
   134237    }
   134238 }
   134239 
   134240 
   134241 
   134242 /* INSTDONE_2::SVG Done */
   134243 
   134244 
   134245 #define GEN6_INSTDONE_2_SVGDone_bits  1
   134246 
   134247 static inline uint32_t ATTRIBUTE_PURE
   134248 INSTDONE_2_SVGDone_bits(const struct gen_device_info *devinfo)
   134249 {
   134250    switch (devinfo->gen) {
   134251    case 10: return 0;
   134252    case 9: return 0;
   134253    case 8: return 0;
   134254    case 7:
   134255       if (devinfo->is_haswell) {
   134256          return 0;
   134257       } else {
   134258          return 0;
   134259       }
   134260    case 6: return 1;
   134261    case 5: return 0;
   134262    case 4:
   134263       if (devinfo->is_g4x) {
   134264          return 0;
   134265       } else {
   134266          return 0;
   134267       }
   134268    default:
   134269       unreachable("Invalid hardware generation");
   134270    }
   134271 }
   134272 
   134273 
   134274 
   134275 #define GEN6_INSTDONE_2_SVGDone_start  26
   134276 
   134277 static inline uint32_t ATTRIBUTE_PURE
   134278 INSTDONE_2_SVGDone_start(const struct gen_device_info *devinfo)
   134279 {
   134280    switch (devinfo->gen) {
   134281    case 10: return 0;
   134282    case 9: return 0;
   134283    case 8: return 0;
   134284    case 7:
   134285       if (devinfo->is_haswell) {
   134286          return 0;
   134287       } else {
   134288          return 0;
   134289       }
   134290    case 6: return 26;
   134291    case 5: return 0;
   134292    case 4:
   134293       if (devinfo->is_g4x) {
   134294          return 0;
   134295       } else {
   134296          return 0;
   134297       }
   134298    default:
   134299       unreachable("Invalid hardware generation");
   134300    }
   134301 }
   134302 
   134303 
   134304 
   134305 /* INSTDONE_2::SVRW Done */
   134306 
   134307 
   134308 #define GEN6_INSTDONE_2_SVRWDone_bits  1
   134309 
   134310 static inline uint32_t ATTRIBUTE_PURE
   134311 INSTDONE_2_SVRWDone_bits(const struct gen_device_info *devinfo)
   134312 {
   134313    switch (devinfo->gen) {
   134314    case 10: return 0;
   134315    case 9: return 0;
   134316    case 8: return 0;
   134317    case 7:
   134318       if (devinfo->is_haswell) {
   134319          return 0;
   134320       } else {
   134321          return 0;
   134322       }
   134323    case 6: return 1;
   134324    case 5: return 0;
   134325    case 4:
   134326       if (devinfo->is_g4x) {
   134327          return 0;
   134328       } else {
   134329          return 0;
   134330       }
   134331    default:
   134332       unreachable("Invalid hardware generation");
   134333    }
   134334 }
   134335 
   134336 
   134337 
   134338 #define GEN6_INSTDONE_2_SVRWDone_start  28
   134339 
   134340 static inline uint32_t ATTRIBUTE_PURE
   134341 INSTDONE_2_SVRWDone_start(const struct gen_device_info *devinfo)
   134342 {
   134343    switch (devinfo->gen) {
   134344    case 10: return 0;
   134345    case 9: return 0;
   134346    case 8: return 0;
   134347    case 7:
   134348       if (devinfo->is_haswell) {
   134349          return 0;
   134350       } else {
   134351          return 0;
   134352       }
   134353    case 6: return 28;
   134354    case 5: return 0;
   134355    case 4:
   134356       if (devinfo->is_g4x) {
   134357          return 0;
   134358       } else {
   134359          return 0;
   134360       }
   134361    default:
   134362       unreachable("Invalid hardware generation");
   134363    }
   134364 }
   134365 
   134366 
   134367 
   134368 /* INSTDONE_2::SVSM Done */
   134369 
   134370 
   134371 #define GEN6_INSTDONE_2_SVSMDone_bits  1
   134372 
   134373 static inline uint32_t ATTRIBUTE_PURE
   134374 INSTDONE_2_SVSMDone_bits(const struct gen_device_info *devinfo)
   134375 {
   134376    switch (devinfo->gen) {
   134377    case 10: return 0;
   134378    case 9: return 0;
   134379    case 8: return 0;
   134380    case 7:
   134381       if (devinfo->is_haswell) {
   134382          return 0;
   134383       } else {
   134384          return 0;
   134385       }
   134386    case 6: return 1;
   134387    case 5: return 0;
   134388    case 4:
   134389       if (devinfo->is_g4x) {
   134390          return 0;
   134391       } else {
   134392          return 0;
   134393       }
   134394    default:
   134395       unreachable("Invalid hardware generation");
   134396    }
   134397 }
   134398 
   134399 
   134400 
   134401 #define GEN6_INSTDONE_2_SVSMDone_start  15
   134402 
   134403 static inline uint32_t ATTRIBUTE_PURE
   134404 INSTDONE_2_SVSMDone_start(const struct gen_device_info *devinfo)
   134405 {
   134406    switch (devinfo->gen) {
   134407    case 10: return 0;
   134408    case 9: return 0;
   134409    case 8: return 0;
   134410    case 7:
   134411       if (devinfo->is_haswell) {
   134412          return 0;
   134413       } else {
   134414          return 0;
   134415       }
   134416    case 6: return 15;
   134417    case 5: return 0;
   134418    case 4:
   134419       if (devinfo->is_g4x) {
   134420          return 0;
   134421       } else {
   134422          return 0;
   134423       }
   134424    default:
   134425       unreachable("Invalid hardware generation");
   134426    }
   134427 }
   134428 
   134429 
   134430 
   134431 /* INSTDONE_2::VDI Done */
   134432 
   134433 
   134434 #define GEN6_INSTDONE_2_VDIDone_bits  1
   134435 
   134436 static inline uint32_t ATTRIBUTE_PURE
   134437 INSTDONE_2_VDIDone_bits(const struct gen_device_info *devinfo)
   134438 {
   134439    switch (devinfo->gen) {
   134440    case 10: return 0;
   134441    case 9: return 0;
   134442    case 8: return 0;
   134443    case 7:
   134444       if (devinfo->is_haswell) {
   134445          return 0;
   134446       } else {
   134447          return 0;
   134448       }
   134449    case 6: return 1;
   134450    case 5: return 0;
   134451    case 4:
   134452       if (devinfo->is_g4x) {
   134453          return 0;
   134454       } else {
   134455          return 0;
   134456       }
   134457    default:
   134458       unreachable("Invalid hardware generation");
   134459    }
   134460 }
   134461 
   134462 
   134463 
   134464 #define GEN6_INSTDONE_2_VDIDone_start  21
   134465 
   134466 static inline uint32_t ATTRIBUTE_PURE
   134467 INSTDONE_2_VDIDone_start(const struct gen_device_info *devinfo)
   134468 {
   134469    switch (devinfo->gen) {
   134470    case 10: return 0;
   134471    case 9: return 0;
   134472    case 8: return 0;
   134473    case 7:
   134474       if (devinfo->is_haswell) {
   134475          return 0;
   134476       } else {
   134477          return 0;
   134478       }
   134479    case 6: return 21;
   134480    case 5: return 0;
   134481    case 4:
   134482       if (devinfo->is_g4x) {
   134483          return 0;
   134484       } else {
   134485          return 0;
   134486       }
   134487    default:
   134488       unreachable("Invalid hardware generation");
   134489    }
   134490 }
   134491 
   134492 
   134493 
   134494 /* INSTDONE_2::VF Done */
   134495 
   134496 
   134497 #define GEN6_INSTDONE_2_VFDone_bits  1
   134498 
   134499 static inline uint32_t ATTRIBUTE_PURE
   134500 INSTDONE_2_VFDone_bits(const struct gen_device_info *devinfo)
   134501 {
   134502    switch (devinfo->gen) {
   134503    case 10: return 0;
   134504    case 9: return 0;
   134505    case 8: return 0;
   134506    case 7:
   134507       if (devinfo->is_haswell) {
   134508          return 0;
   134509       } else {
   134510          return 0;
   134511       }
   134512    case 6: return 1;
   134513    case 5: return 0;
   134514    case 4:
   134515       if (devinfo->is_g4x) {
   134516          return 0;
   134517       } else {
   134518          return 0;
   134519       }
   134520    default:
   134521       unreachable("Invalid hardware generation");
   134522    }
   134523 }
   134524 
   134525 
   134526 
   134527 #define GEN6_INSTDONE_2_VFDone_start  0
   134528 
   134529 static inline uint32_t ATTRIBUTE_PURE
   134530 INSTDONE_2_VFDone_start(const struct gen_device_info *devinfo)
   134531 {
   134532    switch (devinfo->gen) {
   134533    case 10: return 0;
   134534    case 9: return 0;
   134535    case 8: return 0;
   134536    case 7:
   134537       if (devinfo->is_haswell) {
   134538          return 0;
   134539       } else {
   134540          return 0;
   134541       }
   134542    case 6: return 0;
   134543    case 5: return 0;
   134544    case 4:
   134545       if (devinfo->is_g4x) {
   134546          return 0;
   134547       } else {
   134548          return 0;
   134549       }
   134550    default:
   134551       unreachable("Invalid hardware generation");
   134552    }
   134553 }
   134554 
   134555 
   134556 
   134557 /* INSTDONE_2::VME Done */
   134558 
   134559 
   134560 #define GEN6_INSTDONE_2_VMEDone_bits  1
   134561 
   134562 static inline uint32_t ATTRIBUTE_PURE
   134563 INSTDONE_2_VMEDone_bits(const struct gen_device_info *devinfo)
   134564 {
   134565    switch (devinfo->gen) {
   134566    case 10: return 0;
   134567    case 9: return 0;
   134568    case 8: return 0;
   134569    case 7:
   134570       if (devinfo->is_haswell) {
   134571          return 0;
   134572       } else {
   134573          return 0;
   134574       }
   134575    case 6: return 1;
   134576    case 5: return 0;
   134577    case 4:
   134578       if (devinfo->is_g4x) {
   134579          return 0;
   134580       } else {
   134581          return 0;
   134582       }
   134583    default:
   134584       unreachable("Invalid hardware generation");
   134585    }
   134586 }
   134587 
   134588 
   134589 
   134590 #define GEN6_INSTDONE_2_VMEDone_start  5
   134591 
   134592 static inline uint32_t ATTRIBUTE_PURE
   134593 INSTDONE_2_VMEDone_start(const struct gen_device_info *devinfo)
   134594 {
   134595    switch (devinfo->gen) {
   134596    case 10: return 0;
   134597    case 9: return 0;
   134598    case 8: return 0;
   134599    case 7:
   134600       if (devinfo->is_haswell) {
   134601          return 0;
   134602       } else {
   134603          return 0;
   134604       }
   134605    case 6: return 5;
   134606    case 5: return 0;
   134607    case 4:
   134608       if (devinfo->is_g4x) {
   134609          return 0;
   134610       } else {
   134611          return 0;
   134612       }
   134613    default:
   134614       unreachable("Invalid hardware generation");
   134615    }
   134616 }
   134617 
   134618 
   134619 
   134620 /* INSTDONE_2::VS0 Done */
   134621 
   134622 
   134623 #define GEN6_INSTDONE_2_VS0Done_bits  1
   134624 
   134625 static inline uint32_t ATTRIBUTE_PURE
   134626 INSTDONE_2_VS0Done_bits(const struct gen_device_info *devinfo)
   134627 {
   134628    switch (devinfo->gen) {
   134629    case 10: return 0;
   134630    case 9: return 0;
   134631    case 8: return 0;
   134632    case 7:
   134633       if (devinfo->is_haswell) {
   134634          return 0;
   134635       } else {
   134636          return 0;
   134637       }
   134638    case 6: return 1;
   134639    case 5: return 0;
   134640    case 4:
   134641       if (devinfo->is_g4x) {
   134642          return 0;
   134643       } else {
   134644          return 0;
   134645       }
   134646    default:
   134647       unreachable("Invalid hardware generation");
   134648    }
   134649 }
   134650 
   134651 
   134652 
   134653 #define GEN6_INSTDONE_2_VS0Done_start  1
   134654 
   134655 static inline uint32_t ATTRIBUTE_PURE
   134656 INSTDONE_2_VS0Done_start(const struct gen_device_info *devinfo)
   134657 {
   134658    switch (devinfo->gen) {
   134659    case 10: return 0;
   134660    case 9: return 0;
   134661    case 8: return 0;
   134662    case 7:
   134663       if (devinfo->is_haswell) {
   134664          return 0;
   134665       } else {
   134666          return 0;
   134667       }
   134668    case 6: return 1;
   134669    case 5: return 0;
   134670    case 4:
   134671       if (devinfo->is_g4x) {
   134672          return 0;
   134673       } else {
   134674          return 0;
   134675       }
   134676    default:
   134677       unreachable("Invalid hardware generation");
   134678    }
   134679 }
   134680 
   134681 
   134682 
   134683 /* INSTDONE_2::WMBE Done */
   134684 
   134685 
   134686 #define GEN6_INSTDONE_2_WMBEDone_bits  1
   134687 
   134688 static inline uint32_t ATTRIBUTE_PURE
   134689 INSTDONE_2_WMBEDone_bits(const struct gen_device_info *devinfo)
   134690 {
   134691    switch (devinfo->gen) {
   134692    case 10: return 0;
   134693    case 9: return 0;
   134694    case 8: return 0;
   134695    case 7:
   134696       if (devinfo->is_haswell) {
   134697          return 0;
   134698       } else {
   134699          return 0;
   134700       }
   134701    case 6: return 1;
   134702    case 5: return 0;
   134703    case 4:
   134704       if (devinfo->is_g4x) {
   134705          return 0;
   134706       } else {
   134707          return 0;
   134708       }
   134709    default:
   134710       unreachable("Invalid hardware generation");
   134711    }
   134712 }
   134713 
   134714 
   134715 
   134716 #define GEN6_INSTDONE_2_WMBEDone_start  29
   134717 
   134718 static inline uint32_t ATTRIBUTE_PURE
   134719 INSTDONE_2_WMBEDone_start(const struct gen_device_info *devinfo)
   134720 {
   134721    switch (devinfo->gen) {
   134722    case 10: return 0;
   134723    case 9: return 0;
   134724    case 8: return 0;
   134725    case 7:
   134726       if (devinfo->is_haswell) {
   134727          return 0;
   134728       } else {
   134729          return 0;
   134730       }
   134731    case 6: return 29;
   134732    case 5: return 0;
   134733    case 4:
   134734       if (devinfo->is_g4x) {
   134735          return 0;
   134736       } else {
   134737          return 0;
   134738       }
   134739    default:
   134740       unreachable("Invalid hardware generation");
   134741    }
   134742 }
   134743 
   134744 
   134745 
   134746 /* INSTDONE_2::WMFE Done */
   134747 
   134748 
   134749 #define GEN6_INSTDONE_2_WMFEDone_bits  1
   134750 
   134751 static inline uint32_t ATTRIBUTE_PURE
   134752 INSTDONE_2_WMFEDone_bits(const struct gen_device_info *devinfo)
   134753 {
   134754    switch (devinfo->gen) {
   134755    case 10: return 0;
   134756    case 9: return 0;
   134757    case 8: return 0;
   134758    case 7:
   134759       if (devinfo->is_haswell) {
   134760          return 0;
   134761       } else {
   134762          return 0;
   134763       }
   134764    case 6: return 1;
   134765    case 5: return 0;
   134766    case 4:
   134767       if (devinfo->is_g4x) {
   134768          return 0;
   134769       } else {
   134770          return 0;
   134771       }
   134772    default:
   134773       unreachable("Invalid hardware generation");
   134774    }
   134775 }
   134776 
   134777 
   134778 
   134779 #define GEN6_INSTDONE_2_WMFEDone_start  16
   134780 
   134781 static inline uint32_t ATTRIBUTE_PURE
   134782 INSTDONE_2_WMFEDone_start(const struct gen_device_info *devinfo)
   134783 {
   134784    switch (devinfo->gen) {
   134785    case 10: return 0;
   134786    case 9: return 0;
   134787    case 8: return 0;
   134788    case 7:
   134789       if (devinfo->is_haswell) {
   134790          return 0;
   134791       } else {
   134792          return 0;
   134793       }
   134794    case 6: return 16;
   134795    case 5: return 0;
   134796    case 4:
   134797       if (devinfo->is_g4x) {
   134798          return 0;
   134799       } else {
   134800          return 0;
   134801       }
   134802    default:
   134803       unreachable("Invalid hardware generation");
   134804    }
   134805 }
   134806 
   134807 
   134808 
   134809 /* INTERFACE_DESCRIPTOR_DATA */
   134810 
   134811 
   134812 #define GEN10_INTERFACE_DESCRIPTOR_DATA_length  8
   134813 #define GEN9_INTERFACE_DESCRIPTOR_DATA_length  8
   134814 #define GEN8_INTERFACE_DESCRIPTOR_DATA_length  8
   134815 #define GEN75_INTERFACE_DESCRIPTOR_DATA_length  8
   134816 #define GEN7_INTERFACE_DESCRIPTOR_DATA_length  8
   134817 #define GEN6_INTERFACE_DESCRIPTOR_DATA_length  8
   134818 
   134819 static inline uint32_t ATTRIBUTE_PURE
   134820 INTERFACE_DESCRIPTOR_DATA_length(const struct gen_device_info *devinfo)
   134821 {
   134822    switch (devinfo->gen) {
   134823    case 10: return 8;
   134824    case 9: return 8;
   134825    case 8: return 8;
   134826    case 7:
   134827       if (devinfo->is_haswell) {
   134828          return 8;
   134829       } else {
   134830          return 8;
   134831       }
   134832    case 6: return 8;
   134833    case 5: return 0;
   134834    case 4:
   134835       if (devinfo->is_g4x) {
   134836          return 0;
   134837       } else {
   134838          return 0;
   134839       }
   134840    default:
   134841       unreachable("Invalid hardware generation");
   134842    }
   134843 }
   134844 
   134845 
   134846 
   134847 /* INTERFACE_DESCRIPTOR_DATA::Barrier Enable */
   134848 
   134849 
   134850 #define GEN10_INTERFACE_DESCRIPTOR_DATA_BarrierEnable_bits  1
   134851 #define GEN9_INTERFACE_DESCRIPTOR_DATA_BarrierEnable_bits  1
   134852 #define GEN8_INTERFACE_DESCRIPTOR_DATA_BarrierEnable_bits  1
   134853 #define GEN75_INTERFACE_DESCRIPTOR_DATA_BarrierEnable_bits  1
   134854 #define GEN7_INTERFACE_DESCRIPTOR_DATA_BarrierEnable_bits  1
   134855 
   134856 static inline uint32_t ATTRIBUTE_PURE
   134857 INTERFACE_DESCRIPTOR_DATA_BarrierEnable_bits(const struct gen_device_info *devinfo)
   134858 {
   134859    switch (devinfo->gen) {
   134860    case 10: return 1;
   134861    case 9: return 1;
   134862    case 8: return 1;
   134863    case 7:
   134864       if (devinfo->is_haswell) {
   134865          return 1;
   134866       } else {
   134867          return 1;
   134868       }
   134869    case 6: return 0;
   134870    case 5: return 0;
   134871    case 4:
   134872       if (devinfo->is_g4x) {
   134873          return 0;
   134874       } else {
   134875          return 0;
   134876       }
   134877    default:
   134878       unreachable("Invalid hardware generation");
   134879    }
   134880 }
   134881 
   134882 
   134883 
   134884 #define GEN10_INTERFACE_DESCRIPTOR_DATA_BarrierEnable_start  213
   134885 #define GEN9_INTERFACE_DESCRIPTOR_DATA_BarrierEnable_start  213
   134886 #define GEN8_INTERFACE_DESCRIPTOR_DATA_BarrierEnable_start  213
   134887 #define GEN75_INTERFACE_DESCRIPTOR_DATA_BarrierEnable_start  181
   134888 #define GEN7_INTERFACE_DESCRIPTOR_DATA_BarrierEnable_start  181
   134889 
   134890 static inline uint32_t ATTRIBUTE_PURE
   134891 INTERFACE_DESCRIPTOR_DATA_BarrierEnable_start(const struct gen_device_info *devinfo)
   134892 {
   134893    switch (devinfo->gen) {
   134894    case 10: return 213;
   134895    case 9: return 213;
   134896    case 8: return 213;
   134897    case 7:
   134898       if (devinfo->is_haswell) {
   134899          return 181;
   134900       } else {
   134901          return 181;
   134902       }
   134903    case 6: return 0;
   134904    case 5: return 0;
   134905    case 4:
   134906       if (devinfo->is_g4x) {
   134907          return 0;
   134908       } else {
   134909          return 0;
   134910       }
   134911    default:
   134912       unreachable("Invalid hardware generation");
   134913    }
   134914 }
   134915 
   134916 
   134917 
   134918 /* INTERFACE_DESCRIPTOR_DATA::Barrier ID */
   134919 
   134920 
   134921 #define GEN6_INTERFACE_DESCRIPTOR_DATA_BarrierID_bits  4
   134922 
   134923 static inline uint32_t ATTRIBUTE_PURE
   134924 INTERFACE_DESCRIPTOR_DATA_BarrierID_bits(const struct gen_device_info *devinfo)
   134925 {
   134926    switch (devinfo->gen) {
   134927    case 10: return 0;
   134928    case 9: return 0;
   134929    case 8: return 0;
   134930    case 7:
   134931       if (devinfo->is_haswell) {
   134932          return 0;
   134933       } else {
   134934          return 0;
   134935       }
   134936    case 6: return 4;
   134937    case 5: return 0;
   134938    case 4:
   134939       if (devinfo->is_g4x) {
   134940          return 0;
   134941       } else {
   134942          return 0;
   134943       }
   134944    default:
   134945       unreachable("Invalid hardware generation");
   134946    }
   134947 }
   134948 
   134949 
   134950 
   134951 #define GEN6_INTERFACE_DESCRIPTOR_DATA_BarrierID_start  160
   134952 
   134953 static inline uint32_t ATTRIBUTE_PURE
   134954 INTERFACE_DESCRIPTOR_DATA_BarrierID_start(const struct gen_device_info *devinfo)
   134955 {
   134956    switch (devinfo->gen) {
   134957    case 10: return 0;
   134958    case 9: return 0;
   134959    case 8: return 0;
   134960    case 7:
   134961       if (devinfo->is_haswell) {
   134962          return 0;
   134963       } else {
   134964          return 0;
   134965       }
   134966    case 6: return 160;
   134967    case 5: return 0;
   134968    case 4:
   134969       if (devinfo->is_g4x) {
   134970          return 0;
   134971       } else {
   134972          return 0;
   134973       }
   134974    default:
   134975       unreachable("Invalid hardware generation");
   134976    }
   134977 }
   134978 
   134979 
   134980 
   134981 /* INTERFACE_DESCRIPTOR_DATA::Barrier Return Byte */
   134982 
   134983 
   134984 #define GEN6_INTERFACE_DESCRIPTOR_DATA_BarrierReturnByte_bits  8
   134985 
   134986 static inline uint32_t ATTRIBUTE_PURE
   134987 INTERFACE_DESCRIPTOR_DATA_BarrierReturnByte_bits(const struct gen_device_info *devinfo)
   134988 {
   134989    switch (devinfo->gen) {
   134990    case 10: return 0;
   134991    case 9: return 0;
   134992    case 8: return 0;
   134993    case 7:
   134994       if (devinfo->is_haswell) {
   134995          return 0;
   134996       } else {
   134997          return 0;
   134998       }
   134999    case 6: return 8;
   135000    case 5: return 0;
   135001    case 4:
   135002       if (devinfo->is_g4x) {
   135003          return 0;
   135004       } else {
   135005          return 0;
   135006       }
   135007    default:
   135008       unreachable("Invalid hardware generation");
   135009    }
   135010 }
   135011 
   135012 
   135013 
   135014 #define GEN6_INTERFACE_DESCRIPTOR_DATA_BarrierReturnByte_start  168
   135015 
   135016 static inline uint32_t ATTRIBUTE_PURE
   135017 INTERFACE_DESCRIPTOR_DATA_BarrierReturnByte_start(const struct gen_device_info *devinfo)
   135018 {
   135019    switch (devinfo->gen) {
   135020    case 10: return 0;
   135021    case 9: return 0;
   135022    case 8: return 0;
   135023    case 7:
   135024       if (devinfo->is_haswell) {
   135025          return 0;
   135026       } else {
   135027          return 0;
   135028       }
   135029    case 6: return 168;
   135030    case 5: return 0;
   135031    case 4:
   135032       if (devinfo->is_g4x) {
   135033          return 0;
   135034       } else {
   135035          return 0;
   135036       }
   135037    default:
   135038       unreachable("Invalid hardware generation");
   135039    }
   135040 }
   135041 
   135042 
   135043 
   135044 /* INTERFACE_DESCRIPTOR_DATA::Barrier Return GRF Offset */
   135045 
   135046 
   135047 #define GEN6_INTERFACE_DESCRIPTOR_DATA_BarrierReturnGRFOffset_bits  8
   135048 
   135049 static inline uint32_t ATTRIBUTE_PURE
   135050 INTERFACE_DESCRIPTOR_DATA_BarrierReturnGRFOffset_bits(const struct gen_device_info *devinfo)
   135051 {
   135052    switch (devinfo->gen) {
   135053    case 10: return 0;
   135054    case 9: return 0;
   135055    case 8: return 0;
   135056    case 7:
   135057       if (devinfo->is_haswell) {
   135058          return 0;
   135059       } else {
   135060          return 0;
   135061       }
   135062    case 6: return 8;
   135063    case 5: return 0;
   135064    case 4:
   135065       if (devinfo->is_g4x) {
   135066          return 0;
   135067       } else {
   135068          return 0;
   135069       }
   135070    default:
   135071       unreachable("Invalid hardware generation");
   135072    }
   135073 }
   135074 
   135075 
   135076 
   135077 #define GEN6_INTERFACE_DESCRIPTOR_DATA_BarrierReturnGRFOffset_start  184
   135078 
   135079 static inline uint32_t ATTRIBUTE_PURE
   135080 INTERFACE_DESCRIPTOR_DATA_BarrierReturnGRFOffset_start(const struct gen_device_info *devinfo)
   135081 {
   135082    switch (devinfo->gen) {
   135083    case 10: return 0;
   135084    case 9: return 0;
   135085    case 8: return 0;
   135086    case 7:
   135087       if (devinfo->is_haswell) {
   135088          return 0;
   135089       } else {
   135090          return 0;
   135091       }
   135092    case 6: return 184;
   135093    case 5: return 0;
   135094    case 4:
   135095       if (devinfo->is_g4x) {
   135096          return 0;
   135097       } else {
   135098          return 0;
   135099       }
   135100    default:
   135101       unreachable("Invalid hardware generation");
   135102    }
   135103 }
   135104 
   135105 
   135106 
   135107 /* INTERFACE_DESCRIPTOR_DATA::Binding Table Entry Count */
   135108 
   135109 
   135110 #define GEN10_INTERFACE_DESCRIPTOR_DATA_BindingTableEntryCount_bits  5
   135111 #define GEN9_INTERFACE_DESCRIPTOR_DATA_BindingTableEntryCount_bits  5
   135112 #define GEN8_INTERFACE_DESCRIPTOR_DATA_BindingTableEntryCount_bits  5
   135113 #define GEN75_INTERFACE_DESCRIPTOR_DATA_BindingTableEntryCount_bits  5
   135114 #define GEN7_INTERFACE_DESCRIPTOR_DATA_BindingTableEntryCount_bits  5
   135115 #define GEN6_INTERFACE_DESCRIPTOR_DATA_BindingTableEntryCount_bits  5
   135116 
   135117 static inline uint32_t ATTRIBUTE_PURE
   135118 INTERFACE_DESCRIPTOR_DATA_BindingTableEntryCount_bits(const struct gen_device_info *devinfo)
   135119 {
   135120    switch (devinfo->gen) {
   135121    case 10: return 5;
   135122    case 9: return 5;
   135123    case 8: return 5;
   135124    case 7:
   135125       if (devinfo->is_haswell) {
   135126          return 5;
   135127       } else {
   135128          return 5;
   135129       }
   135130    case 6: return 5;
   135131    case 5: return 0;
   135132    case 4:
   135133       if (devinfo->is_g4x) {
   135134          return 0;
   135135       } else {
   135136          return 0;
   135137       }
   135138    default:
   135139       unreachable("Invalid hardware generation");
   135140    }
   135141 }
   135142 
   135143 
   135144 
   135145 #define GEN10_INTERFACE_DESCRIPTOR_DATA_BindingTableEntryCount_start  128
   135146 #define GEN9_INTERFACE_DESCRIPTOR_DATA_BindingTableEntryCount_start  128
   135147 #define GEN8_INTERFACE_DESCRIPTOR_DATA_BindingTableEntryCount_start  128
   135148 #define GEN75_INTERFACE_DESCRIPTOR_DATA_BindingTableEntryCount_start  96
   135149 #define GEN7_INTERFACE_DESCRIPTOR_DATA_BindingTableEntryCount_start  96
   135150 #define GEN6_INTERFACE_DESCRIPTOR_DATA_BindingTableEntryCount_start  96
   135151 
   135152 static inline uint32_t ATTRIBUTE_PURE
   135153 INTERFACE_DESCRIPTOR_DATA_BindingTableEntryCount_start(const struct gen_device_info *devinfo)
   135154 {
   135155    switch (devinfo->gen) {
   135156    case 10: return 128;
   135157    case 9: return 128;
   135158    case 8: return 128;
   135159    case 7:
   135160       if (devinfo->is_haswell) {
   135161          return 96;
   135162       } else {
   135163          return 96;
   135164       }
   135165    case 6: return 96;
   135166    case 5: return 0;
   135167    case 4:
   135168       if (devinfo->is_g4x) {
   135169          return 0;
   135170       } else {
   135171          return 0;
   135172       }
   135173    default:
   135174       unreachable("Invalid hardware generation");
   135175    }
   135176 }
   135177 
   135178 
   135179 
   135180 /* INTERFACE_DESCRIPTOR_DATA::Binding Table Pointer */
   135181 
   135182 
   135183 #define GEN10_INTERFACE_DESCRIPTOR_DATA_BindingTablePointer_bits  11
   135184 #define GEN9_INTERFACE_DESCRIPTOR_DATA_BindingTablePointer_bits  11
   135185 #define GEN8_INTERFACE_DESCRIPTOR_DATA_BindingTablePointer_bits  11
   135186 #define GEN75_INTERFACE_DESCRIPTOR_DATA_BindingTablePointer_bits  11
   135187 #define GEN7_INTERFACE_DESCRIPTOR_DATA_BindingTablePointer_bits  11
   135188 #define GEN6_INTERFACE_DESCRIPTOR_DATA_BindingTablePointer_bits  27
   135189 
   135190 static inline uint32_t ATTRIBUTE_PURE
   135191 INTERFACE_DESCRIPTOR_DATA_BindingTablePointer_bits(const struct gen_device_info *devinfo)
   135192 {
   135193    switch (devinfo->gen) {
   135194    case 10: return 11;
   135195    case 9: return 11;
   135196    case 8: return 11;
   135197    case 7:
   135198       if (devinfo->is_haswell) {
   135199          return 11;
   135200       } else {
   135201          return 11;
   135202       }
   135203    case 6: return 27;
   135204    case 5: return 0;
   135205    case 4:
   135206       if (devinfo->is_g4x) {
   135207          return 0;
   135208       } else {
   135209          return 0;
   135210       }
   135211    default:
   135212       unreachable("Invalid hardware generation");
   135213    }
   135214 }
   135215 
   135216 
   135217 
   135218 #define GEN10_INTERFACE_DESCRIPTOR_DATA_BindingTablePointer_start  133
   135219 #define GEN9_INTERFACE_DESCRIPTOR_DATA_BindingTablePointer_start  133
   135220 #define GEN8_INTERFACE_DESCRIPTOR_DATA_BindingTablePointer_start  133
   135221 #define GEN75_INTERFACE_DESCRIPTOR_DATA_BindingTablePointer_start  101
   135222 #define GEN7_INTERFACE_DESCRIPTOR_DATA_BindingTablePointer_start  101
   135223 #define GEN6_INTERFACE_DESCRIPTOR_DATA_BindingTablePointer_start  101
   135224 
   135225 static inline uint32_t ATTRIBUTE_PURE
   135226 INTERFACE_DESCRIPTOR_DATA_BindingTablePointer_start(const struct gen_device_info *devinfo)
   135227 {
   135228    switch (devinfo->gen) {
   135229    case 10: return 133;
   135230    case 9: return 133;
   135231    case 8: return 133;
   135232    case 7:
   135233       if (devinfo->is_haswell) {
   135234          return 101;
   135235       } else {
   135236          return 101;
   135237       }
   135238    case 6: return 101;
   135239    case 5: return 0;
   135240    case 4:
   135241       if (devinfo->is_g4x) {
   135242          return 0;
   135243       } else {
   135244          return 0;
   135245       }
   135246    default:
   135247       unreachable("Invalid hardware generation");
   135248    }
   135249 }
   135250 
   135251 
   135252 
   135253 /* INTERFACE_DESCRIPTOR_DATA::Constant URB Entry Read Length */
   135254 
   135255 
   135256 #define GEN10_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadLength_bits  16
   135257 #define GEN9_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadLength_bits  16
   135258 #define GEN8_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadLength_bits  16
   135259 #define GEN75_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadLength_bits  16
   135260 #define GEN7_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadLength_bits  16
   135261 #define GEN6_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadLength_bits  16
   135262 
   135263 static inline uint32_t ATTRIBUTE_PURE
   135264 INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadLength_bits(const struct gen_device_info *devinfo)
   135265 {
   135266    switch (devinfo->gen) {
   135267    case 10: return 16;
   135268    case 9: return 16;
   135269    case 8: return 16;
   135270    case 7:
   135271       if (devinfo->is_haswell) {
   135272          return 16;
   135273       } else {
   135274          return 16;
   135275       }
   135276    case 6: return 16;
   135277    case 5: return 0;
   135278    case 4:
   135279       if (devinfo->is_g4x) {
   135280          return 0;
   135281       } else {
   135282          return 0;
   135283       }
   135284    default:
   135285       unreachable("Invalid hardware generation");
   135286    }
   135287 }
   135288 
   135289 
   135290 
   135291 #define GEN10_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadLength_start  176
   135292 #define GEN9_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadLength_start  176
   135293 #define GEN8_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadLength_start  176
   135294 #define GEN75_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadLength_start  144
   135295 #define GEN7_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadLength_start  144
   135296 #define GEN6_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadLength_start  144
   135297 
   135298 static inline uint32_t ATTRIBUTE_PURE
   135299 INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadLength_start(const struct gen_device_info *devinfo)
   135300 {
   135301    switch (devinfo->gen) {
   135302    case 10: return 176;
   135303    case 9: return 176;
   135304    case 8: return 176;
   135305    case 7:
   135306       if (devinfo->is_haswell) {
   135307          return 144;
   135308       } else {
   135309          return 144;
   135310       }
   135311    case 6: return 144;
   135312    case 5: return 0;
   135313    case 4:
   135314       if (devinfo->is_g4x) {
   135315          return 0;
   135316       } else {
   135317          return 0;
   135318       }
   135319    default:
   135320       unreachable("Invalid hardware generation");
   135321    }
   135322 }
   135323 
   135324 
   135325 
   135326 /* INTERFACE_DESCRIPTOR_DATA::Constant URB Entry Read Offset */
   135327 
   135328 
   135329 #define GEN10_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadOffset_bits  16
   135330 #define GEN9_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadOffset_bits  16
   135331 #define GEN8_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadOffset_bits  16
   135332 #define GEN7_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadOffset_bits  16
   135333 #define GEN6_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadOffset_bits  16
   135334 
   135335 static inline uint32_t ATTRIBUTE_PURE
   135336 INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadOffset_bits(const struct gen_device_info *devinfo)
   135337 {
   135338    switch (devinfo->gen) {
   135339    case 10: return 16;
   135340    case 9: return 16;
   135341    case 8: return 16;
   135342    case 7:
   135343       if (devinfo->is_haswell) {
   135344          return 0;
   135345       } else {
   135346          return 16;
   135347       }
   135348    case 6: return 16;
   135349    case 5: return 0;
   135350    case 4:
   135351       if (devinfo->is_g4x) {
   135352          return 0;
   135353       } else {
   135354          return 0;
   135355       }
   135356    default:
   135357       unreachable("Invalid hardware generation");
   135358    }
   135359 }
   135360 
   135361 
   135362 
   135363 #define GEN10_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadOffset_start  160
   135364 #define GEN9_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadOffset_start  160
   135365 #define GEN8_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadOffset_start  160
   135366 #define GEN7_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadOffset_start  128
   135367 #define GEN6_INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadOffset_start  128
   135368 
   135369 static inline uint32_t ATTRIBUTE_PURE
   135370 INTERFACE_DESCRIPTOR_DATA_ConstantURBEntryReadOffset_start(const struct gen_device_info *devinfo)
   135371 {
   135372    switch (devinfo->gen) {
   135373    case 10: return 160;
   135374    case 9: return 160;
   135375    case 8: return 160;
   135376    case 7:
   135377       if (devinfo->is_haswell) {
   135378          return 0;
   135379       } else {
   135380          return 128;
   135381       }
   135382    case 6: return 128;
   135383    case 5: return 0;
   135384    case 4:
   135385       if (devinfo->is_g4x) {
   135386          return 0;
   135387       } else {
   135388          return 0;
   135389       }
   135390    default:
   135391       unreachable("Invalid hardware generation");
   135392    }
   135393 }
   135394 
   135395 
   135396 
   135397 /* INTERFACE_DESCRIPTOR_DATA::Cross-Thread Constant Data Read Length */
   135398 
   135399 
   135400 #define GEN10_INTERFACE_DESCRIPTOR_DATA_CrossThreadConstantDataReadLength_bits  8
   135401 #define GEN9_INTERFACE_DESCRIPTOR_DATA_CrossThreadConstantDataReadLength_bits  8
   135402 #define GEN8_INTERFACE_DESCRIPTOR_DATA_CrossThreadConstantDataReadLength_bits  8
   135403 #define GEN75_INTERFACE_DESCRIPTOR_DATA_CrossThreadConstantDataReadLength_bits  8
   135404 
   135405 static inline uint32_t ATTRIBUTE_PURE
   135406 INTERFACE_DESCRIPTOR_DATA_CrossThreadConstantDataReadLength_bits(const struct gen_device_info *devinfo)
   135407 {
   135408    switch (devinfo->gen) {
   135409    case 10: return 8;
   135410    case 9: return 8;
   135411    case 8: return 8;
   135412    case 7:
   135413       if (devinfo->is_haswell) {
   135414          return 8;
   135415       } else {
   135416          return 0;
   135417       }
   135418    case 6: return 0;
   135419    case 5: return 0;
   135420    case 4:
   135421       if (devinfo->is_g4x) {
   135422          return 0;
   135423       } else {
   135424          return 0;
   135425       }
   135426    default:
   135427       unreachable("Invalid hardware generation");
   135428    }
   135429 }
   135430 
   135431 
   135432 
   135433 #define GEN10_INTERFACE_DESCRIPTOR_DATA_CrossThreadConstantDataReadLength_start  224
   135434 #define GEN9_INTERFACE_DESCRIPTOR_DATA_CrossThreadConstantDataReadLength_start  224
   135435 #define GEN8_INTERFACE_DESCRIPTOR_DATA_CrossThreadConstantDataReadLength_start  224
   135436 #define GEN75_INTERFACE_DESCRIPTOR_DATA_CrossThreadConstantDataReadLength_start  192
   135437 
   135438 static inline uint32_t ATTRIBUTE_PURE
   135439 INTERFACE_DESCRIPTOR_DATA_CrossThreadConstantDataReadLength_start(const struct gen_device_info *devinfo)
   135440 {
   135441    switch (devinfo->gen) {
   135442    case 10: return 224;
   135443    case 9: return 224;
   135444    case 8: return 224;
   135445    case 7:
   135446       if (devinfo->is_haswell) {
   135447          return 192;
   135448       } else {
   135449          return 0;
   135450       }
   135451    case 6: return 0;
   135452    case 5: return 0;
   135453    case 4:
   135454       if (devinfo->is_g4x) {
   135455          return 0;
   135456       } else {
   135457          return 0;
   135458       }
   135459    default:
   135460       unreachable("Invalid hardware generation");
   135461    }
   135462 }
   135463 
   135464 
   135465 
   135466 /* INTERFACE_DESCRIPTOR_DATA::Denorm Mode */
   135467 
   135468 
   135469 #define GEN10_INTERFACE_DESCRIPTOR_DATA_DenormMode_bits  1
   135470 #define GEN9_INTERFACE_DESCRIPTOR_DATA_DenormMode_bits  1
   135471 #define GEN8_INTERFACE_DESCRIPTOR_DATA_DenormMode_bits  1
   135472 
   135473 static inline uint32_t ATTRIBUTE_PURE
   135474 INTERFACE_DESCRIPTOR_DATA_DenormMode_bits(const struct gen_device_info *devinfo)
   135475 {
   135476    switch (devinfo->gen) {
   135477    case 10: return 1;
   135478    case 9: return 1;
   135479    case 8: return 1;
   135480    case 7:
   135481       if (devinfo->is_haswell) {
   135482          return 0;
   135483       } else {
   135484          return 0;
   135485       }
   135486    case 6: return 0;
   135487    case 5: return 0;
   135488    case 4:
   135489       if (devinfo->is_g4x) {
   135490          return 0;
   135491       } else {
   135492          return 0;
   135493       }
   135494    default:
   135495       unreachable("Invalid hardware generation");
   135496    }
   135497 }
   135498 
   135499 
   135500 
   135501 #define GEN10_INTERFACE_DESCRIPTOR_DATA_DenormMode_start  83
   135502 #define GEN9_INTERFACE_DESCRIPTOR_DATA_DenormMode_start  83
   135503 #define GEN8_INTERFACE_DESCRIPTOR_DATA_DenormMode_start  83
   135504 
   135505 static inline uint32_t ATTRIBUTE_PURE
   135506 INTERFACE_DESCRIPTOR_DATA_DenormMode_start(const struct gen_device_info *devinfo)
   135507 {
   135508    switch (devinfo->gen) {
   135509    case 10: return 83;
   135510    case 9: return 83;
   135511    case 8: return 83;
   135512    case 7:
   135513       if (devinfo->is_haswell) {
   135514          return 0;
   135515       } else {
   135516          return 0;
   135517       }
   135518    case 6: return 0;
   135519    case 5: return 0;
   135520    case 4:
   135521       if (devinfo->is_g4x) {
   135522          return 0;
   135523       } else {
   135524          return 0;
   135525       }
   135526    default:
   135527       unreachable("Invalid hardware generation");
   135528    }
   135529 }
   135530 
   135531 
   135532 
   135533 /* INTERFACE_DESCRIPTOR_DATA::Floating Point Mode */
   135534 
   135535 
   135536 #define GEN10_INTERFACE_DESCRIPTOR_DATA_FloatingPointMode_bits  1
   135537 #define GEN9_INTERFACE_DESCRIPTOR_DATA_FloatingPointMode_bits  1
   135538 #define GEN8_INTERFACE_DESCRIPTOR_DATA_FloatingPointMode_bits  1
   135539 #define GEN75_INTERFACE_DESCRIPTOR_DATA_FloatingPointMode_bits  1
   135540 #define GEN7_INTERFACE_DESCRIPTOR_DATA_FloatingPointMode_bits  1
   135541 #define GEN6_INTERFACE_DESCRIPTOR_DATA_FloatingPointMode_bits  1
   135542 
   135543 static inline uint32_t ATTRIBUTE_PURE
   135544 INTERFACE_DESCRIPTOR_DATA_FloatingPointMode_bits(const struct gen_device_info *devinfo)
   135545 {
   135546    switch (devinfo->gen) {
   135547    case 10: return 1;
   135548    case 9: return 1;
   135549    case 8: return 1;
   135550    case 7:
   135551       if (devinfo->is_haswell) {
   135552          return 1;
   135553       } else {
   135554          return 1;
   135555       }
   135556    case 6: return 1;
   135557    case 5: return 0;
   135558    case 4:
   135559       if (devinfo->is_g4x) {
   135560          return 0;
   135561       } else {
   135562          return 0;
   135563       }
   135564    default:
   135565       unreachable("Invalid hardware generation");
   135566    }
   135567 }
   135568 
   135569 
   135570 
   135571 #define GEN10_INTERFACE_DESCRIPTOR_DATA_FloatingPointMode_start  80
   135572 #define GEN9_INTERFACE_DESCRIPTOR_DATA_FloatingPointMode_start  80
   135573 #define GEN8_INTERFACE_DESCRIPTOR_DATA_FloatingPointMode_start  80
   135574 #define GEN75_INTERFACE_DESCRIPTOR_DATA_FloatingPointMode_start  48
   135575 #define GEN7_INTERFACE_DESCRIPTOR_DATA_FloatingPointMode_start  48
   135576 #define GEN6_INTERFACE_DESCRIPTOR_DATA_FloatingPointMode_start  48
   135577 
   135578 static inline uint32_t ATTRIBUTE_PURE
   135579 INTERFACE_DESCRIPTOR_DATA_FloatingPointMode_start(const struct gen_device_info *devinfo)
   135580 {
   135581    switch (devinfo->gen) {
   135582    case 10: return 80;
   135583    case 9: return 80;
   135584    case 8: return 80;
   135585    case 7:
   135586       if (devinfo->is_haswell) {
   135587          return 48;
   135588       } else {
   135589          return 48;
   135590       }
   135591    case 6: return 48;
   135592    case 5: return 0;
   135593    case 4:
   135594       if (devinfo->is_g4x) {
   135595          return 0;
   135596       } else {
   135597          return 0;
   135598       }
   135599    default:
   135600       unreachable("Invalid hardware generation");
   135601    }
   135602 }
   135603 
   135604 
   135605 
   135606 /* INTERFACE_DESCRIPTOR_DATA::Global Barrier Enable */
   135607 
   135608 
   135609 #define GEN10_INTERFACE_DESCRIPTOR_DATA_GlobalBarrierEnable_bits  1
   135610 #define GEN9_INTERFACE_DESCRIPTOR_DATA_GlobalBarrierEnable_bits  1
   135611 
   135612 static inline uint32_t ATTRIBUTE_PURE
   135613 INTERFACE_DESCRIPTOR_DATA_GlobalBarrierEnable_bits(const struct gen_device_info *devinfo)
   135614 {
   135615    switch (devinfo->gen) {
   135616    case 10: return 1;
   135617    case 9: return 1;
   135618    case 8: return 0;
   135619    case 7:
   135620       if (devinfo->is_haswell) {
   135621          return 0;
   135622       } else {
   135623          return 0;
   135624       }
   135625    case 6: return 0;
   135626    case 5: return 0;
   135627    case 4:
   135628       if (devinfo->is_g4x) {
   135629          return 0;
   135630       } else {
   135631          return 0;
   135632       }
   135633    default:
   135634       unreachable("Invalid hardware generation");
   135635    }
   135636 }
   135637 
   135638 
   135639 
   135640 #define GEN10_INTERFACE_DESCRIPTOR_DATA_GlobalBarrierEnable_start  207
   135641 #define GEN9_INTERFACE_DESCRIPTOR_DATA_GlobalBarrierEnable_start  207
   135642 
   135643 static inline uint32_t ATTRIBUTE_PURE
   135644 INTERFACE_DESCRIPTOR_DATA_GlobalBarrierEnable_start(const struct gen_device_info *devinfo)
   135645 {
   135646    switch (devinfo->gen) {
   135647    case 10: return 207;
   135648    case 9: return 207;
   135649    case 8: return 0;
   135650    case 7:
   135651       if (devinfo->is_haswell) {
   135652          return 0;
   135653       } else {
   135654          return 0;
   135655       }
   135656    case 6: return 0;
   135657    case 5: return 0;
   135658    case 4:
   135659       if (devinfo->is_g4x) {
   135660          return 0;
   135661       } else {
   135662          return 0;
   135663       }
   135664    default:
   135665       unreachable("Invalid hardware generation");
   135666    }
   135667 }
   135668 
   135669 
   135670 
   135671 /* INTERFACE_DESCRIPTOR_DATA::Illegal Opcode Exception Enable */
   135672 
   135673 
   135674 #define GEN10_INTERFACE_DESCRIPTOR_DATA_IllegalOpcodeExceptionEnable_bits  1
   135675 #define GEN9_INTERFACE_DESCRIPTOR_DATA_IllegalOpcodeExceptionEnable_bits  1
   135676 #define GEN8_INTERFACE_DESCRIPTOR_DATA_IllegalOpcodeExceptionEnable_bits  1
   135677 #define GEN75_INTERFACE_DESCRIPTOR_DATA_IllegalOpcodeExceptionEnable_bits  1
   135678 #define GEN7_INTERFACE_DESCRIPTOR_DATA_IllegalOpcodeExceptionEnable_bits  1
   135679 #define GEN6_INTERFACE_DESCRIPTOR_DATA_IllegalOpcodeExceptionEnable_bits  1
   135680 
   135681 static inline uint32_t ATTRIBUTE_PURE
   135682 INTERFACE_DESCRIPTOR_DATA_IllegalOpcodeExceptionEnable_bits(const struct gen_device_info *devinfo)
   135683 {
   135684    switch (devinfo->gen) {
   135685    case 10: return 1;
   135686    case 9: return 1;
   135687    case 8: return 1;
   135688    case 7:
   135689       if (devinfo->is_haswell) {
   135690          return 1;
   135691       } else {
   135692          return 1;
   135693       }
   135694    case 6: return 1;
   135695    case 5: return 0;
   135696    case 4:
   135697       if (devinfo->is_g4x) {
   135698          return 0;
   135699       } else {
   135700          return 0;
   135701       }
   135702    default:
   135703       unreachable("Invalid hardware generation");
   135704    }
   135705 }
   135706 
   135707 
   135708 
   135709 #define GEN10_INTERFACE_DESCRIPTOR_DATA_IllegalOpcodeExceptionEnable_start  77
   135710 #define GEN9_INTERFACE_DESCRIPTOR_DATA_IllegalOpcodeExceptionEnable_start  77
   135711 #define GEN8_INTERFACE_DESCRIPTOR_DATA_IllegalOpcodeExceptionEnable_start  77
   135712 #define GEN75_INTERFACE_DESCRIPTOR_DATA_IllegalOpcodeExceptionEnable_start  45
   135713 #define GEN7_INTERFACE_DESCRIPTOR_DATA_IllegalOpcodeExceptionEnable_start  45
   135714 #define GEN6_INTERFACE_DESCRIPTOR_DATA_IllegalOpcodeExceptionEnable_start  45
   135715 
   135716 static inline uint32_t ATTRIBUTE_PURE
   135717 INTERFACE_DESCRIPTOR_DATA_IllegalOpcodeExceptionEnable_start(const struct gen_device_info *devinfo)
   135718 {
   135719    switch (devinfo->gen) {
   135720    case 10: return 77;
   135721    case 9: return 77;
   135722    case 8: return 77;
   135723    case 7:
   135724       if (devinfo->is_haswell) {
   135725          return 45;
   135726       } else {
   135727          return 45;
   135728       }
   135729    case 6: return 45;
   135730    case 5: return 0;
   135731    case 4:
   135732       if (devinfo->is_g4x) {
   135733          return 0;
   135734       } else {
   135735          return 0;
   135736       }
   135737    default:
   135738       unreachable("Invalid hardware generation");
   135739    }
   135740 }
   135741 
   135742 
   135743 
   135744 /* INTERFACE_DESCRIPTOR_DATA::Kernel Start Pointer */
   135745 
   135746 
   135747 #define GEN10_INTERFACE_DESCRIPTOR_DATA_KernelStartPointer_bits  42
   135748 #define GEN9_INTERFACE_DESCRIPTOR_DATA_KernelStartPointer_bits  42
   135749 #define GEN8_INTERFACE_DESCRIPTOR_DATA_KernelStartPointer_bits  42
   135750 #define GEN75_INTERFACE_DESCRIPTOR_DATA_KernelStartPointer_bits  26
   135751 #define GEN7_INTERFACE_DESCRIPTOR_DATA_KernelStartPointer_bits  26
   135752 #define GEN6_INTERFACE_DESCRIPTOR_DATA_KernelStartPointer_bits  26
   135753 
   135754 static inline uint32_t ATTRIBUTE_PURE
   135755 INTERFACE_DESCRIPTOR_DATA_KernelStartPointer_bits(const struct gen_device_info *devinfo)
   135756 {
   135757    switch (devinfo->gen) {
   135758    case 10: return 42;
   135759    case 9: return 42;
   135760    case 8: return 42;
   135761    case 7:
   135762       if (devinfo->is_haswell) {
   135763          return 26;
   135764       } else {
   135765          return 26;
   135766       }
   135767    case 6: return 26;
   135768    case 5: return 0;
   135769    case 4:
   135770       if (devinfo->is_g4x) {
   135771          return 0;
   135772       } else {
   135773          return 0;
   135774       }
   135775    default:
   135776       unreachable("Invalid hardware generation");
   135777    }
   135778 }
   135779 
   135780 
   135781 
   135782 #define GEN10_INTERFACE_DESCRIPTOR_DATA_KernelStartPointer_start  6
   135783 #define GEN9_INTERFACE_DESCRIPTOR_DATA_KernelStartPointer_start  6
   135784 #define GEN8_INTERFACE_DESCRIPTOR_DATA_KernelStartPointer_start  6
   135785 #define GEN75_INTERFACE_DESCRIPTOR_DATA_KernelStartPointer_start  6
   135786 #define GEN7_INTERFACE_DESCRIPTOR_DATA_KernelStartPointer_start  6
   135787 #define GEN6_INTERFACE_DESCRIPTOR_DATA_KernelStartPointer_start  6
   135788 
   135789 static inline uint32_t ATTRIBUTE_PURE
   135790 INTERFACE_DESCRIPTOR_DATA_KernelStartPointer_start(const struct gen_device_info *devinfo)
   135791 {
   135792    switch (devinfo->gen) {
   135793    case 10: return 6;
   135794    case 9: return 6;
   135795    case 8: return 6;
   135796    case 7:
   135797       if (devinfo->is_haswell) {
   135798          return 6;
   135799       } else {
   135800          return 6;
   135801       }
   135802    case 6: return 6;
   135803    case 5: return 0;
   135804    case 4:
   135805       if (devinfo->is_g4x) {
   135806          return 0;
   135807       } else {
   135808          return 0;
   135809       }
   135810    default:
   135811       unreachable("Invalid hardware generation");
   135812    }
   135813 }
   135814 
   135815 
   135816 
   135817 /* INTERFACE_DESCRIPTOR_DATA::Mask Stack Exception Enable */
   135818 
   135819 
   135820 #define GEN10_INTERFACE_DESCRIPTOR_DATA_MaskStackExceptionEnable_bits  1
   135821 #define GEN9_INTERFACE_DESCRIPTOR_DATA_MaskStackExceptionEnable_bits  1
   135822 #define GEN8_INTERFACE_DESCRIPTOR_DATA_MaskStackExceptionEnable_bits  1
   135823 #define GEN75_INTERFACE_DESCRIPTOR_DATA_MaskStackExceptionEnable_bits  1
   135824 #define GEN7_INTERFACE_DESCRIPTOR_DATA_MaskStackExceptionEnable_bits  1
   135825 #define GEN6_INTERFACE_DESCRIPTOR_DATA_MaskStackExceptionEnable_bits  1
   135826 
   135827 static inline uint32_t ATTRIBUTE_PURE
   135828 INTERFACE_DESCRIPTOR_DATA_MaskStackExceptionEnable_bits(const struct gen_device_info *devinfo)
   135829 {
   135830    switch (devinfo->gen) {
   135831    case 10: return 1;
   135832    case 9: return 1;
   135833    case 8: return 1;
   135834    case 7:
   135835       if (devinfo->is_haswell) {
   135836          return 1;
   135837       } else {
   135838          return 1;
   135839       }
   135840    case 6: return 1;
   135841    case 5: return 0;
   135842    case 4:
   135843       if (devinfo->is_g4x) {
   135844          return 0;
   135845       } else {
   135846          return 0;
   135847       }
   135848    default:
   135849       unreachable("Invalid hardware generation");
   135850    }
   135851 }
   135852 
   135853 
   135854 
   135855 #define GEN10_INTERFACE_DESCRIPTOR_DATA_MaskStackExceptionEnable_start  75
   135856 #define GEN9_INTERFACE_DESCRIPTOR_DATA_MaskStackExceptionEnable_start  75
   135857 #define GEN8_INTERFACE_DESCRIPTOR_DATA_MaskStackExceptionEnable_start  75
   135858 #define GEN75_INTERFACE_DESCRIPTOR_DATA_MaskStackExceptionEnable_start  43
   135859 #define GEN7_INTERFACE_DESCRIPTOR_DATA_MaskStackExceptionEnable_start  43
   135860 #define GEN6_INTERFACE_DESCRIPTOR_DATA_MaskStackExceptionEnable_start  43
   135861 
   135862 static inline uint32_t ATTRIBUTE_PURE
   135863 INTERFACE_DESCRIPTOR_DATA_MaskStackExceptionEnable_start(const struct gen_device_info *devinfo)
   135864 {
   135865    switch (devinfo->gen) {
   135866    case 10: return 75;
   135867    case 9: return 75;
   135868    case 8: return 75;
   135869    case 7:
   135870       if (devinfo->is_haswell) {
   135871          return 43;
   135872       } else {
   135873          return 43;
   135874       }
   135875    case 6: return 43;
   135876    case 5: return 0;
   135877    case 4:
   135878       if (devinfo->is_g4x) {
   135879          return 0;
   135880       } else {
   135881          return 0;
   135882       }
   135883    default:
   135884       unreachable("Invalid hardware generation");
   135885    }
   135886 }
   135887 
   135888 
   135889 
   135890 /* INTERFACE_DESCRIPTOR_DATA::Number of Threads in GPGPU Thread Group */
   135891 
   135892 
   135893 #define GEN10_INTERFACE_DESCRIPTOR_DATA_NumberofThreadsinGPGPUThreadGroup_bits  10
   135894 #define GEN9_INTERFACE_DESCRIPTOR_DATA_NumberofThreadsinGPGPUThreadGroup_bits  10
   135895 #define GEN8_INTERFACE_DESCRIPTOR_DATA_NumberofThreadsinGPGPUThreadGroup_bits  10
   135896 #define GEN75_INTERFACE_DESCRIPTOR_DATA_NumberofThreadsinGPGPUThreadGroup_bits  8
   135897 #define GEN7_INTERFACE_DESCRIPTOR_DATA_NumberofThreadsinGPGPUThreadGroup_bits  8
   135898 
   135899 static inline uint32_t ATTRIBUTE_PURE
   135900 INTERFACE_DESCRIPTOR_DATA_NumberofThreadsinGPGPUThreadGroup_bits(const struct gen_device_info *devinfo)
   135901 {
   135902    switch (devinfo->gen) {
   135903    case 10: return 10;
   135904    case 9: return 10;
   135905    case 8: return 10;
   135906    case 7:
   135907       if (devinfo->is_haswell) {
   135908          return 8;
   135909       } else {
   135910          return 8;
   135911       }
   135912    case 6: return 0;
   135913    case 5: return 0;
   135914    case 4:
   135915       if (devinfo->is_g4x) {
   135916          return 0;
   135917       } else {
   135918          return 0;
   135919       }
   135920    default:
   135921       unreachable("Invalid hardware generation");
   135922    }
   135923 }
   135924 
   135925 
   135926 
   135927 #define GEN10_INTERFACE_DESCRIPTOR_DATA_NumberofThreadsinGPGPUThreadGroup_start  192
   135928 #define GEN9_INTERFACE_DESCRIPTOR_DATA_NumberofThreadsinGPGPUThreadGroup_start  192
   135929 #define GEN8_INTERFACE_DESCRIPTOR_DATA_NumberofThreadsinGPGPUThreadGroup_start  192
   135930 #define GEN75_INTERFACE_DESCRIPTOR_DATA_NumberofThreadsinGPGPUThreadGroup_start  160
   135931 #define GEN7_INTERFACE_DESCRIPTOR_DATA_NumberofThreadsinGPGPUThreadGroup_start  160
   135932 
   135933 static inline uint32_t ATTRIBUTE_PURE
   135934 INTERFACE_DESCRIPTOR_DATA_NumberofThreadsinGPGPUThreadGroup_start(const struct gen_device_info *devinfo)
   135935 {
   135936    switch (devinfo->gen) {
   135937    case 10: return 192;
   135938    case 9: return 192;
   135939    case 8: return 192;
   135940    case 7:
   135941       if (devinfo->is_haswell) {
   135942          return 160;
   135943       } else {
   135944          return 160;
   135945       }
   135946    case 6: return 0;
   135947    case 5: return 0;
   135948    case 4:
   135949       if (devinfo->is_g4x) {
   135950          return 0;
   135951       } else {
   135952          return 0;
   135953       }
   135954    default:
   135955       unreachable("Invalid hardware generation");
   135956    }
   135957 }
   135958 
   135959 
   135960 
   135961 /* INTERFACE_DESCRIPTOR_DATA::Rounding Mode */
   135962 
   135963 
   135964 #define GEN10_INTERFACE_DESCRIPTOR_DATA_RoundingMode_bits  2
   135965 #define GEN9_INTERFACE_DESCRIPTOR_DATA_RoundingMode_bits  2
   135966 #define GEN8_INTERFACE_DESCRIPTOR_DATA_RoundingMode_bits  2
   135967 #define GEN75_INTERFACE_DESCRIPTOR_DATA_RoundingMode_bits  2
   135968 #define GEN7_INTERFACE_DESCRIPTOR_DATA_RoundingMode_bits  2
   135969 
   135970 static inline uint32_t ATTRIBUTE_PURE
   135971 INTERFACE_DESCRIPTOR_DATA_RoundingMode_bits(const struct gen_device_info *devinfo)
   135972 {
   135973    switch (devinfo->gen) {
   135974    case 10: return 2;
   135975    case 9: return 2;
   135976    case 8: return 2;
   135977    case 7:
   135978       if (devinfo->is_haswell) {
   135979          return 2;
   135980       } else {
   135981          return 2;
   135982       }
   135983    case 6: return 0;
   135984    case 5: return 0;
   135985    case 4:
   135986       if (devinfo->is_g4x) {
   135987          return 0;
   135988       } else {
   135989          return 0;
   135990       }
   135991    default:
   135992       unreachable("Invalid hardware generation");
   135993    }
   135994 }
   135995 
   135996 
   135997 
   135998 #define GEN10_INTERFACE_DESCRIPTOR_DATA_RoundingMode_start  214
   135999 #define GEN9_INTERFACE_DESCRIPTOR_DATA_RoundingMode_start  214
   136000 #define GEN8_INTERFACE_DESCRIPTOR_DATA_RoundingMode_start  214
   136001 #define GEN75_INTERFACE_DESCRIPTOR_DATA_RoundingMode_start  182
   136002 #define GEN7_INTERFACE_DESCRIPTOR_DATA_RoundingMode_start  182
   136003 
   136004 static inline uint32_t ATTRIBUTE_PURE
   136005 INTERFACE_DESCRIPTOR_DATA_RoundingMode_start(const struct gen_device_info *devinfo)
   136006 {
   136007    switch (devinfo->gen) {
   136008    case 10: return 214;
   136009    case 9: return 214;
   136010    case 8: return 214;
   136011    case 7:
   136012       if (devinfo->is_haswell) {
   136013          return 182;
   136014       } else {
   136015          return 182;
   136016       }
   136017    case 6: return 0;
   136018    case 5: return 0;
   136019    case 4:
   136020       if (devinfo->is_g4x) {
   136021          return 0;
   136022       } else {
   136023          return 0;
   136024       }
   136025    default:
   136026       unreachable("Invalid hardware generation");
   136027    }
   136028 }
   136029 
   136030 
   136031 
   136032 /* INTERFACE_DESCRIPTOR_DATA::Sampler Count */
   136033 
   136034 
   136035 #define GEN10_INTERFACE_DESCRIPTOR_DATA_SamplerCount_bits  3
   136036 #define GEN9_INTERFACE_DESCRIPTOR_DATA_SamplerCount_bits  3
   136037 #define GEN8_INTERFACE_DESCRIPTOR_DATA_SamplerCount_bits  3
   136038 #define GEN75_INTERFACE_DESCRIPTOR_DATA_SamplerCount_bits  3
   136039 #define GEN7_INTERFACE_DESCRIPTOR_DATA_SamplerCount_bits  3
   136040 #define GEN6_INTERFACE_DESCRIPTOR_DATA_SamplerCount_bits  3
   136041 
   136042 static inline uint32_t ATTRIBUTE_PURE
   136043 INTERFACE_DESCRIPTOR_DATA_SamplerCount_bits(const struct gen_device_info *devinfo)
   136044 {
   136045    switch (devinfo->gen) {
   136046    case 10: return 3;
   136047    case 9: return 3;
   136048    case 8: return 3;
   136049    case 7:
   136050       if (devinfo->is_haswell) {
   136051          return 3;
   136052       } else {
   136053          return 3;
   136054       }
   136055    case 6: return 3;
   136056    case 5: return 0;
   136057    case 4:
   136058       if (devinfo->is_g4x) {
   136059          return 0;
   136060       } else {
   136061          return 0;
   136062       }
   136063    default:
   136064       unreachable("Invalid hardware generation");
   136065    }
   136066 }
   136067 
   136068 
   136069 
   136070 #define GEN10_INTERFACE_DESCRIPTOR_DATA_SamplerCount_start  98
   136071 #define GEN9_INTERFACE_DESCRIPTOR_DATA_SamplerCount_start  98
   136072 #define GEN8_INTERFACE_DESCRIPTOR_DATA_SamplerCount_start  98
   136073 #define GEN75_INTERFACE_DESCRIPTOR_DATA_SamplerCount_start  66
   136074 #define GEN7_INTERFACE_DESCRIPTOR_DATA_SamplerCount_start  66
   136075 #define GEN6_INTERFACE_DESCRIPTOR_DATA_SamplerCount_start  66
   136076 
   136077 static inline uint32_t ATTRIBUTE_PURE
   136078 INTERFACE_DESCRIPTOR_DATA_SamplerCount_start(const struct gen_device_info *devinfo)
   136079 {
   136080    switch (devinfo->gen) {
   136081    case 10: return 98;
   136082    case 9: return 98;
   136083    case 8: return 98;
   136084    case 7:
   136085       if (devinfo->is_haswell) {
   136086          return 66;
   136087       } else {
   136088          return 66;
   136089       }
   136090    case 6: return 66;
   136091    case 5: return 0;
   136092    case 4:
   136093       if (devinfo->is_g4x) {
   136094          return 0;
   136095       } else {
   136096          return 0;
   136097       }
   136098    default:
   136099       unreachable("Invalid hardware generation");
   136100    }
   136101 }
   136102 
   136103 
   136104 
   136105 /* INTERFACE_DESCRIPTOR_DATA::Sampler State Pointer */
   136106 
   136107 
   136108 #define GEN10_INTERFACE_DESCRIPTOR_DATA_SamplerStatePointer_bits  27
   136109 #define GEN9_INTERFACE_DESCRIPTOR_DATA_SamplerStatePointer_bits  27
   136110 #define GEN8_INTERFACE_DESCRIPTOR_DATA_SamplerStatePointer_bits  27
   136111 #define GEN75_INTERFACE_DESCRIPTOR_DATA_SamplerStatePointer_bits  27
   136112 #define GEN7_INTERFACE_DESCRIPTOR_DATA_SamplerStatePointer_bits  27
   136113 #define GEN6_INTERFACE_DESCRIPTOR_DATA_SamplerStatePointer_bits  27
   136114 
   136115 static inline uint32_t ATTRIBUTE_PURE
   136116 INTERFACE_DESCRIPTOR_DATA_SamplerStatePointer_bits(const struct gen_device_info *devinfo)
   136117 {
   136118    switch (devinfo->gen) {
   136119    case 10: return 27;
   136120    case 9: return 27;
   136121    case 8: return 27;
   136122    case 7:
   136123       if (devinfo->is_haswell) {
   136124          return 27;
   136125       } else {
   136126          return 27;
   136127       }
   136128    case 6: return 27;
   136129    case 5: return 0;
   136130    case 4:
   136131       if (devinfo->is_g4x) {
   136132          return 0;
   136133       } else {
   136134          return 0;
   136135       }
   136136    default:
   136137       unreachable("Invalid hardware generation");
   136138    }
   136139 }
   136140 
   136141 
   136142 
   136143 #define GEN10_INTERFACE_DESCRIPTOR_DATA_SamplerStatePointer_start  101
   136144 #define GEN9_INTERFACE_DESCRIPTOR_DATA_SamplerStatePointer_start  101
   136145 #define GEN8_INTERFACE_DESCRIPTOR_DATA_SamplerStatePointer_start  101
   136146 #define GEN75_INTERFACE_DESCRIPTOR_DATA_SamplerStatePointer_start  69
   136147 #define GEN7_INTERFACE_DESCRIPTOR_DATA_SamplerStatePointer_start  69
   136148 #define GEN6_INTERFACE_DESCRIPTOR_DATA_SamplerStatePointer_start  69
   136149 
   136150 static inline uint32_t ATTRIBUTE_PURE
   136151 INTERFACE_DESCRIPTOR_DATA_SamplerStatePointer_start(const struct gen_device_info *devinfo)
   136152 {
   136153    switch (devinfo->gen) {
   136154    case 10: return 101;
   136155    case 9: return 101;
   136156    case 8: return 101;
   136157    case 7:
   136158       if (devinfo->is_haswell) {
   136159          return 69;
   136160       } else {
   136161          return 69;
   136162       }
   136163    case 6: return 69;
   136164    case 5: return 0;
   136165    case 4:
   136166       if (devinfo->is_g4x) {
   136167          return 0;
   136168       } else {
   136169          return 0;
   136170       }
   136171    default:
   136172       unreachable("Invalid hardware generation");
   136173    }
   136174 }
   136175 
   136176 
   136177 
   136178 /* INTERFACE_DESCRIPTOR_DATA::Shared Local Memory Size */
   136179 
   136180 
   136181 #define GEN10_INTERFACE_DESCRIPTOR_DATA_SharedLocalMemorySize_bits  5
   136182 #define GEN9_INTERFACE_DESCRIPTOR_DATA_SharedLocalMemorySize_bits  5
   136183 #define GEN8_INTERFACE_DESCRIPTOR_DATA_SharedLocalMemorySize_bits  5
   136184 #define GEN75_INTERFACE_DESCRIPTOR_DATA_SharedLocalMemorySize_bits  5
   136185 #define GEN7_INTERFACE_DESCRIPTOR_DATA_SharedLocalMemorySize_bits  5
   136186 
   136187 static inline uint32_t ATTRIBUTE_PURE
   136188 INTERFACE_DESCRIPTOR_DATA_SharedLocalMemorySize_bits(const struct gen_device_info *devinfo)
   136189 {
   136190    switch (devinfo->gen) {
   136191    case 10: return 5;
   136192    case 9: return 5;
   136193    case 8: return 5;
   136194    case 7:
   136195       if (devinfo->is_haswell) {
   136196          return 5;
   136197       } else {
   136198          return 5;
   136199       }
   136200    case 6: return 0;
   136201    case 5: return 0;
   136202    case 4:
   136203       if (devinfo->is_g4x) {
   136204          return 0;
   136205       } else {
   136206          return 0;
   136207       }
   136208    default:
   136209       unreachable("Invalid hardware generation");
   136210    }
   136211 }
   136212 
   136213 
   136214 
   136215 #define GEN10_INTERFACE_DESCRIPTOR_DATA_SharedLocalMemorySize_start  208
   136216 #define GEN9_INTERFACE_DESCRIPTOR_DATA_SharedLocalMemorySize_start  208
   136217 #define GEN8_INTERFACE_DESCRIPTOR_DATA_SharedLocalMemorySize_start  208
   136218 #define GEN75_INTERFACE_DESCRIPTOR_DATA_SharedLocalMemorySize_start  176
   136219 #define GEN7_INTERFACE_DESCRIPTOR_DATA_SharedLocalMemorySize_start  176
   136220 
   136221 static inline uint32_t ATTRIBUTE_PURE
   136222 INTERFACE_DESCRIPTOR_DATA_SharedLocalMemorySize_start(const struct gen_device_info *devinfo)
   136223 {
   136224    switch (devinfo->gen) {
   136225    case 10: return 208;
   136226    case 9: return 208;
   136227    case 8: return 208;
   136228    case 7:
   136229       if (devinfo->is_haswell) {
   136230          return 176;
   136231       } else {
   136232          return 176;
   136233       }
   136234    case 6: return 0;
   136235    case 5: return 0;
   136236    case 4:
   136237       if (devinfo->is_g4x) {
   136238          return 0;
   136239       } else {
   136240          return 0;
   136241       }
   136242    default:
   136243       unreachable("Invalid hardware generation");
   136244    }
   136245 }
   136246 
   136247 
   136248 
   136249 /* INTERFACE_DESCRIPTOR_DATA::Single Program Flow */
   136250 
   136251 
   136252 #define GEN10_INTERFACE_DESCRIPTOR_DATA_SingleProgramFlow_bits  1
   136253 #define GEN9_INTERFACE_DESCRIPTOR_DATA_SingleProgramFlow_bits  1
   136254 #define GEN8_INTERFACE_DESCRIPTOR_DATA_SingleProgramFlow_bits  1
   136255 #define GEN75_INTERFACE_DESCRIPTOR_DATA_SingleProgramFlow_bits  1
   136256 #define GEN7_INTERFACE_DESCRIPTOR_DATA_SingleProgramFlow_bits  1
   136257 #define GEN6_INTERFACE_DESCRIPTOR_DATA_SingleProgramFlow_bits  1
   136258 
   136259 static inline uint32_t ATTRIBUTE_PURE
   136260 INTERFACE_DESCRIPTOR_DATA_SingleProgramFlow_bits(const struct gen_device_info *devinfo)
   136261 {
   136262    switch (devinfo->gen) {
   136263    case 10: return 1;
   136264    case 9: return 1;
   136265    case 8: return 1;
   136266    case 7:
   136267       if (devinfo->is_haswell) {
   136268          return 1;
   136269       } else {
   136270          return 1;
   136271       }
   136272    case 6: return 1;
   136273    case 5: return 0;
   136274    case 4:
   136275       if (devinfo->is_g4x) {
   136276          return 0;
   136277       } else {
   136278          return 0;
   136279       }
   136280    default:
   136281       unreachable("Invalid hardware generation");
   136282    }
   136283 }
   136284 
   136285 
   136286 
   136287 #define GEN10_INTERFACE_DESCRIPTOR_DATA_SingleProgramFlow_start  82
   136288 #define GEN9_INTERFACE_DESCRIPTOR_DATA_SingleProgramFlow_start  82
   136289 #define GEN8_INTERFACE_DESCRIPTOR_DATA_SingleProgramFlow_start  82
   136290 #define GEN75_INTERFACE_DESCRIPTOR_DATA_SingleProgramFlow_start  50
   136291 #define GEN7_INTERFACE_DESCRIPTOR_DATA_SingleProgramFlow_start  50
   136292 #define GEN6_INTERFACE_DESCRIPTOR_DATA_SingleProgramFlow_start  50
   136293 
   136294 static inline uint32_t ATTRIBUTE_PURE
   136295 INTERFACE_DESCRIPTOR_DATA_SingleProgramFlow_start(const struct gen_device_info *devinfo)
   136296 {
   136297    switch (devinfo->gen) {
   136298    case 10: return 82;
   136299    case 9: return 82;
   136300    case 8: return 82;
   136301    case 7:
   136302       if (devinfo->is_haswell) {
   136303          return 50;
   136304       } else {
   136305          return 50;
   136306       }
   136307    case 6: return 50;
   136308    case 5: return 0;
   136309    case 4:
   136310       if (devinfo->is_g4x) {
   136311          return 0;
   136312       } else {
   136313          return 0;
   136314       }
   136315    default:
   136316       unreachable("Invalid hardware generation");
   136317    }
   136318 }
   136319 
   136320 
   136321 
   136322 /* INTERFACE_DESCRIPTOR_DATA::Software Exception Enable */
   136323 
   136324 
   136325 #define GEN10_INTERFACE_DESCRIPTOR_DATA_SoftwareExceptionEnable_bits  1
   136326 #define GEN9_INTERFACE_DESCRIPTOR_DATA_SoftwareExceptionEnable_bits  1
   136327 #define GEN8_INTERFACE_DESCRIPTOR_DATA_SoftwareExceptionEnable_bits  1
   136328 #define GEN75_INTERFACE_DESCRIPTOR_DATA_SoftwareExceptionEnable_bits  1
   136329 #define GEN7_INTERFACE_DESCRIPTOR_DATA_SoftwareExceptionEnable_bits  1
   136330 #define GEN6_INTERFACE_DESCRIPTOR_DATA_SoftwareExceptionEnable_bits  1
   136331 
   136332 static inline uint32_t ATTRIBUTE_PURE
   136333 INTERFACE_DESCRIPTOR_DATA_SoftwareExceptionEnable_bits(const struct gen_device_info *devinfo)
   136334 {
   136335    switch (devinfo->gen) {
   136336    case 10: return 1;
   136337    case 9: return 1;
   136338    case 8: return 1;
   136339    case 7:
   136340       if (devinfo->is_haswell) {
   136341          return 1;
   136342       } else {
   136343          return 1;
   136344       }
   136345    case 6: return 1;
   136346    case 5: return 0;
   136347    case 4:
   136348       if (devinfo->is_g4x) {
   136349          return 0;
   136350       } else {
   136351          return 0;
   136352       }
   136353    default:
   136354       unreachable("Invalid hardware generation");
   136355    }
   136356 }
   136357 
   136358 
   136359 
   136360 #define GEN10_INTERFACE_DESCRIPTOR_DATA_SoftwareExceptionEnable_start  71
   136361 #define GEN9_INTERFACE_DESCRIPTOR_DATA_SoftwareExceptionEnable_start  71
   136362 #define GEN8_INTERFACE_DESCRIPTOR_DATA_SoftwareExceptionEnable_start  71
   136363 #define GEN75_INTERFACE_DESCRIPTOR_DATA_SoftwareExceptionEnable_start  39
   136364 #define GEN7_INTERFACE_DESCRIPTOR_DATA_SoftwareExceptionEnable_start  39
   136365 #define GEN6_INTERFACE_DESCRIPTOR_DATA_SoftwareExceptionEnable_start  39
   136366 
   136367 static inline uint32_t ATTRIBUTE_PURE
   136368 INTERFACE_DESCRIPTOR_DATA_SoftwareExceptionEnable_start(const struct gen_device_info *devinfo)
   136369 {
   136370    switch (devinfo->gen) {
   136371    case 10: return 71;
   136372    case 9: return 71;
   136373    case 8: return 71;
   136374    case 7:
   136375       if (devinfo->is_haswell) {
   136376          return 39;
   136377       } else {
   136378          return 39;
   136379       }
   136380    case 6: return 39;
   136381    case 5: return 0;
   136382    case 4:
   136383       if (devinfo->is_g4x) {
   136384          return 0;
   136385       } else {
   136386          return 0;
   136387       }
   136388    default:
   136389       unreachable("Invalid hardware generation");
   136390    }
   136391 }
   136392 
   136393 
   136394 
   136395 /* INTERFACE_DESCRIPTOR_DATA::Thread Preemption disable */
   136396 
   136397 
   136398 #define GEN10_INTERFACE_DESCRIPTOR_DATA_ThreadPreemptiondisable_bits  1
   136399 
   136400 static inline uint32_t ATTRIBUTE_PURE
   136401 INTERFACE_DESCRIPTOR_DATA_ThreadPreemptiondisable_bits(const struct gen_device_info *devinfo)
   136402 {
   136403    switch (devinfo->gen) {
   136404    case 10: return 1;
   136405    case 9: return 0;
   136406    case 8: return 0;
   136407    case 7:
   136408       if (devinfo->is_haswell) {
   136409          return 0;
   136410       } else {
   136411          return 0;
   136412       }
   136413    case 6: return 0;
   136414    case 5: return 0;
   136415    case 4:
   136416       if (devinfo->is_g4x) {
   136417          return 0;
   136418       } else {
   136419          return 0;
   136420       }
   136421    default:
   136422       unreachable("Invalid hardware generation");
   136423    }
   136424 }
   136425 
   136426 
   136427 
   136428 #define GEN10_INTERFACE_DESCRIPTOR_DATA_ThreadPreemptiondisable_start  84
   136429 
   136430 static inline uint32_t ATTRIBUTE_PURE
   136431 INTERFACE_DESCRIPTOR_DATA_ThreadPreemptiondisable_start(const struct gen_device_info *devinfo)
   136432 {
   136433    switch (devinfo->gen) {
   136434    case 10: return 84;
   136435    case 9: return 0;
   136436    case 8: return 0;
   136437    case 7:
   136438       if (devinfo->is_haswell) {
   136439          return 0;
   136440       } else {
   136441          return 0;
   136442       }
   136443    case 6: return 0;
   136444    case 5: return 0;
   136445    case 4:
   136446       if (devinfo->is_g4x) {
   136447          return 0;
   136448       } else {
   136449          return 0;
   136450       }
   136451    default:
   136452       unreachable("Invalid hardware generation");
   136453    }
   136454 }
   136455 
   136456 
   136457 
   136458 /* INTERFACE_DESCRIPTOR_DATA::Thread Priority */
   136459 
   136460 
   136461 #define GEN10_INTERFACE_DESCRIPTOR_DATA_ThreadPriority_bits  1
   136462 #define GEN9_INTERFACE_DESCRIPTOR_DATA_ThreadPriority_bits  1
   136463 #define GEN8_INTERFACE_DESCRIPTOR_DATA_ThreadPriority_bits  1
   136464 #define GEN75_INTERFACE_DESCRIPTOR_DATA_ThreadPriority_bits  1
   136465 #define GEN7_INTERFACE_DESCRIPTOR_DATA_ThreadPriority_bits  1
   136466 #define GEN6_INTERFACE_DESCRIPTOR_DATA_ThreadPriority_bits  1
   136467 
   136468 static inline uint32_t ATTRIBUTE_PURE
   136469 INTERFACE_DESCRIPTOR_DATA_ThreadPriority_bits(const struct gen_device_info *devinfo)
   136470 {
   136471    switch (devinfo->gen) {
   136472    case 10: return 1;
   136473    case 9: return 1;
   136474    case 8: return 1;
   136475    case 7:
   136476       if (devinfo->is_haswell) {
   136477          return 1;
   136478       } else {
   136479          return 1;
   136480       }
   136481    case 6: return 1;
   136482    case 5: return 0;
   136483    case 4:
   136484       if (devinfo->is_g4x) {
   136485          return 0;
   136486       } else {
   136487          return 0;
   136488       }
   136489    default:
   136490       unreachable("Invalid hardware generation");
   136491    }
   136492 }
   136493 
   136494 
   136495 
   136496 #define GEN10_INTERFACE_DESCRIPTOR_DATA_ThreadPriority_start  81
   136497 #define GEN9_INTERFACE_DESCRIPTOR_DATA_ThreadPriority_start  81
   136498 #define GEN8_INTERFACE_DESCRIPTOR_DATA_ThreadPriority_start  81
   136499 #define GEN75_INTERFACE_DESCRIPTOR_DATA_ThreadPriority_start  49
   136500 #define GEN7_INTERFACE_DESCRIPTOR_DATA_ThreadPriority_start  49
   136501 #define GEN6_INTERFACE_DESCRIPTOR_DATA_ThreadPriority_start  49
   136502 
   136503 static inline uint32_t ATTRIBUTE_PURE
   136504 INTERFACE_DESCRIPTOR_DATA_ThreadPriority_start(const struct gen_device_info *devinfo)
   136505 {
   136506    switch (devinfo->gen) {
   136507    case 10: return 81;
   136508    case 9: return 81;
   136509    case 8: return 81;
   136510    case 7:
   136511       if (devinfo->is_haswell) {
   136512          return 49;
   136513       } else {
   136514          return 49;
   136515       }
   136516    case 6: return 49;
   136517    case 5: return 0;
   136518    case 4:
   136519       if (devinfo->is_g4x) {
   136520          return 0;
   136521       } else {
   136522          return 0;
   136523       }
   136524    default:
   136525       unreachable("Invalid hardware generation");
   136526    }
   136527 }
   136528 
   136529 
   136530 
   136531 /* L3CNTLREG */
   136532 
   136533 
   136534 #define GEN10_L3CNTLREG_length  1
   136535 #define GEN9_L3CNTLREG_length  1
   136536 #define GEN8_L3CNTLREG_length  1
   136537 
   136538 static inline uint32_t ATTRIBUTE_PURE
   136539 L3CNTLREG_length(const struct gen_device_info *devinfo)
   136540 {
   136541    switch (devinfo->gen) {
   136542    case 10: return 1;
   136543    case 9: return 1;
   136544    case 8: return 1;
   136545    case 7:
   136546       if (devinfo->is_haswell) {
   136547          return 0;
   136548       } else {
   136549          return 0;
   136550       }
   136551    case 6: return 0;
   136552    case 5: return 0;
   136553    case 4:
   136554       if (devinfo->is_g4x) {
   136555          return 0;
   136556       } else {
   136557          return 0;
   136558       }
   136559    default:
   136560       unreachable("Invalid hardware generation");
   136561    }
   136562 }
   136563 
   136564 
   136565 
   136566 /* L3CNTLREG::All Allocation */
   136567 
   136568 
   136569 #define GEN10_L3CNTLREG_AllAllocation_bits  7
   136570 #define GEN9_L3CNTLREG_AllAllocation_bits  7
   136571 #define GEN8_L3CNTLREG_AllAllocation_bits  7
   136572 
   136573 static inline uint32_t ATTRIBUTE_PURE
   136574 L3CNTLREG_AllAllocation_bits(const struct gen_device_info *devinfo)
   136575 {
   136576    switch (devinfo->gen) {
   136577    case 10: return 7;
   136578    case 9: return 7;
   136579    case 8: return 7;
   136580    case 7:
   136581       if (devinfo->is_haswell) {
   136582          return 0;
   136583       } else {
   136584          return 0;
   136585       }
   136586    case 6: return 0;
   136587    case 5: return 0;
   136588    case 4:
   136589       if (devinfo->is_g4x) {
   136590          return 0;
   136591       } else {
   136592          return 0;
   136593       }
   136594    default:
   136595       unreachable("Invalid hardware generation");
   136596    }
   136597 }
   136598 
   136599 
   136600 
   136601 #define GEN10_L3CNTLREG_AllAllocation_start  25
   136602 #define GEN9_L3CNTLREG_AllAllocation_start  25
   136603 #define GEN8_L3CNTLREG_AllAllocation_start  25
   136604 
   136605 static inline uint32_t ATTRIBUTE_PURE
   136606 L3CNTLREG_AllAllocation_start(const struct gen_device_info *devinfo)
   136607 {
   136608    switch (devinfo->gen) {
   136609    case 10: return 25;
   136610    case 9: return 25;
   136611    case 8: return 25;
   136612    case 7:
   136613       if (devinfo->is_haswell) {
   136614          return 0;
   136615       } else {
   136616          return 0;
   136617       }
   136618    case 6: return 0;
   136619    case 5: return 0;
   136620    case 4:
   136621       if (devinfo->is_g4x) {
   136622          return 0;
   136623       } else {
   136624          return 0;
   136625       }
   136626    default:
   136627       unreachable("Invalid hardware generation");
   136628    }
   136629 }
   136630 
   136631 
   136632 
   136633 /* L3CNTLREG::DC Allocation */
   136634 
   136635 
   136636 #define GEN10_L3CNTLREG_DCAllocation_bits  7
   136637 #define GEN9_L3CNTLREG_DCAllocation_bits  7
   136638 #define GEN8_L3CNTLREG_DCAllocation_bits  7
   136639 
   136640 static inline uint32_t ATTRIBUTE_PURE
   136641 L3CNTLREG_DCAllocation_bits(const struct gen_device_info *devinfo)
   136642 {
   136643    switch (devinfo->gen) {
   136644    case 10: return 7;
   136645    case 9: return 7;
   136646    case 8: return 7;
   136647    case 7:
   136648       if (devinfo->is_haswell) {
   136649          return 0;
   136650       } else {
   136651          return 0;
   136652       }
   136653    case 6: return 0;
   136654    case 5: return 0;
   136655    case 4:
   136656       if (devinfo->is_g4x) {
   136657          return 0;
   136658       } else {
   136659          return 0;
   136660       }
   136661    default:
   136662       unreachable("Invalid hardware generation");
   136663    }
   136664 }
   136665 
   136666 
   136667 
   136668 #define GEN10_L3CNTLREG_DCAllocation_start  18
   136669 #define GEN9_L3CNTLREG_DCAllocation_start  18
   136670 #define GEN8_L3CNTLREG_DCAllocation_start  18
   136671 
   136672 static inline uint32_t ATTRIBUTE_PURE
   136673 L3CNTLREG_DCAllocation_start(const struct gen_device_info *devinfo)
   136674 {
   136675    switch (devinfo->gen) {
   136676    case 10: return 18;
   136677    case 9: return 18;
   136678    case 8: return 18;
   136679    case 7:
   136680       if (devinfo->is_haswell) {
   136681          return 0;
   136682       } else {
   136683          return 0;
   136684       }
   136685    case 6: return 0;
   136686    case 5: return 0;
   136687    case 4:
   136688       if (devinfo->is_g4x) {
   136689          return 0;
   136690       } else {
   136691          return 0;
   136692       }
   136693    default:
   136694       unreachable("Invalid hardware generation");
   136695    }
   136696 }
   136697 
   136698 
   136699 
   136700 /* L3CNTLREG::RO Allocation */
   136701 
   136702 
   136703 #define GEN10_L3CNTLREG_ROAllocation_bits  7
   136704 #define GEN9_L3CNTLREG_ROAllocation_bits  7
   136705 #define GEN8_L3CNTLREG_ROAllocation_bits  7
   136706 
   136707 static inline uint32_t ATTRIBUTE_PURE
   136708 L3CNTLREG_ROAllocation_bits(const struct gen_device_info *devinfo)
   136709 {
   136710    switch (devinfo->gen) {
   136711    case 10: return 7;
   136712    case 9: return 7;
   136713    case 8: return 7;
   136714    case 7:
   136715       if (devinfo->is_haswell) {
   136716          return 0;
   136717       } else {
   136718          return 0;
   136719       }
   136720    case 6: return 0;
   136721    case 5: return 0;
   136722    case 4:
   136723       if (devinfo->is_g4x) {
   136724          return 0;
   136725       } else {
   136726          return 0;
   136727       }
   136728    default:
   136729       unreachable("Invalid hardware generation");
   136730    }
   136731 }
   136732 
   136733 
   136734 
   136735 #define GEN10_L3CNTLREG_ROAllocation_start  11
   136736 #define GEN9_L3CNTLREG_ROAllocation_start  11
   136737 #define GEN8_L3CNTLREG_ROAllocation_start  11
   136738 
   136739 static inline uint32_t ATTRIBUTE_PURE
   136740 L3CNTLREG_ROAllocation_start(const struct gen_device_info *devinfo)
   136741 {
   136742    switch (devinfo->gen) {
   136743    case 10: return 11;
   136744    case 9: return 11;
   136745    case 8: return 11;
   136746    case 7:
   136747       if (devinfo->is_haswell) {
   136748          return 0;
   136749       } else {
   136750          return 0;
   136751       }
   136752    case 6: return 0;
   136753    case 5: return 0;
   136754    case 4:
   136755       if (devinfo->is_g4x) {
   136756          return 0;
   136757       } else {
   136758          return 0;
   136759       }
   136760    default:
   136761       unreachable("Invalid hardware generation");
   136762    }
   136763 }
   136764 
   136765 
   136766 
   136767 /* L3CNTLREG::SLM Enable */
   136768 
   136769 
   136770 #define GEN10_L3CNTLREG_SLMEnable_bits  1
   136771 #define GEN9_L3CNTLREG_SLMEnable_bits  1
   136772 #define GEN8_L3CNTLREG_SLMEnable_bits  1
   136773 
   136774 static inline uint32_t ATTRIBUTE_PURE
   136775 L3CNTLREG_SLMEnable_bits(const struct gen_device_info *devinfo)
   136776 {
   136777    switch (devinfo->gen) {
   136778    case 10: return 1;
   136779    case 9: return 1;
   136780    case 8: return 1;
   136781    case 7:
   136782       if (devinfo->is_haswell) {
   136783          return 0;
   136784       } else {
   136785          return 0;
   136786       }
   136787    case 6: return 0;
   136788    case 5: return 0;
   136789    case 4:
   136790       if (devinfo->is_g4x) {
   136791          return 0;
   136792       } else {
   136793          return 0;
   136794       }
   136795    default:
   136796       unreachable("Invalid hardware generation");
   136797    }
   136798 }
   136799 
   136800 
   136801 
   136802 #define GEN10_L3CNTLREG_SLMEnable_start  0
   136803 #define GEN9_L3CNTLREG_SLMEnable_start  0
   136804 #define GEN8_L3CNTLREG_SLMEnable_start  0
   136805 
   136806 static inline uint32_t ATTRIBUTE_PURE
   136807 L3CNTLREG_SLMEnable_start(const struct gen_device_info *devinfo)
   136808 {
   136809    switch (devinfo->gen) {
   136810    case 10: return 0;
   136811    case 9: return 0;
   136812    case 8: return 0;
   136813    case 7:
   136814       if (devinfo->is_haswell) {
   136815          return 0;
   136816       } else {
   136817          return 0;
   136818       }
   136819    case 6: return 0;
   136820    case 5: return 0;
   136821    case 4:
   136822       if (devinfo->is_g4x) {
   136823          return 0;
   136824       } else {
   136825          return 0;
   136826       }
   136827    default:
   136828       unreachable("Invalid hardware generation");
   136829    }
   136830 }
   136831 
   136832 
   136833 
   136834 /* L3CNTLREG::URB Allocation */
   136835 
   136836 
   136837 #define GEN10_L3CNTLREG_URBAllocation_bits  7
   136838 #define GEN9_L3CNTLREG_URBAllocation_bits  7
   136839 #define GEN8_L3CNTLREG_URBAllocation_bits  7
   136840 
   136841 static inline uint32_t ATTRIBUTE_PURE
   136842 L3CNTLREG_URBAllocation_bits(const struct gen_device_info *devinfo)
   136843 {
   136844    switch (devinfo->gen) {
   136845    case 10: return 7;
   136846    case 9: return 7;
   136847    case 8: return 7;
   136848    case 7:
   136849       if (devinfo->is_haswell) {
   136850          return 0;
   136851       } else {
   136852          return 0;
   136853       }
   136854    case 6: return 0;
   136855    case 5: return 0;
   136856    case 4:
   136857       if (devinfo->is_g4x) {
   136858          return 0;
   136859       } else {
   136860          return 0;
   136861       }
   136862    default:
   136863       unreachable("Invalid hardware generation");
   136864    }
   136865 }
   136866 
   136867 
   136868 
   136869 #define GEN10_L3CNTLREG_URBAllocation_start  1
   136870 #define GEN9_L3CNTLREG_URBAllocation_start  1
   136871 #define GEN8_L3CNTLREG_URBAllocation_start  1
   136872 
   136873 static inline uint32_t ATTRIBUTE_PURE
   136874 L3CNTLREG_URBAllocation_start(const struct gen_device_info *devinfo)
   136875 {
   136876    switch (devinfo->gen) {
   136877    case 10: return 1;
   136878    case 9: return 1;
   136879    case 8: return 1;
   136880    case 7:
   136881       if (devinfo->is_haswell) {
   136882          return 0;
   136883       } else {
   136884          return 0;
   136885       }
   136886    case 6: return 0;
   136887    case 5: return 0;
   136888    case 4:
   136889       if (devinfo->is_g4x) {
   136890          return 0;
   136891       } else {
   136892          return 0;
   136893       }
   136894    default:
   136895       unreachable("Invalid hardware generation");
   136896    }
   136897 }
   136898 
   136899 
   136900 
   136901 /* L3CNTLREG2 */
   136902 
   136903 
   136904 #define GEN75_L3CNTLREG2_length  1
   136905 #define GEN7_L3CNTLREG2_length  1
   136906 
   136907 static inline uint32_t ATTRIBUTE_PURE
   136908 L3CNTLREG2_length(const struct gen_device_info *devinfo)
   136909 {
   136910    switch (devinfo->gen) {
   136911    case 10: return 0;
   136912    case 9: return 0;
   136913    case 8: return 0;
   136914    case 7:
   136915       if (devinfo->is_haswell) {
   136916          return 1;
   136917       } else {
   136918          return 1;
   136919       }
   136920    case 6: return 0;
   136921    case 5: return 0;
   136922    case 4:
   136923       if (devinfo->is_g4x) {
   136924          return 0;
   136925       } else {
   136926          return 0;
   136927       }
   136928    default:
   136929       unreachable("Invalid hardware generation");
   136930    }
   136931 }
   136932 
   136933 
   136934 
   136935 /* L3CNTLREG2::ALL Allocation */
   136936 
   136937 
   136938 #define GEN7_L3CNTLREG2_ALLAllocation_bits  6
   136939 
   136940 static inline uint32_t ATTRIBUTE_PURE
   136941 L3CNTLREG2_ALLAllocation_bits(const struct gen_device_info *devinfo)
   136942 {
   136943    switch (devinfo->gen) {
   136944    case 10: return 0;
   136945    case 9: return 0;
   136946    case 8: return 0;
   136947    case 7:
   136948       if (devinfo->is_haswell) {
   136949          return 0;
   136950       } else {
   136951          return 6;
   136952       }
   136953    case 6: return 0;
   136954    case 5: return 0;
   136955    case 4:
   136956       if (devinfo->is_g4x) {
   136957          return 0;
   136958       } else {
   136959          return 0;
   136960       }
   136961    default:
   136962       unreachable("Invalid hardware generation");
   136963    }
   136964 }
   136965 
   136966 
   136967 
   136968 #define GEN7_L3CNTLREG2_ALLAllocation_start  8
   136969 
   136970 static inline uint32_t ATTRIBUTE_PURE
   136971 L3CNTLREG2_ALLAllocation_start(const struct gen_device_info *devinfo)
   136972 {
   136973    switch (devinfo->gen) {
   136974    case 10: return 0;
   136975    case 9: return 0;
   136976    case 8: return 0;
   136977    case 7:
   136978       if (devinfo->is_haswell) {
   136979          return 0;
   136980       } else {
   136981          return 8;
   136982       }
   136983    case 6: return 0;
   136984    case 5: return 0;
   136985    case 4:
   136986       if (devinfo->is_g4x) {
   136987          return 0;
   136988       } else {
   136989          return 0;
   136990       }
   136991    default:
   136992       unreachable("Invalid hardware generation");
   136993    }
   136994 }
   136995 
   136996 
   136997 
   136998 /* L3CNTLREG2::DC Allocation */
   136999 
   137000 
   137001 #define GEN75_L3CNTLREG2_DCAllocation_bits  6
   137002 #define GEN7_L3CNTLREG2_DCAllocation_bits  6
   137003 
   137004 static inline uint32_t ATTRIBUTE_PURE
   137005 L3CNTLREG2_DCAllocation_bits(const struct gen_device_info *devinfo)
   137006 {
   137007    switch (devinfo->gen) {
   137008    case 10: return 0;
   137009    case 9: return 0;
   137010    case 8: return 0;
   137011    case 7:
   137012       if (devinfo->is_haswell) {
   137013          return 6;
   137014       } else {
   137015          return 6;
   137016       }
   137017    case 6: return 0;
   137018    case 5: return 0;
   137019    case 4:
   137020       if (devinfo->is_g4x) {
   137021          return 0;
   137022       } else {
   137023          return 0;
   137024       }
   137025    default:
   137026       unreachable("Invalid hardware generation");
   137027    }
   137028 }
   137029 
   137030 
   137031 
   137032 #define GEN75_L3CNTLREG2_DCAllocation_start  21
   137033 #define GEN7_L3CNTLREG2_DCAllocation_start  21
   137034 
   137035 static inline uint32_t ATTRIBUTE_PURE
   137036 L3CNTLREG2_DCAllocation_start(const struct gen_device_info *devinfo)
   137037 {
   137038    switch (devinfo->gen) {
   137039    case 10: return 0;
   137040    case 9: return 0;
   137041    case 8: return 0;
   137042    case 7:
   137043       if (devinfo->is_haswell) {
   137044          return 21;
   137045       } else {
   137046          return 21;
   137047       }
   137048    case 6: return 0;
   137049    case 5: return 0;
   137050    case 4:
   137051       if (devinfo->is_g4x) {
   137052          return 0;
   137053       } else {
   137054          return 0;
   137055       }
   137056    default:
   137057       unreachable("Invalid hardware generation");
   137058    }
   137059 }
   137060 
   137061 
   137062 
   137063 /* L3CNTLREG2::DC Low Bandwidth */
   137064 
   137065 
   137066 #define GEN75_L3CNTLREG2_DCLowBandwidth_bits  1
   137067 #define GEN7_L3CNTLREG2_DCLowBandwidth_bits  1
   137068 
   137069 static inline uint32_t ATTRIBUTE_PURE
   137070 L3CNTLREG2_DCLowBandwidth_bits(const struct gen_device_info *devinfo)
   137071 {
   137072    switch (devinfo->gen) {
   137073    case 10: return 0;
   137074    case 9: return 0;
   137075    case 8: return 0;
   137076    case 7:
   137077       if (devinfo->is_haswell) {
   137078          return 1;
   137079       } else {
   137080          return 1;
   137081       }
   137082    case 6: return 0;
   137083    case 5: return 0;
   137084    case 4:
   137085       if (devinfo->is_g4x) {
   137086          return 0;
   137087       } else {
   137088          return 0;
   137089       }
   137090    default:
   137091       unreachable("Invalid hardware generation");
   137092    }
   137093 }
   137094 
   137095 
   137096 
   137097 #define GEN75_L3CNTLREG2_DCLowBandwidth_start  27
   137098 #define GEN7_L3CNTLREG2_DCLowBandwidth_start  27
   137099 
   137100 static inline uint32_t ATTRIBUTE_PURE
   137101 L3CNTLREG2_DCLowBandwidth_start(const struct gen_device_info *devinfo)
   137102 {
   137103    switch (devinfo->gen) {
   137104    case 10: return 0;
   137105    case 9: return 0;
   137106    case 8: return 0;
   137107    case 7:
   137108       if (devinfo->is_haswell) {
   137109          return 27;
   137110       } else {
   137111          return 27;
   137112       }
   137113    case 6: return 0;
   137114    case 5: return 0;
   137115    case 4:
   137116       if (devinfo->is_g4x) {
   137117          return 0;
   137118       } else {
   137119          return 0;
   137120       }
   137121    default:
   137122       unreachable("Invalid hardware generation");
   137123    }
   137124 }
   137125 
   137126 
   137127 
   137128 /* L3CNTLREG2::RO Allocation */
   137129 
   137130 
   137131 #define GEN75_L3CNTLREG2_ROAllocation_bits  6
   137132 #define GEN7_L3CNTLREG2_ROAllocation_bits  6
   137133 
   137134 static inline uint32_t ATTRIBUTE_PURE
   137135 L3CNTLREG2_ROAllocation_bits(const struct gen_device_info *devinfo)
   137136 {
   137137    switch (devinfo->gen) {
   137138    case 10: return 0;
   137139    case 9: return 0;
   137140    case 8: return 0;
   137141    case 7:
   137142       if (devinfo->is_haswell) {
   137143          return 6;
   137144       } else {
   137145          return 6;
   137146       }
   137147    case 6: return 0;
   137148    case 5: return 0;
   137149    case 4:
   137150       if (devinfo->is_g4x) {
   137151          return 0;
   137152       } else {
   137153          return 0;
   137154       }
   137155    default:
   137156       unreachable("Invalid hardware generation");
   137157    }
   137158 }
   137159 
   137160 
   137161 
   137162 #define GEN75_L3CNTLREG2_ROAllocation_start  14
   137163 #define GEN7_L3CNTLREG2_ROAllocation_start  14
   137164 
   137165 static inline uint32_t ATTRIBUTE_PURE
   137166 L3CNTLREG2_ROAllocation_start(const struct gen_device_info *devinfo)
   137167 {
   137168    switch (devinfo->gen) {
   137169    case 10: return 0;
   137170    case 9: return 0;
   137171    case 8: return 0;
   137172    case 7:
   137173       if (devinfo->is_haswell) {
   137174          return 14;
   137175       } else {
   137176          return 14;
   137177       }
   137178    case 6: return 0;
   137179    case 5: return 0;
   137180    case 4:
   137181       if (devinfo->is_g4x) {
   137182          return 0;
   137183       } else {
   137184          return 0;
   137185       }
   137186    default:
   137187       unreachable("Invalid hardware generation");
   137188    }
   137189 }
   137190 
   137191 
   137192 
   137193 /* L3CNTLREG2::RO Low Bandwidth */
   137194 
   137195 
   137196 #define GEN75_L3CNTLREG2_ROLowBandwidth_bits  1
   137197 #define GEN7_L3CNTLREG2_ROLowBandwidth_bits  1
   137198 
   137199 static inline uint32_t ATTRIBUTE_PURE
   137200 L3CNTLREG2_ROLowBandwidth_bits(const struct gen_device_info *devinfo)
   137201 {
   137202    switch (devinfo->gen) {
   137203    case 10: return 0;
   137204    case 9: return 0;
   137205    case 8: return 0;
   137206    case 7:
   137207       if (devinfo->is_haswell) {
   137208          return 1;
   137209       } else {
   137210          return 1;
   137211       }
   137212    case 6: return 0;
   137213    case 5: return 0;
   137214    case 4:
   137215       if (devinfo->is_g4x) {
   137216          return 0;
   137217       } else {
   137218          return 0;
   137219       }
   137220    default:
   137221       unreachable("Invalid hardware generation");
   137222    }
   137223 }
   137224 
   137225 
   137226 
   137227 #define GEN75_L3CNTLREG2_ROLowBandwidth_start  20
   137228 #define GEN7_L3CNTLREG2_ROLowBandwidth_start  20
   137229 
   137230 static inline uint32_t ATTRIBUTE_PURE
   137231 L3CNTLREG2_ROLowBandwidth_start(const struct gen_device_info *devinfo)
   137232 {
   137233    switch (devinfo->gen) {
   137234    case 10: return 0;
   137235    case 9: return 0;
   137236    case 8: return 0;
   137237    case 7:
   137238       if (devinfo->is_haswell) {
   137239          return 20;
   137240       } else {
   137241          return 20;
   137242       }
   137243    case 6: return 0;
   137244    case 5: return 0;
   137245    case 4:
   137246       if (devinfo->is_g4x) {
   137247          return 0;
   137248       } else {
   137249          return 0;
   137250       }
   137251    default:
   137252       unreachable("Invalid hardware generation");
   137253    }
   137254 }
   137255 
   137256 
   137257 
   137258 /* L3CNTLREG2::SLM Enable */
   137259 
   137260 
   137261 #define GEN75_L3CNTLREG2_SLMEnable_bits  1
   137262 #define GEN7_L3CNTLREG2_SLMEnable_bits  1
   137263 
   137264 static inline uint32_t ATTRIBUTE_PURE
   137265 L3CNTLREG2_SLMEnable_bits(const struct gen_device_info *devinfo)
   137266 {
   137267    switch (devinfo->gen) {
   137268    case 10: return 0;
   137269    case 9: return 0;
   137270    case 8: return 0;
   137271    case 7:
   137272       if (devinfo->is_haswell) {
   137273          return 1;
   137274       } else {
   137275          return 1;
   137276       }
   137277    case 6: return 0;
   137278    case 5: return 0;
   137279    case 4:
   137280       if (devinfo->is_g4x) {
   137281          return 0;
   137282       } else {
   137283          return 0;
   137284       }
   137285    default:
   137286       unreachable("Invalid hardware generation");
   137287    }
   137288 }
   137289 
   137290 
   137291 
   137292 #define GEN75_L3CNTLREG2_SLMEnable_start  0
   137293 #define GEN7_L3CNTLREG2_SLMEnable_start  0
   137294 
   137295 static inline uint32_t ATTRIBUTE_PURE
   137296 L3CNTLREG2_SLMEnable_start(const struct gen_device_info *devinfo)
   137297 {
   137298    switch (devinfo->gen) {
   137299    case 10: return 0;
   137300    case 9: return 0;
   137301    case 8: return 0;
   137302    case 7:
   137303       if (devinfo->is_haswell) {
   137304          return 0;
   137305       } else {
   137306          return 0;
   137307       }
   137308    case 6: return 0;
   137309    case 5: return 0;
   137310    case 4:
   137311       if (devinfo->is_g4x) {
   137312          return 0;
   137313       } else {
   137314          return 0;
   137315       }
   137316    default:
   137317       unreachable("Invalid hardware generation");
   137318    }
   137319 }
   137320 
   137321 
   137322 
   137323 /* L3CNTLREG2::URB Allocation */
   137324 
   137325 
   137326 #define GEN75_L3CNTLREG2_URBAllocation_bits  6
   137327 #define GEN7_L3CNTLREG2_URBAllocation_bits  6
   137328 
   137329 static inline uint32_t ATTRIBUTE_PURE
   137330 L3CNTLREG2_URBAllocation_bits(const struct gen_device_info *devinfo)
   137331 {
   137332    switch (devinfo->gen) {
   137333    case 10: return 0;
   137334    case 9: return 0;
   137335    case 8: return 0;
   137336    case 7:
   137337       if (devinfo->is_haswell) {
   137338          return 6;
   137339       } else {
   137340          return 6;
   137341       }
   137342    case 6: return 0;
   137343    case 5: return 0;
   137344    case 4:
   137345       if (devinfo->is_g4x) {
   137346          return 0;
   137347       } else {
   137348          return 0;
   137349       }
   137350    default:
   137351       unreachable("Invalid hardware generation");
   137352    }
   137353 }
   137354 
   137355 
   137356 
   137357 #define GEN75_L3CNTLREG2_URBAllocation_start  1
   137358 #define GEN7_L3CNTLREG2_URBAllocation_start  1
   137359 
   137360 static inline uint32_t ATTRIBUTE_PURE
   137361 L3CNTLREG2_URBAllocation_start(const struct gen_device_info *devinfo)
   137362 {
   137363    switch (devinfo->gen) {
   137364    case 10: return 0;
   137365    case 9: return 0;
   137366    case 8: return 0;
   137367    case 7:
   137368       if (devinfo->is_haswell) {
   137369          return 1;
   137370       } else {
   137371          return 1;
   137372       }
   137373    case 6: return 0;
   137374    case 5: return 0;
   137375    case 4:
   137376       if (devinfo->is_g4x) {
   137377          return 0;
   137378       } else {
   137379          return 0;
   137380       }
   137381    default:
   137382       unreachable("Invalid hardware generation");
   137383    }
   137384 }
   137385 
   137386 
   137387 
   137388 /* L3CNTLREG2::URB Low Bandwidth */
   137389 
   137390 
   137391 #define GEN75_L3CNTLREG2_URBLowBandwidth_bits  1
   137392 #define GEN7_L3CNTLREG2_URBLowBandwidth_bits  1
   137393 
   137394 static inline uint32_t ATTRIBUTE_PURE
   137395 L3CNTLREG2_URBLowBandwidth_bits(const struct gen_device_info *devinfo)
   137396 {
   137397    switch (devinfo->gen) {
   137398    case 10: return 0;
   137399    case 9: return 0;
   137400    case 8: return 0;
   137401    case 7:
   137402       if (devinfo->is_haswell) {
   137403          return 1;
   137404       } else {
   137405          return 1;
   137406       }
   137407    case 6: return 0;
   137408    case 5: return 0;
   137409    case 4:
   137410       if (devinfo->is_g4x) {
   137411          return 0;
   137412       } else {
   137413          return 0;
   137414       }
   137415    default:
   137416       unreachable("Invalid hardware generation");
   137417    }
   137418 }
   137419 
   137420 
   137421 
   137422 #define GEN75_L3CNTLREG2_URBLowBandwidth_start  7
   137423 #define GEN7_L3CNTLREG2_URBLowBandwidth_start  7
   137424 
   137425 static inline uint32_t ATTRIBUTE_PURE
   137426 L3CNTLREG2_URBLowBandwidth_start(const struct gen_device_info *devinfo)
   137427 {
   137428    switch (devinfo->gen) {
   137429    case 10: return 0;
   137430    case 9: return 0;
   137431    case 8: return 0;
   137432    case 7:
   137433       if (devinfo->is_haswell) {
   137434          return 7;
   137435       } else {
   137436          return 7;
   137437       }
   137438    case 6: return 0;
   137439    case 5: return 0;
   137440    case 4:
   137441       if (devinfo->is_g4x) {
   137442          return 0;
   137443       } else {
   137444          return 0;
   137445       }
   137446    default:
   137447       unreachable("Invalid hardware generation");
   137448    }
   137449 }
   137450 
   137451 
   137452 
   137453 /* L3CNTLREG3 */
   137454 
   137455 
   137456 #define GEN75_L3CNTLREG3_length  1
   137457 #define GEN7_L3CNTLREG3_length  1
   137458 
   137459 static inline uint32_t ATTRIBUTE_PURE
   137460 L3CNTLREG3_length(const struct gen_device_info *devinfo)
   137461 {
   137462    switch (devinfo->gen) {
   137463    case 10: return 0;
   137464    case 9: return 0;
   137465    case 8: return 0;
   137466    case 7:
   137467       if (devinfo->is_haswell) {
   137468          return 1;
   137469       } else {
   137470          return 1;
   137471       }
   137472    case 6: return 0;
   137473    case 5: return 0;
   137474    case 4:
   137475       if (devinfo->is_g4x) {
   137476          return 0;
   137477       } else {
   137478          return 0;
   137479       }
   137480    default:
   137481       unreachable("Invalid hardware generation");
   137482    }
   137483 }
   137484 
   137485 
   137486 
   137487 /* L3CNTLREG3::C Allocation */
   137488 
   137489 
   137490 #define GEN75_L3CNTLREG3_CAllocation_bits  6
   137491 #define GEN7_L3CNTLREG3_CAllocation_bits  6
   137492 
   137493 static inline uint32_t ATTRIBUTE_PURE
   137494 L3CNTLREG3_CAllocation_bits(const struct gen_device_info *devinfo)
   137495 {
   137496    switch (devinfo->gen) {
   137497    case 10: return 0;
   137498    case 9: return 0;
   137499    case 8: return 0;
   137500    case 7:
   137501       if (devinfo->is_haswell) {
   137502          return 6;
   137503       } else {
   137504          return 6;
   137505       }
   137506    case 6: return 0;
   137507    case 5: return 0;
   137508    case 4:
   137509       if (devinfo->is_g4x) {
   137510          return 0;
   137511       } else {
   137512          return 0;
   137513       }
   137514    default:
   137515       unreachable("Invalid hardware generation");
   137516    }
   137517 }
   137518 
   137519 
   137520 
   137521 #define GEN75_L3CNTLREG3_CAllocation_start  8
   137522 #define GEN7_L3CNTLREG3_CAllocation_start  8
   137523 
   137524 static inline uint32_t ATTRIBUTE_PURE
   137525 L3CNTLREG3_CAllocation_start(const struct gen_device_info *devinfo)
   137526 {
   137527    switch (devinfo->gen) {
   137528    case 10: return 0;
   137529    case 9: return 0;
   137530    case 8: return 0;
   137531    case 7:
   137532       if (devinfo->is_haswell) {
   137533          return 8;
   137534       } else {
   137535          return 8;
   137536       }
   137537    case 6: return 0;
   137538    case 5: return 0;
   137539    case 4:
   137540       if (devinfo->is_g4x) {
   137541          return 0;
   137542       } else {
   137543          return 0;
   137544       }
   137545    default:
   137546       unreachable("Invalid hardware generation");
   137547    }
   137548 }
   137549 
   137550 
   137551 
   137552 /* L3CNTLREG3::C Low Bandwidth */
   137553 
   137554 
   137555 #define GEN75_L3CNTLREG3_CLowBandwidth_bits  1
   137556 #define GEN7_L3CNTLREG3_CLowBandwidth_bits  1
   137557 
   137558 static inline uint32_t ATTRIBUTE_PURE
   137559 L3CNTLREG3_CLowBandwidth_bits(const struct gen_device_info *devinfo)
   137560 {
   137561    switch (devinfo->gen) {
   137562    case 10: return 0;
   137563    case 9: return 0;
   137564    case 8: return 0;
   137565    case 7:
   137566       if (devinfo->is_haswell) {
   137567          return 1;
   137568       } else {
   137569          return 1;
   137570       }
   137571    case 6: return 0;
   137572    case 5: return 0;
   137573    case 4:
   137574       if (devinfo->is_g4x) {
   137575          return 0;
   137576       } else {
   137577          return 0;
   137578       }
   137579    default:
   137580       unreachable("Invalid hardware generation");
   137581    }
   137582 }
   137583 
   137584 
   137585 
   137586 #define GEN75_L3CNTLREG3_CLowBandwidth_start  14
   137587 #define GEN7_L3CNTLREG3_CLowBandwidth_start  14
   137588 
   137589 static inline uint32_t ATTRIBUTE_PURE
   137590 L3CNTLREG3_CLowBandwidth_start(const struct gen_device_info *devinfo)
   137591 {
   137592    switch (devinfo->gen) {
   137593    case 10: return 0;
   137594    case 9: return 0;
   137595    case 8: return 0;
   137596    case 7:
   137597       if (devinfo->is_haswell) {
   137598          return 14;
   137599       } else {
   137600          return 14;
   137601       }
   137602    case 6: return 0;
   137603    case 5: return 0;
   137604    case 4:
   137605       if (devinfo->is_g4x) {
   137606          return 0;
   137607       } else {
   137608          return 0;
   137609       }
   137610    default:
   137611       unreachable("Invalid hardware generation");
   137612    }
   137613 }
   137614 
   137615 
   137616 
   137617 /* L3CNTLREG3::IS Allocation */
   137618 
   137619 
   137620 #define GEN75_L3CNTLREG3_ISAllocation_bits  6
   137621 #define GEN7_L3CNTLREG3_ISAllocation_bits  6
   137622 
   137623 static inline uint32_t ATTRIBUTE_PURE
   137624 L3CNTLREG3_ISAllocation_bits(const struct gen_device_info *devinfo)
   137625 {
   137626    switch (devinfo->gen) {
   137627    case 10: return 0;
   137628    case 9: return 0;
   137629    case 8: return 0;
   137630    case 7:
   137631       if (devinfo->is_haswell) {
   137632          return 6;
   137633       } else {
   137634          return 6;
   137635       }
   137636    case 6: return 0;
   137637    case 5: return 0;
   137638    case 4:
   137639       if (devinfo->is_g4x) {
   137640          return 0;
   137641       } else {
   137642          return 0;
   137643       }
   137644    default:
   137645       unreachable("Invalid hardware generation");
   137646    }
   137647 }
   137648 
   137649 
   137650 
   137651 #define GEN75_L3CNTLREG3_ISAllocation_start  1
   137652 #define GEN7_L3CNTLREG3_ISAllocation_start  1
   137653 
   137654 static inline uint32_t ATTRIBUTE_PURE
   137655 L3CNTLREG3_ISAllocation_start(const struct gen_device_info *devinfo)
   137656 {
   137657    switch (devinfo->gen) {
   137658    case 10: return 0;
   137659    case 9: return 0;
   137660    case 8: return 0;
   137661    case 7:
   137662       if (devinfo->is_haswell) {
   137663          return 1;
   137664       } else {
   137665          return 1;
   137666       }
   137667    case 6: return 0;
   137668    case 5: return 0;
   137669    case 4:
   137670       if (devinfo->is_g4x) {
   137671          return 0;
   137672       } else {
   137673          return 0;
   137674       }
   137675    default:
   137676       unreachable("Invalid hardware generation");
   137677    }
   137678 }
   137679 
   137680 
   137681 
   137682 /* L3CNTLREG3::IS Low Bandwidth */
   137683 
   137684 
   137685 #define GEN75_L3CNTLREG3_ISLowBandwidth_bits  1
   137686 #define GEN7_L3CNTLREG3_ISLowBandwidth_bits  1
   137687 
   137688 static inline uint32_t ATTRIBUTE_PURE
   137689 L3CNTLREG3_ISLowBandwidth_bits(const struct gen_device_info *devinfo)
   137690 {
   137691    switch (devinfo->gen) {
   137692    case 10: return 0;
   137693    case 9: return 0;
   137694    case 8: return 0;
   137695    case 7:
   137696       if (devinfo->is_haswell) {
   137697          return 1;
   137698       } else {
   137699          return 1;
   137700       }
   137701    case 6: return 0;
   137702    case 5: return 0;
   137703    case 4:
   137704       if (devinfo->is_g4x) {
   137705          return 0;
   137706       } else {
   137707          return 0;
   137708       }
   137709    default:
   137710       unreachable("Invalid hardware generation");
   137711    }
   137712 }
   137713 
   137714 
   137715 
   137716 #define GEN75_L3CNTLREG3_ISLowBandwidth_start  7
   137717 #define GEN7_L3CNTLREG3_ISLowBandwidth_start  7
   137718 
   137719 static inline uint32_t ATTRIBUTE_PURE
   137720 L3CNTLREG3_ISLowBandwidth_start(const struct gen_device_info *devinfo)
   137721 {
   137722    switch (devinfo->gen) {
   137723    case 10: return 0;
   137724    case 9: return 0;
   137725    case 8: return 0;
   137726    case 7:
   137727       if (devinfo->is_haswell) {
   137728          return 7;
   137729       } else {
   137730          return 7;
   137731       }
   137732    case 6: return 0;
   137733    case 5: return 0;
   137734    case 4:
   137735       if (devinfo->is_g4x) {
   137736          return 0;
   137737       } else {
   137738          return 0;
   137739       }
   137740    default:
   137741       unreachable("Invalid hardware generation");
   137742    }
   137743 }
   137744 
   137745 
   137746 
   137747 /* L3CNTLREG3::T Allocation */
   137748 
   137749 
   137750 #define GEN75_L3CNTLREG3_TAllocation_bits  6
   137751 #define GEN7_L3CNTLREG3_TAllocation_bits  6
   137752 
   137753 static inline uint32_t ATTRIBUTE_PURE
   137754 L3CNTLREG3_TAllocation_bits(const struct gen_device_info *devinfo)
   137755 {
   137756    switch (devinfo->gen) {
   137757    case 10: return 0;
   137758    case 9: return 0;
   137759    case 8: return 0;
   137760    case 7:
   137761       if (devinfo->is_haswell) {
   137762          return 6;
   137763       } else {
   137764          return 6;
   137765       }
   137766    case 6: return 0;
   137767    case 5: return 0;
   137768    case 4:
   137769       if (devinfo->is_g4x) {
   137770          return 0;
   137771       } else {
   137772          return 0;
   137773       }
   137774    default:
   137775       unreachable("Invalid hardware generation");
   137776    }
   137777 }
   137778 
   137779 
   137780 
   137781 #define GEN75_L3CNTLREG3_TAllocation_start  15
   137782 #define GEN7_L3CNTLREG3_TAllocation_start  15
   137783 
   137784 static inline uint32_t ATTRIBUTE_PURE
   137785 L3CNTLREG3_TAllocation_start(const struct gen_device_info *devinfo)
   137786 {
   137787    switch (devinfo->gen) {
   137788    case 10: return 0;
   137789    case 9: return 0;
   137790    case 8: return 0;
   137791    case 7:
   137792       if (devinfo->is_haswell) {
   137793          return 15;
   137794       } else {
   137795          return 15;
   137796       }
   137797    case 6: return 0;
   137798    case 5: return 0;
   137799    case 4:
   137800       if (devinfo->is_g4x) {
   137801          return 0;
   137802       } else {
   137803          return 0;
   137804       }
   137805    default:
   137806       unreachable("Invalid hardware generation");
   137807    }
   137808 }
   137809 
   137810 
   137811 
   137812 /* L3CNTLREG3::T Low Bandwidth */
   137813 
   137814 
   137815 #define GEN75_L3CNTLREG3_TLowBandwidth_bits  1
   137816 #define GEN7_L3CNTLREG3_TLowBandwidth_bits  1
   137817 
   137818 static inline uint32_t ATTRIBUTE_PURE
   137819 L3CNTLREG3_TLowBandwidth_bits(const struct gen_device_info *devinfo)
   137820 {
   137821    switch (devinfo->gen) {
   137822    case 10: return 0;
   137823    case 9: return 0;
   137824    case 8: return 0;
   137825    case 7:
   137826       if (devinfo->is_haswell) {
   137827          return 1;
   137828       } else {
   137829          return 1;
   137830       }
   137831    case 6: return 0;
   137832    case 5: return 0;
   137833    case 4:
   137834       if (devinfo->is_g4x) {
   137835          return 0;
   137836       } else {
   137837          return 0;
   137838       }
   137839    default:
   137840       unreachable("Invalid hardware generation");
   137841    }
   137842 }
   137843 
   137844 
   137845 
   137846 #define GEN75_L3CNTLREG3_TLowBandwidth_start  21
   137847 #define GEN7_L3CNTLREG3_TLowBandwidth_start  21
   137848 
   137849 static inline uint32_t ATTRIBUTE_PURE
   137850 L3CNTLREG3_TLowBandwidth_start(const struct gen_device_info *devinfo)
   137851 {
   137852    switch (devinfo->gen) {
   137853    case 10: return 0;
   137854    case 9: return 0;
   137855    case 8: return 0;
   137856    case 7:
   137857       if (devinfo->is_haswell) {
   137858          return 21;
   137859       } else {
   137860          return 21;
   137861       }
   137862    case 6: return 0;
   137863    case 5: return 0;
   137864    case 4:
   137865       if (devinfo->is_g4x) {
   137866          return 0;
   137867       } else {
   137868          return 0;
   137869       }
   137870    default:
   137871       unreachable("Invalid hardware generation");
   137872    }
   137873 }
   137874 
   137875 
   137876 
   137877 /* L3SQCREG1 */
   137878 
   137879 
   137880 #define GEN75_L3SQCREG1_length  1
   137881 #define GEN7_L3SQCREG1_length  1
   137882 
   137883 static inline uint32_t ATTRIBUTE_PURE
   137884 L3SQCREG1_length(const struct gen_device_info *devinfo)
   137885 {
   137886    switch (devinfo->gen) {
   137887    case 10: return 0;
   137888    case 9: return 0;
   137889    case 8: return 0;
   137890    case 7:
   137891       if (devinfo->is_haswell) {
   137892          return 1;
   137893       } else {
   137894          return 1;
   137895       }
   137896    case 6: return 0;
   137897    case 5: return 0;
   137898    case 4:
   137899       if (devinfo->is_g4x) {
   137900          return 0;
   137901       } else {
   137902          return 0;
   137903       }
   137904    default:
   137905       unreachable("Invalid hardware generation");
   137906    }
   137907 }
   137908 
   137909 
   137910 
   137911 /* L3SQCREG1::Convert C_UC */
   137912 
   137913 
   137914 #define GEN75_L3SQCREG1_ConvertC_UC_bits  1
   137915 #define GEN7_L3SQCREG1_ConvertC_UC_bits  1
   137916 
   137917 static inline uint32_t ATTRIBUTE_PURE
   137918 L3SQCREG1_ConvertC_UC_bits(const struct gen_device_info *devinfo)
   137919 {
   137920    switch (devinfo->gen) {
   137921    case 10: return 0;
   137922    case 9: return 0;
   137923    case 8: return 0;
   137924    case 7:
   137925       if (devinfo->is_haswell) {
   137926          return 1;
   137927       } else {
   137928          return 1;
   137929       }
   137930    case 6: return 0;
   137931    case 5: return 0;
   137932    case 4:
   137933       if (devinfo->is_g4x) {
   137934          return 0;
   137935       } else {
   137936          return 0;
   137937       }
   137938    default:
   137939       unreachable("Invalid hardware generation");
   137940    }
   137941 }
   137942 
   137943 
   137944 
   137945 #define GEN75_L3SQCREG1_ConvertC_UC_start  26
   137946 #define GEN7_L3SQCREG1_ConvertC_UC_start  26
   137947 
   137948 static inline uint32_t ATTRIBUTE_PURE
   137949 L3SQCREG1_ConvertC_UC_start(const struct gen_device_info *devinfo)
   137950 {
   137951    switch (devinfo->gen) {
   137952    case 10: return 0;
   137953    case 9: return 0;
   137954    case 8: return 0;
   137955    case 7:
   137956       if (devinfo->is_haswell) {
   137957          return 26;
   137958       } else {
   137959          return 26;
   137960       }
   137961    case 6: return 0;
   137962    case 5: return 0;
   137963    case 4:
   137964       if (devinfo->is_g4x) {
   137965          return 0;
   137966       } else {
   137967          return 0;
   137968       }
   137969    default:
   137970       unreachable("Invalid hardware generation");
   137971    }
   137972 }
   137973 
   137974 
   137975 
   137976 /* L3SQCREG1::Convert DC_UC */
   137977 
   137978 
   137979 #define GEN75_L3SQCREG1_ConvertDC_UC_bits  1
   137980 #define GEN7_L3SQCREG1_ConvertDC_UC_bits  1
   137981 
   137982 static inline uint32_t ATTRIBUTE_PURE
   137983 L3SQCREG1_ConvertDC_UC_bits(const struct gen_device_info *devinfo)
   137984 {
   137985    switch (devinfo->gen) {
   137986    case 10: return 0;
   137987    case 9: return 0;
   137988    case 8: return 0;
   137989    case 7:
   137990       if (devinfo->is_haswell) {
   137991          return 1;
   137992       } else {
   137993          return 1;
   137994       }
   137995    case 6: return 0;
   137996    case 5: return 0;
   137997    case 4:
   137998       if (devinfo->is_g4x) {
   137999          return 0;
   138000       } else {
   138001          return 0;
   138002       }
   138003    default:
   138004       unreachable("Invalid hardware generation");
   138005    }
   138006 }
   138007 
   138008 
   138009 
   138010 #define GEN75_L3SQCREG1_ConvertDC_UC_start  24
   138011 #define GEN7_L3SQCREG1_ConvertDC_UC_start  24
   138012 
   138013 static inline uint32_t ATTRIBUTE_PURE
   138014 L3SQCREG1_ConvertDC_UC_start(const struct gen_device_info *devinfo)
   138015 {
   138016    switch (devinfo->gen) {
   138017    case 10: return 0;
   138018    case 9: return 0;
   138019    case 8: return 0;
   138020    case 7:
   138021       if (devinfo->is_haswell) {
   138022          return 24;
   138023       } else {
   138024          return 24;
   138025       }
   138026    case 6: return 0;
   138027    case 5: return 0;
   138028    case 4:
   138029       if (devinfo->is_g4x) {
   138030          return 0;
   138031       } else {
   138032          return 0;
   138033       }
   138034    default:
   138035       unreachable("Invalid hardware generation");
   138036    }
   138037 }
   138038 
   138039 
   138040 
   138041 /* L3SQCREG1::Convert IS_UC */
   138042 
   138043 
   138044 #define GEN75_L3SQCREG1_ConvertIS_UC_bits  1
   138045 #define GEN7_L3SQCREG1_ConvertIS_UC_bits  1
   138046 
   138047 static inline uint32_t ATTRIBUTE_PURE
   138048 L3SQCREG1_ConvertIS_UC_bits(const struct gen_device_info *devinfo)
   138049 {
   138050    switch (devinfo->gen) {
   138051    case 10: return 0;
   138052    case 9: return 0;
   138053    case 8: return 0;
   138054    case 7:
   138055       if (devinfo->is_haswell) {
   138056          return 1;
   138057       } else {
   138058          return 1;
   138059       }
   138060    case 6: return 0;
   138061    case 5: return 0;
   138062    case 4:
   138063       if (devinfo->is_g4x) {
   138064          return 0;
   138065       } else {
   138066          return 0;
   138067       }
   138068    default:
   138069       unreachable("Invalid hardware generation");
   138070    }
   138071 }
   138072 
   138073 
   138074 
   138075 #define GEN75_L3SQCREG1_ConvertIS_UC_start  25
   138076 #define GEN7_L3SQCREG1_ConvertIS_UC_start  25
   138077 
   138078 static inline uint32_t ATTRIBUTE_PURE
   138079 L3SQCREG1_ConvertIS_UC_start(const struct gen_device_info *devinfo)
   138080 {
   138081    switch (devinfo->gen) {
   138082    case 10: return 0;
   138083    case 9: return 0;
   138084    case 8: return 0;
   138085    case 7:
   138086       if (devinfo->is_haswell) {
   138087          return 25;
   138088       } else {
   138089          return 25;
   138090       }
   138091    case 6: return 0;
   138092    case 5: return 0;
   138093    case 4:
   138094       if (devinfo->is_g4x) {
   138095          return 0;
   138096       } else {
   138097          return 0;
   138098       }
   138099    default:
   138100       unreachable("Invalid hardware generation");
   138101    }
   138102 }
   138103 
   138104 
   138105 
   138106 /* L3SQCREG1::Convert T_UC */
   138107 
   138108 
   138109 #define GEN75_L3SQCREG1_ConvertT_UC_bits  1
   138110 #define GEN7_L3SQCREG1_ConvertT_UC_bits  1
   138111 
   138112 static inline uint32_t ATTRIBUTE_PURE
   138113 L3SQCREG1_ConvertT_UC_bits(const struct gen_device_info *devinfo)
   138114 {
   138115    switch (devinfo->gen) {
   138116    case 10: return 0;
   138117    case 9: return 0;
   138118    case 8: return 0;
   138119    case 7:
   138120       if (devinfo->is_haswell) {
   138121          return 1;
   138122       } else {
   138123          return 1;
   138124       }
   138125    case 6: return 0;
   138126    case 5: return 0;
   138127    case 4:
   138128       if (devinfo->is_g4x) {
   138129          return 0;
   138130       } else {
   138131          return 0;
   138132       }
   138133    default:
   138134       unreachable("Invalid hardware generation");
   138135    }
   138136 }
   138137 
   138138 
   138139 
   138140 #define GEN75_L3SQCREG1_ConvertT_UC_start  27
   138141 #define GEN7_L3SQCREG1_ConvertT_UC_start  27
   138142 
   138143 static inline uint32_t ATTRIBUTE_PURE
   138144 L3SQCREG1_ConvertT_UC_start(const struct gen_device_info *devinfo)
   138145 {
   138146    switch (devinfo->gen) {
   138147    case 10: return 0;
   138148    case 9: return 0;
   138149    case 8: return 0;
   138150    case 7:
   138151       if (devinfo->is_haswell) {
   138152          return 27;
   138153       } else {
   138154          return 27;
   138155       }
   138156    case 6: return 0;
   138157    case 5: return 0;
   138158    case 4:
   138159       if (devinfo->is_g4x) {
   138160          return 0;
   138161       } else {
   138162          return 0;
   138163       }
   138164    default:
   138165       unreachable("Invalid hardware generation");
   138166    }
   138167 }
   138168 
   138169 
   138170 
   138171 /* MEDIA_CURBE_LOAD */
   138172 
   138173 
   138174 #define GEN10_MEDIA_CURBE_LOAD_length  4
   138175 #define GEN9_MEDIA_CURBE_LOAD_length  4
   138176 #define GEN8_MEDIA_CURBE_LOAD_length  4
   138177 #define GEN75_MEDIA_CURBE_LOAD_length  4
   138178 #define GEN7_MEDIA_CURBE_LOAD_length  4
   138179 #define GEN6_MEDIA_CURBE_LOAD_length  4
   138180 
   138181 static inline uint32_t ATTRIBUTE_PURE
   138182 MEDIA_CURBE_LOAD_length(const struct gen_device_info *devinfo)
   138183 {
   138184    switch (devinfo->gen) {
   138185    case 10: return 4;
   138186    case 9: return 4;
   138187    case 8: return 4;
   138188    case 7:
   138189       if (devinfo->is_haswell) {
   138190          return 4;
   138191       } else {
   138192          return 4;
   138193       }
   138194    case 6: return 4;
   138195    case 5: return 0;
   138196    case 4:
   138197       if (devinfo->is_g4x) {
   138198          return 0;
   138199       } else {
   138200          return 0;
   138201       }
   138202    default:
   138203       unreachable("Invalid hardware generation");
   138204    }
   138205 }
   138206 
   138207 
   138208 
   138209 /* MEDIA_CURBE_LOAD::CURBE Data Start Address */
   138210 
   138211 
   138212 #define GEN10_MEDIA_CURBE_LOAD_CURBEDataStartAddress_bits  32
   138213 #define GEN9_MEDIA_CURBE_LOAD_CURBEDataStartAddress_bits  32
   138214 #define GEN8_MEDIA_CURBE_LOAD_CURBEDataStartAddress_bits  32
   138215 #define GEN75_MEDIA_CURBE_LOAD_CURBEDataStartAddress_bits  32
   138216 #define GEN7_MEDIA_CURBE_LOAD_CURBEDataStartAddress_bits  32
   138217 #define GEN6_MEDIA_CURBE_LOAD_CURBEDataStartAddress_bits  32
   138218 
   138219 static inline uint32_t ATTRIBUTE_PURE
   138220 MEDIA_CURBE_LOAD_CURBEDataStartAddress_bits(const struct gen_device_info *devinfo)
   138221 {
   138222    switch (devinfo->gen) {
   138223    case 10: return 32;
   138224    case 9: return 32;
   138225    case 8: return 32;
   138226    case 7:
   138227       if (devinfo->is_haswell) {
   138228          return 32;
   138229       } else {
   138230          return 32;
   138231       }
   138232    case 6: return 32;
   138233    case 5: return 0;
   138234    case 4:
   138235       if (devinfo->is_g4x) {
   138236          return 0;
   138237       } else {
   138238          return 0;
   138239       }
   138240    default:
   138241       unreachable("Invalid hardware generation");
   138242    }
   138243 }
   138244 
   138245 
   138246 
   138247 #define GEN10_MEDIA_CURBE_LOAD_CURBEDataStartAddress_start  96
   138248 #define GEN9_MEDIA_CURBE_LOAD_CURBEDataStartAddress_start  96
   138249 #define GEN8_MEDIA_CURBE_LOAD_CURBEDataStartAddress_start  96
   138250 #define GEN75_MEDIA_CURBE_LOAD_CURBEDataStartAddress_start  96
   138251 #define GEN7_MEDIA_CURBE_LOAD_CURBEDataStartAddress_start  96
   138252 #define GEN6_MEDIA_CURBE_LOAD_CURBEDataStartAddress_start  96
   138253 
   138254 static inline uint32_t ATTRIBUTE_PURE
   138255 MEDIA_CURBE_LOAD_CURBEDataStartAddress_start(const struct gen_device_info *devinfo)
   138256 {
   138257    switch (devinfo->gen) {
   138258    case 10: return 96;
   138259    case 9: return 96;
   138260    case 8: return 96;
   138261    case 7:
   138262       if (devinfo->is_haswell) {
   138263          return 96;
   138264       } else {
   138265          return 96;
   138266       }
   138267    case 6: return 96;
   138268    case 5: return 0;
   138269    case 4:
   138270       if (devinfo->is_g4x) {
   138271          return 0;
   138272       } else {
   138273          return 0;
   138274       }
   138275    default:
   138276       unreachable("Invalid hardware generation");
   138277    }
   138278 }
   138279 
   138280 
   138281 
   138282 /* MEDIA_CURBE_LOAD::CURBE Total Data Length */
   138283 
   138284 
   138285 #define GEN10_MEDIA_CURBE_LOAD_CURBETotalDataLength_bits  17
   138286 #define GEN9_MEDIA_CURBE_LOAD_CURBETotalDataLength_bits  17
   138287 #define GEN8_MEDIA_CURBE_LOAD_CURBETotalDataLength_bits  17
   138288 #define GEN75_MEDIA_CURBE_LOAD_CURBETotalDataLength_bits  17
   138289 #define GEN7_MEDIA_CURBE_LOAD_CURBETotalDataLength_bits  17
   138290 #define GEN6_MEDIA_CURBE_LOAD_CURBETotalDataLength_bits  17
   138291 
   138292 static inline uint32_t ATTRIBUTE_PURE
   138293 MEDIA_CURBE_LOAD_CURBETotalDataLength_bits(const struct gen_device_info *devinfo)
   138294 {
   138295    switch (devinfo->gen) {
   138296    case 10: return 17;
   138297    case 9: return 17;
   138298    case 8: return 17;
   138299    case 7:
   138300       if (devinfo->is_haswell) {
   138301          return 17;
   138302       } else {
   138303          return 17;
   138304       }
   138305    case 6: return 17;
   138306    case 5: return 0;
   138307    case 4:
   138308       if (devinfo->is_g4x) {
   138309          return 0;
   138310       } else {
   138311          return 0;
   138312       }
   138313    default:
   138314       unreachable("Invalid hardware generation");
   138315    }
   138316 }
   138317 
   138318 
   138319 
   138320 #define GEN10_MEDIA_CURBE_LOAD_CURBETotalDataLength_start  64
   138321 #define GEN9_MEDIA_CURBE_LOAD_CURBETotalDataLength_start  64
   138322 #define GEN8_MEDIA_CURBE_LOAD_CURBETotalDataLength_start  64
   138323 #define GEN75_MEDIA_CURBE_LOAD_CURBETotalDataLength_start  64
   138324 #define GEN7_MEDIA_CURBE_LOAD_CURBETotalDataLength_start  64
   138325 #define GEN6_MEDIA_CURBE_LOAD_CURBETotalDataLength_start  64
   138326 
   138327 static inline uint32_t ATTRIBUTE_PURE
   138328 MEDIA_CURBE_LOAD_CURBETotalDataLength_start(const struct gen_device_info *devinfo)
   138329 {
   138330    switch (devinfo->gen) {
   138331    case 10: return 64;
   138332    case 9: return 64;
   138333    case 8: return 64;
   138334    case 7:
   138335       if (devinfo->is_haswell) {
   138336          return 64;
   138337       } else {
   138338          return 64;
   138339       }
   138340    case 6: return 64;
   138341    case 5: return 0;
   138342    case 4:
   138343       if (devinfo->is_g4x) {
   138344          return 0;
   138345       } else {
   138346          return 0;
   138347       }
   138348    default:
   138349       unreachable("Invalid hardware generation");
   138350    }
   138351 }
   138352 
   138353 
   138354 
   138355 /* MEDIA_CURBE_LOAD::Command Type */
   138356 
   138357 
   138358 #define GEN10_MEDIA_CURBE_LOAD_CommandType_bits  3
   138359 #define GEN9_MEDIA_CURBE_LOAD_CommandType_bits  3
   138360 #define GEN8_MEDIA_CURBE_LOAD_CommandType_bits  3
   138361 #define GEN75_MEDIA_CURBE_LOAD_CommandType_bits  3
   138362 #define GEN7_MEDIA_CURBE_LOAD_CommandType_bits  3
   138363 #define GEN6_MEDIA_CURBE_LOAD_CommandType_bits  3
   138364 
   138365 static inline uint32_t ATTRIBUTE_PURE
   138366 MEDIA_CURBE_LOAD_CommandType_bits(const struct gen_device_info *devinfo)
   138367 {
   138368    switch (devinfo->gen) {
   138369    case 10: return 3;
   138370    case 9: return 3;
   138371    case 8: return 3;
   138372    case 7:
   138373       if (devinfo->is_haswell) {
   138374          return 3;
   138375       } else {
   138376          return 3;
   138377       }
   138378    case 6: return 3;
   138379    case 5: return 0;
   138380    case 4:
   138381       if (devinfo->is_g4x) {
   138382          return 0;
   138383       } else {
   138384          return 0;
   138385       }
   138386    default:
   138387       unreachable("Invalid hardware generation");
   138388    }
   138389 }
   138390 
   138391 
   138392 
   138393 #define GEN10_MEDIA_CURBE_LOAD_CommandType_start  29
   138394 #define GEN9_MEDIA_CURBE_LOAD_CommandType_start  29
   138395 #define GEN8_MEDIA_CURBE_LOAD_CommandType_start  29
   138396 #define GEN75_MEDIA_CURBE_LOAD_CommandType_start  29
   138397 #define GEN7_MEDIA_CURBE_LOAD_CommandType_start  29
   138398 #define GEN6_MEDIA_CURBE_LOAD_CommandType_start  29
   138399 
   138400 static inline uint32_t ATTRIBUTE_PURE
   138401 MEDIA_CURBE_LOAD_CommandType_start(const struct gen_device_info *devinfo)
   138402 {
   138403    switch (devinfo->gen) {
   138404    case 10: return 29;
   138405    case 9: return 29;
   138406    case 8: return 29;
   138407    case 7:
   138408       if (devinfo->is_haswell) {
   138409          return 29;
   138410       } else {
   138411          return 29;
   138412       }
   138413    case 6: return 29;
   138414    case 5: return 0;
   138415    case 4:
   138416       if (devinfo->is_g4x) {
   138417          return 0;
   138418       } else {
   138419          return 0;
   138420       }
   138421    default:
   138422       unreachable("Invalid hardware generation");
   138423    }
   138424 }
   138425 
   138426 
   138427 
   138428 /* MEDIA_CURBE_LOAD::DWord Length */
   138429 
   138430 
   138431 #define GEN10_MEDIA_CURBE_LOAD_DWordLength_bits  16
   138432 #define GEN9_MEDIA_CURBE_LOAD_DWordLength_bits  16
   138433 #define GEN8_MEDIA_CURBE_LOAD_DWordLength_bits  16
   138434 #define GEN75_MEDIA_CURBE_LOAD_DWordLength_bits  16
   138435 #define GEN7_MEDIA_CURBE_LOAD_DWordLength_bits  16
   138436 #define GEN6_MEDIA_CURBE_LOAD_DWordLength_bits  16
   138437 
   138438 static inline uint32_t ATTRIBUTE_PURE
   138439 MEDIA_CURBE_LOAD_DWordLength_bits(const struct gen_device_info *devinfo)
   138440 {
   138441    switch (devinfo->gen) {
   138442    case 10: return 16;
   138443    case 9: return 16;
   138444    case 8: return 16;
   138445    case 7:
   138446       if (devinfo->is_haswell) {
   138447          return 16;
   138448       } else {
   138449          return 16;
   138450       }
   138451    case 6: return 16;
   138452    case 5: return 0;
   138453    case 4:
   138454       if (devinfo->is_g4x) {
   138455          return 0;
   138456       } else {
   138457          return 0;
   138458       }
   138459    default:
   138460       unreachable("Invalid hardware generation");
   138461    }
   138462 }
   138463 
   138464 
   138465 
   138466 #define GEN10_MEDIA_CURBE_LOAD_DWordLength_start  0
   138467 #define GEN9_MEDIA_CURBE_LOAD_DWordLength_start  0
   138468 #define GEN8_MEDIA_CURBE_LOAD_DWordLength_start  0
   138469 #define GEN75_MEDIA_CURBE_LOAD_DWordLength_start  0
   138470 #define GEN7_MEDIA_CURBE_LOAD_DWordLength_start  0
   138471 #define GEN6_MEDIA_CURBE_LOAD_DWordLength_start  0
   138472 
   138473 static inline uint32_t ATTRIBUTE_PURE
   138474 MEDIA_CURBE_LOAD_DWordLength_start(const struct gen_device_info *devinfo)
   138475 {
   138476    switch (devinfo->gen) {
   138477    case 10: return 0;
   138478    case 9: return 0;
   138479    case 8: return 0;
   138480    case 7:
   138481       if (devinfo->is_haswell) {
   138482          return 0;
   138483       } else {
   138484          return 0;
   138485       }
   138486    case 6: return 0;
   138487    case 5: return 0;
   138488    case 4:
   138489       if (devinfo->is_g4x) {
   138490          return 0;
   138491       } else {
   138492          return 0;
   138493       }
   138494    default:
   138495       unreachable("Invalid hardware generation");
   138496    }
   138497 }
   138498 
   138499 
   138500 
   138501 /* MEDIA_CURBE_LOAD::Media Command Opcode */
   138502 
   138503 
   138504 #define GEN10_MEDIA_CURBE_LOAD_MediaCommandOpcode_bits  3
   138505 #define GEN9_MEDIA_CURBE_LOAD_MediaCommandOpcode_bits  3
   138506 #define GEN8_MEDIA_CURBE_LOAD_MediaCommandOpcode_bits  3
   138507 #define GEN75_MEDIA_CURBE_LOAD_MediaCommandOpcode_bits  3
   138508 #define GEN7_MEDIA_CURBE_LOAD_MediaCommandOpcode_bits  3
   138509 #define GEN6_MEDIA_CURBE_LOAD_MediaCommandOpcode_bits  3
   138510 
   138511 static inline uint32_t ATTRIBUTE_PURE
   138512 MEDIA_CURBE_LOAD_MediaCommandOpcode_bits(const struct gen_device_info *devinfo)
   138513 {
   138514    switch (devinfo->gen) {
   138515    case 10: return 3;
   138516    case 9: return 3;
   138517    case 8: return 3;
   138518    case 7:
   138519       if (devinfo->is_haswell) {
   138520          return 3;
   138521       } else {
   138522          return 3;
   138523       }
   138524    case 6: return 3;
   138525    case 5: return 0;
   138526    case 4:
   138527       if (devinfo->is_g4x) {
   138528          return 0;
   138529       } else {
   138530          return 0;
   138531       }
   138532    default:
   138533       unreachable("Invalid hardware generation");
   138534    }
   138535 }
   138536 
   138537 
   138538 
   138539 #define GEN10_MEDIA_CURBE_LOAD_MediaCommandOpcode_start  24
   138540 #define GEN9_MEDIA_CURBE_LOAD_MediaCommandOpcode_start  24
   138541 #define GEN8_MEDIA_CURBE_LOAD_MediaCommandOpcode_start  24
   138542 #define GEN75_MEDIA_CURBE_LOAD_MediaCommandOpcode_start  24
   138543 #define GEN7_MEDIA_CURBE_LOAD_MediaCommandOpcode_start  24
   138544 #define GEN6_MEDIA_CURBE_LOAD_MediaCommandOpcode_start  24
   138545 
   138546 static inline uint32_t ATTRIBUTE_PURE
   138547 MEDIA_CURBE_LOAD_MediaCommandOpcode_start(const struct gen_device_info *devinfo)
   138548 {
   138549    switch (devinfo->gen) {
   138550    case 10: return 24;
   138551    case 9: return 24;
   138552    case 8: return 24;
   138553    case 7:
   138554       if (devinfo->is_haswell) {
   138555          return 24;
   138556       } else {
   138557          return 24;
   138558       }
   138559    case 6: return 24;
   138560    case 5: return 0;
   138561    case 4:
   138562       if (devinfo->is_g4x) {
   138563          return 0;
   138564       } else {
   138565          return 0;
   138566       }
   138567    default:
   138568       unreachable("Invalid hardware generation");
   138569    }
   138570 }
   138571 
   138572 
   138573 
   138574 /* MEDIA_CURBE_LOAD::Pipeline */
   138575 
   138576 
   138577 #define GEN10_MEDIA_CURBE_LOAD_Pipeline_bits  2
   138578 #define GEN9_MEDIA_CURBE_LOAD_Pipeline_bits  2
   138579 #define GEN8_MEDIA_CURBE_LOAD_Pipeline_bits  2
   138580 #define GEN75_MEDIA_CURBE_LOAD_Pipeline_bits  2
   138581 #define GEN7_MEDIA_CURBE_LOAD_Pipeline_bits  2
   138582 #define GEN6_MEDIA_CURBE_LOAD_Pipeline_bits  2
   138583 
   138584 static inline uint32_t ATTRIBUTE_PURE
   138585 MEDIA_CURBE_LOAD_Pipeline_bits(const struct gen_device_info *devinfo)
   138586 {
   138587    switch (devinfo->gen) {
   138588    case 10: return 2;
   138589    case 9: return 2;
   138590    case 8: return 2;
   138591    case 7:
   138592       if (devinfo->is_haswell) {
   138593          return 2;
   138594       } else {
   138595          return 2;
   138596       }
   138597    case 6: return 2;
   138598    case 5: return 0;
   138599    case 4:
   138600       if (devinfo->is_g4x) {
   138601          return 0;
   138602       } else {
   138603          return 0;
   138604       }
   138605    default:
   138606       unreachable("Invalid hardware generation");
   138607    }
   138608 }
   138609 
   138610 
   138611 
   138612 #define GEN10_MEDIA_CURBE_LOAD_Pipeline_start  27
   138613 #define GEN9_MEDIA_CURBE_LOAD_Pipeline_start  27
   138614 #define GEN8_MEDIA_CURBE_LOAD_Pipeline_start  27
   138615 #define GEN75_MEDIA_CURBE_LOAD_Pipeline_start  27
   138616 #define GEN7_MEDIA_CURBE_LOAD_Pipeline_start  27
   138617 #define GEN6_MEDIA_CURBE_LOAD_Pipeline_start  27
   138618 
   138619 static inline uint32_t ATTRIBUTE_PURE
   138620 MEDIA_CURBE_LOAD_Pipeline_start(const struct gen_device_info *devinfo)
   138621 {
   138622    switch (devinfo->gen) {
   138623    case 10: return 27;
   138624    case 9: return 27;
   138625    case 8: return 27;
   138626    case 7:
   138627       if (devinfo->is_haswell) {
   138628          return 27;
   138629       } else {
   138630          return 27;
   138631       }
   138632    case 6: return 27;
   138633    case 5: return 0;
   138634    case 4:
   138635       if (devinfo->is_g4x) {
   138636          return 0;
   138637       } else {
   138638          return 0;
   138639       }
   138640    default:
   138641       unreachable("Invalid hardware generation");
   138642    }
   138643 }
   138644 
   138645 
   138646 
   138647 /* MEDIA_CURBE_LOAD::SubOpcode */
   138648 
   138649 
   138650 #define GEN10_MEDIA_CURBE_LOAD_SubOpcode_bits  8
   138651 #define GEN9_MEDIA_CURBE_LOAD_SubOpcode_bits  8
   138652 #define GEN8_MEDIA_CURBE_LOAD_SubOpcode_bits  8
   138653 #define GEN75_MEDIA_CURBE_LOAD_SubOpcode_bits  8
   138654 #define GEN7_MEDIA_CURBE_LOAD_SubOpcode_bits  8
   138655 #define GEN6_MEDIA_CURBE_LOAD_SubOpcode_bits  8
   138656 
   138657 static inline uint32_t ATTRIBUTE_PURE
   138658 MEDIA_CURBE_LOAD_SubOpcode_bits(const struct gen_device_info *devinfo)
   138659 {
   138660    switch (devinfo->gen) {
   138661    case 10: return 8;
   138662    case 9: return 8;
   138663    case 8: return 8;
   138664    case 7:
   138665       if (devinfo->is_haswell) {
   138666          return 8;
   138667       } else {
   138668          return 8;
   138669       }
   138670    case 6: return 8;
   138671    case 5: return 0;
   138672    case 4:
   138673       if (devinfo->is_g4x) {
   138674          return 0;
   138675       } else {
   138676          return 0;
   138677       }
   138678    default:
   138679       unreachable("Invalid hardware generation");
   138680    }
   138681 }
   138682 
   138683 
   138684 
   138685 #define GEN10_MEDIA_CURBE_LOAD_SubOpcode_start  16
   138686 #define GEN9_MEDIA_CURBE_LOAD_SubOpcode_start  16
   138687 #define GEN8_MEDIA_CURBE_LOAD_SubOpcode_start  16
   138688 #define GEN75_MEDIA_CURBE_LOAD_SubOpcode_start  16
   138689 #define GEN7_MEDIA_CURBE_LOAD_SubOpcode_start  16
   138690 #define GEN6_MEDIA_CURBE_LOAD_SubOpcode_start  16
   138691 
   138692 static inline uint32_t ATTRIBUTE_PURE
   138693 MEDIA_CURBE_LOAD_SubOpcode_start(const struct gen_device_info *devinfo)
   138694 {
   138695    switch (devinfo->gen) {
   138696    case 10: return 16;
   138697    case 9: return 16;
   138698    case 8: return 16;
   138699    case 7:
   138700       if (devinfo->is_haswell) {
   138701          return 16;
   138702       } else {
   138703          return 16;
   138704       }
   138705    case 6: return 16;
   138706    case 5: return 0;
   138707    case 4:
   138708       if (devinfo->is_g4x) {
   138709          return 0;
   138710       } else {
   138711          return 0;
   138712       }
   138713    default:
   138714       unreachable("Invalid hardware generation");
   138715    }
   138716 }
   138717 
   138718 
   138719 
   138720 /* MEDIA_GATEWAY_STATE */
   138721 
   138722 
   138723 #define GEN6_MEDIA_GATEWAY_STATE_length  2
   138724 
   138725 static inline uint32_t ATTRIBUTE_PURE
   138726 MEDIA_GATEWAY_STATE_length(const struct gen_device_info *devinfo)
   138727 {
   138728    switch (devinfo->gen) {
   138729    case 10: return 0;
   138730    case 9: return 0;
   138731    case 8: return 0;
   138732    case 7:
   138733       if (devinfo->is_haswell) {
   138734          return 0;
   138735       } else {
   138736          return 0;
   138737       }
   138738    case 6: return 2;
   138739    case 5: return 0;
   138740    case 4:
   138741       if (devinfo->is_g4x) {
   138742          return 0;
   138743       } else {
   138744          return 0;
   138745       }
   138746    default:
   138747       unreachable("Invalid hardware generation");
   138748    }
   138749 }
   138750 
   138751 
   138752 
   138753 /* MEDIA_GATEWAY_STATE::Barrier.Byte */
   138754 
   138755 
   138756 #define GEN6_MEDIA_GATEWAY_STATE_BarrierByte_bits  8
   138757 
   138758 static inline uint32_t ATTRIBUTE_PURE
   138759 MEDIA_GATEWAY_STATE_BarrierByte_bits(const struct gen_device_info *devinfo)
   138760 {
   138761    switch (devinfo->gen) {
   138762    case 10: return 0;
   138763    case 9: return 0;
   138764    case 8: return 0;
   138765    case 7:
   138766       if (devinfo->is_haswell) {
   138767          return 0;
   138768       } else {
   138769          return 0;
   138770       }
   138771    case 6: return 8;
   138772    case 5: return 0;
   138773    case 4:
   138774       if (devinfo->is_g4x) {
   138775          return 0;
   138776       } else {
   138777          return 0;
   138778       }
   138779    default:
   138780       unreachable("Invalid hardware generation");
   138781    }
   138782 }
   138783 
   138784 
   138785 
   138786 #define GEN6_MEDIA_GATEWAY_STATE_BarrierByte_start  40
   138787 
   138788 static inline uint32_t ATTRIBUTE_PURE
   138789 MEDIA_GATEWAY_STATE_BarrierByte_start(const struct gen_device_info *devinfo)
   138790 {
   138791    switch (devinfo->gen) {
   138792    case 10: return 0;
   138793    case 9: return 0;
   138794    case 8: return 0;
   138795    case 7:
   138796       if (devinfo->is_haswell) {
   138797          return 0;
   138798       } else {
   138799          return 0;
   138800       }
   138801    case 6: return 40;
   138802    case 5: return 0;
   138803    case 4:
   138804       if (devinfo->is_g4x) {
   138805          return 0;
   138806       } else {
   138807          return 0;
   138808       }
   138809    default:
   138810       unreachable("Invalid hardware generation");
   138811    }
   138812 }
   138813 
   138814 
   138815 
   138816 /* MEDIA_GATEWAY_STATE::Barrier.ThreadCount */
   138817 
   138818 
   138819 #define GEN6_MEDIA_GATEWAY_STATE_BarrierThreadCount_bits  8
   138820 
   138821 static inline uint32_t ATTRIBUTE_PURE
   138822 MEDIA_GATEWAY_STATE_BarrierThreadCount_bits(const struct gen_device_info *devinfo)
   138823 {
   138824    switch (devinfo->gen) {
   138825    case 10: return 0;
   138826    case 9: return 0;
   138827    case 8: return 0;
   138828    case 7:
   138829       if (devinfo->is_haswell) {
   138830          return 0;
   138831       } else {
   138832          return 0;
   138833       }
   138834    case 6: return 8;
   138835    case 5: return 0;
   138836    case 4:
   138837       if (devinfo->is_g4x) {
   138838          return 0;
   138839       } else {
   138840          return 0;
   138841       }
   138842    default:
   138843       unreachable("Invalid hardware generation");
   138844    }
   138845 }
   138846 
   138847 
   138848 
   138849 #define GEN6_MEDIA_GATEWAY_STATE_BarrierThreadCount_start  32
   138850 
   138851 static inline uint32_t ATTRIBUTE_PURE
   138852 MEDIA_GATEWAY_STATE_BarrierThreadCount_start(const struct gen_device_info *devinfo)
   138853 {
   138854    switch (devinfo->gen) {
   138855    case 10: return 0;
   138856    case 9: return 0;
   138857    case 8: return 0;
   138858    case 7:
   138859       if (devinfo->is_haswell) {
   138860          return 0;
   138861       } else {
   138862          return 0;
   138863       }
   138864    case 6: return 32;
   138865    case 5: return 0;
   138866    case 4:
   138867       if (devinfo->is_g4x) {
   138868          return 0;
   138869       } else {
   138870          return 0;
   138871       }
   138872    default:
   138873       unreachable("Invalid hardware generation");
   138874    }
   138875 }
   138876 
   138877 
   138878 
   138879 /* MEDIA_GATEWAY_STATE::BarrierID */
   138880 
   138881 
   138882 #define GEN6_MEDIA_GATEWAY_STATE_BarrierID_bits  8
   138883 
   138884 static inline uint32_t ATTRIBUTE_PURE
   138885 MEDIA_GATEWAY_STATE_BarrierID_bits(const struct gen_device_info *devinfo)
   138886 {
   138887    switch (devinfo->gen) {
   138888    case 10: return 0;
   138889    case 9: return 0;
   138890    case 8: return 0;
   138891    case 7:
   138892       if (devinfo->is_haswell) {
   138893          return 0;
   138894       } else {
   138895          return 0;
   138896       }
   138897    case 6: return 8;
   138898    case 5: return 0;
   138899    case 4:
   138900       if (devinfo->is_g4x) {
   138901          return 0;
   138902       } else {
   138903          return 0;
   138904       }
   138905    default:
   138906       unreachable("Invalid hardware generation");
   138907    }
   138908 }
   138909 
   138910 
   138911 
   138912 #define GEN6_MEDIA_GATEWAY_STATE_BarrierID_start  48
   138913 
   138914 static inline uint32_t ATTRIBUTE_PURE
   138915 MEDIA_GATEWAY_STATE_BarrierID_start(const struct gen_device_info *devinfo)
   138916 {
   138917    switch (devinfo->gen) {
   138918    case 10: return 0;
   138919    case 9: return 0;
   138920    case 8: return 0;
   138921    case 7:
   138922       if (devinfo->is_haswell) {
   138923          return 0;
   138924       } else {
   138925          return 0;
   138926       }
   138927    case 6: return 48;
   138928    case 5: return 0;
   138929    case 4:
   138930       if (devinfo->is_g4x) {
   138931          return 0;
   138932       } else {
   138933          return 0;
   138934       }
   138935    default:
   138936       unreachable("Invalid hardware generation");
   138937    }
   138938 }
   138939 
   138940 
   138941 
   138942 /* MEDIA_GATEWAY_STATE::Command Type */
   138943 
   138944 
   138945 #define GEN6_MEDIA_GATEWAY_STATE_CommandType_bits  3
   138946 
   138947 static inline uint32_t ATTRIBUTE_PURE
   138948 MEDIA_GATEWAY_STATE_CommandType_bits(const struct gen_device_info *devinfo)
   138949 {
   138950    switch (devinfo->gen) {
   138951    case 10: return 0;
   138952    case 9: return 0;
   138953    case 8: return 0;
   138954    case 7:
   138955       if (devinfo->is_haswell) {
   138956          return 0;
   138957       } else {
   138958          return 0;
   138959       }
   138960    case 6: return 3;
   138961    case 5: return 0;
   138962    case 4:
   138963       if (devinfo->is_g4x) {
   138964          return 0;
   138965       } else {
   138966          return 0;
   138967       }
   138968    default:
   138969       unreachable("Invalid hardware generation");
   138970    }
   138971 }
   138972 
   138973 
   138974 
   138975 #define GEN6_MEDIA_GATEWAY_STATE_CommandType_start  29
   138976 
   138977 static inline uint32_t ATTRIBUTE_PURE
   138978 MEDIA_GATEWAY_STATE_CommandType_start(const struct gen_device_info *devinfo)
   138979 {
   138980    switch (devinfo->gen) {
   138981    case 10: return 0;
   138982    case 9: return 0;
   138983    case 8: return 0;
   138984    case 7:
   138985       if (devinfo->is_haswell) {
   138986          return 0;
   138987       } else {
   138988          return 0;
   138989       }
   138990    case 6: return 29;
   138991    case 5: return 0;
   138992    case 4:
   138993       if (devinfo->is_g4x) {
   138994          return 0;
   138995       } else {
   138996          return 0;
   138997       }
   138998    default:
   138999       unreachable("Invalid hardware generation");
   139000    }
   139001 }
   139002 
   139003 
   139004 
   139005 /* MEDIA_GATEWAY_STATE::DWord Length */
   139006 
   139007 
   139008 #define GEN6_MEDIA_GATEWAY_STATE_DWordLength_bits  16
   139009 
   139010 static inline uint32_t ATTRIBUTE_PURE
   139011 MEDIA_GATEWAY_STATE_DWordLength_bits(const struct gen_device_info *devinfo)
   139012 {
   139013    switch (devinfo->gen) {
   139014    case 10: return 0;
   139015    case 9: return 0;
   139016    case 8: return 0;
   139017    case 7:
   139018       if (devinfo->is_haswell) {
   139019          return 0;
   139020       } else {
   139021          return 0;
   139022       }
   139023    case 6: return 16;
   139024    case 5: return 0;
   139025    case 4:
   139026       if (devinfo->is_g4x) {
   139027          return 0;
   139028       } else {
   139029          return 0;
   139030       }
   139031    default:
   139032       unreachable("Invalid hardware generation");
   139033    }
   139034 }
   139035 
   139036 
   139037 
   139038 #define GEN6_MEDIA_GATEWAY_STATE_DWordLength_start  0
   139039 
   139040 static inline uint32_t ATTRIBUTE_PURE
   139041 MEDIA_GATEWAY_STATE_DWordLength_start(const struct gen_device_info *devinfo)
   139042 {
   139043    switch (devinfo->gen) {
   139044    case 10: return 0;
   139045    case 9: return 0;
   139046    case 8: return 0;
   139047    case 7:
   139048       if (devinfo->is_haswell) {
   139049          return 0;
   139050       } else {
   139051          return 0;
   139052       }
   139053    case 6: return 0;
   139054    case 5: return 0;
   139055    case 4:
   139056       if (devinfo->is_g4x) {
   139057          return 0;
   139058       } else {
   139059          return 0;
   139060       }
   139061    default:
   139062       unreachable("Invalid hardware generation");
   139063    }
   139064 }
   139065 
   139066 
   139067 
   139068 /* MEDIA_GATEWAY_STATE::Media Command Opcode */
   139069 
   139070 
   139071 #define GEN6_MEDIA_GATEWAY_STATE_MediaCommandOpcode_bits  3
   139072 
   139073 static inline uint32_t ATTRIBUTE_PURE
   139074 MEDIA_GATEWAY_STATE_MediaCommandOpcode_bits(const struct gen_device_info *devinfo)
   139075 {
   139076    switch (devinfo->gen) {
   139077    case 10: return 0;
   139078    case 9: return 0;
   139079    case 8: return 0;
   139080    case 7:
   139081       if (devinfo->is_haswell) {
   139082          return 0;
   139083       } else {
   139084          return 0;
   139085       }
   139086    case 6: return 3;
   139087    case 5: return 0;
   139088    case 4:
   139089       if (devinfo->is_g4x) {
   139090          return 0;
   139091       } else {
   139092          return 0;
   139093       }
   139094    default:
   139095       unreachable("Invalid hardware generation");
   139096    }
   139097 }
   139098 
   139099 
   139100 
   139101 #define GEN6_MEDIA_GATEWAY_STATE_MediaCommandOpcode_start  24
   139102 
   139103 static inline uint32_t ATTRIBUTE_PURE
   139104 MEDIA_GATEWAY_STATE_MediaCommandOpcode_start(const struct gen_device_info *devinfo)
   139105 {
   139106    switch (devinfo->gen) {
   139107    case 10: return 0;
   139108    case 9: return 0;
   139109    case 8: return 0;
   139110    case 7:
   139111       if (devinfo->is_haswell) {
   139112          return 0;
   139113       } else {
   139114          return 0;
   139115       }
   139116    case 6: return 24;
   139117    case 5: return 0;
   139118    case 4:
   139119       if (devinfo->is_g4x) {
   139120          return 0;
   139121       } else {
   139122          return 0;
   139123       }
   139124    default:
   139125       unreachable("Invalid hardware generation");
   139126    }
   139127 }
   139128 
   139129 
   139130 
   139131 /* MEDIA_GATEWAY_STATE::Pipeline */
   139132 
   139133 
   139134 #define GEN6_MEDIA_GATEWAY_STATE_Pipeline_bits  2
   139135 
   139136 static inline uint32_t ATTRIBUTE_PURE
   139137 MEDIA_GATEWAY_STATE_Pipeline_bits(const struct gen_device_info *devinfo)
   139138 {
   139139    switch (devinfo->gen) {
   139140    case 10: return 0;
   139141    case 9: return 0;
   139142    case 8: return 0;
   139143    case 7:
   139144       if (devinfo->is_haswell) {
   139145          return 0;
   139146       } else {
   139147          return 0;
   139148       }
   139149    case 6: return 2;
   139150    case 5: return 0;
   139151    case 4:
   139152       if (devinfo->is_g4x) {
   139153          return 0;
   139154       } else {
   139155          return 0;
   139156       }
   139157    default:
   139158       unreachable("Invalid hardware generation");
   139159    }
   139160 }
   139161 
   139162 
   139163 
   139164 #define GEN6_MEDIA_GATEWAY_STATE_Pipeline_start  27
   139165 
   139166 static inline uint32_t ATTRIBUTE_PURE
   139167 MEDIA_GATEWAY_STATE_Pipeline_start(const struct gen_device_info *devinfo)
   139168 {
   139169    switch (devinfo->gen) {
   139170    case 10: return 0;
   139171    case 9: return 0;
   139172    case 8: return 0;
   139173    case 7:
   139174       if (devinfo->is_haswell) {
   139175          return 0;
   139176       } else {
   139177          return 0;
   139178       }
   139179    case 6: return 27;
   139180    case 5: return 0;
   139181    case 4:
   139182       if (devinfo->is_g4x) {
   139183          return 0;
   139184       } else {
   139185          return 0;
   139186       }
   139187    default:
   139188       unreachable("Invalid hardware generation");
   139189    }
   139190 }
   139191 
   139192 
   139193 
   139194 /* MEDIA_GATEWAY_STATE::SubOpcode */
   139195 
   139196 
   139197 #define GEN6_MEDIA_GATEWAY_STATE_SubOpcode_bits  8
   139198 
   139199 static inline uint32_t ATTRIBUTE_PURE
   139200 MEDIA_GATEWAY_STATE_SubOpcode_bits(const struct gen_device_info *devinfo)
   139201 {
   139202    switch (devinfo->gen) {
   139203    case 10: return 0;
   139204    case 9: return 0;
   139205    case 8: return 0;
   139206    case 7:
   139207       if (devinfo->is_haswell) {
   139208          return 0;
   139209       } else {
   139210          return 0;
   139211       }
   139212    case 6: return 8;
   139213    case 5: return 0;
   139214    case 4:
   139215       if (devinfo->is_g4x) {
   139216          return 0;
   139217       } else {
   139218          return 0;
   139219       }
   139220    default:
   139221       unreachable("Invalid hardware generation");
   139222    }
   139223 }
   139224 
   139225 
   139226 
   139227 #define GEN6_MEDIA_GATEWAY_STATE_SubOpcode_start  16
   139228 
   139229 static inline uint32_t ATTRIBUTE_PURE
   139230 MEDIA_GATEWAY_STATE_SubOpcode_start(const struct gen_device_info *devinfo)
   139231 {
   139232    switch (devinfo->gen) {
   139233    case 10: return 0;
   139234    case 9: return 0;
   139235    case 8: return 0;
   139236    case 7:
   139237       if (devinfo->is_haswell) {
   139238          return 0;
   139239       } else {
   139240          return 0;
   139241       }
   139242    case 6: return 16;
   139243    case 5: return 0;
   139244    case 4:
   139245       if (devinfo->is_g4x) {
   139246          return 0;
   139247       } else {
   139248          return 0;
   139249       }
   139250    default:
   139251       unreachable("Invalid hardware generation");
   139252    }
   139253 }
   139254 
   139255 
   139256 
   139257 /* MEDIA_INTERFACE_DESCRIPTOR_LOAD */
   139258 
   139259 
   139260 #define GEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD_length  4
   139261 #define GEN9_MEDIA_INTERFACE_DESCRIPTOR_LOAD_length  4
   139262 #define GEN8_MEDIA_INTERFACE_DESCRIPTOR_LOAD_length  4
   139263 #define GEN75_MEDIA_INTERFACE_DESCRIPTOR_LOAD_length  4
   139264 #define GEN7_MEDIA_INTERFACE_DESCRIPTOR_LOAD_length  4
   139265 #define GEN6_MEDIA_INTERFACE_DESCRIPTOR_LOAD_length  4
   139266 
   139267 static inline uint32_t ATTRIBUTE_PURE
   139268 MEDIA_INTERFACE_DESCRIPTOR_LOAD_length(const struct gen_device_info *devinfo)
   139269 {
   139270    switch (devinfo->gen) {
   139271    case 10: return 4;
   139272    case 9: return 4;
   139273    case 8: return 4;
   139274    case 7:
   139275       if (devinfo->is_haswell) {
   139276          return 4;
   139277       } else {
   139278          return 4;
   139279       }
   139280    case 6: return 4;
   139281    case 5: return 0;
   139282    case 4:
   139283       if (devinfo->is_g4x) {
   139284          return 0;
   139285       } else {
   139286          return 0;
   139287       }
   139288    default:
   139289       unreachable("Invalid hardware generation");
   139290    }
   139291 }
   139292 
   139293 
   139294 
   139295 /* MEDIA_INTERFACE_DESCRIPTOR_LOAD::Command Type */
   139296 
   139297 
   139298 #define GEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD_CommandType_bits  3
   139299 #define GEN9_MEDIA_INTERFACE_DESCRIPTOR_LOAD_CommandType_bits  3
   139300 #define GEN8_MEDIA_INTERFACE_DESCRIPTOR_LOAD_CommandType_bits  3
   139301 #define GEN75_MEDIA_INTERFACE_DESCRIPTOR_LOAD_CommandType_bits  3
   139302 #define GEN7_MEDIA_INTERFACE_DESCRIPTOR_LOAD_CommandType_bits  3
   139303 #define GEN6_MEDIA_INTERFACE_DESCRIPTOR_LOAD_CommandType_bits  3
   139304 
   139305 static inline uint32_t ATTRIBUTE_PURE
   139306 MEDIA_INTERFACE_DESCRIPTOR_LOAD_CommandType_bits(const struct gen_device_info *devinfo)
   139307 {
   139308    switch (devinfo->gen) {
   139309    case 10: return 3;
   139310    case 9: return 3;
   139311    case 8: return 3;
   139312    case 7:
   139313       if (devinfo->is_haswell) {
   139314          return 3;
   139315       } else {
   139316          return 3;
   139317       }
   139318    case 6: return 3;
   139319    case 5: return 0;
   139320    case 4:
   139321       if (devinfo->is_g4x) {
   139322          return 0;
   139323       } else {
   139324          return 0;
   139325       }
   139326    default:
   139327       unreachable("Invalid hardware generation");
   139328    }
   139329 }
   139330 
   139331 
   139332 
   139333 #define GEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD_CommandType_start  29
   139334 #define GEN9_MEDIA_INTERFACE_DESCRIPTOR_LOAD_CommandType_start  29
   139335 #define GEN8_MEDIA_INTERFACE_DESCRIPTOR_LOAD_CommandType_start  29
   139336 #define GEN75_MEDIA_INTERFACE_DESCRIPTOR_LOAD_CommandType_start  29
   139337 #define GEN7_MEDIA_INTERFACE_DESCRIPTOR_LOAD_CommandType_start  29
   139338 #define GEN6_MEDIA_INTERFACE_DESCRIPTOR_LOAD_CommandType_start  29
   139339 
   139340 static inline uint32_t ATTRIBUTE_PURE
   139341 MEDIA_INTERFACE_DESCRIPTOR_LOAD_CommandType_start(const struct gen_device_info *devinfo)
   139342 {
   139343    switch (devinfo->gen) {
   139344    case 10: return 29;
   139345    case 9: return 29;
   139346    case 8: return 29;
   139347    case 7:
   139348       if (devinfo->is_haswell) {
   139349          return 29;
   139350       } else {
   139351          return 29;
   139352       }
   139353    case 6: return 29;
   139354    case 5: return 0;
   139355    case 4:
   139356       if (devinfo->is_g4x) {
   139357          return 0;
   139358       } else {
   139359          return 0;
   139360       }
   139361    default:
   139362       unreachable("Invalid hardware generation");
   139363    }
   139364 }
   139365 
   139366 
   139367 
   139368 /* MEDIA_INTERFACE_DESCRIPTOR_LOAD::DWord Length */
   139369 
   139370 
   139371 #define GEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD_DWordLength_bits  16
   139372 #define GEN9_MEDIA_INTERFACE_DESCRIPTOR_LOAD_DWordLength_bits  16
   139373 #define GEN8_MEDIA_INTERFACE_DESCRIPTOR_LOAD_DWordLength_bits  16
   139374 #define GEN75_MEDIA_INTERFACE_DESCRIPTOR_LOAD_DWordLength_bits  16
   139375 #define GEN7_MEDIA_INTERFACE_DESCRIPTOR_LOAD_DWordLength_bits  16
   139376 #define GEN6_MEDIA_INTERFACE_DESCRIPTOR_LOAD_DWordLength_bits  16
   139377 
   139378 static inline uint32_t ATTRIBUTE_PURE
   139379 MEDIA_INTERFACE_DESCRIPTOR_LOAD_DWordLength_bits(const struct gen_device_info *devinfo)
   139380 {
   139381    switch (devinfo->gen) {
   139382    case 10: return 16;
   139383    case 9: return 16;
   139384    case 8: return 16;
   139385    case 7:
   139386       if (devinfo->is_haswell) {
   139387          return 16;
   139388       } else {
   139389          return 16;
   139390       }
   139391    case 6: return 16;
   139392    case 5: return 0;
   139393    case 4:
   139394       if (devinfo->is_g4x) {
   139395          return 0;
   139396       } else {
   139397          return 0;
   139398       }
   139399    default:
   139400       unreachable("Invalid hardware generation");
   139401    }
   139402 }
   139403 
   139404 
   139405 
   139406 #define GEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD_DWordLength_start  0
   139407 #define GEN9_MEDIA_INTERFACE_DESCRIPTOR_LOAD_DWordLength_start  0
   139408 #define GEN8_MEDIA_INTERFACE_DESCRIPTOR_LOAD_DWordLength_start  0
   139409 #define GEN75_MEDIA_INTERFACE_DESCRIPTOR_LOAD_DWordLength_start  0
   139410 #define GEN7_MEDIA_INTERFACE_DESCRIPTOR_LOAD_DWordLength_start  0
   139411 #define GEN6_MEDIA_INTERFACE_DESCRIPTOR_LOAD_DWordLength_start  0
   139412 
   139413 static inline uint32_t ATTRIBUTE_PURE
   139414 MEDIA_INTERFACE_DESCRIPTOR_LOAD_DWordLength_start(const struct gen_device_info *devinfo)
   139415 {
   139416    switch (devinfo->gen) {
   139417    case 10: return 0;
   139418    case 9: return 0;
   139419    case 8: return 0;
   139420    case 7:
   139421       if (devinfo->is_haswell) {
   139422          return 0;
   139423       } else {
   139424          return 0;
   139425       }
   139426    case 6: return 0;
   139427    case 5: return 0;
   139428    case 4:
   139429       if (devinfo->is_g4x) {
   139430          return 0;
   139431       } else {
   139432          return 0;
   139433       }
   139434    default:
   139435       unreachable("Invalid hardware generation");
   139436    }
   139437 }
   139438 
   139439 
   139440 
   139441 /* MEDIA_INTERFACE_DESCRIPTOR_LOAD::Interface Descriptor Data Start Address */
   139442 
   139443 
   139444 #define GEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorDataStartAddress_bits  32
   139445 #define GEN9_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorDataStartAddress_bits  32
   139446 #define GEN8_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorDataStartAddress_bits  32
   139447 #define GEN75_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorDataStartAddress_bits  32
   139448 #define GEN7_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorDataStartAddress_bits  32
   139449 #define GEN6_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorDataStartAddress_bits  32
   139450 
   139451 static inline uint32_t ATTRIBUTE_PURE
   139452 MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorDataStartAddress_bits(const struct gen_device_info *devinfo)
   139453 {
   139454    switch (devinfo->gen) {
   139455    case 10: return 32;
   139456    case 9: return 32;
   139457    case 8: return 32;
   139458    case 7:
   139459       if (devinfo->is_haswell) {
   139460          return 32;
   139461       } else {
   139462          return 32;
   139463       }
   139464    case 6: return 32;
   139465    case 5: return 0;
   139466    case 4:
   139467       if (devinfo->is_g4x) {
   139468          return 0;
   139469       } else {
   139470          return 0;
   139471       }
   139472    default:
   139473       unreachable("Invalid hardware generation");
   139474    }
   139475 }
   139476 
   139477 
   139478 
   139479 #define GEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorDataStartAddress_start  96
   139480 #define GEN9_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorDataStartAddress_start  96
   139481 #define GEN8_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorDataStartAddress_start  96
   139482 #define GEN75_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorDataStartAddress_start  96
   139483 #define GEN7_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorDataStartAddress_start  96
   139484 #define GEN6_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorDataStartAddress_start  96
   139485 
   139486 static inline uint32_t ATTRIBUTE_PURE
   139487 MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorDataStartAddress_start(const struct gen_device_info *devinfo)
   139488 {
   139489    switch (devinfo->gen) {
   139490    case 10: return 96;
   139491    case 9: return 96;
   139492    case 8: return 96;
   139493    case 7:
   139494       if (devinfo->is_haswell) {
   139495          return 96;
   139496       } else {
   139497          return 96;
   139498       }
   139499    case 6: return 96;
   139500    case 5: return 0;
   139501    case 4:
   139502       if (devinfo->is_g4x) {
   139503          return 0;
   139504       } else {
   139505          return 0;
   139506       }
   139507    default:
   139508       unreachable("Invalid hardware generation");
   139509    }
   139510 }
   139511 
   139512 
   139513 
   139514 /* MEDIA_INTERFACE_DESCRIPTOR_LOAD::Interface Descriptor Total Length */
   139515 
   139516 
   139517 #define GEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorTotalLength_bits  17
   139518 #define GEN9_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorTotalLength_bits  17
   139519 #define GEN8_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorTotalLength_bits  17
   139520 #define GEN75_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorTotalLength_bits  17
   139521 #define GEN7_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorTotalLength_bits  17
   139522 #define GEN6_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorTotalLength_bits  17
   139523 
   139524 static inline uint32_t ATTRIBUTE_PURE
   139525 MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorTotalLength_bits(const struct gen_device_info *devinfo)
   139526 {
   139527    switch (devinfo->gen) {
   139528    case 10: return 17;
   139529    case 9: return 17;
   139530    case 8: return 17;
   139531    case 7:
   139532       if (devinfo->is_haswell) {
   139533          return 17;
   139534       } else {
   139535          return 17;
   139536       }
   139537    case 6: return 17;
   139538    case 5: return 0;
   139539    case 4:
   139540       if (devinfo->is_g4x) {
   139541          return 0;
   139542       } else {
   139543          return 0;
   139544       }
   139545    default:
   139546       unreachable("Invalid hardware generation");
   139547    }
   139548 }
   139549 
   139550 
   139551 
   139552 #define GEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorTotalLength_start  64
   139553 #define GEN9_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorTotalLength_start  64
   139554 #define GEN8_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorTotalLength_start  64
   139555 #define GEN75_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorTotalLength_start  64
   139556 #define GEN7_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorTotalLength_start  64
   139557 #define GEN6_MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorTotalLength_start  64
   139558 
   139559 static inline uint32_t ATTRIBUTE_PURE
   139560 MEDIA_INTERFACE_DESCRIPTOR_LOAD_InterfaceDescriptorTotalLength_start(const struct gen_device_info *devinfo)
   139561 {
   139562    switch (devinfo->gen) {
   139563    case 10: return 64;
   139564    case 9: return 64;
   139565    case 8: return 64;
   139566    case 7:
   139567       if (devinfo->is_haswell) {
   139568          return 64;
   139569       } else {
   139570          return 64;
   139571       }
   139572    case 6: return 64;
   139573    case 5: return 0;
   139574    case 4:
   139575       if (devinfo->is_g4x) {
   139576          return 0;
   139577       } else {
   139578          return 0;
   139579       }
   139580    default:
   139581       unreachable("Invalid hardware generation");
   139582    }
   139583 }
   139584 
   139585 
   139586 
   139587 /* MEDIA_INTERFACE_DESCRIPTOR_LOAD::Media Command Opcode */
   139588 
   139589 
   139590 #define GEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD_MediaCommandOpcode_bits  3
   139591 #define GEN9_MEDIA_INTERFACE_DESCRIPTOR_LOAD_MediaCommandOpcode_bits  3
   139592 #define GEN8_MEDIA_INTERFACE_DESCRIPTOR_LOAD_MediaCommandOpcode_bits  3
   139593 #define GEN75_MEDIA_INTERFACE_DESCRIPTOR_LOAD_MediaCommandOpcode_bits  3
   139594 #define GEN7_MEDIA_INTERFACE_DESCRIPTOR_LOAD_MediaCommandOpcode_bits  3
   139595 #define GEN6_MEDIA_INTERFACE_DESCRIPTOR_LOAD_MediaCommandOpcode_bits  3
   139596 
   139597 static inline uint32_t ATTRIBUTE_PURE
   139598 MEDIA_INTERFACE_DESCRIPTOR_LOAD_MediaCommandOpcode_bits(const struct gen_device_info *devinfo)
   139599 {
   139600    switch (devinfo->gen) {
   139601    case 10: return 3;
   139602    case 9: return 3;
   139603    case 8: return 3;
   139604    case 7:
   139605       if (devinfo->is_haswell) {
   139606          return 3;
   139607       } else {
   139608          return 3;
   139609       }
   139610    case 6: return 3;
   139611    case 5: return 0;
   139612    case 4:
   139613       if (devinfo->is_g4x) {
   139614          return 0;
   139615       } else {
   139616          return 0;
   139617       }
   139618    default:
   139619       unreachable("Invalid hardware generation");
   139620    }
   139621 }
   139622 
   139623 
   139624 
   139625 #define GEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD_MediaCommandOpcode_start  24
   139626 #define GEN9_MEDIA_INTERFACE_DESCRIPTOR_LOAD_MediaCommandOpcode_start  24
   139627 #define GEN8_MEDIA_INTERFACE_DESCRIPTOR_LOAD_MediaCommandOpcode_start  24
   139628 #define GEN75_MEDIA_INTERFACE_DESCRIPTOR_LOAD_MediaCommandOpcode_start  24
   139629 #define GEN7_MEDIA_INTERFACE_DESCRIPTOR_LOAD_MediaCommandOpcode_start  24
   139630 #define GEN6_MEDIA_INTERFACE_DESCRIPTOR_LOAD_MediaCommandOpcode_start  24
   139631 
   139632 static inline uint32_t ATTRIBUTE_PURE
   139633 MEDIA_INTERFACE_DESCRIPTOR_LOAD_MediaCommandOpcode_start(const struct gen_device_info *devinfo)
   139634 {
   139635    switch (devinfo->gen) {
   139636    case 10: return 24;
   139637    case 9: return 24;
   139638    case 8: return 24;
   139639    case 7:
   139640       if (devinfo->is_haswell) {
   139641          return 24;
   139642       } else {
   139643          return 24;
   139644       }
   139645    case 6: return 24;
   139646    case 5: return 0;
   139647    case 4:
   139648       if (devinfo->is_g4x) {
   139649          return 0;
   139650       } else {
   139651          return 0;
   139652       }
   139653    default:
   139654       unreachable("Invalid hardware generation");
   139655    }
   139656 }
   139657 
   139658 
   139659 
   139660 /* MEDIA_INTERFACE_DESCRIPTOR_LOAD::Pipeline */
   139661 
   139662 
   139663 #define GEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD_Pipeline_bits  2
   139664 #define GEN9_MEDIA_INTERFACE_DESCRIPTOR_LOAD_Pipeline_bits  2
   139665 #define GEN8_MEDIA_INTERFACE_DESCRIPTOR_LOAD_Pipeline_bits  2
   139666 #define GEN75_MEDIA_INTERFACE_DESCRIPTOR_LOAD_Pipeline_bits  2
   139667 #define GEN7_MEDIA_INTERFACE_DESCRIPTOR_LOAD_Pipeline_bits  2
   139668 #define GEN6_MEDIA_INTERFACE_DESCRIPTOR_LOAD_Pipeline_bits  2
   139669 
   139670 static inline uint32_t ATTRIBUTE_PURE
   139671 MEDIA_INTERFACE_DESCRIPTOR_LOAD_Pipeline_bits(const struct gen_device_info *devinfo)
   139672 {
   139673    switch (devinfo->gen) {
   139674    case 10: return 2;
   139675    case 9: return 2;
   139676    case 8: return 2;
   139677    case 7:
   139678       if (devinfo->is_haswell) {
   139679          return 2;
   139680       } else {
   139681          return 2;
   139682       }
   139683    case 6: return 2;
   139684    case 5: return 0;
   139685    case 4:
   139686       if (devinfo->is_g4x) {
   139687          return 0;
   139688       } else {
   139689          return 0;
   139690       }
   139691    default:
   139692       unreachable("Invalid hardware generation");
   139693    }
   139694 }
   139695 
   139696 
   139697 
   139698 #define GEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD_Pipeline_start  27
   139699 #define GEN9_MEDIA_INTERFACE_DESCRIPTOR_LOAD_Pipeline_start  27
   139700 #define GEN8_MEDIA_INTERFACE_DESCRIPTOR_LOAD_Pipeline_start  27
   139701 #define GEN75_MEDIA_INTERFACE_DESCRIPTOR_LOAD_Pipeline_start  27
   139702 #define GEN7_MEDIA_INTERFACE_DESCRIPTOR_LOAD_Pipeline_start  27
   139703 #define GEN6_MEDIA_INTERFACE_DESCRIPTOR_LOAD_Pipeline_start  27
   139704 
   139705 static inline uint32_t ATTRIBUTE_PURE
   139706 MEDIA_INTERFACE_DESCRIPTOR_LOAD_Pipeline_start(const struct gen_device_info *devinfo)
   139707 {
   139708    switch (devinfo->gen) {
   139709    case 10: return 27;
   139710    case 9: return 27;
   139711    case 8: return 27;
   139712    case 7:
   139713       if (devinfo->is_haswell) {
   139714          return 27;
   139715       } else {
   139716          return 27;
   139717       }
   139718    case 6: return 27;
   139719    case 5: return 0;
   139720    case 4:
   139721       if (devinfo->is_g4x) {
   139722          return 0;
   139723       } else {
   139724          return 0;
   139725       }
   139726    default:
   139727       unreachable("Invalid hardware generation");
   139728    }
   139729 }
   139730 
   139731 
   139732 
   139733 /* MEDIA_INTERFACE_DESCRIPTOR_LOAD::SubOpcode */
   139734 
   139735 
   139736 #define GEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD_SubOpcode_bits  8
   139737 #define GEN9_MEDIA_INTERFACE_DESCRIPTOR_LOAD_SubOpcode_bits  8
   139738 #define GEN8_MEDIA_INTERFACE_DESCRIPTOR_LOAD_SubOpcode_bits  8
   139739 #define GEN75_MEDIA_INTERFACE_DESCRIPTOR_LOAD_SubOpcode_bits  8
   139740 #define GEN7_MEDIA_INTERFACE_DESCRIPTOR_LOAD_SubOpcode_bits  8
   139741 #define GEN6_MEDIA_INTERFACE_DESCRIPTOR_LOAD_SubOpcode_bits  8
   139742 
   139743 static inline uint32_t ATTRIBUTE_PURE
   139744 MEDIA_INTERFACE_DESCRIPTOR_LOAD_SubOpcode_bits(const struct gen_device_info *devinfo)
   139745 {
   139746    switch (devinfo->gen) {
   139747    case 10: return 8;
   139748    case 9: return 8;
   139749    case 8: return 8;
   139750    case 7:
   139751       if (devinfo->is_haswell) {
   139752          return 8;
   139753       } else {
   139754          return 8;
   139755       }
   139756    case 6: return 8;
   139757    case 5: return 0;
   139758    case 4:
   139759       if (devinfo->is_g4x) {
   139760          return 0;
   139761       } else {
   139762          return 0;
   139763       }
   139764    default:
   139765       unreachable("Invalid hardware generation");
   139766    }
   139767 }
   139768 
   139769 
   139770 
   139771 #define GEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD_SubOpcode_start  16
   139772 #define GEN9_MEDIA_INTERFACE_DESCRIPTOR_LOAD_SubOpcode_start  16
   139773 #define GEN8_MEDIA_INTERFACE_DESCRIPTOR_LOAD_SubOpcode_start  16
   139774 #define GEN75_MEDIA_INTERFACE_DESCRIPTOR_LOAD_SubOpcode_start  16
   139775 #define GEN7_MEDIA_INTERFACE_DESCRIPTOR_LOAD_SubOpcode_start  16
   139776 #define GEN6_MEDIA_INTERFACE_DESCRIPTOR_LOAD_SubOpcode_start  16
   139777 
   139778 static inline uint32_t ATTRIBUTE_PURE
   139779 MEDIA_INTERFACE_DESCRIPTOR_LOAD_SubOpcode_start(const struct gen_device_info *devinfo)
   139780 {
   139781    switch (devinfo->gen) {
   139782    case 10: return 16;
   139783    case 9: return 16;
   139784    case 8: return 16;
   139785    case 7:
   139786       if (devinfo->is_haswell) {
   139787          return 16;
   139788       } else {
   139789          return 16;
   139790       }
   139791    case 6: return 16;
   139792    case 5: return 0;
   139793    case 4:
   139794       if (devinfo->is_g4x) {
   139795          return 0;
   139796       } else {
   139797          return 0;
   139798       }
   139799    default:
   139800       unreachable("Invalid hardware generation");
   139801    }
   139802 }
   139803 
   139804 
   139805 
   139806 /* MEDIA_OBJECT */
   139807 
   139808 
   139809 
   139810 
   139811 
   139812 /* MEDIA_OBJECT::Children Present */
   139813 
   139814 
   139815 #define GEN10_MEDIA_OBJECT_ChildrenPresent_bits  1
   139816 #define GEN9_MEDIA_OBJECT_ChildrenPresent_bits  1
   139817 #define GEN8_MEDIA_OBJECT_ChildrenPresent_bits  1
   139818 #define GEN75_MEDIA_OBJECT_ChildrenPresent_bits  1
   139819 #define GEN7_MEDIA_OBJECT_ChildrenPresent_bits  1
   139820 #define GEN6_MEDIA_OBJECT_ChildrenPresent_bits  1
   139821 
   139822 static inline uint32_t ATTRIBUTE_PURE
   139823 MEDIA_OBJECT_ChildrenPresent_bits(const struct gen_device_info *devinfo)
   139824 {
   139825    switch (devinfo->gen) {
   139826    case 10: return 1;
   139827    case 9: return 1;
   139828    case 8: return 1;
   139829    case 7:
   139830       if (devinfo->is_haswell) {
   139831          return 1;
   139832       } else {
   139833          return 1;
   139834       }
   139835    case 6: return 1;
   139836    case 5: return 0;
   139837    case 4:
   139838       if (devinfo->is_g4x) {
   139839          return 0;
   139840       } else {
   139841          return 0;
   139842       }
   139843    default:
   139844       unreachable("Invalid hardware generation");
   139845    }
   139846 }
   139847 
   139848 
   139849 
   139850 #define GEN10_MEDIA_OBJECT_ChildrenPresent_start  95
   139851 #define GEN9_MEDIA_OBJECT_ChildrenPresent_start  95
   139852 #define GEN8_MEDIA_OBJECT_ChildrenPresent_start  95
   139853 #define GEN75_MEDIA_OBJECT_ChildrenPresent_start  95
   139854 #define GEN7_MEDIA_OBJECT_ChildrenPresent_start  95
   139855 #define GEN6_MEDIA_OBJECT_ChildrenPresent_start  95
   139856 
   139857 static inline uint32_t ATTRIBUTE_PURE
   139858 MEDIA_OBJECT_ChildrenPresent_start(const struct gen_device_info *devinfo)
   139859 {
   139860    switch (devinfo->gen) {
   139861    case 10: return 95;
   139862    case 9: return 95;
   139863    case 8: return 95;
   139864    case 7:
   139865       if (devinfo->is_haswell) {
   139866          return 95;
   139867       } else {
   139868          return 95;
   139869       }
   139870    case 6: return 95;
   139871    case 5: return 0;
   139872    case 4:
   139873       if (devinfo->is_g4x) {
   139874          return 0;
   139875       } else {
   139876          return 0;
   139877       }
   139878    default:
   139879       unreachable("Invalid hardware generation");
   139880    }
   139881 }
   139882 
   139883 
   139884 
   139885 /* MEDIA_OBJECT::Command Type */
   139886 
   139887 
   139888 #define GEN10_MEDIA_OBJECT_CommandType_bits  3
   139889 #define GEN9_MEDIA_OBJECT_CommandType_bits  3
   139890 #define GEN8_MEDIA_OBJECT_CommandType_bits  3
   139891 #define GEN75_MEDIA_OBJECT_CommandType_bits  3
   139892 #define GEN7_MEDIA_OBJECT_CommandType_bits  3
   139893 #define GEN6_MEDIA_OBJECT_CommandType_bits  3
   139894 
   139895 static inline uint32_t ATTRIBUTE_PURE
   139896 MEDIA_OBJECT_CommandType_bits(const struct gen_device_info *devinfo)
   139897 {
   139898    switch (devinfo->gen) {
   139899    case 10: return 3;
   139900    case 9: return 3;
   139901    case 8: return 3;
   139902    case 7:
   139903       if (devinfo->is_haswell) {
   139904          return 3;
   139905       } else {
   139906          return 3;
   139907       }
   139908    case 6: return 3;
   139909    case 5: return 0;
   139910    case 4:
   139911       if (devinfo->is_g4x) {
   139912          return 0;
   139913       } else {
   139914          return 0;
   139915       }
   139916    default:
   139917       unreachable("Invalid hardware generation");
   139918    }
   139919 }
   139920 
   139921 
   139922 
   139923 #define GEN10_MEDIA_OBJECT_CommandType_start  29
   139924 #define GEN9_MEDIA_OBJECT_CommandType_start  29
   139925 #define GEN8_MEDIA_OBJECT_CommandType_start  29
   139926 #define GEN75_MEDIA_OBJECT_CommandType_start  29
   139927 #define GEN7_MEDIA_OBJECT_CommandType_start  29
   139928 #define GEN6_MEDIA_OBJECT_CommandType_start  29
   139929 
   139930 static inline uint32_t ATTRIBUTE_PURE
   139931 MEDIA_OBJECT_CommandType_start(const struct gen_device_info *devinfo)
   139932 {
   139933    switch (devinfo->gen) {
   139934    case 10: return 29;
   139935    case 9: return 29;
   139936    case 8: return 29;
   139937    case 7:
   139938       if (devinfo->is_haswell) {
   139939          return 29;
   139940       } else {
   139941          return 29;
   139942       }
   139943    case 6: return 29;
   139944    case 5: return 0;
   139945    case 4:
   139946       if (devinfo->is_g4x) {
   139947          return 0;
   139948       } else {
   139949          return 0;
   139950       }
   139951    default:
   139952       unreachable("Invalid hardware generation");
   139953    }
   139954 }
   139955 
   139956 
   139957 
   139958 /* MEDIA_OBJECT::DWord Length */
   139959 
   139960 
   139961 #define GEN10_MEDIA_OBJECT_DWordLength_bits  15
   139962 #define GEN9_MEDIA_OBJECT_DWordLength_bits  16
   139963 #define GEN8_MEDIA_OBJECT_DWordLength_bits  16
   139964 #define GEN75_MEDIA_OBJECT_DWordLength_bits  16
   139965 #define GEN7_MEDIA_OBJECT_DWordLength_bits  16
   139966 #define GEN6_MEDIA_OBJECT_DWordLength_bits  16
   139967 
   139968 static inline uint32_t ATTRIBUTE_PURE
   139969 MEDIA_OBJECT_DWordLength_bits(const struct gen_device_info *devinfo)
   139970 {
   139971    switch (devinfo->gen) {
   139972    case 10: return 15;
   139973    case 9: return 16;
   139974    case 8: return 16;
   139975    case 7:
   139976       if (devinfo->is_haswell) {
   139977          return 16;
   139978       } else {
   139979          return 16;
   139980       }
   139981    case 6: return 16;
   139982    case 5: return 0;
   139983    case 4:
   139984       if (devinfo->is_g4x) {
   139985          return 0;
   139986       } else {
   139987          return 0;
   139988       }
   139989    default:
   139990       unreachable("Invalid hardware generation");
   139991    }
   139992 }
   139993 
   139994 
   139995 
   139996 #define GEN10_MEDIA_OBJECT_DWordLength_start  0
   139997 #define GEN9_MEDIA_OBJECT_DWordLength_start  0
   139998 #define GEN8_MEDIA_OBJECT_DWordLength_start  0
   139999 #define GEN75_MEDIA_OBJECT_DWordLength_start  0
   140000 #define GEN7_MEDIA_OBJECT_DWordLength_start  0
   140001 #define GEN6_MEDIA_OBJECT_DWordLength_start  0
   140002 
   140003 static inline uint32_t ATTRIBUTE_PURE
   140004 MEDIA_OBJECT_DWordLength_start(const struct gen_device_info *devinfo)
   140005 {
   140006    switch (devinfo->gen) {
   140007    case 10: return 0;
   140008    case 9: return 0;
   140009    case 8: return 0;
   140010    case 7:
   140011       if (devinfo->is_haswell) {
   140012          return 0;
   140013       } else {
   140014          return 0;
   140015       }
   140016    case 6: return 0;
   140017    case 5: return 0;
   140018    case 4:
   140019       if (devinfo->is_g4x) {
   140020          return 0;
   140021       } else {
   140022          return 0;
   140023       }
   140024    default:
   140025       unreachable("Invalid hardware generation");
   140026    }
   140027 }
   140028 
   140029 
   140030 
   140031 /* MEDIA_OBJECT::Force Destination */
   140032 
   140033 
   140034 #define GEN10_MEDIA_OBJECT_ForceDestination_bits  1
   140035 #define GEN9_MEDIA_OBJECT_ForceDestination_bits  1
   140036 #define GEN8_MEDIA_OBJECT_ForceDestination_bits  1
   140037 
   140038 static inline uint32_t ATTRIBUTE_PURE
   140039 MEDIA_OBJECT_ForceDestination_bits(const struct gen_device_info *devinfo)
   140040 {
   140041    switch (devinfo->gen) {
   140042    case 10: return 1;
   140043    case 9: return 1;
   140044    case 8: return 1;
   140045    case 7:
   140046       if (devinfo->is_haswell) {
   140047          return 0;
   140048       } else {
   140049          return 0;
   140050       }
   140051    case 6: return 0;
   140052    case 5: return 0;
   140053    case 4:
   140054       if (devinfo->is_g4x) {
   140055          return 0;
   140056       } else {
   140057          return 0;
   140058       }
   140059    default:
   140060       unreachable("Invalid hardware generation");
   140061    }
   140062 }
   140063 
   140064 
   140065 
   140066 #define GEN10_MEDIA_OBJECT_ForceDestination_start  86
   140067 #define GEN9_MEDIA_OBJECT_ForceDestination_start  86
   140068 #define GEN8_MEDIA_OBJECT_ForceDestination_start  86
   140069 
   140070 static inline uint32_t ATTRIBUTE_PURE
   140071 MEDIA_OBJECT_ForceDestination_start(const struct gen_device_info *devinfo)
   140072 {
   140073    switch (devinfo->gen) {
   140074    case 10: return 86;
   140075    case 9: return 86;
   140076    case 8: return 86;
   140077    case 7:
   140078       if (devinfo->is_haswell) {
   140079          return 0;
   140080       } else {
   140081          return 0;
   140082       }
   140083    case 6: return 0;
   140084    case 5: return 0;
   140085    case 4:
   140086       if (devinfo->is_g4x) {
   140087          return 0;
   140088       } else {
   140089          return 0;
   140090       }
   140091    default:
   140092       unreachable("Invalid hardware generation");
   140093    }
   140094 }
   140095 
   140096 
   140097 
   140098 /* MEDIA_OBJECT::Half-Slice Destination Select */
   140099 
   140100 
   140101 #define GEN75_MEDIA_OBJECT_HalfSliceDestinationSelect_bits  2
   140102 #define GEN7_MEDIA_OBJECT_HalfSliceDestinationSelect_bits  2
   140103 
   140104 static inline uint32_t ATTRIBUTE_PURE
   140105 MEDIA_OBJECT_HalfSliceDestinationSelect_bits(const struct gen_device_info *devinfo)
   140106 {
   140107    switch (devinfo->gen) {
   140108    case 10: return 0;
   140109    case 9: return 0;
   140110    case 8: return 0;
   140111    case 7:
   140112       if (devinfo->is_haswell) {
   140113          return 2;
   140114       } else {
   140115          return 2;
   140116       }
   140117    case 6: return 0;
   140118    case 5: return 0;
   140119    case 4:
   140120       if (devinfo->is_g4x) {
   140121          return 0;
   140122       } else {
   140123          return 0;
   140124       }
   140125    default:
   140126       unreachable("Invalid hardware generation");
   140127    }
   140128 }
   140129 
   140130 
   140131 
   140132 #define GEN75_MEDIA_OBJECT_HalfSliceDestinationSelect_start  81
   140133 #define GEN7_MEDIA_OBJECT_HalfSliceDestinationSelect_start  81
   140134 
   140135 static inline uint32_t ATTRIBUTE_PURE
   140136 MEDIA_OBJECT_HalfSliceDestinationSelect_start(const struct gen_device_info *devinfo)
   140137 {
   140138    switch (devinfo->gen) {
   140139    case 10: return 0;
   140140    case 9: return 0;
   140141    case 8: return 0;
   140142    case 7:
   140143       if (devinfo->is_haswell) {
   140144          return 81;
   140145       } else {
   140146          return 81;
   140147       }
   140148    case 6: return 0;
   140149    case 5: return 0;
   140150    case 4:
   140151       if (devinfo->is_g4x) {
   140152          return 0;
   140153       } else {
   140154          return 0;
   140155       }
   140156    default:
   140157       unreachable("Invalid hardware generation");
   140158    }
   140159 }
   140160 
   140161 
   140162 
   140163 /* MEDIA_OBJECT::Indirect Data Length */
   140164 
   140165 
   140166 #define GEN10_MEDIA_OBJECT_IndirectDataLength_bits  17
   140167 #define GEN9_MEDIA_OBJECT_IndirectDataLength_bits  17
   140168 #define GEN8_MEDIA_OBJECT_IndirectDataLength_bits  17
   140169 #define GEN75_MEDIA_OBJECT_IndirectDataLength_bits  17
   140170 #define GEN7_MEDIA_OBJECT_IndirectDataLength_bits  17
   140171 #define GEN6_MEDIA_OBJECT_IndirectDataLength_bits  17
   140172 
   140173 static inline uint32_t ATTRIBUTE_PURE
   140174 MEDIA_OBJECT_IndirectDataLength_bits(const struct gen_device_info *devinfo)
   140175 {
   140176    switch (devinfo->gen) {
   140177    case 10: return 17;
   140178    case 9: return 17;
   140179    case 8: return 17;
   140180    case 7:
   140181       if (devinfo->is_haswell) {
   140182          return 17;
   140183       } else {
   140184          return 17;
   140185       }
   140186    case 6: return 17;
   140187    case 5: return 0;
   140188    case 4:
   140189       if (devinfo->is_g4x) {
   140190          return 0;
   140191       } else {
   140192          return 0;
   140193       }
   140194    default:
   140195       unreachable("Invalid hardware generation");
   140196    }
   140197 }
   140198 
   140199 
   140200 
   140201 #define GEN10_MEDIA_OBJECT_IndirectDataLength_start  64
   140202 #define GEN9_MEDIA_OBJECT_IndirectDataLength_start  64
   140203 #define GEN8_MEDIA_OBJECT_IndirectDataLength_start  64
   140204 #define GEN75_MEDIA_OBJECT_IndirectDataLength_start  64
   140205 #define GEN7_MEDIA_OBJECT_IndirectDataLength_start  64
   140206 #define GEN6_MEDIA_OBJECT_IndirectDataLength_start  64
   140207 
   140208 static inline uint32_t ATTRIBUTE_PURE
   140209 MEDIA_OBJECT_IndirectDataLength_start(const struct gen_device_info *devinfo)
   140210 {
   140211    switch (devinfo->gen) {
   140212    case 10: return 64;
   140213    case 9: return 64;
   140214    case 8: return 64;
   140215    case 7:
   140216       if (devinfo->is_haswell) {
   140217          return 64;
   140218       } else {
   140219          return 64;
   140220       }
   140221    case 6: return 64;
   140222    case 5: return 0;
   140223    case 4:
   140224       if (devinfo->is_g4x) {
   140225          return 0;
   140226       } else {
   140227          return 0;
   140228       }
   140229    default:
   140230       unreachable("Invalid hardware generation");
   140231    }
   140232 }
   140233 
   140234 
   140235 
   140236 /* MEDIA_OBJECT::Indirect Data Start Address */
   140237 
   140238 
   140239 #define GEN10_MEDIA_OBJECT_IndirectDataStartAddress_bits  32
   140240 #define GEN9_MEDIA_OBJECT_IndirectDataStartAddress_bits  32
   140241 #define GEN8_MEDIA_OBJECT_IndirectDataStartAddress_bits  32
   140242 #define GEN75_MEDIA_OBJECT_IndirectDataStartAddress_bits  32
   140243 #define GEN7_MEDIA_OBJECT_IndirectDataStartAddress_bits  32
   140244 #define GEN6_MEDIA_OBJECT_IndirectDataStartAddress_bits  32
   140245 
   140246 static inline uint32_t ATTRIBUTE_PURE
   140247 MEDIA_OBJECT_IndirectDataStartAddress_bits(const struct gen_device_info *devinfo)
   140248 {
   140249    switch (devinfo->gen) {
   140250    case 10: return 32;
   140251    case 9: return 32;
   140252    case 8: return 32;
   140253    case 7:
   140254       if (devinfo->is_haswell) {
   140255          return 32;
   140256       } else {
   140257          return 32;
   140258       }
   140259    case 6: return 32;
   140260    case 5: return 0;
   140261    case 4:
   140262       if (devinfo->is_g4x) {
   140263          return 0;
   140264       } else {
   140265          return 0;
   140266       }
   140267    default:
   140268       unreachable("Invalid hardware generation");
   140269    }
   140270 }
   140271 
   140272 
   140273 
   140274 #define GEN10_MEDIA_OBJECT_IndirectDataStartAddress_start  96
   140275 #define GEN9_MEDIA_OBJECT_IndirectDataStartAddress_start  96
   140276 #define GEN8_MEDIA_OBJECT_IndirectDataStartAddress_start  96
   140277 #define GEN75_MEDIA_OBJECT_IndirectDataStartAddress_start  96
   140278 #define GEN7_MEDIA_OBJECT_IndirectDataStartAddress_start  96
   140279 #define GEN6_MEDIA_OBJECT_IndirectDataStartAddress_start  96
   140280 
   140281 static inline uint32_t ATTRIBUTE_PURE
   140282 MEDIA_OBJECT_IndirectDataStartAddress_start(const struct gen_device_info *devinfo)
   140283 {
   140284    switch (devinfo->gen) {
   140285    case 10: return 96;
   140286    case 9: return 96;
   140287    case 8: return 96;
   140288    case 7:
   140289       if (devinfo->is_haswell) {
   140290          return 96;
   140291       } else {
   140292          return 96;
   140293       }
   140294    case 6: return 96;
   140295    case 5: return 0;
   140296    case 4:
   140297       if (devinfo->is_g4x) {
   140298          return 0;
   140299       } else {
   140300          return 0;
   140301       }
   140302    default:
   140303       unreachable("Invalid hardware generation");
   140304    }
   140305 }
   140306 
   140307 
   140308 
   140309 /* MEDIA_OBJECT::Inline Data */
   140310 
   140311 
   140312 #define GEN10_MEDIA_OBJECT_InlineData_bits  32
   140313 #define GEN9_MEDIA_OBJECT_InlineData_bits  32
   140314 #define GEN8_MEDIA_OBJECT_InlineData_bits  32
   140315 #define GEN75_MEDIA_OBJECT_InlineData_bits  32
   140316 #define GEN7_MEDIA_OBJECT_InlineData_bits  32
   140317 #define GEN6_MEDIA_OBJECT_InlineData_bits  32
   140318 
   140319 static inline uint32_t ATTRIBUTE_PURE
   140320 MEDIA_OBJECT_InlineData_bits(const struct gen_device_info *devinfo)
   140321 {
   140322    switch (devinfo->gen) {
   140323    case 10: return 32;
   140324    case 9: return 32;
   140325    case 8: return 32;
   140326    case 7:
   140327       if (devinfo->is_haswell) {
   140328          return 32;
   140329       } else {
   140330          return 32;
   140331       }
   140332    case 6: return 32;
   140333    case 5: return 0;
   140334    case 4:
   140335       if (devinfo->is_g4x) {
   140336          return 0;
   140337       } else {
   140338          return 0;
   140339       }
   140340    default:
   140341       unreachable("Invalid hardware generation");
   140342    }
   140343 }
   140344 
   140345 
   140346 
   140347 #define GEN10_MEDIA_OBJECT_InlineData_start  0
   140348 #define GEN9_MEDIA_OBJECT_InlineData_start  0
   140349 #define GEN8_MEDIA_OBJECT_InlineData_start  0
   140350 #define GEN75_MEDIA_OBJECT_InlineData_start  0
   140351 #define GEN7_MEDIA_OBJECT_InlineData_start  0
   140352 #define GEN6_MEDIA_OBJECT_InlineData_start  0
   140353 
   140354 static inline uint32_t ATTRIBUTE_PURE
   140355 MEDIA_OBJECT_InlineData_start(const struct gen_device_info *devinfo)
   140356 {
   140357    switch (devinfo->gen) {
   140358    case 10: return 0;
   140359    case 9: return 0;
   140360    case 8: return 0;
   140361    case 7:
   140362       if (devinfo->is_haswell) {
   140363          return 0;
   140364       } else {
   140365          return 0;
   140366       }
   140367    case 6: return 0;
   140368    case 5: return 0;
   140369    case 4:
   140370       if (devinfo->is_g4x) {
   140371          return 0;
   140372       } else {
   140373          return 0;
   140374       }
   140375    default:
   140376       unreachable("Invalid hardware generation");
   140377    }
   140378 }
   140379 
   140380 
   140381 
   140382 /* MEDIA_OBJECT::Interface Descriptor Offset */
   140383 
   140384 
   140385 #define GEN10_MEDIA_OBJECT_InterfaceDescriptorOffset_bits  6
   140386 #define GEN9_MEDIA_OBJECT_InterfaceDescriptorOffset_bits  6
   140387 #define GEN8_MEDIA_OBJECT_InterfaceDescriptorOffset_bits  6
   140388 #define GEN75_MEDIA_OBJECT_InterfaceDescriptorOffset_bits  6
   140389 #define GEN7_MEDIA_OBJECT_InterfaceDescriptorOffset_bits  5
   140390 #define GEN6_MEDIA_OBJECT_InterfaceDescriptorOffset_bits  5
   140391 
   140392 static inline uint32_t ATTRIBUTE_PURE
   140393 MEDIA_OBJECT_InterfaceDescriptorOffset_bits(const struct gen_device_info *devinfo)
   140394 {
   140395    switch (devinfo->gen) {
   140396    case 10: return 6;
   140397    case 9: return 6;
   140398    case 8: return 6;
   140399    case 7:
   140400       if (devinfo->is_haswell) {
   140401          return 6;
   140402       } else {
   140403          return 5;
   140404       }
   140405    case 6: return 5;
   140406    case 5: return 0;
   140407    case 4:
   140408       if (devinfo->is_g4x) {
   140409          return 0;
   140410       } else {
   140411          return 0;
   140412       }
   140413    default:
   140414       unreachable("Invalid hardware generation");
   140415    }
   140416 }
   140417 
   140418 
   140419 
   140420 #define GEN10_MEDIA_OBJECT_InterfaceDescriptorOffset_start  32
   140421 #define GEN9_MEDIA_OBJECT_InterfaceDescriptorOffset_start  32
   140422 #define GEN8_MEDIA_OBJECT_InterfaceDescriptorOffset_start  32
   140423 #define GEN75_MEDIA_OBJECT_InterfaceDescriptorOffset_start  32
   140424 #define GEN7_MEDIA_OBJECT_InterfaceDescriptorOffset_start  32
   140425 #define GEN6_MEDIA_OBJECT_InterfaceDescriptorOffset_start  32
   140426 
   140427 static inline uint32_t ATTRIBUTE_PURE
   140428 MEDIA_OBJECT_InterfaceDescriptorOffset_start(const struct gen_device_info *devinfo)
   140429 {
   140430    switch (devinfo->gen) {
   140431    case 10: return 32;
   140432    case 9: return 32;
   140433    case 8: return 32;
   140434    case 7:
   140435       if (devinfo->is_haswell) {
   140436          return 32;
   140437       } else {
   140438          return 32;
   140439       }
   140440    case 6: return 32;
   140441    case 5: return 0;
   140442    case 4:
   140443       if (devinfo->is_g4x) {
   140444          return 0;
   140445       } else {
   140446          return 0;
   140447       }
   140448    default:
   140449       unreachable("Invalid hardware generation");
   140450    }
   140451 }
   140452 
   140453 
   140454 
   140455 /* MEDIA_OBJECT::Media Command Opcode */
   140456 
   140457 
   140458 #define GEN10_MEDIA_OBJECT_MediaCommandOpcode_bits  3
   140459 #define GEN9_MEDIA_OBJECT_MediaCommandOpcode_bits  3
   140460 #define GEN8_MEDIA_OBJECT_MediaCommandOpcode_bits  3
   140461 #define GEN75_MEDIA_OBJECT_MediaCommandOpcode_bits  3
   140462 #define GEN7_MEDIA_OBJECT_MediaCommandOpcode_bits  3
   140463 #define GEN6_MEDIA_OBJECT_MediaCommandOpcode_bits  3
   140464 
   140465 static inline uint32_t ATTRIBUTE_PURE
   140466 MEDIA_OBJECT_MediaCommandOpcode_bits(const struct gen_device_info *devinfo)
   140467 {
   140468    switch (devinfo->gen) {
   140469    case 10: return 3;
   140470    case 9: return 3;
   140471    case 8: return 3;
   140472    case 7:
   140473       if (devinfo->is_haswell) {
   140474          return 3;
   140475       } else {
   140476          return 3;
   140477       }
   140478    case 6: return 3;
   140479    case 5: return 0;
   140480    case 4:
   140481       if (devinfo->is_g4x) {
   140482          return 0;
   140483       } else {
   140484          return 0;
   140485       }
   140486    default:
   140487       unreachable("Invalid hardware generation");
   140488    }
   140489 }
   140490 
   140491 
   140492 
   140493 #define GEN10_MEDIA_OBJECT_MediaCommandOpcode_start  24
   140494 #define GEN9_MEDIA_OBJECT_MediaCommandOpcode_start  24
   140495 #define GEN8_MEDIA_OBJECT_MediaCommandOpcode_start  24
   140496 #define GEN75_MEDIA_OBJECT_MediaCommandOpcode_start  24
   140497 #define GEN7_MEDIA_OBJECT_MediaCommandOpcode_start  24
   140498 #define GEN6_MEDIA_OBJECT_MediaCommandOpcode_start  24
   140499 
   140500 static inline uint32_t ATTRIBUTE_PURE
   140501 MEDIA_OBJECT_MediaCommandOpcode_start(const struct gen_device_info *devinfo)
   140502 {
   140503    switch (devinfo->gen) {
   140504    case 10: return 24;
   140505    case 9: return 24;
   140506    case 8: return 24;
   140507    case 7:
   140508       if (devinfo->is_haswell) {
   140509          return 24;
   140510       } else {
   140511          return 24;
   140512       }
   140513    case 6: return 24;
   140514    case 5: return 0;
   140515    case 4:
   140516       if (devinfo->is_g4x) {
   140517          return 0;
   140518       } else {
   140519          return 0;
   140520       }
   140521    default:
   140522       unreachable("Invalid hardware generation");
   140523    }
   140524 }
   140525 
   140526 
   140527 
   140528 /* MEDIA_OBJECT::Media Command Pipeline */
   140529 
   140530 
   140531 #define GEN10_MEDIA_OBJECT_MediaCommandPipeline_bits  2
   140532 #define GEN9_MEDIA_OBJECT_MediaCommandPipeline_bits  2
   140533 #define GEN8_MEDIA_OBJECT_MediaCommandPipeline_bits  2
   140534 #define GEN75_MEDIA_OBJECT_MediaCommandPipeline_bits  2
   140535 #define GEN7_MEDIA_OBJECT_MediaCommandPipeline_bits  2
   140536 #define GEN6_MEDIA_OBJECT_MediaCommandPipeline_bits  2
   140537 
   140538 static inline uint32_t ATTRIBUTE_PURE
   140539 MEDIA_OBJECT_MediaCommandPipeline_bits(const struct gen_device_info *devinfo)
   140540 {
   140541    switch (devinfo->gen) {
   140542    case 10: return 2;
   140543    case 9: return 2;
   140544    case 8: return 2;
   140545    case 7:
   140546       if (devinfo->is_haswell) {
   140547          return 2;
   140548       } else {
   140549          return 2;
   140550       }
   140551    case 6: return 2;
   140552    case 5: return 0;
   140553    case 4:
   140554       if (devinfo->is_g4x) {
   140555          return 0;
   140556       } else {
   140557          return 0;
   140558       }
   140559    default:
   140560       unreachable("Invalid hardware generation");
   140561    }
   140562 }
   140563 
   140564 
   140565 
   140566 #define GEN10_MEDIA_OBJECT_MediaCommandPipeline_start  27
   140567 #define GEN9_MEDIA_OBJECT_MediaCommandPipeline_start  27
   140568 #define GEN8_MEDIA_OBJECT_MediaCommandPipeline_start  27
   140569 #define GEN75_MEDIA_OBJECT_MediaCommandPipeline_start  27
   140570 #define GEN7_MEDIA_OBJECT_MediaCommandPipeline_start  27
   140571 #define GEN6_MEDIA_OBJECT_MediaCommandPipeline_start  27
   140572 
   140573 static inline uint32_t ATTRIBUTE_PURE
   140574 MEDIA_OBJECT_MediaCommandPipeline_start(const struct gen_device_info *devinfo)
   140575 {
   140576    switch (devinfo->gen) {
   140577    case 10: return 27;
   140578    case 9: return 27;
   140579    case 8: return 27;
   140580    case 7:
   140581       if (devinfo->is_haswell) {
   140582          return 27;
   140583       } else {
   140584          return 27;
   140585       }
   140586    case 6: return 27;
   140587    case 5: return 0;
   140588    case 4:
   140589       if (devinfo->is_g4x) {
   140590          return 0;
   140591       } else {
   140592          return 0;
   140593       }
   140594    default:
   140595       unreachable("Invalid hardware generation");
   140596    }
   140597 }
   140598 
   140599 
   140600 
   140601 /* MEDIA_OBJECT::Media Command Sub-Opcode */
   140602 
   140603 
   140604 #define GEN10_MEDIA_OBJECT_MediaCommandSubOpcode_bits  8
   140605 #define GEN9_MEDIA_OBJECT_MediaCommandSubOpcode_bits  8
   140606 #define GEN8_MEDIA_OBJECT_MediaCommandSubOpcode_bits  8
   140607 #define GEN75_MEDIA_OBJECT_MediaCommandSubOpcode_bits  8
   140608 #define GEN7_MEDIA_OBJECT_MediaCommandSubOpcode_bits  8
   140609 #define GEN6_MEDIA_OBJECT_MediaCommandSubOpcode_bits  8
   140610 
   140611 static inline uint32_t ATTRIBUTE_PURE
   140612 MEDIA_OBJECT_MediaCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   140613 {
   140614    switch (devinfo->gen) {
   140615    case 10: return 8;
   140616    case 9: return 8;
   140617    case 8: return 8;
   140618    case 7:
   140619       if (devinfo->is_haswell) {
   140620          return 8;
   140621       } else {
   140622          return 8;
   140623       }
   140624    case 6: return 8;
   140625    case 5: return 0;
   140626    case 4:
   140627       if (devinfo->is_g4x) {
   140628          return 0;
   140629       } else {
   140630          return 0;
   140631       }
   140632    default:
   140633       unreachable("Invalid hardware generation");
   140634    }
   140635 }
   140636 
   140637 
   140638 
   140639 #define GEN10_MEDIA_OBJECT_MediaCommandSubOpcode_start  16
   140640 #define GEN9_MEDIA_OBJECT_MediaCommandSubOpcode_start  16
   140641 #define GEN8_MEDIA_OBJECT_MediaCommandSubOpcode_start  16
   140642 #define GEN75_MEDIA_OBJECT_MediaCommandSubOpcode_start  16
   140643 #define GEN7_MEDIA_OBJECT_MediaCommandSubOpcode_start  16
   140644 #define GEN6_MEDIA_OBJECT_MediaCommandSubOpcode_start  16
   140645 
   140646 static inline uint32_t ATTRIBUTE_PURE
   140647 MEDIA_OBJECT_MediaCommandSubOpcode_start(const struct gen_device_info *devinfo)
   140648 {
   140649    switch (devinfo->gen) {
   140650    case 10: return 16;
   140651    case 9: return 16;
   140652    case 8: return 16;
   140653    case 7:
   140654       if (devinfo->is_haswell) {
   140655          return 16;
   140656       } else {
   140657          return 16;
   140658       }
   140659    case 6: return 16;
   140660    case 5: return 0;
   140661    case 4:
   140662       if (devinfo->is_g4x) {
   140663          return 0;
   140664       } else {
   140665          return 0;
   140666       }
   140667    default:
   140668       unreachable("Invalid hardware generation");
   140669    }
   140670 }
   140671 
   140672 
   140673 
   140674 /* MEDIA_OBJECT::Scoreboard Color */
   140675 
   140676 
   140677 #define GEN10_MEDIA_OBJECT_ScoreboardColor_bits  4
   140678 #define GEN9_MEDIA_OBJECT_ScoreboardColor_bits  4
   140679 #define GEN8_MEDIA_OBJECT_ScoreboardColor_bits  4
   140680 #define GEN75_MEDIA_OBJECT_ScoreboardColor_bits  4
   140681 #define GEN7_MEDIA_OBJECT_ScoreboardColor_bits  4
   140682 #define GEN6_MEDIA_OBJECT_ScoreboardColor_bits  4
   140683 
   140684 static inline uint32_t ATTRIBUTE_PURE
   140685 MEDIA_OBJECT_ScoreboardColor_bits(const struct gen_device_info *devinfo)
   140686 {
   140687    switch (devinfo->gen) {
   140688    case 10: return 4;
   140689    case 9: return 4;
   140690    case 8: return 4;
   140691    case 7:
   140692       if (devinfo->is_haswell) {
   140693          return 4;
   140694       } else {
   140695          return 4;
   140696       }
   140697    case 6: return 4;
   140698    case 5: return 0;
   140699    case 4:
   140700       if (devinfo->is_g4x) {
   140701          return 0;
   140702       } else {
   140703          return 0;
   140704       }
   140705    default:
   140706       unreachable("Invalid hardware generation");
   140707    }
   140708 }
   140709 
   140710 
   140711 
   140712 #define GEN10_MEDIA_OBJECT_ScoreboardColor_start  176
   140713 #define GEN9_MEDIA_OBJECT_ScoreboardColor_start  176
   140714 #define GEN8_MEDIA_OBJECT_ScoreboardColor_start  176
   140715 #define GEN75_MEDIA_OBJECT_ScoreboardColor_start  176
   140716 #define GEN7_MEDIA_OBJECT_ScoreboardColor_start  176
   140717 #define GEN6_MEDIA_OBJECT_ScoreboardColor_start  176
   140718 
   140719 static inline uint32_t ATTRIBUTE_PURE
   140720 MEDIA_OBJECT_ScoreboardColor_start(const struct gen_device_info *devinfo)
   140721 {
   140722    switch (devinfo->gen) {
   140723    case 10: return 176;
   140724    case 9: return 176;
   140725    case 8: return 176;
   140726    case 7:
   140727       if (devinfo->is_haswell) {
   140728          return 176;
   140729       } else {
   140730          return 176;
   140731       }
   140732    case 6: return 176;
   140733    case 5: return 0;
   140734    case 4:
   140735       if (devinfo->is_g4x) {
   140736          return 0;
   140737       } else {
   140738          return 0;
   140739       }
   140740    default:
   140741       unreachable("Invalid hardware generation");
   140742    }
   140743 }
   140744 
   140745 
   140746 
   140747 /* MEDIA_OBJECT::Scoreboard Mask */
   140748 
   140749 
   140750 #define GEN10_MEDIA_OBJECT_ScoreboardMask_bits  8
   140751 #define GEN9_MEDIA_OBJECT_ScoreboardMask_bits  8
   140752 #define GEN8_MEDIA_OBJECT_ScoreboardMask_bits  8
   140753 #define GEN75_MEDIA_OBJECT_ScoreboardMask_bits  8
   140754 #define GEN7_MEDIA_OBJECT_ScoreboardMask_bits  8
   140755 #define GEN6_MEDIA_OBJECT_ScoreboardMask_bits  8
   140756 
   140757 static inline uint32_t ATTRIBUTE_PURE
   140758 MEDIA_OBJECT_ScoreboardMask_bits(const struct gen_device_info *devinfo)
   140759 {
   140760    switch (devinfo->gen) {
   140761    case 10: return 8;
   140762    case 9: return 8;
   140763    case 8: return 8;
   140764    case 7:
   140765       if (devinfo->is_haswell) {
   140766          return 8;
   140767       } else {
   140768          return 8;
   140769       }
   140770    case 6: return 8;
   140771    case 5: return 0;
   140772    case 4:
   140773       if (devinfo->is_g4x) {
   140774          return 0;
   140775       } else {
   140776          return 0;
   140777       }
   140778    default:
   140779       unreachable("Invalid hardware generation");
   140780    }
   140781 }
   140782 
   140783 
   140784 
   140785 #define GEN10_MEDIA_OBJECT_ScoreboardMask_start  160
   140786 #define GEN9_MEDIA_OBJECT_ScoreboardMask_start  160
   140787 #define GEN8_MEDIA_OBJECT_ScoreboardMask_start  160
   140788 #define GEN75_MEDIA_OBJECT_ScoreboardMask_start  160
   140789 #define GEN7_MEDIA_OBJECT_ScoreboardMask_start  160
   140790 #define GEN6_MEDIA_OBJECT_ScoreboardMask_start  160
   140791 
   140792 static inline uint32_t ATTRIBUTE_PURE
   140793 MEDIA_OBJECT_ScoreboardMask_start(const struct gen_device_info *devinfo)
   140794 {
   140795    switch (devinfo->gen) {
   140796    case 10: return 160;
   140797    case 9: return 160;
   140798    case 8: return 160;
   140799    case 7:
   140800       if (devinfo->is_haswell) {
   140801          return 160;
   140802       } else {
   140803          return 160;
   140804       }
   140805    case 6: return 160;
   140806    case 5: return 0;
   140807    case 4:
   140808       if (devinfo->is_g4x) {
   140809          return 0;
   140810       } else {
   140811          return 0;
   140812       }
   140813    default:
   140814       unreachable("Invalid hardware generation");
   140815    }
   140816 }
   140817 
   140818 
   140819 
   140820 /* MEDIA_OBJECT::Scoreboard X */
   140821 
   140822 
   140823 #define GEN10_MEDIA_OBJECT_ScoreboardX_bits  9
   140824 #define GEN9_MEDIA_OBJECT_ScoreboardX_bits  9
   140825 #define GEN8_MEDIA_OBJECT_ScoreboardX_bits  9
   140826 #define GEN75_MEDIA_OBJECT_ScoreboardX_bits  9
   140827 #define GEN7_MEDIA_OBJECT_ScoreboardX_bits  9
   140828 #define GEN6_MEDIA_OBJECT_ScoreboardX_bits  9
   140829 
   140830 static inline uint32_t ATTRIBUTE_PURE
   140831 MEDIA_OBJECT_ScoreboardX_bits(const struct gen_device_info *devinfo)
   140832 {
   140833    switch (devinfo->gen) {
   140834    case 10: return 9;
   140835    case 9: return 9;
   140836    case 8: return 9;
   140837    case 7:
   140838       if (devinfo->is_haswell) {
   140839          return 9;
   140840       } else {
   140841          return 9;
   140842       }
   140843    case 6: return 9;
   140844    case 5: return 0;
   140845    case 4:
   140846       if (devinfo->is_g4x) {
   140847          return 0;
   140848       } else {
   140849          return 0;
   140850       }
   140851    default:
   140852       unreachable("Invalid hardware generation");
   140853    }
   140854 }
   140855 
   140856 
   140857 
   140858 #define GEN10_MEDIA_OBJECT_ScoreboardX_start  128
   140859 #define GEN9_MEDIA_OBJECT_ScoreboardX_start  128
   140860 #define GEN8_MEDIA_OBJECT_ScoreboardX_start  128
   140861 #define GEN75_MEDIA_OBJECT_ScoreboardX_start  128
   140862 #define GEN7_MEDIA_OBJECT_ScoreboardX_start  128
   140863 #define GEN6_MEDIA_OBJECT_ScoreboardX_start  128
   140864 
   140865 static inline uint32_t ATTRIBUTE_PURE
   140866 MEDIA_OBJECT_ScoreboardX_start(const struct gen_device_info *devinfo)
   140867 {
   140868    switch (devinfo->gen) {
   140869    case 10: return 128;
   140870    case 9: return 128;
   140871    case 8: return 128;
   140872    case 7:
   140873       if (devinfo->is_haswell) {
   140874          return 128;
   140875       } else {
   140876          return 128;
   140877       }
   140878    case 6: return 128;
   140879    case 5: return 0;
   140880    case 4:
   140881       if (devinfo->is_g4x) {
   140882          return 0;
   140883       } else {
   140884          return 0;
   140885       }
   140886    default:
   140887       unreachable("Invalid hardware generation");
   140888    }
   140889 }
   140890 
   140891 
   140892 
   140893 /* MEDIA_OBJECT::Scoredboard Y */
   140894 
   140895 
   140896 #define GEN10_MEDIA_OBJECT_ScoredboardY_bits  9
   140897 #define GEN9_MEDIA_OBJECT_ScoredboardY_bits  9
   140898 #define GEN8_MEDIA_OBJECT_ScoredboardY_bits  9
   140899 #define GEN75_MEDIA_OBJECT_ScoredboardY_bits  9
   140900 #define GEN7_MEDIA_OBJECT_ScoredboardY_bits  9
   140901 #define GEN6_MEDIA_OBJECT_ScoredboardY_bits  9
   140902 
   140903 static inline uint32_t ATTRIBUTE_PURE
   140904 MEDIA_OBJECT_ScoredboardY_bits(const struct gen_device_info *devinfo)
   140905 {
   140906    switch (devinfo->gen) {
   140907    case 10: return 9;
   140908    case 9: return 9;
   140909    case 8: return 9;
   140910    case 7:
   140911       if (devinfo->is_haswell) {
   140912          return 9;
   140913       } else {
   140914          return 9;
   140915       }
   140916    case 6: return 9;
   140917    case 5: return 0;
   140918    case 4:
   140919       if (devinfo->is_g4x) {
   140920          return 0;
   140921       } else {
   140922          return 0;
   140923       }
   140924    default:
   140925       unreachable("Invalid hardware generation");
   140926    }
   140927 }
   140928 
   140929 
   140930 
   140931 #define GEN10_MEDIA_OBJECT_ScoredboardY_start  144
   140932 #define GEN9_MEDIA_OBJECT_ScoredboardY_start  144
   140933 #define GEN8_MEDIA_OBJECT_ScoredboardY_start  144
   140934 #define GEN75_MEDIA_OBJECT_ScoredboardY_start  144
   140935 #define GEN7_MEDIA_OBJECT_ScoredboardY_start  144
   140936 #define GEN6_MEDIA_OBJECT_ScoredboardY_start  144
   140937 
   140938 static inline uint32_t ATTRIBUTE_PURE
   140939 MEDIA_OBJECT_ScoredboardY_start(const struct gen_device_info *devinfo)
   140940 {
   140941    switch (devinfo->gen) {
   140942    case 10: return 144;
   140943    case 9: return 144;
   140944    case 8: return 144;
   140945    case 7:
   140946       if (devinfo->is_haswell) {
   140947          return 144;
   140948       } else {
   140949          return 144;
   140950       }
   140951    case 6: return 144;
   140952    case 5: return 0;
   140953    case 4:
   140954       if (devinfo->is_g4x) {
   140955          return 0;
   140956       } else {
   140957          return 0;
   140958       }
   140959    default:
   140960       unreachable("Invalid hardware generation");
   140961    }
   140962 }
   140963 
   140964 
   140965 
   140966 /* MEDIA_OBJECT::Slice Destination Select */
   140967 
   140968 
   140969 #define GEN10_MEDIA_OBJECT_SliceDestinationSelect_bits  2
   140970 #define GEN9_MEDIA_OBJECT_SliceDestinationSelect_bits  2
   140971 #define GEN8_MEDIA_OBJECT_SliceDestinationSelect_bits  2
   140972 #define GEN75_MEDIA_OBJECT_SliceDestinationSelect_bits  1
   140973 
   140974 static inline uint32_t ATTRIBUTE_PURE
   140975 MEDIA_OBJECT_SliceDestinationSelect_bits(const struct gen_device_info *devinfo)
   140976 {
   140977    switch (devinfo->gen) {
   140978    case 10: return 2;
   140979    case 9: return 2;
   140980    case 8: return 2;
   140981    case 7:
   140982       if (devinfo->is_haswell) {
   140983          return 1;
   140984       } else {
   140985          return 0;
   140986       }
   140987    case 6: return 0;
   140988    case 5: return 0;
   140989    case 4:
   140990       if (devinfo->is_g4x) {
   140991          return 0;
   140992       } else {
   140993          return 0;
   140994       }
   140995    default:
   140996       unreachable("Invalid hardware generation");
   140997    }
   140998 }
   140999 
   141000 
   141001 
   141002 #define GEN10_MEDIA_OBJECT_SliceDestinationSelect_start  83
   141003 #define GEN9_MEDIA_OBJECT_SliceDestinationSelect_start  83
   141004 #define GEN8_MEDIA_OBJECT_SliceDestinationSelect_start  83
   141005 #define GEN75_MEDIA_OBJECT_SliceDestinationSelect_start  83
   141006 
   141007 static inline uint32_t ATTRIBUTE_PURE
   141008 MEDIA_OBJECT_SliceDestinationSelect_start(const struct gen_device_info *devinfo)
   141009 {
   141010    switch (devinfo->gen) {
   141011    case 10: return 83;
   141012    case 9: return 83;
   141013    case 8: return 83;
   141014    case 7:
   141015       if (devinfo->is_haswell) {
   141016          return 83;
   141017       } else {
   141018          return 0;
   141019       }
   141020    case 6: return 0;
   141021    case 5: return 0;
   141022    case 4:
   141023       if (devinfo->is_g4x) {
   141024          return 0;
   141025       } else {
   141026          return 0;
   141027       }
   141028    default:
   141029       unreachable("Invalid hardware generation");
   141030    }
   141031 }
   141032 
   141033 
   141034 
   141035 /* MEDIA_OBJECT::Slice Destination Select MSBs */
   141036 
   141037 
   141038 #define GEN10_MEDIA_OBJECT_SliceDestinationSelectMSBs_bits  2
   141039 #define GEN9_MEDIA_OBJECT_SliceDestinationSelectMSBs_bits  2
   141040 
   141041 static inline uint32_t ATTRIBUTE_PURE
   141042 MEDIA_OBJECT_SliceDestinationSelectMSBs_bits(const struct gen_device_info *devinfo)
   141043 {
   141044    switch (devinfo->gen) {
   141045    case 10: return 2;
   141046    case 9: return 2;
   141047    case 8: return 0;
   141048    case 7:
   141049       if (devinfo->is_haswell) {
   141050          return 0;
   141051       } else {
   141052          return 0;
   141053       }
   141054    case 6: return 0;
   141055    case 5: return 0;
   141056    case 4:
   141057       if (devinfo->is_g4x) {
   141058          return 0;
   141059       } else {
   141060          return 0;
   141061       }
   141062    default:
   141063       unreachable("Invalid hardware generation");
   141064    }
   141065 }
   141066 
   141067 
   141068 
   141069 #define GEN10_MEDIA_OBJECT_SliceDestinationSelectMSBs_start  89
   141070 #define GEN9_MEDIA_OBJECT_SliceDestinationSelectMSBs_start  89
   141071 
   141072 static inline uint32_t ATTRIBUTE_PURE
   141073 MEDIA_OBJECT_SliceDestinationSelectMSBs_start(const struct gen_device_info *devinfo)
   141074 {
   141075    switch (devinfo->gen) {
   141076    case 10: return 89;
   141077    case 9: return 89;
   141078    case 8: return 0;
   141079    case 7:
   141080       if (devinfo->is_haswell) {
   141081          return 0;
   141082       } else {
   141083          return 0;
   141084       }
   141085    case 6: return 0;
   141086    case 5: return 0;
   141087    case 4:
   141088       if (devinfo->is_g4x) {
   141089          return 0;
   141090       } else {
   141091          return 0;
   141092       }
   141093    default:
   141094       unreachable("Invalid hardware generation");
   141095    }
   141096 }
   141097 
   141098 
   141099 
   141100 /* MEDIA_OBJECT::SubSlice Destination Select */
   141101 
   141102 
   141103 #define GEN10_MEDIA_OBJECT_SubSliceDestinationSelect_bits  2
   141104 #define GEN9_MEDIA_OBJECT_SubSliceDestinationSelect_bits  2
   141105 #define GEN8_MEDIA_OBJECT_SubSliceDestinationSelect_bits  2
   141106 
   141107 static inline uint32_t ATTRIBUTE_PURE
   141108 MEDIA_OBJECT_SubSliceDestinationSelect_bits(const struct gen_device_info *devinfo)
   141109 {
   141110    switch (devinfo->gen) {
   141111    case 10: return 2;
   141112    case 9: return 2;
   141113    case 8: return 2;
   141114    case 7:
   141115       if (devinfo->is_haswell) {
   141116          return 0;
   141117       } else {
   141118          return 0;
   141119       }
   141120    case 6: return 0;
   141121    case 5: return 0;
   141122    case 4:
   141123       if (devinfo->is_g4x) {
   141124          return 0;
   141125       } else {
   141126          return 0;
   141127       }
   141128    default:
   141129       unreachable("Invalid hardware generation");
   141130    }
   141131 }
   141132 
   141133 
   141134 
   141135 #define GEN10_MEDIA_OBJECT_SubSliceDestinationSelect_start  81
   141136 #define GEN9_MEDIA_OBJECT_SubSliceDestinationSelect_start  81
   141137 #define GEN8_MEDIA_OBJECT_SubSliceDestinationSelect_start  81
   141138 
   141139 static inline uint32_t ATTRIBUTE_PURE
   141140 MEDIA_OBJECT_SubSliceDestinationSelect_start(const struct gen_device_info *devinfo)
   141141 {
   141142    switch (devinfo->gen) {
   141143    case 10: return 81;
   141144    case 9: return 81;
   141145    case 8: return 81;
   141146    case 7:
   141147       if (devinfo->is_haswell) {
   141148          return 0;
   141149       } else {
   141150          return 0;
   141151       }
   141152    case 6: return 0;
   141153    case 5: return 0;
   141154    case 4:
   141155       if (devinfo->is_g4x) {
   141156          return 0;
   141157       } else {
   141158          return 0;
   141159       }
   141160    default:
   141161       unreachable("Invalid hardware generation");
   141162    }
   141163 }
   141164 
   141165 
   141166 
   141167 /* MEDIA_OBJECT::Thread Synchronization */
   141168 
   141169 
   141170 #define GEN10_MEDIA_OBJECT_ThreadSynchronization_bits  1
   141171 #define GEN9_MEDIA_OBJECT_ThreadSynchronization_bits  1
   141172 #define GEN8_MEDIA_OBJECT_ThreadSynchronization_bits  1
   141173 #define GEN75_MEDIA_OBJECT_ThreadSynchronization_bits  1
   141174 #define GEN7_MEDIA_OBJECT_ThreadSynchronization_bits  1
   141175 #define GEN6_MEDIA_OBJECT_ThreadSynchronization_bits  1
   141176 
   141177 static inline uint32_t ATTRIBUTE_PURE
   141178 MEDIA_OBJECT_ThreadSynchronization_bits(const struct gen_device_info *devinfo)
   141179 {
   141180    switch (devinfo->gen) {
   141181    case 10: return 1;
   141182    case 9: return 1;
   141183    case 8: return 1;
   141184    case 7:
   141185       if (devinfo->is_haswell) {
   141186          return 1;
   141187       } else {
   141188          return 1;
   141189       }
   141190    case 6: return 1;
   141191    case 5: return 0;
   141192    case 4:
   141193       if (devinfo->is_g4x) {
   141194          return 0;
   141195       } else {
   141196          return 0;
   141197       }
   141198    default:
   141199       unreachable("Invalid hardware generation");
   141200    }
   141201 }
   141202 
   141203 
   141204 
   141205 #define GEN10_MEDIA_OBJECT_ThreadSynchronization_start  88
   141206 #define GEN9_MEDIA_OBJECT_ThreadSynchronization_start  88
   141207 #define GEN8_MEDIA_OBJECT_ThreadSynchronization_start  88
   141208 #define GEN75_MEDIA_OBJECT_ThreadSynchronization_start  88
   141209 #define GEN7_MEDIA_OBJECT_ThreadSynchronization_start  88
   141210 #define GEN6_MEDIA_OBJECT_ThreadSynchronization_start  88
   141211 
   141212 static inline uint32_t ATTRIBUTE_PURE
   141213 MEDIA_OBJECT_ThreadSynchronization_start(const struct gen_device_info *devinfo)
   141214 {
   141215    switch (devinfo->gen) {
   141216    case 10: return 88;
   141217    case 9: return 88;
   141218    case 8: return 88;
   141219    case 7:
   141220       if (devinfo->is_haswell) {
   141221          return 88;
   141222       } else {
   141223          return 88;
   141224       }
   141225    case 6: return 88;
   141226    case 5: return 0;
   141227    case 4:
   141228       if (devinfo->is_g4x) {
   141229          return 0;
   141230       } else {
   141231          return 0;
   141232       }
   141233    default:
   141234       unreachable("Invalid hardware generation");
   141235    }
   141236 }
   141237 
   141238 
   141239 
   141240 /* MEDIA_OBJECT::Use Scoreboard */
   141241 
   141242 
   141243 #define GEN10_MEDIA_OBJECT_UseScoreboard_bits  1
   141244 #define GEN9_MEDIA_OBJECT_UseScoreboard_bits  1
   141245 #define GEN8_MEDIA_OBJECT_UseScoreboard_bits  1
   141246 #define GEN75_MEDIA_OBJECT_UseScoreboard_bits  1
   141247 #define GEN7_MEDIA_OBJECT_UseScoreboard_bits  1
   141248 #define GEN6_MEDIA_OBJECT_UseScoreboard_bits  1
   141249 
   141250 static inline uint32_t ATTRIBUTE_PURE
   141251 MEDIA_OBJECT_UseScoreboard_bits(const struct gen_device_info *devinfo)
   141252 {
   141253    switch (devinfo->gen) {
   141254    case 10: return 1;
   141255    case 9: return 1;
   141256    case 8: return 1;
   141257    case 7:
   141258       if (devinfo->is_haswell) {
   141259          return 1;
   141260       } else {
   141261          return 1;
   141262       }
   141263    case 6: return 1;
   141264    case 5: return 0;
   141265    case 4:
   141266       if (devinfo->is_g4x) {
   141267          return 0;
   141268       } else {
   141269          return 0;
   141270       }
   141271    default:
   141272       unreachable("Invalid hardware generation");
   141273    }
   141274 }
   141275 
   141276 
   141277 
   141278 #define GEN10_MEDIA_OBJECT_UseScoreboard_start  85
   141279 #define GEN9_MEDIA_OBJECT_UseScoreboard_start  85
   141280 #define GEN8_MEDIA_OBJECT_UseScoreboard_start  85
   141281 #define GEN75_MEDIA_OBJECT_UseScoreboard_start  85
   141282 #define GEN7_MEDIA_OBJECT_UseScoreboard_start  85
   141283 #define GEN6_MEDIA_OBJECT_UseScoreboard_start  85
   141284 
   141285 static inline uint32_t ATTRIBUTE_PURE
   141286 MEDIA_OBJECT_UseScoreboard_start(const struct gen_device_info *devinfo)
   141287 {
   141288    switch (devinfo->gen) {
   141289    case 10: return 85;
   141290    case 9: return 85;
   141291    case 8: return 85;
   141292    case 7:
   141293       if (devinfo->is_haswell) {
   141294          return 85;
   141295       } else {
   141296          return 85;
   141297       }
   141298    case 6: return 85;
   141299    case 5: return 0;
   141300    case 4:
   141301       if (devinfo->is_g4x) {
   141302          return 0;
   141303       } else {
   141304          return 0;
   141305       }
   141306    default:
   141307       unreachable("Invalid hardware generation");
   141308    }
   141309 }
   141310 
   141311 
   141312 
   141313 /* MEDIA_OBJECT_GRPID */
   141314 
   141315 
   141316 
   141317 
   141318 
   141319 /* MEDIA_OBJECT_GRPID::Command Type */
   141320 
   141321 
   141322 #define GEN10_MEDIA_OBJECT_GRPID_CommandType_bits  3
   141323 #define GEN9_MEDIA_OBJECT_GRPID_CommandType_bits  3
   141324 #define GEN8_MEDIA_OBJECT_GRPID_CommandType_bits  3
   141325 
   141326 static inline uint32_t ATTRIBUTE_PURE
   141327 MEDIA_OBJECT_GRPID_CommandType_bits(const struct gen_device_info *devinfo)
   141328 {
   141329    switch (devinfo->gen) {
   141330    case 10: return 3;
   141331    case 9: return 3;
   141332    case 8: return 3;
   141333    case 7:
   141334       if (devinfo->is_haswell) {
   141335          return 0;
   141336       } else {
   141337          return 0;
   141338       }
   141339    case 6: return 0;
   141340    case 5: return 0;
   141341    case 4:
   141342       if (devinfo->is_g4x) {
   141343          return 0;
   141344       } else {
   141345          return 0;
   141346       }
   141347    default:
   141348       unreachable("Invalid hardware generation");
   141349    }
   141350 }
   141351 
   141352 
   141353 
   141354 #define GEN10_MEDIA_OBJECT_GRPID_CommandType_start  29
   141355 #define GEN9_MEDIA_OBJECT_GRPID_CommandType_start  29
   141356 #define GEN8_MEDIA_OBJECT_GRPID_CommandType_start  29
   141357 
   141358 static inline uint32_t ATTRIBUTE_PURE
   141359 MEDIA_OBJECT_GRPID_CommandType_start(const struct gen_device_info *devinfo)
   141360 {
   141361    switch (devinfo->gen) {
   141362    case 10: return 29;
   141363    case 9: return 29;
   141364    case 8: return 29;
   141365    case 7:
   141366       if (devinfo->is_haswell) {
   141367          return 0;
   141368       } else {
   141369          return 0;
   141370       }
   141371    case 6: return 0;
   141372    case 5: return 0;
   141373    case 4:
   141374       if (devinfo->is_g4x) {
   141375          return 0;
   141376       } else {
   141377          return 0;
   141378       }
   141379    default:
   141380       unreachable("Invalid hardware generation");
   141381    }
   141382 }
   141383 
   141384 
   141385 
   141386 /* MEDIA_OBJECT_GRPID::DWord Length */
   141387 
   141388 
   141389 #define GEN10_MEDIA_OBJECT_GRPID_DWordLength_bits  16
   141390 #define GEN9_MEDIA_OBJECT_GRPID_DWordLength_bits  16
   141391 #define GEN8_MEDIA_OBJECT_GRPID_DWordLength_bits  16
   141392 
   141393 static inline uint32_t ATTRIBUTE_PURE
   141394 MEDIA_OBJECT_GRPID_DWordLength_bits(const struct gen_device_info *devinfo)
   141395 {
   141396    switch (devinfo->gen) {
   141397    case 10: return 16;
   141398    case 9: return 16;
   141399    case 8: return 16;
   141400    case 7:
   141401       if (devinfo->is_haswell) {
   141402          return 0;
   141403       } else {
   141404          return 0;
   141405       }
   141406    case 6: return 0;
   141407    case 5: return 0;
   141408    case 4:
   141409       if (devinfo->is_g4x) {
   141410          return 0;
   141411       } else {
   141412          return 0;
   141413       }
   141414    default:
   141415       unreachable("Invalid hardware generation");
   141416    }
   141417 }
   141418 
   141419 
   141420 
   141421 #define GEN10_MEDIA_OBJECT_GRPID_DWordLength_start  0
   141422 #define GEN9_MEDIA_OBJECT_GRPID_DWordLength_start  0
   141423 #define GEN8_MEDIA_OBJECT_GRPID_DWordLength_start  0
   141424 
   141425 static inline uint32_t ATTRIBUTE_PURE
   141426 MEDIA_OBJECT_GRPID_DWordLength_start(const struct gen_device_info *devinfo)
   141427 {
   141428    switch (devinfo->gen) {
   141429    case 10: return 0;
   141430    case 9: return 0;
   141431    case 8: return 0;
   141432    case 7:
   141433       if (devinfo->is_haswell) {
   141434          return 0;
   141435       } else {
   141436          return 0;
   141437       }
   141438    case 6: return 0;
   141439    case 5: return 0;
   141440    case 4:
   141441       if (devinfo->is_g4x) {
   141442          return 0;
   141443       } else {
   141444          return 0;
   141445       }
   141446    default:
   141447       unreachable("Invalid hardware generation");
   141448    }
   141449 }
   141450 
   141451 
   141452 
   141453 /* MEDIA_OBJECT_GRPID::End of Thread Group */
   141454 
   141455 
   141456 #define GEN10_MEDIA_OBJECT_GRPID_EndofThreadGroup_bits  1
   141457 #define GEN9_MEDIA_OBJECT_GRPID_EndofThreadGroup_bits  1
   141458 #define GEN8_MEDIA_OBJECT_GRPID_EndofThreadGroup_bits  1
   141459 
   141460 static inline uint32_t ATTRIBUTE_PURE
   141461 MEDIA_OBJECT_GRPID_EndofThreadGroup_bits(const struct gen_device_info *devinfo)
   141462 {
   141463    switch (devinfo->gen) {
   141464    case 10: return 1;
   141465    case 9: return 1;
   141466    case 8: return 1;
   141467    case 7:
   141468       if (devinfo->is_haswell) {
   141469          return 0;
   141470       } else {
   141471          return 0;
   141472       }
   141473    case 6: return 0;
   141474    case 5: return 0;
   141475    case 4:
   141476       if (devinfo->is_g4x) {
   141477          return 0;
   141478       } else {
   141479          return 0;
   141480       }
   141481    default:
   141482       unreachable("Invalid hardware generation");
   141483    }
   141484 }
   141485 
   141486 
   141487 
   141488 #define GEN10_MEDIA_OBJECT_GRPID_EndofThreadGroup_start  87
   141489 #define GEN9_MEDIA_OBJECT_GRPID_EndofThreadGroup_start  87
   141490 #define GEN8_MEDIA_OBJECT_GRPID_EndofThreadGroup_start  87
   141491 
   141492 static inline uint32_t ATTRIBUTE_PURE
   141493 MEDIA_OBJECT_GRPID_EndofThreadGroup_start(const struct gen_device_info *devinfo)
   141494 {
   141495    switch (devinfo->gen) {
   141496    case 10: return 87;
   141497    case 9: return 87;
   141498    case 8: return 87;
   141499    case 7:
   141500       if (devinfo->is_haswell) {
   141501          return 0;
   141502       } else {
   141503          return 0;
   141504       }
   141505    case 6: return 0;
   141506    case 5: return 0;
   141507    case 4:
   141508       if (devinfo->is_g4x) {
   141509          return 0;
   141510       } else {
   141511          return 0;
   141512       }
   141513    default:
   141514       unreachable("Invalid hardware generation");
   141515    }
   141516 }
   141517 
   141518 
   141519 
   141520 /* MEDIA_OBJECT_GRPID::Force Destination */
   141521 
   141522 
   141523 #define GEN9_MEDIA_OBJECT_GRPID_ForceDestination_bits  1
   141524 #define GEN8_MEDIA_OBJECT_GRPID_ForceDestination_bits  1
   141525 
   141526 static inline uint32_t ATTRIBUTE_PURE
   141527 MEDIA_OBJECT_GRPID_ForceDestination_bits(const struct gen_device_info *devinfo)
   141528 {
   141529    switch (devinfo->gen) {
   141530    case 10: return 0;
   141531    case 9: return 1;
   141532    case 8: return 1;
   141533    case 7:
   141534       if (devinfo->is_haswell) {
   141535          return 0;
   141536       } else {
   141537          return 0;
   141538       }
   141539    case 6: return 0;
   141540    case 5: return 0;
   141541    case 4:
   141542       if (devinfo->is_g4x) {
   141543          return 0;
   141544       } else {
   141545          return 0;
   141546       }
   141547    default:
   141548       unreachable("Invalid hardware generation");
   141549    }
   141550 }
   141551 
   141552 
   141553 
   141554 #define GEN9_MEDIA_OBJECT_GRPID_ForceDestination_start  86
   141555 #define GEN8_MEDIA_OBJECT_GRPID_ForceDestination_start  86
   141556 
   141557 static inline uint32_t ATTRIBUTE_PURE
   141558 MEDIA_OBJECT_GRPID_ForceDestination_start(const struct gen_device_info *devinfo)
   141559 {
   141560    switch (devinfo->gen) {
   141561    case 10: return 0;
   141562    case 9: return 86;
   141563    case 8: return 86;
   141564    case 7:
   141565       if (devinfo->is_haswell) {
   141566          return 0;
   141567       } else {
   141568          return 0;
   141569       }
   141570    case 6: return 0;
   141571    case 5: return 0;
   141572    case 4:
   141573       if (devinfo->is_g4x) {
   141574          return 0;
   141575       } else {
   141576          return 0;
   141577       }
   141578    default:
   141579       unreachable("Invalid hardware generation");
   141580    }
   141581 }
   141582 
   141583 
   141584 
   141585 /* MEDIA_OBJECT_GRPID::GroupID */
   141586 
   141587 
   141588 #define GEN10_MEDIA_OBJECT_GRPID_GroupID_bits  32
   141589 #define GEN9_MEDIA_OBJECT_GRPID_GroupID_bits  32
   141590 #define GEN8_MEDIA_OBJECT_GRPID_GroupID_bits  32
   141591 
   141592 static inline uint32_t ATTRIBUTE_PURE
   141593 MEDIA_OBJECT_GRPID_GroupID_bits(const struct gen_device_info *devinfo)
   141594 {
   141595    switch (devinfo->gen) {
   141596    case 10: return 32;
   141597    case 9: return 32;
   141598    case 8: return 32;
   141599    case 7:
   141600       if (devinfo->is_haswell) {
   141601          return 0;
   141602       } else {
   141603          return 0;
   141604       }
   141605    case 6: return 0;
   141606    case 5: return 0;
   141607    case 4:
   141608       if (devinfo->is_g4x) {
   141609          return 0;
   141610       } else {
   141611          return 0;
   141612       }
   141613    default:
   141614       unreachable("Invalid hardware generation");
   141615    }
   141616 }
   141617 
   141618 
   141619 
   141620 #define GEN10_MEDIA_OBJECT_GRPID_GroupID_start  192
   141621 #define GEN9_MEDIA_OBJECT_GRPID_GroupID_start  192
   141622 #define GEN8_MEDIA_OBJECT_GRPID_GroupID_start  192
   141623 
   141624 static inline uint32_t ATTRIBUTE_PURE
   141625 MEDIA_OBJECT_GRPID_GroupID_start(const struct gen_device_info *devinfo)
   141626 {
   141627    switch (devinfo->gen) {
   141628    case 10: return 192;
   141629    case 9: return 192;
   141630    case 8: return 192;
   141631    case 7:
   141632       if (devinfo->is_haswell) {
   141633          return 0;
   141634       } else {
   141635          return 0;
   141636       }
   141637    case 6: return 0;
   141638    case 5: return 0;
   141639    case 4:
   141640       if (devinfo->is_g4x) {
   141641          return 0;
   141642       } else {
   141643          return 0;
   141644       }
   141645    default:
   141646       unreachable("Invalid hardware generation");
   141647    }
   141648 }
   141649 
   141650 
   141651 
   141652 /* MEDIA_OBJECT_GRPID::Indirect Data Length */
   141653 
   141654 
   141655 #define GEN10_MEDIA_OBJECT_GRPID_IndirectDataLength_bits  17
   141656 #define GEN9_MEDIA_OBJECT_GRPID_IndirectDataLength_bits  17
   141657 #define GEN8_MEDIA_OBJECT_GRPID_IndirectDataLength_bits  17
   141658 
   141659 static inline uint32_t ATTRIBUTE_PURE
   141660 MEDIA_OBJECT_GRPID_IndirectDataLength_bits(const struct gen_device_info *devinfo)
   141661 {
   141662    switch (devinfo->gen) {
   141663    case 10: return 17;
   141664    case 9: return 17;
   141665    case 8: return 17;
   141666    case 7:
   141667       if (devinfo->is_haswell) {
   141668          return 0;
   141669       } else {
   141670          return 0;
   141671       }
   141672    case 6: return 0;
   141673    case 5: return 0;
   141674    case 4:
   141675       if (devinfo->is_g4x) {
   141676          return 0;
   141677       } else {
   141678          return 0;
   141679       }
   141680    default:
   141681       unreachable("Invalid hardware generation");
   141682    }
   141683 }
   141684 
   141685 
   141686 
   141687 #define GEN10_MEDIA_OBJECT_GRPID_IndirectDataLength_start  64
   141688 #define GEN9_MEDIA_OBJECT_GRPID_IndirectDataLength_start  64
   141689 #define GEN8_MEDIA_OBJECT_GRPID_IndirectDataLength_start  64
   141690 
   141691 static inline uint32_t ATTRIBUTE_PURE
   141692 MEDIA_OBJECT_GRPID_IndirectDataLength_start(const struct gen_device_info *devinfo)
   141693 {
   141694    switch (devinfo->gen) {
   141695    case 10: return 64;
   141696    case 9: return 64;
   141697    case 8: return 64;
   141698    case 7:
   141699       if (devinfo->is_haswell) {
   141700          return 0;
   141701       } else {
   141702          return 0;
   141703       }
   141704    case 6: return 0;
   141705    case 5: return 0;
   141706    case 4:
   141707       if (devinfo->is_g4x) {
   141708          return 0;
   141709       } else {
   141710          return 0;
   141711       }
   141712    default:
   141713       unreachable("Invalid hardware generation");
   141714    }
   141715 }
   141716 
   141717 
   141718 
   141719 /* MEDIA_OBJECT_GRPID::Indirect Data Start Address */
   141720 
   141721 
   141722 #define GEN10_MEDIA_OBJECT_GRPID_IndirectDataStartAddress_bits  32
   141723 #define GEN9_MEDIA_OBJECT_GRPID_IndirectDataStartAddress_bits  32
   141724 #define GEN8_MEDIA_OBJECT_GRPID_IndirectDataStartAddress_bits  32
   141725 
   141726 static inline uint32_t ATTRIBUTE_PURE
   141727 MEDIA_OBJECT_GRPID_IndirectDataStartAddress_bits(const struct gen_device_info *devinfo)
   141728 {
   141729    switch (devinfo->gen) {
   141730    case 10: return 32;
   141731    case 9: return 32;
   141732    case 8: return 32;
   141733    case 7:
   141734       if (devinfo->is_haswell) {
   141735          return 0;
   141736       } else {
   141737          return 0;
   141738       }
   141739    case 6: return 0;
   141740    case 5: return 0;
   141741    case 4:
   141742       if (devinfo->is_g4x) {
   141743          return 0;
   141744       } else {
   141745          return 0;
   141746       }
   141747    default:
   141748       unreachable("Invalid hardware generation");
   141749    }
   141750 }
   141751 
   141752 
   141753 
   141754 #define GEN10_MEDIA_OBJECT_GRPID_IndirectDataStartAddress_start  96
   141755 #define GEN9_MEDIA_OBJECT_GRPID_IndirectDataStartAddress_start  96
   141756 #define GEN8_MEDIA_OBJECT_GRPID_IndirectDataStartAddress_start  96
   141757 
   141758 static inline uint32_t ATTRIBUTE_PURE
   141759 MEDIA_OBJECT_GRPID_IndirectDataStartAddress_start(const struct gen_device_info *devinfo)
   141760 {
   141761    switch (devinfo->gen) {
   141762    case 10: return 96;
   141763    case 9: return 96;
   141764    case 8: return 96;
   141765    case 7:
   141766       if (devinfo->is_haswell) {
   141767          return 0;
   141768       } else {
   141769          return 0;
   141770       }
   141771    case 6: return 0;
   141772    case 5: return 0;
   141773    case 4:
   141774       if (devinfo->is_g4x) {
   141775          return 0;
   141776       } else {
   141777          return 0;
   141778       }
   141779    default:
   141780       unreachable("Invalid hardware generation");
   141781    }
   141782 }
   141783 
   141784 
   141785 
   141786 /* MEDIA_OBJECT_GRPID::Inline Data */
   141787 
   141788 
   141789 #define GEN10_MEDIA_OBJECT_GRPID_InlineData_bits  32
   141790 #define GEN9_MEDIA_OBJECT_GRPID_InlineData_bits  32
   141791 #define GEN8_MEDIA_OBJECT_GRPID_InlineData_bits  32
   141792 
   141793 static inline uint32_t ATTRIBUTE_PURE
   141794 MEDIA_OBJECT_GRPID_InlineData_bits(const struct gen_device_info *devinfo)
   141795 {
   141796    switch (devinfo->gen) {
   141797    case 10: return 32;
   141798    case 9: return 32;
   141799    case 8: return 32;
   141800    case 7:
   141801       if (devinfo->is_haswell) {
   141802          return 0;
   141803       } else {
   141804          return 0;
   141805       }
   141806    case 6: return 0;
   141807    case 5: return 0;
   141808    case 4:
   141809       if (devinfo->is_g4x) {
   141810          return 0;
   141811       } else {
   141812          return 0;
   141813       }
   141814    default:
   141815       unreachable("Invalid hardware generation");
   141816    }
   141817 }
   141818 
   141819 
   141820 
   141821 #define GEN10_MEDIA_OBJECT_GRPID_InlineData_start  0
   141822 #define GEN9_MEDIA_OBJECT_GRPID_InlineData_start  0
   141823 #define GEN8_MEDIA_OBJECT_GRPID_InlineData_start  0
   141824 
   141825 static inline uint32_t ATTRIBUTE_PURE
   141826 MEDIA_OBJECT_GRPID_InlineData_start(const struct gen_device_info *devinfo)
   141827 {
   141828    switch (devinfo->gen) {
   141829    case 10: return 0;
   141830    case 9: return 0;
   141831    case 8: return 0;
   141832    case 7:
   141833       if (devinfo->is_haswell) {
   141834          return 0;
   141835       } else {
   141836          return 0;
   141837       }
   141838    case 6: return 0;
   141839    case 5: return 0;
   141840    case 4:
   141841       if (devinfo->is_g4x) {
   141842          return 0;
   141843       } else {
   141844          return 0;
   141845       }
   141846    default:
   141847       unreachable("Invalid hardware generation");
   141848    }
   141849 }
   141850 
   141851 
   141852 
   141853 /* MEDIA_OBJECT_GRPID::Interface Descriptor Offset */
   141854 
   141855 
   141856 #define GEN10_MEDIA_OBJECT_GRPID_InterfaceDescriptorOffset_bits  6
   141857 #define GEN9_MEDIA_OBJECT_GRPID_InterfaceDescriptorOffset_bits  6
   141858 #define GEN8_MEDIA_OBJECT_GRPID_InterfaceDescriptorOffset_bits  6
   141859 
   141860 static inline uint32_t ATTRIBUTE_PURE
   141861 MEDIA_OBJECT_GRPID_InterfaceDescriptorOffset_bits(const struct gen_device_info *devinfo)
   141862 {
   141863    switch (devinfo->gen) {
   141864    case 10: return 6;
   141865    case 9: return 6;
   141866    case 8: return 6;
   141867    case 7:
   141868       if (devinfo->is_haswell) {
   141869          return 0;
   141870       } else {
   141871          return 0;
   141872       }
   141873    case 6: return 0;
   141874    case 5: return 0;
   141875    case 4:
   141876       if (devinfo->is_g4x) {
   141877          return 0;
   141878       } else {
   141879          return 0;
   141880       }
   141881    default:
   141882       unreachable("Invalid hardware generation");
   141883    }
   141884 }
   141885 
   141886 
   141887 
   141888 #define GEN10_MEDIA_OBJECT_GRPID_InterfaceDescriptorOffset_start  32
   141889 #define GEN9_MEDIA_OBJECT_GRPID_InterfaceDescriptorOffset_start  32
   141890 #define GEN8_MEDIA_OBJECT_GRPID_InterfaceDescriptorOffset_start  32
   141891 
   141892 static inline uint32_t ATTRIBUTE_PURE
   141893 MEDIA_OBJECT_GRPID_InterfaceDescriptorOffset_start(const struct gen_device_info *devinfo)
   141894 {
   141895    switch (devinfo->gen) {
   141896    case 10: return 32;
   141897    case 9: return 32;
   141898    case 8: return 32;
   141899    case 7:
   141900       if (devinfo->is_haswell) {
   141901          return 0;
   141902       } else {
   141903          return 0;
   141904       }
   141905    case 6: return 0;
   141906    case 5: return 0;
   141907    case 4:
   141908       if (devinfo->is_g4x) {
   141909          return 0;
   141910       } else {
   141911          return 0;
   141912       }
   141913    default:
   141914       unreachable("Invalid hardware generation");
   141915    }
   141916 }
   141917 
   141918 
   141919 
   141920 /* MEDIA_OBJECT_GRPID::Media Command Opcode */
   141921 
   141922 
   141923 #define GEN10_MEDIA_OBJECT_GRPID_MediaCommandOpcode_bits  3
   141924 #define GEN9_MEDIA_OBJECT_GRPID_MediaCommandOpcode_bits  3
   141925 #define GEN8_MEDIA_OBJECT_GRPID_MediaCommandOpcode_bits  3
   141926 
   141927 static inline uint32_t ATTRIBUTE_PURE
   141928 MEDIA_OBJECT_GRPID_MediaCommandOpcode_bits(const struct gen_device_info *devinfo)
   141929 {
   141930    switch (devinfo->gen) {
   141931    case 10: return 3;
   141932    case 9: return 3;
   141933    case 8: return 3;
   141934    case 7:
   141935       if (devinfo->is_haswell) {
   141936          return 0;
   141937       } else {
   141938          return 0;
   141939       }
   141940    case 6: return 0;
   141941    case 5: return 0;
   141942    case 4:
   141943       if (devinfo->is_g4x) {
   141944          return 0;
   141945       } else {
   141946          return 0;
   141947       }
   141948    default:
   141949       unreachable("Invalid hardware generation");
   141950    }
   141951 }
   141952 
   141953 
   141954 
   141955 #define GEN10_MEDIA_OBJECT_GRPID_MediaCommandOpcode_start  24
   141956 #define GEN9_MEDIA_OBJECT_GRPID_MediaCommandOpcode_start  24
   141957 #define GEN8_MEDIA_OBJECT_GRPID_MediaCommandOpcode_start  24
   141958 
   141959 static inline uint32_t ATTRIBUTE_PURE
   141960 MEDIA_OBJECT_GRPID_MediaCommandOpcode_start(const struct gen_device_info *devinfo)
   141961 {
   141962    switch (devinfo->gen) {
   141963    case 10: return 24;
   141964    case 9: return 24;
   141965    case 8: return 24;
   141966    case 7:
   141967       if (devinfo->is_haswell) {
   141968          return 0;
   141969       } else {
   141970          return 0;
   141971       }
   141972    case 6: return 0;
   141973    case 5: return 0;
   141974    case 4:
   141975       if (devinfo->is_g4x) {
   141976          return 0;
   141977       } else {
   141978          return 0;
   141979       }
   141980    default:
   141981       unreachable("Invalid hardware generation");
   141982    }
   141983 }
   141984 
   141985 
   141986 
   141987 /* MEDIA_OBJECT_GRPID::Media Command Pipeline */
   141988 
   141989 
   141990 #define GEN10_MEDIA_OBJECT_GRPID_MediaCommandPipeline_bits  2
   141991 #define GEN9_MEDIA_OBJECT_GRPID_MediaCommandPipeline_bits  2
   141992 #define GEN8_MEDIA_OBJECT_GRPID_MediaCommandPipeline_bits  2
   141993 
   141994 static inline uint32_t ATTRIBUTE_PURE
   141995 MEDIA_OBJECT_GRPID_MediaCommandPipeline_bits(const struct gen_device_info *devinfo)
   141996 {
   141997    switch (devinfo->gen) {
   141998    case 10: return 2;
   141999    case 9: return 2;
   142000    case 8: return 2;
   142001    case 7:
   142002       if (devinfo->is_haswell) {
   142003          return 0;
   142004       } else {
   142005          return 0;
   142006       }
   142007    case 6: return 0;
   142008    case 5: return 0;
   142009    case 4:
   142010       if (devinfo->is_g4x) {
   142011          return 0;
   142012       } else {
   142013          return 0;
   142014       }
   142015    default:
   142016       unreachable("Invalid hardware generation");
   142017    }
   142018 }
   142019 
   142020 
   142021 
   142022 #define GEN10_MEDIA_OBJECT_GRPID_MediaCommandPipeline_start  27
   142023 #define GEN9_MEDIA_OBJECT_GRPID_MediaCommandPipeline_start  27
   142024 #define GEN8_MEDIA_OBJECT_GRPID_MediaCommandPipeline_start  27
   142025 
   142026 static inline uint32_t ATTRIBUTE_PURE
   142027 MEDIA_OBJECT_GRPID_MediaCommandPipeline_start(const struct gen_device_info *devinfo)
   142028 {
   142029    switch (devinfo->gen) {
   142030    case 10: return 27;
   142031    case 9: return 27;
   142032    case 8: return 27;
   142033    case 7:
   142034       if (devinfo->is_haswell) {
   142035          return 0;
   142036       } else {
   142037          return 0;
   142038       }
   142039    case 6: return 0;
   142040    case 5: return 0;
   142041    case 4:
   142042       if (devinfo->is_g4x) {
   142043          return 0;
   142044       } else {
   142045          return 0;
   142046       }
   142047    default:
   142048       unreachable("Invalid hardware generation");
   142049    }
   142050 }
   142051 
   142052 
   142053 
   142054 /* MEDIA_OBJECT_GRPID::Media Command Sub-Opcode */
   142055 
   142056 
   142057 #define GEN10_MEDIA_OBJECT_GRPID_MediaCommandSubOpcode_bits  8
   142058 #define GEN9_MEDIA_OBJECT_GRPID_MediaCommandSubOpcode_bits  8
   142059 #define GEN8_MEDIA_OBJECT_GRPID_MediaCommandSubOpcode_bits  8
   142060 
   142061 static inline uint32_t ATTRIBUTE_PURE
   142062 MEDIA_OBJECT_GRPID_MediaCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   142063 {
   142064    switch (devinfo->gen) {
   142065    case 10: return 8;
   142066    case 9: return 8;
   142067    case 8: return 8;
   142068    case 7:
   142069       if (devinfo->is_haswell) {
   142070          return 0;
   142071       } else {
   142072          return 0;
   142073       }
   142074    case 6: return 0;
   142075    case 5: return 0;
   142076    case 4:
   142077       if (devinfo->is_g4x) {
   142078          return 0;
   142079       } else {
   142080          return 0;
   142081       }
   142082    default:
   142083       unreachable("Invalid hardware generation");
   142084    }
   142085 }
   142086 
   142087 
   142088 
   142089 #define GEN10_MEDIA_OBJECT_GRPID_MediaCommandSubOpcode_start  16
   142090 #define GEN9_MEDIA_OBJECT_GRPID_MediaCommandSubOpcode_start  16
   142091 #define GEN8_MEDIA_OBJECT_GRPID_MediaCommandSubOpcode_start  16
   142092 
   142093 static inline uint32_t ATTRIBUTE_PURE
   142094 MEDIA_OBJECT_GRPID_MediaCommandSubOpcode_start(const struct gen_device_info *devinfo)
   142095 {
   142096    switch (devinfo->gen) {
   142097    case 10: return 16;
   142098    case 9: return 16;
   142099    case 8: return 16;
   142100    case 7:
   142101       if (devinfo->is_haswell) {
   142102          return 0;
   142103       } else {
   142104          return 0;
   142105       }
   142106    case 6: return 0;
   142107    case 5: return 0;
   142108    case 4:
   142109       if (devinfo->is_g4x) {
   142110          return 0;
   142111       } else {
   142112          return 0;
   142113       }
   142114    default:
   142115       unreachable("Invalid hardware generation");
   142116    }
   142117 }
   142118 
   142119 
   142120 
   142121 /* MEDIA_OBJECT_GRPID::Scoreboard Color */
   142122 
   142123 
   142124 #define GEN10_MEDIA_OBJECT_GRPID_ScoreboardColor_bits  4
   142125 #define GEN9_MEDIA_OBJECT_GRPID_ScoreboardColor_bits  4
   142126 #define GEN8_MEDIA_OBJECT_GRPID_ScoreboardColor_bits  4
   142127 
   142128 static inline uint32_t ATTRIBUTE_PURE
   142129 MEDIA_OBJECT_GRPID_ScoreboardColor_bits(const struct gen_device_info *devinfo)
   142130 {
   142131    switch (devinfo->gen) {
   142132    case 10: return 4;
   142133    case 9: return 4;
   142134    case 8: return 4;
   142135    case 7:
   142136       if (devinfo->is_haswell) {
   142137          return 0;
   142138       } else {
   142139          return 0;
   142140       }
   142141    case 6: return 0;
   142142    case 5: return 0;
   142143    case 4:
   142144       if (devinfo->is_g4x) {
   142145          return 0;
   142146       } else {
   142147          return 0;
   142148       }
   142149    default:
   142150       unreachable("Invalid hardware generation");
   142151    }
   142152 }
   142153 
   142154 
   142155 
   142156 #define GEN10_MEDIA_OBJECT_GRPID_ScoreboardColor_start  176
   142157 #define GEN9_MEDIA_OBJECT_GRPID_ScoreboardColor_start  176
   142158 #define GEN8_MEDIA_OBJECT_GRPID_ScoreboardColor_start  176
   142159 
   142160 static inline uint32_t ATTRIBUTE_PURE
   142161 MEDIA_OBJECT_GRPID_ScoreboardColor_start(const struct gen_device_info *devinfo)
   142162 {
   142163    switch (devinfo->gen) {
   142164    case 10: return 176;
   142165    case 9: return 176;
   142166    case 8: return 176;
   142167    case 7:
   142168       if (devinfo->is_haswell) {
   142169          return 0;
   142170       } else {
   142171          return 0;
   142172       }
   142173    case 6: return 0;
   142174    case 5: return 0;
   142175    case 4:
   142176       if (devinfo->is_g4x) {
   142177          return 0;
   142178       } else {
   142179          return 0;
   142180       }
   142181    default:
   142182       unreachable("Invalid hardware generation");
   142183    }
   142184 }
   142185 
   142186 
   142187 
   142188 /* MEDIA_OBJECT_GRPID::Scoreboard Mask */
   142189 
   142190 
   142191 #define GEN10_MEDIA_OBJECT_GRPID_ScoreboardMask_bits  8
   142192 #define GEN9_MEDIA_OBJECT_GRPID_ScoreboardMask_bits  8
   142193 #define GEN8_MEDIA_OBJECT_GRPID_ScoreboardMask_bits  8
   142194 
   142195 static inline uint32_t ATTRIBUTE_PURE
   142196 MEDIA_OBJECT_GRPID_ScoreboardMask_bits(const struct gen_device_info *devinfo)
   142197 {
   142198    switch (devinfo->gen) {
   142199    case 10: return 8;
   142200    case 9: return 8;
   142201    case 8: return 8;
   142202    case 7:
   142203       if (devinfo->is_haswell) {
   142204          return 0;
   142205       } else {
   142206          return 0;
   142207       }
   142208    case 6: return 0;
   142209    case 5: return 0;
   142210    case 4:
   142211       if (devinfo->is_g4x) {
   142212          return 0;
   142213       } else {
   142214          return 0;
   142215       }
   142216    default:
   142217       unreachable("Invalid hardware generation");
   142218    }
   142219 }
   142220 
   142221 
   142222 
   142223 #define GEN10_MEDIA_OBJECT_GRPID_ScoreboardMask_start  160
   142224 #define GEN9_MEDIA_OBJECT_GRPID_ScoreboardMask_start  160
   142225 #define GEN8_MEDIA_OBJECT_GRPID_ScoreboardMask_start  160
   142226 
   142227 static inline uint32_t ATTRIBUTE_PURE
   142228 MEDIA_OBJECT_GRPID_ScoreboardMask_start(const struct gen_device_info *devinfo)
   142229 {
   142230    switch (devinfo->gen) {
   142231    case 10: return 160;
   142232    case 9: return 160;
   142233    case 8: return 160;
   142234    case 7:
   142235       if (devinfo->is_haswell) {
   142236          return 0;
   142237       } else {
   142238          return 0;
   142239       }
   142240    case 6: return 0;
   142241    case 5: return 0;
   142242    case 4:
   142243       if (devinfo->is_g4x) {
   142244          return 0;
   142245       } else {
   142246          return 0;
   142247       }
   142248    default:
   142249       unreachable("Invalid hardware generation");
   142250    }
   142251 }
   142252 
   142253 
   142254 
   142255 /* MEDIA_OBJECT_GRPID::Scoreboard X */
   142256 
   142257 
   142258 #define GEN10_MEDIA_OBJECT_GRPID_ScoreboardX_bits  9
   142259 #define GEN9_MEDIA_OBJECT_GRPID_ScoreboardX_bits  9
   142260 #define GEN8_MEDIA_OBJECT_GRPID_ScoreboardX_bits  9
   142261 
   142262 static inline uint32_t ATTRIBUTE_PURE
   142263 MEDIA_OBJECT_GRPID_ScoreboardX_bits(const struct gen_device_info *devinfo)
   142264 {
   142265    switch (devinfo->gen) {
   142266    case 10: return 9;
   142267    case 9: return 9;
   142268    case 8: return 9;
   142269    case 7:
   142270       if (devinfo->is_haswell) {
   142271          return 0;
   142272       } else {
   142273          return 0;
   142274       }
   142275    case 6: return 0;
   142276    case 5: return 0;
   142277    case 4:
   142278       if (devinfo->is_g4x) {
   142279          return 0;
   142280       } else {
   142281          return 0;
   142282       }
   142283    default:
   142284       unreachable("Invalid hardware generation");
   142285    }
   142286 }
   142287 
   142288 
   142289 
   142290 #define GEN10_MEDIA_OBJECT_GRPID_ScoreboardX_start  128
   142291 #define GEN9_MEDIA_OBJECT_GRPID_ScoreboardX_start  128
   142292 #define GEN8_MEDIA_OBJECT_GRPID_ScoreboardX_start  128
   142293 
   142294 static inline uint32_t ATTRIBUTE_PURE
   142295 MEDIA_OBJECT_GRPID_ScoreboardX_start(const struct gen_device_info *devinfo)
   142296 {
   142297    switch (devinfo->gen) {
   142298    case 10: return 128;
   142299    case 9: return 128;
   142300    case 8: return 128;
   142301    case 7:
   142302       if (devinfo->is_haswell) {
   142303          return 0;
   142304       } else {
   142305          return 0;
   142306       }
   142307    case 6: return 0;
   142308    case 5: return 0;
   142309    case 4:
   142310       if (devinfo->is_g4x) {
   142311          return 0;
   142312       } else {
   142313          return 0;
   142314       }
   142315    default:
   142316       unreachable("Invalid hardware generation");
   142317    }
   142318 }
   142319 
   142320 
   142321 
   142322 /* MEDIA_OBJECT_GRPID::Scoreboard Y */
   142323 
   142324 
   142325 #define GEN10_MEDIA_OBJECT_GRPID_ScoreboardY_bits  9
   142326 #define GEN9_MEDIA_OBJECT_GRPID_ScoreboardY_bits  9
   142327 #define GEN8_MEDIA_OBJECT_GRPID_ScoreboardY_bits  9
   142328 
   142329 static inline uint32_t ATTRIBUTE_PURE
   142330 MEDIA_OBJECT_GRPID_ScoreboardY_bits(const struct gen_device_info *devinfo)
   142331 {
   142332    switch (devinfo->gen) {
   142333    case 10: return 9;
   142334    case 9: return 9;
   142335    case 8: return 9;
   142336    case 7:
   142337       if (devinfo->is_haswell) {
   142338          return 0;
   142339       } else {
   142340          return 0;
   142341       }
   142342    case 6: return 0;
   142343    case 5: return 0;
   142344    case 4:
   142345       if (devinfo->is_g4x) {
   142346          return 0;
   142347       } else {
   142348          return 0;
   142349       }
   142350    default:
   142351       unreachable("Invalid hardware generation");
   142352    }
   142353 }
   142354 
   142355 
   142356 
   142357 #define GEN10_MEDIA_OBJECT_GRPID_ScoreboardY_start  144
   142358 #define GEN9_MEDIA_OBJECT_GRPID_ScoreboardY_start  144
   142359 #define GEN8_MEDIA_OBJECT_GRPID_ScoreboardY_start  144
   142360 
   142361 static inline uint32_t ATTRIBUTE_PURE
   142362 MEDIA_OBJECT_GRPID_ScoreboardY_start(const struct gen_device_info *devinfo)
   142363 {
   142364    switch (devinfo->gen) {
   142365    case 10: return 144;
   142366    case 9: return 144;
   142367    case 8: return 144;
   142368    case 7:
   142369       if (devinfo->is_haswell) {
   142370          return 0;
   142371       } else {
   142372          return 0;
   142373       }
   142374    case 6: return 0;
   142375    case 5: return 0;
   142376    case 4:
   142377       if (devinfo->is_g4x) {
   142378          return 0;
   142379       } else {
   142380          return 0;
   142381       }
   142382    default:
   142383       unreachable("Invalid hardware generation");
   142384    }
   142385 }
   142386 
   142387 
   142388 
   142389 /* MEDIA_OBJECT_GRPID::Slice Destination Select */
   142390 
   142391 
   142392 #define GEN9_MEDIA_OBJECT_GRPID_SliceDestinationSelect_bits  2
   142393 #define GEN8_MEDIA_OBJECT_GRPID_SliceDestinationSelect_bits  2
   142394 
   142395 static inline uint32_t ATTRIBUTE_PURE
   142396 MEDIA_OBJECT_GRPID_SliceDestinationSelect_bits(const struct gen_device_info *devinfo)
   142397 {
   142398    switch (devinfo->gen) {
   142399    case 10: return 0;
   142400    case 9: return 2;
   142401    case 8: return 2;
   142402    case 7:
   142403       if (devinfo->is_haswell) {
   142404          return 0;
   142405       } else {
   142406          return 0;
   142407       }
   142408    case 6: return 0;
   142409    case 5: return 0;
   142410    case 4:
   142411       if (devinfo->is_g4x) {
   142412          return 0;
   142413       } else {
   142414          return 0;
   142415       }
   142416    default:
   142417       unreachable("Invalid hardware generation");
   142418    }
   142419 }
   142420 
   142421 
   142422 
   142423 #define GEN9_MEDIA_OBJECT_GRPID_SliceDestinationSelect_start  83
   142424 #define GEN8_MEDIA_OBJECT_GRPID_SliceDestinationSelect_start  83
   142425 
   142426 static inline uint32_t ATTRIBUTE_PURE
   142427 MEDIA_OBJECT_GRPID_SliceDestinationSelect_start(const struct gen_device_info *devinfo)
   142428 {
   142429    switch (devinfo->gen) {
   142430    case 10: return 0;
   142431    case 9: return 83;
   142432    case 8: return 83;
   142433    case 7:
   142434       if (devinfo->is_haswell) {
   142435          return 0;
   142436       } else {
   142437          return 0;
   142438       }
   142439    case 6: return 0;
   142440    case 5: return 0;
   142441    case 4:
   142442       if (devinfo->is_g4x) {
   142443          return 0;
   142444       } else {
   142445          return 0;
   142446       }
   142447    default:
   142448       unreachable("Invalid hardware generation");
   142449    }
   142450 }
   142451 
   142452 
   142453 
   142454 /* MEDIA_OBJECT_GRPID::Slice Destination Select MSB */
   142455 
   142456 
   142457 #define GEN9_MEDIA_OBJECT_GRPID_SliceDestinationSelectMSB_bits  1
   142458 
   142459 static inline uint32_t ATTRIBUTE_PURE
   142460 MEDIA_OBJECT_GRPID_SliceDestinationSelectMSB_bits(const struct gen_device_info *devinfo)
   142461 {
   142462    switch (devinfo->gen) {
   142463    case 10: return 0;
   142464    case 9: return 1;
   142465    case 8: return 0;
   142466    case 7:
   142467       if (devinfo->is_haswell) {
   142468          return 0;
   142469       } else {
   142470          return 0;
   142471       }
   142472    case 6: return 0;
   142473    case 5: return 0;
   142474    case 4:
   142475       if (devinfo->is_g4x) {
   142476          return 0;
   142477       } else {
   142478          return 0;
   142479       }
   142480    default:
   142481       unreachable("Invalid hardware generation");
   142482    }
   142483 }
   142484 
   142485 
   142486 
   142487 #define GEN9_MEDIA_OBJECT_GRPID_SliceDestinationSelectMSB_start  88
   142488 
   142489 static inline uint32_t ATTRIBUTE_PURE
   142490 MEDIA_OBJECT_GRPID_SliceDestinationSelectMSB_start(const struct gen_device_info *devinfo)
   142491 {
   142492    switch (devinfo->gen) {
   142493    case 10: return 0;
   142494    case 9: return 88;
   142495    case 8: return 0;
   142496    case 7:
   142497       if (devinfo->is_haswell) {
   142498          return 0;
   142499       } else {
   142500          return 0;
   142501       }
   142502    case 6: return 0;
   142503    case 5: return 0;
   142504    case 4:
   142505       if (devinfo->is_g4x) {
   142506          return 0;
   142507       } else {
   142508          return 0;
   142509       }
   142510    default:
   142511       unreachable("Invalid hardware generation");
   142512    }
   142513 }
   142514 
   142515 
   142516 
   142517 /* MEDIA_OBJECT_GRPID::SubSlice Destination Select */
   142518 
   142519 
   142520 #define GEN9_MEDIA_OBJECT_GRPID_SubSliceDestinationSelect_bits  2
   142521 #define GEN8_MEDIA_OBJECT_GRPID_SubSliceDestinationSelect_bits  2
   142522 
   142523 static inline uint32_t ATTRIBUTE_PURE
   142524 MEDIA_OBJECT_GRPID_SubSliceDestinationSelect_bits(const struct gen_device_info *devinfo)
   142525 {
   142526    switch (devinfo->gen) {
   142527    case 10: return 0;
   142528    case 9: return 2;
   142529    case 8: return 2;
   142530    case 7:
   142531       if (devinfo->is_haswell) {
   142532          return 0;
   142533       } else {
   142534          return 0;
   142535       }
   142536    case 6: return 0;
   142537    case 5: return 0;
   142538    case 4:
   142539       if (devinfo->is_g4x) {
   142540          return 0;
   142541       } else {
   142542          return 0;
   142543       }
   142544    default:
   142545       unreachable("Invalid hardware generation");
   142546    }
   142547 }
   142548 
   142549 
   142550 
   142551 #define GEN9_MEDIA_OBJECT_GRPID_SubSliceDestinationSelect_start  81
   142552 #define GEN8_MEDIA_OBJECT_GRPID_SubSliceDestinationSelect_start  81
   142553 
   142554 static inline uint32_t ATTRIBUTE_PURE
   142555 MEDIA_OBJECT_GRPID_SubSliceDestinationSelect_start(const struct gen_device_info *devinfo)
   142556 {
   142557    switch (devinfo->gen) {
   142558    case 10: return 0;
   142559    case 9: return 81;
   142560    case 8: return 81;
   142561    case 7:
   142562       if (devinfo->is_haswell) {
   142563          return 0;
   142564       } else {
   142565          return 0;
   142566       }
   142567    case 6: return 0;
   142568    case 5: return 0;
   142569    case 4:
   142570       if (devinfo->is_g4x) {
   142571          return 0;
   142572       } else {
   142573          return 0;
   142574       }
   142575    default:
   142576       unreachable("Invalid hardware generation");
   142577    }
   142578 }
   142579 
   142580 
   142581 
   142582 /* MEDIA_OBJECT_GRPID::Use Scoreboard */
   142583 
   142584 
   142585 #define GEN10_MEDIA_OBJECT_GRPID_UseScoreboard_bits  1
   142586 #define GEN9_MEDIA_OBJECT_GRPID_UseScoreboard_bits  1
   142587 #define GEN8_MEDIA_OBJECT_GRPID_UseScoreboard_bits  1
   142588 
   142589 static inline uint32_t ATTRIBUTE_PURE
   142590 MEDIA_OBJECT_GRPID_UseScoreboard_bits(const struct gen_device_info *devinfo)
   142591 {
   142592    switch (devinfo->gen) {
   142593    case 10: return 1;
   142594    case 9: return 1;
   142595    case 8: return 1;
   142596    case 7:
   142597       if (devinfo->is_haswell) {
   142598          return 0;
   142599       } else {
   142600          return 0;
   142601       }
   142602    case 6: return 0;
   142603    case 5: return 0;
   142604    case 4:
   142605       if (devinfo->is_g4x) {
   142606          return 0;
   142607       } else {
   142608          return 0;
   142609       }
   142610    default:
   142611       unreachable("Invalid hardware generation");
   142612    }
   142613 }
   142614 
   142615 
   142616 
   142617 #define GEN10_MEDIA_OBJECT_GRPID_UseScoreboard_start  85
   142618 #define GEN9_MEDIA_OBJECT_GRPID_UseScoreboard_start  85
   142619 #define GEN8_MEDIA_OBJECT_GRPID_UseScoreboard_start  85
   142620 
   142621 static inline uint32_t ATTRIBUTE_PURE
   142622 MEDIA_OBJECT_GRPID_UseScoreboard_start(const struct gen_device_info *devinfo)
   142623 {
   142624    switch (devinfo->gen) {
   142625    case 10: return 85;
   142626    case 9: return 85;
   142627    case 8: return 85;
   142628    case 7:
   142629       if (devinfo->is_haswell) {
   142630          return 0;
   142631       } else {
   142632          return 0;
   142633       }
   142634    case 6: return 0;
   142635    case 5: return 0;
   142636    case 4:
   142637       if (devinfo->is_g4x) {
   142638          return 0;
   142639       } else {
   142640          return 0;
   142641       }
   142642    default:
   142643       unreachable("Invalid hardware generation");
   142644    }
   142645 }
   142646 
   142647 
   142648 
   142649 /* MEDIA_OBJECT_PRT */
   142650 
   142651 
   142652 #define GEN10_MEDIA_OBJECT_PRT_length  16
   142653 #define GEN9_MEDIA_OBJECT_PRT_length  16
   142654 #define GEN8_MEDIA_OBJECT_PRT_length  16
   142655 #define GEN75_MEDIA_OBJECT_PRT_length  16
   142656 #define GEN7_MEDIA_OBJECT_PRT_length  16
   142657 #define GEN6_MEDIA_OBJECT_PRT_length  16
   142658 
   142659 static inline uint32_t ATTRIBUTE_PURE
   142660 MEDIA_OBJECT_PRT_length(const struct gen_device_info *devinfo)
   142661 {
   142662    switch (devinfo->gen) {
   142663    case 10: return 16;
   142664    case 9: return 16;
   142665    case 8: return 16;
   142666    case 7:
   142667       if (devinfo->is_haswell) {
   142668          return 16;
   142669       } else {
   142670          return 16;
   142671       }
   142672    case 6: return 16;
   142673    case 5: return 0;
   142674    case 4:
   142675       if (devinfo->is_g4x) {
   142676          return 0;
   142677       } else {
   142678          return 0;
   142679       }
   142680    default:
   142681       unreachable("Invalid hardware generation");
   142682    }
   142683 }
   142684 
   142685 
   142686 
   142687 /* MEDIA_OBJECT_PRT::Children Present */
   142688 
   142689 
   142690 #define GEN10_MEDIA_OBJECT_PRT_ChildrenPresent_bits  1
   142691 #define GEN9_MEDIA_OBJECT_PRT_ChildrenPresent_bits  1
   142692 #define GEN8_MEDIA_OBJECT_PRT_ChildrenPresent_bits  1
   142693 #define GEN75_MEDIA_OBJECT_PRT_ChildrenPresent_bits  1
   142694 #define GEN7_MEDIA_OBJECT_PRT_ChildrenPresent_bits  1
   142695 #define GEN6_MEDIA_OBJECT_PRT_ChildrenPresent_bits  1
   142696 
   142697 static inline uint32_t ATTRIBUTE_PURE
   142698 MEDIA_OBJECT_PRT_ChildrenPresent_bits(const struct gen_device_info *devinfo)
   142699 {
   142700    switch (devinfo->gen) {
   142701    case 10: return 1;
   142702    case 9: return 1;
   142703    case 8: return 1;
   142704    case 7:
   142705       if (devinfo->is_haswell) {
   142706          return 1;
   142707       } else {
   142708          return 1;
   142709       }
   142710    case 6: return 1;
   142711    case 5: return 0;
   142712    case 4:
   142713       if (devinfo->is_g4x) {
   142714          return 0;
   142715       } else {
   142716          return 0;
   142717       }
   142718    default:
   142719       unreachable("Invalid hardware generation");
   142720    }
   142721 }
   142722 
   142723 
   142724 
   142725 #define GEN10_MEDIA_OBJECT_PRT_ChildrenPresent_start  95
   142726 #define GEN9_MEDIA_OBJECT_PRT_ChildrenPresent_start  95
   142727 #define GEN8_MEDIA_OBJECT_PRT_ChildrenPresent_start  95
   142728 #define GEN75_MEDIA_OBJECT_PRT_ChildrenPresent_start  95
   142729 #define GEN7_MEDIA_OBJECT_PRT_ChildrenPresent_start  95
   142730 #define GEN6_MEDIA_OBJECT_PRT_ChildrenPresent_start  95
   142731 
   142732 static inline uint32_t ATTRIBUTE_PURE
   142733 MEDIA_OBJECT_PRT_ChildrenPresent_start(const struct gen_device_info *devinfo)
   142734 {
   142735    switch (devinfo->gen) {
   142736    case 10: return 95;
   142737    case 9: return 95;
   142738    case 8: return 95;
   142739    case 7:
   142740       if (devinfo->is_haswell) {
   142741          return 95;
   142742       } else {
   142743          return 95;
   142744       }
   142745    case 6: return 95;
   142746    case 5: return 0;
   142747    case 4:
   142748       if (devinfo->is_g4x) {
   142749          return 0;
   142750       } else {
   142751          return 0;
   142752       }
   142753    default:
   142754       unreachable("Invalid hardware generation");
   142755    }
   142756 }
   142757 
   142758 
   142759 
   142760 /* MEDIA_OBJECT_PRT::Command Type */
   142761 
   142762 
   142763 #define GEN10_MEDIA_OBJECT_PRT_CommandType_bits  3
   142764 #define GEN9_MEDIA_OBJECT_PRT_CommandType_bits  3
   142765 #define GEN8_MEDIA_OBJECT_PRT_CommandType_bits  3
   142766 #define GEN75_MEDIA_OBJECT_PRT_CommandType_bits  3
   142767 #define GEN7_MEDIA_OBJECT_PRT_CommandType_bits  3
   142768 #define GEN6_MEDIA_OBJECT_PRT_CommandType_bits  3
   142769 
   142770 static inline uint32_t ATTRIBUTE_PURE
   142771 MEDIA_OBJECT_PRT_CommandType_bits(const struct gen_device_info *devinfo)
   142772 {
   142773    switch (devinfo->gen) {
   142774    case 10: return 3;
   142775    case 9: return 3;
   142776    case 8: return 3;
   142777    case 7:
   142778       if (devinfo->is_haswell) {
   142779          return 3;
   142780       } else {
   142781          return 3;
   142782       }
   142783    case 6: return 3;
   142784    case 5: return 0;
   142785    case 4:
   142786       if (devinfo->is_g4x) {
   142787          return 0;
   142788       } else {
   142789          return 0;
   142790       }
   142791    default:
   142792       unreachable("Invalid hardware generation");
   142793    }
   142794 }
   142795 
   142796 
   142797 
   142798 #define GEN10_MEDIA_OBJECT_PRT_CommandType_start  29
   142799 #define GEN9_MEDIA_OBJECT_PRT_CommandType_start  29
   142800 #define GEN8_MEDIA_OBJECT_PRT_CommandType_start  29
   142801 #define GEN75_MEDIA_OBJECT_PRT_CommandType_start  29
   142802 #define GEN7_MEDIA_OBJECT_PRT_CommandType_start  29
   142803 #define GEN6_MEDIA_OBJECT_PRT_CommandType_start  29
   142804 
   142805 static inline uint32_t ATTRIBUTE_PURE
   142806 MEDIA_OBJECT_PRT_CommandType_start(const struct gen_device_info *devinfo)
   142807 {
   142808    switch (devinfo->gen) {
   142809    case 10: return 29;
   142810    case 9: return 29;
   142811    case 8: return 29;
   142812    case 7:
   142813       if (devinfo->is_haswell) {
   142814          return 29;
   142815       } else {
   142816          return 29;
   142817       }
   142818    case 6: return 29;
   142819    case 5: return 0;
   142820    case 4:
   142821       if (devinfo->is_g4x) {
   142822          return 0;
   142823       } else {
   142824          return 0;
   142825       }
   142826    default:
   142827       unreachable("Invalid hardware generation");
   142828    }
   142829 }
   142830 
   142831 
   142832 
   142833 /* MEDIA_OBJECT_PRT::DWord Length */
   142834 
   142835 
   142836 #define GEN10_MEDIA_OBJECT_PRT_DWordLength_bits  15
   142837 #define GEN9_MEDIA_OBJECT_PRT_DWordLength_bits  16
   142838 #define GEN8_MEDIA_OBJECT_PRT_DWordLength_bits  16
   142839 #define GEN75_MEDIA_OBJECT_PRT_DWordLength_bits  16
   142840 #define GEN7_MEDIA_OBJECT_PRT_DWordLength_bits  16
   142841 #define GEN6_MEDIA_OBJECT_PRT_DWordLength_bits  16
   142842 
   142843 static inline uint32_t ATTRIBUTE_PURE
   142844 MEDIA_OBJECT_PRT_DWordLength_bits(const struct gen_device_info *devinfo)
   142845 {
   142846    switch (devinfo->gen) {
   142847    case 10: return 15;
   142848    case 9: return 16;
   142849    case 8: return 16;
   142850    case 7:
   142851       if (devinfo->is_haswell) {
   142852          return 16;
   142853       } else {
   142854          return 16;
   142855       }
   142856    case 6: return 16;
   142857    case 5: return 0;
   142858    case 4:
   142859       if (devinfo->is_g4x) {
   142860          return 0;
   142861       } else {
   142862          return 0;
   142863       }
   142864    default:
   142865       unreachable("Invalid hardware generation");
   142866    }
   142867 }
   142868 
   142869 
   142870 
   142871 #define GEN10_MEDIA_OBJECT_PRT_DWordLength_start  0
   142872 #define GEN9_MEDIA_OBJECT_PRT_DWordLength_start  0
   142873 #define GEN8_MEDIA_OBJECT_PRT_DWordLength_start  0
   142874 #define GEN75_MEDIA_OBJECT_PRT_DWordLength_start  0
   142875 #define GEN7_MEDIA_OBJECT_PRT_DWordLength_start  0
   142876 #define GEN6_MEDIA_OBJECT_PRT_DWordLength_start  0
   142877 
   142878 static inline uint32_t ATTRIBUTE_PURE
   142879 MEDIA_OBJECT_PRT_DWordLength_start(const struct gen_device_info *devinfo)
   142880 {
   142881    switch (devinfo->gen) {
   142882    case 10: return 0;
   142883    case 9: return 0;
   142884    case 8: return 0;
   142885    case 7:
   142886       if (devinfo->is_haswell) {
   142887          return 0;
   142888       } else {
   142889          return 0;
   142890       }
   142891    case 6: return 0;
   142892    case 5: return 0;
   142893    case 4:
   142894       if (devinfo->is_g4x) {
   142895          return 0;
   142896       } else {
   142897          return 0;
   142898       }
   142899    default:
   142900       unreachable("Invalid hardware generation");
   142901    }
   142902 }
   142903 
   142904 
   142905 
   142906 /* MEDIA_OBJECT_PRT::Inline Data */
   142907 
   142908 
   142909 #define GEN10_MEDIA_OBJECT_PRT_InlineData_bits  32
   142910 #define GEN9_MEDIA_OBJECT_PRT_InlineData_bits  32
   142911 #define GEN8_MEDIA_OBJECT_PRT_InlineData_bits  32
   142912 #define GEN75_MEDIA_OBJECT_PRT_InlineData_bits  32
   142913 #define GEN7_MEDIA_OBJECT_PRT_InlineData_bits  32
   142914 #define GEN6_MEDIA_OBJECT_PRT_InlineData_bits  32
   142915 
   142916 static inline uint32_t ATTRIBUTE_PURE
   142917 MEDIA_OBJECT_PRT_InlineData_bits(const struct gen_device_info *devinfo)
   142918 {
   142919    switch (devinfo->gen) {
   142920    case 10: return 32;
   142921    case 9: return 32;
   142922    case 8: return 32;
   142923    case 7:
   142924       if (devinfo->is_haswell) {
   142925          return 32;
   142926       } else {
   142927          return 32;
   142928       }
   142929    case 6: return 32;
   142930    case 5: return 0;
   142931    case 4:
   142932       if (devinfo->is_g4x) {
   142933          return 0;
   142934       } else {
   142935          return 0;
   142936       }
   142937    default:
   142938       unreachable("Invalid hardware generation");
   142939    }
   142940 }
   142941 
   142942 
   142943 
   142944 #define GEN10_MEDIA_OBJECT_PRT_InlineData_start  0
   142945 #define GEN9_MEDIA_OBJECT_PRT_InlineData_start  0
   142946 #define GEN8_MEDIA_OBJECT_PRT_InlineData_start  0
   142947 #define GEN75_MEDIA_OBJECT_PRT_InlineData_start  0
   142948 #define GEN7_MEDIA_OBJECT_PRT_InlineData_start  0
   142949 #define GEN6_MEDIA_OBJECT_PRT_InlineData_start  0
   142950 
   142951 static inline uint32_t ATTRIBUTE_PURE
   142952 MEDIA_OBJECT_PRT_InlineData_start(const struct gen_device_info *devinfo)
   142953 {
   142954    switch (devinfo->gen) {
   142955    case 10: return 0;
   142956    case 9: return 0;
   142957    case 8: return 0;
   142958    case 7:
   142959       if (devinfo->is_haswell) {
   142960          return 0;
   142961       } else {
   142962          return 0;
   142963       }
   142964    case 6: return 0;
   142965    case 5: return 0;
   142966    case 4:
   142967       if (devinfo->is_g4x) {
   142968          return 0;
   142969       } else {
   142970          return 0;
   142971       }
   142972    default:
   142973       unreachable("Invalid hardware generation");
   142974    }
   142975 }
   142976 
   142977 
   142978 
   142979 /* MEDIA_OBJECT_PRT::Interface Descriptor Offset */
   142980 
   142981 
   142982 #define GEN10_MEDIA_OBJECT_PRT_InterfaceDescriptorOffset_bits  6
   142983 #define GEN9_MEDIA_OBJECT_PRT_InterfaceDescriptorOffset_bits  6
   142984 #define GEN8_MEDIA_OBJECT_PRT_InterfaceDescriptorOffset_bits  6
   142985 #define GEN75_MEDIA_OBJECT_PRT_InterfaceDescriptorOffset_bits  6
   142986 #define GEN7_MEDIA_OBJECT_PRT_InterfaceDescriptorOffset_bits  5
   142987 #define GEN6_MEDIA_OBJECT_PRT_InterfaceDescriptorOffset_bits  5
   142988 
   142989 static inline uint32_t ATTRIBUTE_PURE
   142990 MEDIA_OBJECT_PRT_InterfaceDescriptorOffset_bits(const struct gen_device_info *devinfo)
   142991 {
   142992    switch (devinfo->gen) {
   142993    case 10: return 6;
   142994    case 9: return 6;
   142995    case 8: return 6;
   142996    case 7:
   142997       if (devinfo->is_haswell) {
   142998          return 6;
   142999       } else {
   143000          return 5;
   143001       }
   143002    case 6: return 5;
   143003    case 5: return 0;
   143004    case 4:
   143005       if (devinfo->is_g4x) {
   143006          return 0;
   143007       } else {
   143008          return 0;
   143009       }
   143010    default:
   143011       unreachable("Invalid hardware generation");
   143012    }
   143013 }
   143014 
   143015 
   143016 
   143017 #define GEN10_MEDIA_OBJECT_PRT_InterfaceDescriptorOffset_start  32
   143018 #define GEN9_MEDIA_OBJECT_PRT_InterfaceDescriptorOffset_start  32
   143019 #define GEN8_MEDIA_OBJECT_PRT_InterfaceDescriptorOffset_start  32
   143020 #define GEN75_MEDIA_OBJECT_PRT_InterfaceDescriptorOffset_start  32
   143021 #define GEN7_MEDIA_OBJECT_PRT_InterfaceDescriptorOffset_start  32
   143022 #define GEN6_MEDIA_OBJECT_PRT_InterfaceDescriptorOffset_start  32
   143023 
   143024 static inline uint32_t ATTRIBUTE_PURE
   143025 MEDIA_OBJECT_PRT_InterfaceDescriptorOffset_start(const struct gen_device_info *devinfo)
   143026 {
   143027    switch (devinfo->gen) {
   143028    case 10: return 32;
   143029    case 9: return 32;
   143030    case 8: return 32;
   143031    case 7:
   143032       if (devinfo->is_haswell) {
   143033          return 32;
   143034       } else {
   143035          return 32;
   143036       }
   143037    case 6: return 32;
   143038    case 5: return 0;
   143039    case 4:
   143040       if (devinfo->is_g4x) {
   143041          return 0;
   143042       } else {
   143043          return 0;
   143044       }
   143045    default:
   143046       unreachable("Invalid hardware generation");
   143047    }
   143048 }
   143049 
   143050 
   143051 
   143052 /* MEDIA_OBJECT_PRT::Media Command Opcode */
   143053 
   143054 
   143055 #define GEN10_MEDIA_OBJECT_PRT_MediaCommandOpcode_bits  3
   143056 #define GEN9_MEDIA_OBJECT_PRT_MediaCommandOpcode_bits  3
   143057 #define GEN8_MEDIA_OBJECT_PRT_MediaCommandOpcode_bits  3
   143058 #define GEN75_MEDIA_OBJECT_PRT_MediaCommandOpcode_bits  3
   143059 #define GEN7_MEDIA_OBJECT_PRT_MediaCommandOpcode_bits  3
   143060 #define GEN6_MEDIA_OBJECT_PRT_MediaCommandOpcode_bits  3
   143061 
   143062 static inline uint32_t ATTRIBUTE_PURE
   143063 MEDIA_OBJECT_PRT_MediaCommandOpcode_bits(const struct gen_device_info *devinfo)
   143064 {
   143065    switch (devinfo->gen) {
   143066    case 10: return 3;
   143067    case 9: return 3;
   143068    case 8: return 3;
   143069    case 7:
   143070       if (devinfo->is_haswell) {
   143071          return 3;
   143072       } else {
   143073          return 3;
   143074       }
   143075    case 6: return 3;
   143076    case 5: return 0;
   143077    case 4:
   143078       if (devinfo->is_g4x) {
   143079          return 0;
   143080       } else {
   143081          return 0;
   143082       }
   143083    default:
   143084       unreachable("Invalid hardware generation");
   143085    }
   143086 }
   143087 
   143088 
   143089 
   143090 #define GEN10_MEDIA_OBJECT_PRT_MediaCommandOpcode_start  24
   143091 #define GEN9_MEDIA_OBJECT_PRT_MediaCommandOpcode_start  24
   143092 #define GEN8_MEDIA_OBJECT_PRT_MediaCommandOpcode_start  24
   143093 #define GEN75_MEDIA_OBJECT_PRT_MediaCommandOpcode_start  24
   143094 #define GEN7_MEDIA_OBJECT_PRT_MediaCommandOpcode_start  24
   143095 #define GEN6_MEDIA_OBJECT_PRT_MediaCommandOpcode_start  24
   143096 
   143097 static inline uint32_t ATTRIBUTE_PURE
   143098 MEDIA_OBJECT_PRT_MediaCommandOpcode_start(const struct gen_device_info *devinfo)
   143099 {
   143100    switch (devinfo->gen) {
   143101    case 10: return 24;
   143102    case 9: return 24;
   143103    case 8: return 24;
   143104    case 7:
   143105       if (devinfo->is_haswell) {
   143106          return 24;
   143107       } else {
   143108          return 24;
   143109       }
   143110    case 6: return 24;
   143111    case 5: return 0;
   143112    case 4:
   143113       if (devinfo->is_g4x) {
   143114          return 0;
   143115       } else {
   143116          return 0;
   143117       }
   143118    default:
   143119       unreachable("Invalid hardware generation");
   143120    }
   143121 }
   143122 
   143123 
   143124 
   143125 /* MEDIA_OBJECT_PRT::PRT_Fence Needed */
   143126 
   143127 
   143128 #define GEN10_MEDIA_OBJECT_PRT_PRT_FenceNeeded_bits  1
   143129 #define GEN9_MEDIA_OBJECT_PRT_PRT_FenceNeeded_bits  1
   143130 #define GEN8_MEDIA_OBJECT_PRT_PRT_FenceNeeded_bits  1
   143131 #define GEN75_MEDIA_OBJECT_PRT_PRT_FenceNeeded_bits  1
   143132 #define GEN7_MEDIA_OBJECT_PRT_PRT_FenceNeeded_bits  1
   143133 #define GEN6_MEDIA_OBJECT_PRT_PRT_FenceNeeded_bits  1
   143134 
   143135 static inline uint32_t ATTRIBUTE_PURE
   143136 MEDIA_OBJECT_PRT_PRT_FenceNeeded_bits(const struct gen_device_info *devinfo)
   143137 {
   143138    switch (devinfo->gen) {
   143139    case 10: return 1;
   143140    case 9: return 1;
   143141    case 8: return 1;
   143142    case 7:
   143143       if (devinfo->is_haswell) {
   143144          return 1;
   143145       } else {
   143146          return 1;
   143147       }
   143148    case 6: return 1;
   143149    case 5: return 0;
   143150    case 4:
   143151       if (devinfo->is_g4x) {
   143152          return 0;
   143153       } else {
   143154          return 0;
   143155       }
   143156    default:
   143157       unreachable("Invalid hardware generation");
   143158    }
   143159 }
   143160 
   143161 
   143162 
   143163 #define GEN10_MEDIA_OBJECT_PRT_PRT_FenceNeeded_start  87
   143164 #define GEN9_MEDIA_OBJECT_PRT_PRT_FenceNeeded_start  87
   143165 #define GEN8_MEDIA_OBJECT_PRT_PRT_FenceNeeded_start  87
   143166 #define GEN75_MEDIA_OBJECT_PRT_PRT_FenceNeeded_start  87
   143167 #define GEN7_MEDIA_OBJECT_PRT_PRT_FenceNeeded_start  87
   143168 #define GEN6_MEDIA_OBJECT_PRT_PRT_FenceNeeded_start  87
   143169 
   143170 static inline uint32_t ATTRIBUTE_PURE
   143171 MEDIA_OBJECT_PRT_PRT_FenceNeeded_start(const struct gen_device_info *devinfo)
   143172 {
   143173    switch (devinfo->gen) {
   143174    case 10: return 87;
   143175    case 9: return 87;
   143176    case 8: return 87;
   143177    case 7:
   143178       if (devinfo->is_haswell) {
   143179          return 87;
   143180       } else {
   143181          return 87;
   143182       }
   143183    case 6: return 87;
   143184    case 5: return 0;
   143185    case 4:
   143186       if (devinfo->is_g4x) {
   143187          return 0;
   143188       } else {
   143189          return 0;
   143190       }
   143191    default:
   143192       unreachable("Invalid hardware generation");
   143193    }
   143194 }
   143195 
   143196 
   143197 
   143198 /* MEDIA_OBJECT_PRT::PRT_FenceType */
   143199 
   143200 
   143201 #define GEN10_MEDIA_OBJECT_PRT_PRT_FenceType_bits  1
   143202 #define GEN9_MEDIA_OBJECT_PRT_PRT_FenceType_bits  1
   143203 #define GEN8_MEDIA_OBJECT_PRT_PRT_FenceType_bits  1
   143204 #define GEN75_MEDIA_OBJECT_PRT_PRT_FenceType_bits  1
   143205 #define GEN7_MEDIA_OBJECT_PRT_PRT_FenceType_bits  1
   143206 #define GEN6_MEDIA_OBJECT_PRT_PRT_FenceType_bits  1
   143207 
   143208 static inline uint32_t ATTRIBUTE_PURE
   143209 MEDIA_OBJECT_PRT_PRT_FenceType_bits(const struct gen_device_info *devinfo)
   143210 {
   143211    switch (devinfo->gen) {
   143212    case 10: return 1;
   143213    case 9: return 1;
   143214    case 8: return 1;
   143215    case 7:
   143216       if (devinfo->is_haswell) {
   143217          return 1;
   143218       } else {
   143219          return 1;
   143220       }
   143221    case 6: return 1;
   143222    case 5: return 0;
   143223    case 4:
   143224       if (devinfo->is_g4x) {
   143225          return 0;
   143226       } else {
   143227          return 0;
   143228       }
   143229    default:
   143230       unreachable("Invalid hardware generation");
   143231    }
   143232 }
   143233 
   143234 
   143235 
   143236 #define GEN10_MEDIA_OBJECT_PRT_PRT_FenceType_start  86
   143237 #define GEN9_MEDIA_OBJECT_PRT_PRT_FenceType_start  86
   143238 #define GEN8_MEDIA_OBJECT_PRT_PRT_FenceType_start  86
   143239 #define GEN75_MEDIA_OBJECT_PRT_PRT_FenceType_start  86
   143240 #define GEN7_MEDIA_OBJECT_PRT_PRT_FenceType_start  86
   143241 #define GEN6_MEDIA_OBJECT_PRT_PRT_FenceType_start  86
   143242 
   143243 static inline uint32_t ATTRIBUTE_PURE
   143244 MEDIA_OBJECT_PRT_PRT_FenceType_start(const struct gen_device_info *devinfo)
   143245 {
   143246    switch (devinfo->gen) {
   143247    case 10: return 86;
   143248    case 9: return 86;
   143249    case 8: return 86;
   143250    case 7:
   143251       if (devinfo->is_haswell) {
   143252          return 86;
   143253       } else {
   143254          return 86;
   143255       }
   143256    case 6: return 86;
   143257    case 5: return 0;
   143258    case 4:
   143259       if (devinfo->is_g4x) {
   143260          return 0;
   143261       } else {
   143262          return 0;
   143263       }
   143264    default:
   143265       unreachable("Invalid hardware generation");
   143266    }
   143267 }
   143268 
   143269 
   143270 
   143271 /* MEDIA_OBJECT_PRT::Pipeline */
   143272 
   143273 
   143274 #define GEN10_MEDIA_OBJECT_PRT_Pipeline_bits  2
   143275 #define GEN9_MEDIA_OBJECT_PRT_Pipeline_bits  2
   143276 #define GEN8_MEDIA_OBJECT_PRT_Pipeline_bits  2
   143277 #define GEN75_MEDIA_OBJECT_PRT_Pipeline_bits  2
   143278 #define GEN7_MEDIA_OBJECT_PRT_Pipeline_bits  2
   143279 #define GEN6_MEDIA_OBJECT_PRT_Pipeline_bits  2
   143280 
   143281 static inline uint32_t ATTRIBUTE_PURE
   143282 MEDIA_OBJECT_PRT_Pipeline_bits(const struct gen_device_info *devinfo)
   143283 {
   143284    switch (devinfo->gen) {
   143285    case 10: return 2;
   143286    case 9: return 2;
   143287    case 8: return 2;
   143288    case 7:
   143289       if (devinfo->is_haswell) {
   143290          return 2;
   143291       } else {
   143292          return 2;
   143293       }
   143294    case 6: return 2;
   143295    case 5: return 0;
   143296    case 4:
   143297       if (devinfo->is_g4x) {
   143298          return 0;
   143299       } else {
   143300          return 0;
   143301       }
   143302    default:
   143303       unreachable("Invalid hardware generation");
   143304    }
   143305 }
   143306 
   143307 
   143308 
   143309 #define GEN10_MEDIA_OBJECT_PRT_Pipeline_start  27
   143310 #define GEN9_MEDIA_OBJECT_PRT_Pipeline_start  27
   143311 #define GEN8_MEDIA_OBJECT_PRT_Pipeline_start  27
   143312 #define GEN75_MEDIA_OBJECT_PRT_Pipeline_start  27
   143313 #define GEN7_MEDIA_OBJECT_PRT_Pipeline_start  27
   143314 #define GEN6_MEDIA_OBJECT_PRT_Pipeline_start  27
   143315 
   143316 static inline uint32_t ATTRIBUTE_PURE
   143317 MEDIA_OBJECT_PRT_Pipeline_start(const struct gen_device_info *devinfo)
   143318 {
   143319    switch (devinfo->gen) {
   143320    case 10: return 27;
   143321    case 9: return 27;
   143322    case 8: return 27;
   143323    case 7:
   143324       if (devinfo->is_haswell) {
   143325          return 27;
   143326       } else {
   143327          return 27;
   143328       }
   143329    case 6: return 27;
   143330    case 5: return 0;
   143331    case 4:
   143332       if (devinfo->is_g4x) {
   143333          return 0;
   143334       } else {
   143335          return 0;
   143336       }
   143337    default:
   143338       unreachable("Invalid hardware generation");
   143339    }
   143340 }
   143341 
   143342 
   143343 
   143344 /* MEDIA_OBJECT_PRT::SubOpcode */
   143345 
   143346 
   143347 #define GEN10_MEDIA_OBJECT_PRT_SubOpcode_bits  8
   143348 #define GEN9_MEDIA_OBJECT_PRT_SubOpcode_bits  8
   143349 #define GEN8_MEDIA_OBJECT_PRT_SubOpcode_bits  8
   143350 #define GEN75_MEDIA_OBJECT_PRT_SubOpcode_bits  8
   143351 #define GEN7_MEDIA_OBJECT_PRT_SubOpcode_bits  8
   143352 #define GEN6_MEDIA_OBJECT_PRT_SubOpcode_bits  8
   143353 
   143354 static inline uint32_t ATTRIBUTE_PURE
   143355 MEDIA_OBJECT_PRT_SubOpcode_bits(const struct gen_device_info *devinfo)
   143356 {
   143357    switch (devinfo->gen) {
   143358    case 10: return 8;
   143359    case 9: return 8;
   143360    case 8: return 8;
   143361    case 7:
   143362       if (devinfo->is_haswell) {
   143363          return 8;
   143364       } else {
   143365          return 8;
   143366       }
   143367    case 6: return 8;
   143368    case 5: return 0;
   143369    case 4:
   143370       if (devinfo->is_g4x) {
   143371          return 0;
   143372       } else {
   143373          return 0;
   143374       }
   143375    default:
   143376       unreachable("Invalid hardware generation");
   143377    }
   143378 }
   143379 
   143380 
   143381 
   143382 #define GEN10_MEDIA_OBJECT_PRT_SubOpcode_start  16
   143383 #define GEN9_MEDIA_OBJECT_PRT_SubOpcode_start  16
   143384 #define GEN8_MEDIA_OBJECT_PRT_SubOpcode_start  16
   143385 #define GEN75_MEDIA_OBJECT_PRT_SubOpcode_start  16
   143386 #define GEN7_MEDIA_OBJECT_PRT_SubOpcode_start  16
   143387 #define GEN6_MEDIA_OBJECT_PRT_SubOpcode_start  16
   143388 
   143389 static inline uint32_t ATTRIBUTE_PURE
   143390 MEDIA_OBJECT_PRT_SubOpcode_start(const struct gen_device_info *devinfo)
   143391 {
   143392    switch (devinfo->gen) {
   143393    case 10: return 16;
   143394    case 9: return 16;
   143395    case 8: return 16;
   143396    case 7:
   143397       if (devinfo->is_haswell) {
   143398          return 16;
   143399       } else {
   143400          return 16;
   143401       }
   143402    case 6: return 16;
   143403    case 5: return 0;
   143404    case 4:
   143405       if (devinfo->is_g4x) {
   143406          return 0;
   143407       } else {
   143408          return 0;
   143409       }
   143410    default:
   143411       unreachable("Invalid hardware generation");
   143412    }
   143413 }
   143414 
   143415 
   143416 
   143417 /* MEDIA_OBJECT_WALKER */
   143418 
   143419 
   143420 
   143421 
   143422 
   143423 /* MEDIA_OBJECT_WALKER::Block Resolution X */
   143424 
   143425 
   143426 #define GEN10_MEDIA_OBJECT_WALKER_BlockResolutionX_bits  11
   143427 #define GEN9_MEDIA_OBJECT_WALKER_BlockResolutionX_bits  11
   143428 #define GEN8_MEDIA_OBJECT_WALKER_BlockResolutionX_bits  9
   143429 #define GEN75_MEDIA_OBJECT_WALKER_BlockResolutionX_bits  9
   143430 #define GEN7_MEDIA_OBJECT_WALKER_BlockResolutionX_bits  9
   143431 #define GEN6_MEDIA_OBJECT_WALKER_BlockResolutionX_bits  9
   143432 
   143433 static inline uint32_t ATTRIBUTE_PURE
   143434 MEDIA_OBJECT_WALKER_BlockResolutionX_bits(const struct gen_device_info *devinfo)
   143435 {
   143436    switch (devinfo->gen) {
   143437    case 10: return 11;
   143438    case 9: return 11;
   143439    case 8: return 9;
   143440    case 7:
   143441       if (devinfo->is_haswell) {
   143442          return 9;
   143443       } else {
   143444          return 9;
   143445       }
   143446    case 6: return 9;
   143447    case 5: return 0;
   143448    case 4:
   143449       if (devinfo->is_g4x) {
   143450          return 0;
   143451       } else {
   143452          return 0;
   143453       }
   143454    default:
   143455       unreachable("Invalid hardware generation");
   143456    }
   143457 }
   143458 
   143459 
   143460 
   143461 #define GEN10_MEDIA_OBJECT_WALKER_BlockResolutionX_start  256
   143462 #define GEN9_MEDIA_OBJECT_WALKER_BlockResolutionX_start  256
   143463 #define GEN8_MEDIA_OBJECT_WALKER_BlockResolutionX_start  256
   143464 #define GEN75_MEDIA_OBJECT_WALKER_BlockResolutionX_start  256
   143465 #define GEN7_MEDIA_OBJECT_WALKER_BlockResolutionX_start  256
   143466 #define GEN6_MEDIA_OBJECT_WALKER_BlockResolutionX_start  256
   143467 
   143468 static inline uint32_t ATTRIBUTE_PURE
   143469 MEDIA_OBJECT_WALKER_BlockResolutionX_start(const struct gen_device_info *devinfo)
   143470 {
   143471    switch (devinfo->gen) {
   143472    case 10: return 256;
   143473    case 9: return 256;
   143474    case 8: return 256;
   143475    case 7:
   143476       if (devinfo->is_haswell) {
   143477          return 256;
   143478       } else {
   143479          return 256;
   143480       }
   143481    case 6: return 256;
   143482    case 5: return 0;
   143483    case 4:
   143484       if (devinfo->is_g4x) {
   143485          return 0;
   143486       } else {
   143487          return 0;
   143488       }
   143489    default:
   143490       unreachable("Invalid hardware generation");
   143491    }
   143492 }
   143493 
   143494 
   143495 
   143496 /* MEDIA_OBJECT_WALKER::Block Resolution Y */
   143497 
   143498 
   143499 #define GEN10_MEDIA_OBJECT_WALKER_BlockResolutionY_bits  11
   143500 #define GEN9_MEDIA_OBJECT_WALKER_BlockResolutionY_bits  11
   143501 #define GEN8_MEDIA_OBJECT_WALKER_BlockResolutionY_bits  9
   143502 #define GEN75_MEDIA_OBJECT_WALKER_BlockResolutionY_bits  9
   143503 #define GEN7_MEDIA_OBJECT_WALKER_BlockResolutionY_bits  9
   143504 #define GEN6_MEDIA_OBJECT_WALKER_BlockResolutionY_bits  9
   143505 
   143506 static inline uint32_t ATTRIBUTE_PURE
   143507 MEDIA_OBJECT_WALKER_BlockResolutionY_bits(const struct gen_device_info *devinfo)
   143508 {
   143509    switch (devinfo->gen) {
   143510    case 10: return 11;
   143511    case 9: return 11;
   143512    case 8: return 9;
   143513    case 7:
   143514       if (devinfo->is_haswell) {
   143515          return 9;
   143516       } else {
   143517          return 9;
   143518       }
   143519    case 6: return 9;
   143520    case 5: return 0;
   143521    case 4:
   143522       if (devinfo->is_g4x) {
   143523          return 0;
   143524       } else {
   143525          return 0;
   143526       }
   143527    default:
   143528       unreachable("Invalid hardware generation");
   143529    }
   143530 }
   143531 
   143532 
   143533 
   143534 #define GEN10_MEDIA_OBJECT_WALKER_BlockResolutionY_start  272
   143535 #define GEN9_MEDIA_OBJECT_WALKER_BlockResolutionY_start  272
   143536 #define GEN8_MEDIA_OBJECT_WALKER_BlockResolutionY_start  272
   143537 #define GEN75_MEDIA_OBJECT_WALKER_BlockResolutionY_start  272
   143538 #define GEN7_MEDIA_OBJECT_WALKER_BlockResolutionY_start  272
   143539 #define GEN6_MEDIA_OBJECT_WALKER_BlockResolutionY_start  272
   143540 
   143541 static inline uint32_t ATTRIBUTE_PURE
   143542 MEDIA_OBJECT_WALKER_BlockResolutionY_start(const struct gen_device_info *devinfo)
   143543 {
   143544    switch (devinfo->gen) {
   143545    case 10: return 272;
   143546    case 9: return 272;
   143547    case 8: return 272;
   143548    case 7:
   143549       if (devinfo->is_haswell) {
   143550          return 272;
   143551       } else {
   143552          return 272;
   143553       }
   143554    case 6: return 272;
   143555    case 5: return 0;
   143556    case 4:
   143557       if (devinfo->is_g4x) {
   143558          return 0;
   143559       } else {
   143560          return 0;
   143561       }
   143562    default:
   143563       unreachable("Invalid hardware generation");
   143564    }
   143565 }
   143566 
   143567 
   143568 
   143569 /* MEDIA_OBJECT_WALKER::Children Present */
   143570 
   143571 
   143572 #define GEN8_MEDIA_OBJECT_WALKER_ChildrenPresent_bits  1
   143573 #define GEN75_MEDIA_OBJECT_WALKER_ChildrenPresent_bits  1
   143574 #define GEN7_MEDIA_OBJECT_WALKER_ChildrenPresent_bits  1
   143575 #define GEN6_MEDIA_OBJECT_WALKER_ChildrenPresent_bits  1
   143576 
   143577 static inline uint32_t ATTRIBUTE_PURE
   143578 MEDIA_OBJECT_WALKER_ChildrenPresent_bits(const struct gen_device_info *devinfo)
   143579 {
   143580    switch (devinfo->gen) {
   143581    case 10: return 0;
   143582    case 9: return 0;
   143583    case 8: return 1;
   143584    case 7:
   143585       if (devinfo->is_haswell) {
   143586          return 1;
   143587       } else {
   143588          return 1;
   143589       }
   143590    case 6: return 1;
   143591    case 5: return 0;
   143592    case 4:
   143593       if (devinfo->is_g4x) {
   143594          return 0;
   143595       } else {
   143596          return 0;
   143597       }
   143598    default:
   143599       unreachable("Invalid hardware generation");
   143600    }
   143601 }
   143602 
   143603 
   143604 
   143605 #define GEN8_MEDIA_OBJECT_WALKER_ChildrenPresent_start  95
   143606 #define GEN75_MEDIA_OBJECT_WALKER_ChildrenPresent_start  95
   143607 #define GEN7_MEDIA_OBJECT_WALKER_ChildrenPresent_start  95
   143608 #define GEN6_MEDIA_OBJECT_WALKER_ChildrenPresent_start  95
   143609 
   143610 static inline uint32_t ATTRIBUTE_PURE
   143611 MEDIA_OBJECT_WALKER_ChildrenPresent_start(const struct gen_device_info *devinfo)
   143612 {
   143613    switch (devinfo->gen) {
   143614    case 10: return 0;
   143615    case 9: return 0;
   143616    case 8: return 95;
   143617    case 7:
   143618       if (devinfo->is_haswell) {
   143619          return 95;
   143620       } else {
   143621          return 95;
   143622       }
   143623    case 6: return 95;
   143624    case 5: return 0;
   143625    case 4:
   143626       if (devinfo->is_g4x) {
   143627          return 0;
   143628       } else {
   143629          return 0;
   143630       }
   143631    default:
   143632       unreachable("Invalid hardware generation");
   143633    }
   143634 }
   143635 
   143636 
   143637 
   143638 /* MEDIA_OBJECT_WALKER::Color Count Minus One */
   143639 
   143640 
   143641 #define GEN10_MEDIA_OBJECT_WALKER_ColorCountMinusOne_bits  4
   143642 #define GEN9_MEDIA_OBJECT_WALKER_ColorCountMinusOne_bits  4
   143643 #define GEN8_MEDIA_OBJECT_WALKER_ColorCountMinusOne_bits  4
   143644 #define GEN75_MEDIA_OBJECT_WALKER_ColorCountMinusOne_bits  4
   143645 #define GEN7_MEDIA_OBJECT_WALKER_ColorCountMinusOne_bits  4
   143646 #define GEN6_MEDIA_OBJECT_WALKER_ColorCountMinusOne_bits  4
   143647 
   143648 static inline uint32_t ATTRIBUTE_PURE
   143649 MEDIA_OBJECT_WALKER_ColorCountMinusOne_bits(const struct gen_device_info *devinfo)
   143650 {
   143651    switch (devinfo->gen) {
   143652    case 10: return 4;
   143653    case 9: return 4;
   143654    case 8: return 4;
   143655    case 7:
   143656       if (devinfo->is_haswell) {
   143657          return 4;
   143658       } else {
   143659          return 4;
   143660       }
   143661    case 6: return 4;
   143662    case 5: return 0;
   143663    case 4:
   143664       if (devinfo->is_g4x) {
   143665          return 0;
   143666       } else {
   143667          return 0;
   143668       }
   143669    default:
   143670       unreachable("Invalid hardware generation");
   143671    }
   143672 }
   143673 
   143674 
   143675 
   143676 #define GEN10_MEDIA_OBJECT_WALKER_ColorCountMinusOne_start  216
   143677 #define GEN9_MEDIA_OBJECT_WALKER_ColorCountMinusOne_start  216
   143678 #define GEN8_MEDIA_OBJECT_WALKER_ColorCountMinusOne_start  216
   143679 #define GEN75_MEDIA_OBJECT_WALKER_ColorCountMinusOne_start  216
   143680 #define GEN7_MEDIA_OBJECT_WALKER_ColorCountMinusOne_start  216
   143681 #define GEN6_MEDIA_OBJECT_WALKER_ColorCountMinusOne_start  216
   143682 
   143683 static inline uint32_t ATTRIBUTE_PURE
   143684 MEDIA_OBJECT_WALKER_ColorCountMinusOne_start(const struct gen_device_info *devinfo)
   143685 {
   143686    switch (devinfo->gen) {
   143687    case 10: return 216;
   143688    case 9: return 216;
   143689    case 8: return 216;
   143690    case 7:
   143691       if (devinfo->is_haswell) {
   143692          return 216;
   143693       } else {
   143694          return 216;
   143695       }
   143696    case 6: return 216;
   143697    case 5: return 0;
   143698    case 4:
   143699       if (devinfo->is_g4x) {
   143700          return 0;
   143701       } else {
   143702          return 0;
   143703       }
   143704    default:
   143705       unreachable("Invalid hardware generation");
   143706    }
   143707 }
   143708 
   143709 
   143710 
   143711 /* MEDIA_OBJECT_WALKER::Command Type */
   143712 
   143713 
   143714 #define GEN10_MEDIA_OBJECT_WALKER_CommandType_bits  3
   143715 #define GEN9_MEDIA_OBJECT_WALKER_CommandType_bits  3
   143716 #define GEN8_MEDIA_OBJECT_WALKER_CommandType_bits  3
   143717 #define GEN75_MEDIA_OBJECT_WALKER_CommandType_bits  3
   143718 #define GEN7_MEDIA_OBJECT_WALKER_CommandType_bits  3
   143719 #define GEN6_MEDIA_OBJECT_WALKER_CommandType_bits  3
   143720 
   143721 static inline uint32_t ATTRIBUTE_PURE
   143722 MEDIA_OBJECT_WALKER_CommandType_bits(const struct gen_device_info *devinfo)
   143723 {
   143724    switch (devinfo->gen) {
   143725    case 10: return 3;
   143726    case 9: return 3;
   143727    case 8: return 3;
   143728    case 7:
   143729       if (devinfo->is_haswell) {
   143730          return 3;
   143731       } else {
   143732          return 3;
   143733       }
   143734    case 6: return 3;
   143735    case 5: return 0;
   143736    case 4:
   143737       if (devinfo->is_g4x) {
   143738          return 0;
   143739       } else {
   143740          return 0;
   143741       }
   143742    default:
   143743       unreachable("Invalid hardware generation");
   143744    }
   143745 }
   143746 
   143747 
   143748 
   143749 #define GEN10_MEDIA_OBJECT_WALKER_CommandType_start  29
   143750 #define GEN9_MEDIA_OBJECT_WALKER_CommandType_start  29
   143751 #define GEN8_MEDIA_OBJECT_WALKER_CommandType_start  29
   143752 #define GEN75_MEDIA_OBJECT_WALKER_CommandType_start  29
   143753 #define GEN7_MEDIA_OBJECT_WALKER_CommandType_start  29
   143754 #define GEN6_MEDIA_OBJECT_WALKER_CommandType_start  29
   143755 
   143756 static inline uint32_t ATTRIBUTE_PURE
   143757 MEDIA_OBJECT_WALKER_CommandType_start(const struct gen_device_info *devinfo)
   143758 {
   143759    switch (devinfo->gen) {
   143760    case 10: return 29;
   143761    case 9: return 29;
   143762    case 8: return 29;
   143763    case 7:
   143764       if (devinfo->is_haswell) {
   143765          return 29;
   143766       } else {
   143767          return 29;
   143768       }
   143769    case 6: return 29;
   143770    case 5: return 0;
   143771    case 4:
   143772       if (devinfo->is_g4x) {
   143773          return 0;
   143774       } else {
   143775          return 0;
   143776       }
   143777    default:
   143778       unreachable("Invalid hardware generation");
   143779    }
   143780 }
   143781 
   143782 
   143783 
   143784 /* MEDIA_OBJECT_WALKER::DWord Length */
   143785 
   143786 
   143787 #define GEN10_MEDIA_OBJECT_WALKER_DWordLength_bits  15
   143788 #define GEN9_MEDIA_OBJECT_WALKER_DWordLength_bits  16
   143789 #define GEN8_MEDIA_OBJECT_WALKER_DWordLength_bits  16
   143790 #define GEN75_MEDIA_OBJECT_WALKER_DWordLength_bits  16
   143791 #define GEN7_MEDIA_OBJECT_WALKER_DWordLength_bits  16
   143792 #define GEN6_MEDIA_OBJECT_WALKER_DWordLength_bits  16
   143793 
   143794 static inline uint32_t ATTRIBUTE_PURE
   143795 MEDIA_OBJECT_WALKER_DWordLength_bits(const struct gen_device_info *devinfo)
   143796 {
   143797    switch (devinfo->gen) {
   143798    case 10: return 15;
   143799    case 9: return 16;
   143800    case 8: return 16;
   143801    case 7:
   143802       if (devinfo->is_haswell) {
   143803          return 16;
   143804       } else {
   143805          return 16;
   143806       }
   143807    case 6: return 16;
   143808    case 5: return 0;
   143809    case 4:
   143810       if (devinfo->is_g4x) {
   143811          return 0;
   143812       } else {
   143813          return 0;
   143814       }
   143815    default:
   143816       unreachable("Invalid hardware generation");
   143817    }
   143818 }
   143819 
   143820 
   143821 
   143822 #define GEN10_MEDIA_OBJECT_WALKER_DWordLength_start  0
   143823 #define GEN9_MEDIA_OBJECT_WALKER_DWordLength_start  0
   143824 #define GEN8_MEDIA_OBJECT_WALKER_DWordLength_start  0
   143825 #define GEN75_MEDIA_OBJECT_WALKER_DWordLength_start  0
   143826 #define GEN7_MEDIA_OBJECT_WALKER_DWordLength_start  0
   143827 #define GEN6_MEDIA_OBJECT_WALKER_DWordLength_start  0
   143828 
   143829 static inline uint32_t ATTRIBUTE_PURE
   143830 MEDIA_OBJECT_WALKER_DWordLength_start(const struct gen_device_info *devinfo)
   143831 {
   143832    switch (devinfo->gen) {
   143833    case 10: return 0;
   143834    case 9: return 0;
   143835    case 8: return 0;
   143836    case 7:
   143837       if (devinfo->is_haswell) {
   143838          return 0;
   143839       } else {
   143840          return 0;
   143841       }
   143842    case 6: return 0;
   143843    case 5: return 0;
   143844    case 4:
   143845       if (devinfo->is_g4x) {
   143846          return 0;
   143847       } else {
   143848          return 0;
   143849       }
   143850    default:
   143851       unreachable("Invalid hardware generation");
   143852    }
   143853 }
   143854 
   143855 
   143856 
   143857 /* MEDIA_OBJECT_WALKER::Dual Mode */
   143858 
   143859 
   143860 #define GEN75_MEDIA_OBJECT_WALKER_DualMode_bits  1
   143861 #define GEN7_MEDIA_OBJECT_WALKER_DualMode_bits  1
   143862 #define GEN6_MEDIA_OBJECT_WALKER_DualMode_bits  1
   143863 
   143864 static inline uint32_t ATTRIBUTE_PURE
   143865 MEDIA_OBJECT_WALKER_DualMode_bits(const struct gen_device_info *devinfo)
   143866 {
   143867    switch (devinfo->gen) {
   143868    case 10: return 0;
   143869    case 9: return 0;
   143870    case 8: return 0;
   143871    case 7:
   143872       if (devinfo->is_haswell) {
   143873          return 1;
   143874       } else {
   143875          return 1;
   143876       }
   143877    case 6: return 1;
   143878    case 5: return 0;
   143879    case 4:
   143880       if (devinfo->is_g4x) {
   143881          return 0;
   143882       } else {
   143883          return 0;
   143884       }
   143885    default:
   143886       unreachable("Invalid hardware generation");
   143887    }
   143888 }
   143889 
   143890 
   143891 
   143892 #define GEN75_MEDIA_OBJECT_WALKER_DualMode_start  223
   143893 #define GEN7_MEDIA_OBJECT_WALKER_DualMode_start  223
   143894 #define GEN6_MEDIA_OBJECT_WALKER_DualMode_start  223
   143895 
   143896 static inline uint32_t ATTRIBUTE_PURE
   143897 MEDIA_OBJECT_WALKER_DualMode_start(const struct gen_device_info *devinfo)
   143898 {
   143899    switch (devinfo->gen) {
   143900    case 10: return 0;
   143901    case 9: return 0;
   143902    case 8: return 0;
   143903    case 7:
   143904       if (devinfo->is_haswell) {
   143905          return 223;
   143906       } else {
   143907          return 223;
   143908       }
   143909    case 6: return 223;
   143910    case 5: return 0;
   143911    case 4:
   143912       if (devinfo->is_g4x) {
   143913          return 0;
   143914       } else {
   143915          return 0;
   143916       }
   143917    default:
   143918       unreachable("Invalid hardware generation");
   143919    }
   143920 }
   143921 
   143922 
   143923 
   143924 /* MEDIA_OBJECT_WALKER::Global Inner Loop Unit X */
   143925 
   143926 
   143927 #define GEN10_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitX_bits  12
   143928 #define GEN9_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitX_bits  12
   143929 #define GEN8_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitX_bits  10
   143930 #define GEN75_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitX_bits  10
   143931 #define GEN7_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitX_bits  10
   143932 #define GEN6_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitX_bits  10
   143933 
   143934 static inline uint32_t ATTRIBUTE_PURE
   143935 MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitX_bits(const struct gen_device_info *devinfo)
   143936 {
   143937    switch (devinfo->gen) {
   143938    case 10: return 12;
   143939    case 9: return 12;
   143940    case 8: return 10;
   143941    case 7:
   143942       if (devinfo->is_haswell) {
   143943          return 10;
   143944       } else {
   143945          return 10;
   143946       }
   143947    case 6: return 10;
   143948    case 5: return 0;
   143949    case 4:
   143950       if (devinfo->is_g4x) {
   143951          return 0;
   143952       } else {
   143953          return 0;
   143954       }
   143955    default:
   143956       unreachable("Invalid hardware generation");
   143957    }
   143958 }
   143959 
   143960 
   143961 
   143962 #define GEN10_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitX_start  512
   143963 #define GEN9_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitX_start  512
   143964 #define GEN8_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitX_start  512
   143965 #define GEN75_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitX_start  512
   143966 #define GEN7_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitX_start  512
   143967 #define GEN6_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitX_start  512
   143968 
   143969 static inline uint32_t ATTRIBUTE_PURE
   143970 MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitX_start(const struct gen_device_info *devinfo)
   143971 {
   143972    switch (devinfo->gen) {
   143973    case 10: return 512;
   143974    case 9: return 512;
   143975    case 8: return 512;
   143976    case 7:
   143977       if (devinfo->is_haswell) {
   143978          return 512;
   143979       } else {
   143980          return 512;
   143981       }
   143982    case 6: return 512;
   143983    case 5: return 0;
   143984    case 4:
   143985       if (devinfo->is_g4x) {
   143986          return 0;
   143987       } else {
   143988          return 0;
   143989       }
   143990    default:
   143991       unreachable("Invalid hardware generation");
   143992    }
   143993 }
   143994 
   143995 
   143996 
   143997 /* MEDIA_OBJECT_WALKER::Global Inner Loop Unit Y */
   143998 
   143999 
   144000 #define GEN10_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitY_bits  12
   144001 #define GEN9_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitY_bits  12
   144002 #define GEN8_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitY_bits  10
   144003 #define GEN75_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitY_bits  10
   144004 #define GEN7_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitY_bits  10
   144005 #define GEN6_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitY_bits  10
   144006 
   144007 static inline uint32_t ATTRIBUTE_PURE
   144008 MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitY_bits(const struct gen_device_info *devinfo)
   144009 {
   144010    switch (devinfo->gen) {
   144011    case 10: return 12;
   144012    case 9: return 12;
   144013    case 8: return 10;
   144014    case 7:
   144015       if (devinfo->is_haswell) {
   144016          return 10;
   144017       } else {
   144018          return 10;
   144019       }
   144020    case 6: return 10;
   144021    case 5: return 0;
   144022    case 4:
   144023       if (devinfo->is_g4x) {
   144024          return 0;
   144025       } else {
   144026          return 0;
   144027       }
   144028    default:
   144029       unreachable("Invalid hardware generation");
   144030    }
   144031 }
   144032 
   144033 
   144034 
   144035 #define GEN10_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitY_start  528
   144036 #define GEN9_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitY_start  528
   144037 #define GEN8_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitY_start  528
   144038 #define GEN75_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitY_start  528
   144039 #define GEN7_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitY_start  528
   144040 #define GEN6_MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitY_start  528
   144041 
   144042 static inline uint32_t ATTRIBUTE_PURE
   144043 MEDIA_OBJECT_WALKER_GlobalInnerLoopUnitY_start(const struct gen_device_info *devinfo)
   144044 {
   144045    switch (devinfo->gen) {
   144046    case 10: return 528;
   144047    case 9: return 528;
   144048    case 8: return 528;
   144049    case 7:
   144050       if (devinfo->is_haswell) {
   144051          return 528;
   144052       } else {
   144053          return 528;
   144054       }
   144055    case 6: return 528;
   144056    case 5: return 0;
   144057    case 4:
   144058       if (devinfo->is_g4x) {
   144059          return 0;
   144060       } else {
   144061          return 0;
   144062       }
   144063    default:
   144064       unreachable("Invalid hardware generation");
   144065    }
   144066 }
   144067 
   144068 
   144069 
   144070 /* MEDIA_OBJECT_WALKER::Global Loop Exec Count */
   144071 
   144072 
   144073 #define GEN10_MEDIA_OBJECT_WALKER_GlobalLoopExecCount_bits  12
   144074 #define GEN9_MEDIA_OBJECT_WALKER_GlobalLoopExecCount_bits  12
   144075 #define GEN8_MEDIA_OBJECT_WALKER_GlobalLoopExecCount_bits  10
   144076 #define GEN75_MEDIA_OBJECT_WALKER_GlobalLoopExecCount_bits  10
   144077 #define GEN7_MEDIA_OBJECT_WALKER_GlobalLoopExecCount_bits  10
   144078 #define GEN6_MEDIA_OBJECT_WALKER_GlobalLoopExecCount_bits  10
   144079 
   144080 static inline uint32_t ATTRIBUTE_PURE
   144081 MEDIA_OBJECT_WALKER_GlobalLoopExecCount_bits(const struct gen_device_info *devinfo)
   144082 {
   144083    switch (devinfo->gen) {
   144084    case 10: return 12;
   144085    case 9: return 12;
   144086    case 8: return 10;
   144087    case 7:
   144088       if (devinfo->is_haswell) {
   144089          return 10;
   144090       } else {
   144091          return 10;
   144092       }
   144093    case 6: return 10;
   144094    case 5: return 0;
   144095    case 4:
   144096       if (devinfo->is_g4x) {
   144097          return 0;
   144098       } else {
   144099          return 0;
   144100       }
   144101    default:
   144102       unreachable("Invalid hardware generation");
   144103    }
   144104 }
   144105 
   144106 
   144107 
   144108 #define GEN10_MEDIA_OBJECT_WALKER_GlobalLoopExecCount_start  240
   144109 #define GEN9_MEDIA_OBJECT_WALKER_GlobalLoopExecCount_start  240
   144110 #define GEN8_MEDIA_OBJECT_WALKER_GlobalLoopExecCount_start  240
   144111 #define GEN75_MEDIA_OBJECT_WALKER_GlobalLoopExecCount_start  240
   144112 #define GEN7_MEDIA_OBJECT_WALKER_GlobalLoopExecCount_start  240
   144113 #define GEN6_MEDIA_OBJECT_WALKER_GlobalLoopExecCount_start  240
   144114 
   144115 static inline uint32_t ATTRIBUTE_PURE
   144116 MEDIA_OBJECT_WALKER_GlobalLoopExecCount_start(const struct gen_device_info *devinfo)
   144117 {
   144118    switch (devinfo->gen) {
   144119    case 10: return 240;
   144120    case 9: return 240;
   144121    case 8: return 240;
   144122    case 7:
   144123       if (devinfo->is_haswell) {
   144124          return 240;
   144125       } else {
   144126          return 240;
   144127       }
   144128    case 6: return 240;
   144129    case 5: return 0;
   144130    case 4:
   144131       if (devinfo->is_g4x) {
   144132          return 0;
   144133       } else {
   144134          return 0;
   144135       }
   144136    default:
   144137       unreachable("Invalid hardware generation");
   144138    }
   144139 }
   144140 
   144141 
   144142 
   144143 /* MEDIA_OBJECT_WALKER::Global Outer Loop Stride X */
   144144 
   144145 
   144146 #define GEN10_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideX_bits  12
   144147 #define GEN9_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideX_bits  12
   144148 #define GEN8_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideX_bits  10
   144149 #define GEN75_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideX_bits  10
   144150 #define GEN7_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideX_bits  10
   144151 #define GEN6_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideX_bits  10
   144152 
   144153 static inline uint32_t ATTRIBUTE_PURE
   144154 MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideX_bits(const struct gen_device_info *devinfo)
   144155 {
   144156    switch (devinfo->gen) {
   144157    case 10: return 12;
   144158    case 9: return 12;
   144159    case 8: return 10;
   144160    case 7:
   144161       if (devinfo->is_haswell) {
   144162          return 10;
   144163       } else {
   144164          return 10;
   144165       }
   144166    case 6: return 10;
   144167    case 5: return 0;
   144168    case 4:
   144169       if (devinfo->is_g4x) {
   144170          return 0;
   144171       } else {
   144172          return 0;
   144173       }
   144174    default:
   144175       unreachable("Invalid hardware generation");
   144176    }
   144177 }
   144178 
   144179 
   144180 
   144181 #define GEN10_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideX_start  480
   144182 #define GEN9_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideX_start  480
   144183 #define GEN8_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideX_start  480
   144184 #define GEN75_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideX_start  480
   144185 #define GEN7_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideX_start  480
   144186 #define GEN6_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideX_start  480
   144187 
   144188 static inline uint32_t ATTRIBUTE_PURE
   144189 MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideX_start(const struct gen_device_info *devinfo)
   144190 {
   144191    switch (devinfo->gen) {
   144192    case 10: return 480;
   144193    case 9: return 480;
   144194    case 8: return 480;
   144195    case 7:
   144196       if (devinfo->is_haswell) {
   144197          return 480;
   144198       } else {
   144199          return 480;
   144200       }
   144201    case 6: return 480;
   144202    case 5: return 0;
   144203    case 4:
   144204       if (devinfo->is_g4x) {
   144205          return 0;
   144206       } else {
   144207          return 0;
   144208       }
   144209    default:
   144210       unreachable("Invalid hardware generation");
   144211    }
   144212 }
   144213 
   144214 
   144215 
   144216 /* MEDIA_OBJECT_WALKER::Global Outer Loop Stride Y */
   144217 
   144218 
   144219 #define GEN10_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideY_bits  12
   144220 #define GEN9_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideY_bits  12
   144221 #define GEN8_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideY_bits  10
   144222 #define GEN75_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideY_bits  10
   144223 #define GEN7_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideY_bits  10
   144224 #define GEN6_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideY_bits  10
   144225 
   144226 static inline uint32_t ATTRIBUTE_PURE
   144227 MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideY_bits(const struct gen_device_info *devinfo)
   144228 {
   144229    switch (devinfo->gen) {
   144230    case 10: return 12;
   144231    case 9: return 12;
   144232    case 8: return 10;
   144233    case 7:
   144234       if (devinfo->is_haswell) {
   144235          return 10;
   144236       } else {
   144237          return 10;
   144238       }
   144239    case 6: return 10;
   144240    case 5: return 0;
   144241    case 4:
   144242       if (devinfo->is_g4x) {
   144243          return 0;
   144244       } else {
   144245          return 0;
   144246       }
   144247    default:
   144248       unreachable("Invalid hardware generation");
   144249    }
   144250 }
   144251 
   144252 
   144253 
   144254 #define GEN10_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideY_start  496
   144255 #define GEN9_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideY_start  496
   144256 #define GEN8_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideY_start  496
   144257 #define GEN75_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideY_start  496
   144258 #define GEN7_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideY_start  496
   144259 #define GEN6_MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideY_start  496
   144260 
   144261 static inline uint32_t ATTRIBUTE_PURE
   144262 MEDIA_OBJECT_WALKER_GlobalOuterLoopStrideY_start(const struct gen_device_info *devinfo)
   144263 {
   144264    switch (devinfo->gen) {
   144265    case 10: return 496;
   144266    case 9: return 496;
   144267    case 8: return 496;
   144268    case 7:
   144269       if (devinfo->is_haswell) {
   144270          return 496;
   144271       } else {
   144272          return 496;
   144273       }
   144274    case 6: return 496;
   144275    case 5: return 0;
   144276    case 4:
   144277       if (devinfo->is_g4x) {
   144278          return 0;
   144279       } else {
   144280          return 0;
   144281       }
   144282    default:
   144283       unreachable("Invalid hardware generation");
   144284    }
   144285 }
   144286 
   144287 
   144288 
   144289 /* MEDIA_OBJECT_WALKER::Global Resolution X */
   144290 
   144291 
   144292 #define GEN10_MEDIA_OBJECT_WALKER_GlobalResolutionX_bits  11
   144293 #define GEN9_MEDIA_OBJECT_WALKER_GlobalResolutionX_bits  11
   144294 #define GEN8_MEDIA_OBJECT_WALKER_GlobalResolutionX_bits  9
   144295 #define GEN75_MEDIA_OBJECT_WALKER_GlobalResolutionX_bits  9
   144296 #define GEN7_MEDIA_OBJECT_WALKER_GlobalResolutionX_bits  9
   144297 #define GEN6_MEDIA_OBJECT_WALKER_GlobalResolutionX_bits  9
   144298 
   144299 static inline uint32_t ATTRIBUTE_PURE
   144300 MEDIA_OBJECT_WALKER_GlobalResolutionX_bits(const struct gen_device_info *devinfo)
   144301 {
   144302    switch (devinfo->gen) {
   144303    case 10: return 11;
   144304    case 9: return 11;
   144305    case 8: return 9;
   144306    case 7:
   144307       if (devinfo->is_haswell) {
   144308          return 9;
   144309       } else {
   144310          return 9;
   144311       }
   144312    case 6: return 9;
   144313    case 5: return 0;
   144314    case 4:
   144315       if (devinfo->is_g4x) {
   144316          return 0;
   144317       } else {
   144318          return 0;
   144319       }
   144320    default:
   144321       unreachable("Invalid hardware generation");
   144322    }
   144323 }
   144324 
   144325 
   144326 
   144327 #define GEN10_MEDIA_OBJECT_WALKER_GlobalResolutionX_start  416
   144328 #define GEN9_MEDIA_OBJECT_WALKER_GlobalResolutionX_start  416
   144329 #define GEN8_MEDIA_OBJECT_WALKER_GlobalResolutionX_start  416
   144330 #define GEN75_MEDIA_OBJECT_WALKER_GlobalResolutionX_start  416
   144331 #define GEN7_MEDIA_OBJECT_WALKER_GlobalResolutionX_start  416
   144332 #define GEN6_MEDIA_OBJECT_WALKER_GlobalResolutionX_start  416
   144333 
   144334 static inline uint32_t ATTRIBUTE_PURE
   144335 MEDIA_OBJECT_WALKER_GlobalResolutionX_start(const struct gen_device_info *devinfo)
   144336 {
   144337    switch (devinfo->gen) {
   144338    case 10: return 416;
   144339    case 9: return 416;
   144340    case 8: return 416;
   144341    case 7:
   144342       if (devinfo->is_haswell) {
   144343          return 416;
   144344       } else {
   144345          return 416;
   144346       }
   144347    case 6: return 416;
   144348    case 5: return 0;
   144349    case 4:
   144350       if (devinfo->is_g4x) {
   144351          return 0;
   144352       } else {
   144353          return 0;
   144354       }
   144355    default:
   144356       unreachable("Invalid hardware generation");
   144357    }
   144358 }
   144359 
   144360 
   144361 
   144362 /* MEDIA_OBJECT_WALKER::Global Resolution Y */
   144363 
   144364 
   144365 #define GEN10_MEDIA_OBJECT_WALKER_GlobalResolutionY_bits  11
   144366 #define GEN9_MEDIA_OBJECT_WALKER_GlobalResolutionY_bits  11
   144367 #define GEN8_MEDIA_OBJECT_WALKER_GlobalResolutionY_bits  9
   144368 #define GEN75_MEDIA_OBJECT_WALKER_GlobalResolutionY_bits  9
   144369 #define GEN7_MEDIA_OBJECT_WALKER_GlobalResolutionY_bits  9
   144370 #define GEN6_MEDIA_OBJECT_WALKER_GlobalResolutionY_bits  9
   144371 
   144372 static inline uint32_t ATTRIBUTE_PURE
   144373 MEDIA_OBJECT_WALKER_GlobalResolutionY_bits(const struct gen_device_info *devinfo)
   144374 {
   144375    switch (devinfo->gen) {
   144376    case 10: return 11;
   144377    case 9: return 11;
   144378    case 8: return 9;
   144379    case 7:
   144380       if (devinfo->is_haswell) {
   144381          return 9;
   144382       } else {
   144383          return 9;
   144384       }
   144385    case 6: return 9;
   144386    case 5: return 0;
   144387    case 4:
   144388       if (devinfo->is_g4x) {
   144389          return 0;
   144390       } else {
   144391          return 0;
   144392       }
   144393    default:
   144394       unreachable("Invalid hardware generation");
   144395    }
   144396 }
   144397 
   144398 
   144399 
   144400 #define GEN10_MEDIA_OBJECT_WALKER_GlobalResolutionY_start  432
   144401 #define GEN9_MEDIA_OBJECT_WALKER_GlobalResolutionY_start  432
   144402 #define GEN8_MEDIA_OBJECT_WALKER_GlobalResolutionY_start  432
   144403 #define GEN75_MEDIA_OBJECT_WALKER_GlobalResolutionY_start  432
   144404 #define GEN7_MEDIA_OBJECT_WALKER_GlobalResolutionY_start  432
   144405 #define GEN6_MEDIA_OBJECT_WALKER_GlobalResolutionY_start  432
   144406 
   144407 static inline uint32_t ATTRIBUTE_PURE
   144408 MEDIA_OBJECT_WALKER_GlobalResolutionY_start(const struct gen_device_info *devinfo)
   144409 {
   144410    switch (devinfo->gen) {
   144411    case 10: return 432;
   144412    case 9: return 432;
   144413    case 8: return 432;
   144414    case 7:
   144415       if (devinfo->is_haswell) {
   144416          return 432;
   144417       } else {
   144418          return 432;
   144419       }
   144420    case 6: return 432;
   144421    case 5: return 0;
   144422    case 4:
   144423       if (devinfo->is_g4x) {
   144424          return 0;
   144425       } else {
   144426          return 0;
   144427       }
   144428    default:
   144429       unreachable("Invalid hardware generation");
   144430    }
   144431 }
   144432 
   144433 
   144434 
   144435 /* MEDIA_OBJECT_WALKER::Global Start X */
   144436 
   144437 
   144438 #define GEN10_MEDIA_OBJECT_WALKER_GlobalStartX_bits  12
   144439 #define GEN9_MEDIA_OBJECT_WALKER_GlobalStartX_bits  12
   144440 #define GEN8_MEDIA_OBJECT_WALKER_GlobalStartX_bits  10
   144441 #define GEN75_MEDIA_OBJECT_WALKER_GlobalStartX_bits  10
   144442 #define GEN7_MEDIA_OBJECT_WALKER_GlobalStartX_bits  10
   144443 #define GEN6_MEDIA_OBJECT_WALKER_GlobalStartX_bits  10
   144444 
   144445 static inline uint32_t ATTRIBUTE_PURE
   144446 MEDIA_OBJECT_WALKER_GlobalStartX_bits(const struct gen_device_info *devinfo)
   144447 {
   144448    switch (devinfo->gen) {
   144449    case 10: return 12;
   144450    case 9: return 12;
   144451    case 8: return 10;
   144452    case 7:
   144453       if (devinfo->is_haswell) {
   144454          return 10;
   144455       } else {
   144456          return 10;
   144457       }
   144458    case 6: return 10;
   144459    case 5: return 0;
   144460    case 4:
   144461       if (devinfo->is_g4x) {
   144462          return 0;
   144463       } else {
   144464          return 0;
   144465       }
   144466    default:
   144467       unreachable("Invalid hardware generation");
   144468    }
   144469 }
   144470 
   144471 
   144472 
   144473 #define GEN10_MEDIA_OBJECT_WALKER_GlobalStartX_start  448
   144474 #define GEN9_MEDIA_OBJECT_WALKER_GlobalStartX_start  448
   144475 #define GEN8_MEDIA_OBJECT_WALKER_GlobalStartX_start  448
   144476 #define GEN75_MEDIA_OBJECT_WALKER_GlobalStartX_start  448
   144477 #define GEN7_MEDIA_OBJECT_WALKER_GlobalStartX_start  448
   144478 #define GEN6_MEDIA_OBJECT_WALKER_GlobalStartX_start  448
   144479 
   144480 static inline uint32_t ATTRIBUTE_PURE
   144481 MEDIA_OBJECT_WALKER_GlobalStartX_start(const struct gen_device_info *devinfo)
   144482 {
   144483    switch (devinfo->gen) {
   144484    case 10: return 448;
   144485    case 9: return 448;
   144486    case 8: return 448;
   144487    case 7:
   144488       if (devinfo->is_haswell) {
   144489          return 448;
   144490       } else {
   144491          return 448;
   144492       }
   144493    case 6: return 448;
   144494    case 5: return 0;
   144495    case 4:
   144496       if (devinfo->is_g4x) {
   144497          return 0;
   144498       } else {
   144499          return 0;
   144500       }
   144501    default:
   144502       unreachable("Invalid hardware generation");
   144503    }
   144504 }
   144505 
   144506 
   144507 
   144508 /* MEDIA_OBJECT_WALKER::Global Start Y */
   144509 
   144510 
   144511 #define GEN10_MEDIA_OBJECT_WALKER_GlobalStartY_bits  12
   144512 #define GEN9_MEDIA_OBJECT_WALKER_GlobalStartY_bits  12
   144513 #define GEN8_MEDIA_OBJECT_WALKER_GlobalStartY_bits  10
   144514 #define GEN75_MEDIA_OBJECT_WALKER_GlobalStartY_bits  10
   144515 #define GEN7_MEDIA_OBJECT_WALKER_GlobalStartY_bits  10
   144516 #define GEN6_MEDIA_OBJECT_WALKER_GlobalStartY_bits  10
   144517 
   144518 static inline uint32_t ATTRIBUTE_PURE
   144519 MEDIA_OBJECT_WALKER_GlobalStartY_bits(const struct gen_device_info *devinfo)
   144520 {
   144521    switch (devinfo->gen) {
   144522    case 10: return 12;
   144523    case 9: return 12;
   144524    case 8: return 10;
   144525    case 7:
   144526       if (devinfo->is_haswell) {
   144527          return 10;
   144528       } else {
   144529          return 10;
   144530       }
   144531    case 6: return 10;
   144532    case 5: return 0;
   144533    case 4:
   144534       if (devinfo->is_g4x) {
   144535          return 0;
   144536       } else {
   144537          return 0;
   144538       }
   144539    default:
   144540       unreachable("Invalid hardware generation");
   144541    }
   144542 }
   144543 
   144544 
   144545 
   144546 #define GEN10_MEDIA_OBJECT_WALKER_GlobalStartY_start  464
   144547 #define GEN9_MEDIA_OBJECT_WALKER_GlobalStartY_start  464
   144548 #define GEN8_MEDIA_OBJECT_WALKER_GlobalStartY_start  464
   144549 #define GEN75_MEDIA_OBJECT_WALKER_GlobalStartY_start  464
   144550 #define GEN7_MEDIA_OBJECT_WALKER_GlobalStartY_start  464
   144551 #define GEN6_MEDIA_OBJECT_WALKER_GlobalStartY_start  464
   144552 
   144553 static inline uint32_t ATTRIBUTE_PURE
   144554 MEDIA_OBJECT_WALKER_GlobalStartY_start(const struct gen_device_info *devinfo)
   144555 {
   144556    switch (devinfo->gen) {
   144557    case 10: return 464;
   144558    case 9: return 464;
   144559    case 8: return 464;
   144560    case 7:
   144561       if (devinfo->is_haswell) {
   144562          return 464;
   144563       } else {
   144564          return 464;
   144565       }
   144566    case 6: return 464;
   144567    case 5: return 0;
   144568    case 4:
   144569       if (devinfo->is_g4x) {
   144570          return 0;
   144571       } else {
   144572          return 0;
   144573       }
   144574    default:
   144575       unreachable("Invalid hardware generation");
   144576    }
   144577 }
   144578 
   144579 
   144580 
   144581 /* MEDIA_OBJECT_WALKER::Group ID Loop Select */
   144582 
   144583 
   144584 #define GEN10_MEDIA_OBJECT_WALKER_GroupIDLoopSelect_bits  24
   144585 #define GEN9_MEDIA_OBJECT_WALKER_GroupIDLoopSelect_bits  24
   144586 #define GEN8_MEDIA_OBJECT_WALKER_GroupIDLoopSelect_bits  24
   144587 
   144588 static inline uint32_t ATTRIBUTE_PURE
   144589 MEDIA_OBJECT_WALKER_GroupIDLoopSelect_bits(const struct gen_device_info *devinfo)
   144590 {
   144591    switch (devinfo->gen) {
   144592    case 10: return 24;
   144593    case 9: return 24;
   144594    case 8: return 24;
   144595    case 7:
   144596       if (devinfo->is_haswell) {
   144597          return 0;
   144598       } else {
   144599          return 0;
   144600       }
   144601    case 6: return 0;
   144602    case 5: return 0;
   144603    case 4:
   144604       if (devinfo->is_g4x) {
   144605          return 0;
   144606       } else {
   144607          return 0;
   144608       }
   144609    default:
   144610       unreachable("Invalid hardware generation");
   144611    }
   144612 }
   144613 
   144614 
   144615 
   144616 #define GEN10_MEDIA_OBJECT_WALKER_GroupIDLoopSelect_start  168
   144617 #define GEN9_MEDIA_OBJECT_WALKER_GroupIDLoopSelect_start  168
   144618 #define GEN8_MEDIA_OBJECT_WALKER_GroupIDLoopSelect_start  168
   144619 
   144620 static inline uint32_t ATTRIBUTE_PURE
   144621 MEDIA_OBJECT_WALKER_GroupIDLoopSelect_start(const struct gen_device_info *devinfo)
   144622 {
   144623    switch (devinfo->gen) {
   144624    case 10: return 168;
   144625    case 9: return 168;
   144626    case 8: return 168;
   144627    case 7:
   144628       if (devinfo->is_haswell) {
   144629          return 0;
   144630       } else {
   144631          return 0;
   144632       }
   144633    case 6: return 0;
   144634    case 5: return 0;
   144635    case 4:
   144636       if (devinfo->is_g4x) {
   144637          return 0;
   144638       } else {
   144639          return 0;
   144640       }
   144641    default:
   144642       unreachable("Invalid hardware generation");
   144643    }
   144644 }
   144645 
   144646 
   144647 
   144648 /* MEDIA_OBJECT_WALKER::Indirect Data Length */
   144649 
   144650 
   144651 #define GEN10_MEDIA_OBJECT_WALKER_IndirectDataLength_bits  17
   144652 #define GEN9_MEDIA_OBJECT_WALKER_IndirectDataLength_bits  17
   144653 #define GEN8_MEDIA_OBJECT_WALKER_IndirectDataLength_bits  17
   144654 #define GEN75_MEDIA_OBJECT_WALKER_IndirectDataLength_bits  17
   144655 #define GEN7_MEDIA_OBJECT_WALKER_IndirectDataLength_bits  17
   144656 #define GEN6_MEDIA_OBJECT_WALKER_IndirectDataLength_bits  17
   144657 
   144658 static inline uint32_t ATTRIBUTE_PURE
   144659 MEDIA_OBJECT_WALKER_IndirectDataLength_bits(const struct gen_device_info *devinfo)
   144660 {
   144661    switch (devinfo->gen) {
   144662    case 10: return 17;
   144663    case 9: return 17;
   144664    case 8: return 17;
   144665    case 7:
   144666       if (devinfo->is_haswell) {
   144667          return 17;
   144668       } else {
   144669          return 17;
   144670       }
   144671    case 6: return 17;
   144672    case 5: return 0;
   144673    case 4:
   144674       if (devinfo->is_g4x) {
   144675          return 0;
   144676       } else {
   144677          return 0;
   144678       }
   144679    default:
   144680       unreachable("Invalid hardware generation");
   144681    }
   144682 }
   144683 
   144684 
   144685 
   144686 #define GEN10_MEDIA_OBJECT_WALKER_IndirectDataLength_start  64
   144687 #define GEN9_MEDIA_OBJECT_WALKER_IndirectDataLength_start  64
   144688 #define GEN8_MEDIA_OBJECT_WALKER_IndirectDataLength_start  64
   144689 #define GEN75_MEDIA_OBJECT_WALKER_IndirectDataLength_start  64
   144690 #define GEN7_MEDIA_OBJECT_WALKER_IndirectDataLength_start  64
   144691 #define GEN6_MEDIA_OBJECT_WALKER_IndirectDataLength_start  64
   144692 
   144693 static inline uint32_t ATTRIBUTE_PURE
   144694 MEDIA_OBJECT_WALKER_IndirectDataLength_start(const struct gen_device_info *devinfo)
   144695 {
   144696    switch (devinfo->gen) {
   144697    case 10: return 64;
   144698    case 9: return 64;
   144699    case 8: return 64;
   144700    case 7:
   144701       if (devinfo->is_haswell) {
   144702          return 64;
   144703       } else {
   144704          return 64;
   144705       }
   144706    case 6: return 64;
   144707    case 5: return 0;
   144708    case 4:
   144709       if (devinfo->is_g4x) {
   144710          return 0;
   144711       } else {
   144712          return 0;
   144713       }
   144714    default:
   144715       unreachable("Invalid hardware generation");
   144716    }
   144717 }
   144718 
   144719 
   144720 
   144721 /* MEDIA_OBJECT_WALKER::Indirect Data Start Address */
   144722 
   144723 
   144724 #define GEN10_MEDIA_OBJECT_WALKER_IndirectDataStartAddress_bits  32
   144725 #define GEN9_MEDIA_OBJECT_WALKER_IndirectDataStartAddress_bits  32
   144726 #define GEN8_MEDIA_OBJECT_WALKER_IndirectDataStartAddress_bits  32
   144727 #define GEN75_MEDIA_OBJECT_WALKER_IndirectDataStartAddress_bits  32
   144728 #define GEN7_MEDIA_OBJECT_WALKER_IndirectDataStartAddress_bits  32
   144729 #define GEN6_MEDIA_OBJECT_WALKER_IndirectDataStartAddress_bits  32
   144730 
   144731 static inline uint32_t ATTRIBUTE_PURE
   144732 MEDIA_OBJECT_WALKER_IndirectDataStartAddress_bits(const struct gen_device_info *devinfo)
   144733 {
   144734    switch (devinfo->gen) {
   144735    case 10: return 32;
   144736    case 9: return 32;
   144737    case 8: return 32;
   144738    case 7:
   144739       if (devinfo->is_haswell) {
   144740          return 32;
   144741       } else {
   144742          return 32;
   144743       }
   144744    case 6: return 32;
   144745    case 5: return 0;
   144746    case 4:
   144747       if (devinfo->is_g4x) {
   144748          return 0;
   144749       } else {
   144750          return 0;
   144751       }
   144752    default:
   144753       unreachable("Invalid hardware generation");
   144754    }
   144755 }
   144756 
   144757 
   144758 
   144759 #define GEN10_MEDIA_OBJECT_WALKER_IndirectDataStartAddress_start  96
   144760 #define GEN9_MEDIA_OBJECT_WALKER_IndirectDataStartAddress_start  96
   144761 #define GEN8_MEDIA_OBJECT_WALKER_IndirectDataStartAddress_start  96
   144762 #define GEN75_MEDIA_OBJECT_WALKER_IndirectDataStartAddress_start  96
   144763 #define GEN7_MEDIA_OBJECT_WALKER_IndirectDataStartAddress_start  96
   144764 #define GEN6_MEDIA_OBJECT_WALKER_IndirectDataStartAddress_start  96
   144765 
   144766 static inline uint32_t ATTRIBUTE_PURE
   144767 MEDIA_OBJECT_WALKER_IndirectDataStartAddress_start(const struct gen_device_info *devinfo)
   144768 {
   144769    switch (devinfo->gen) {
   144770    case 10: return 96;
   144771    case 9: return 96;
   144772    case 8: return 96;
   144773    case 7:
   144774       if (devinfo->is_haswell) {
   144775          return 96;
   144776       } else {
   144777          return 96;
   144778       }
   144779    case 6: return 96;
   144780    case 5: return 0;
   144781    case 4:
   144782       if (devinfo->is_g4x) {
   144783          return 0;
   144784       } else {
   144785          return 0;
   144786       }
   144787    default:
   144788       unreachable("Invalid hardware generation");
   144789    }
   144790 }
   144791 
   144792 
   144793 
   144794 /* MEDIA_OBJECT_WALKER::Inline Data */
   144795 
   144796 
   144797 #define GEN10_MEDIA_OBJECT_WALKER_InlineData_bits  32
   144798 #define GEN9_MEDIA_OBJECT_WALKER_InlineData_bits  32
   144799 #define GEN8_MEDIA_OBJECT_WALKER_InlineData_bits  32
   144800 #define GEN75_MEDIA_OBJECT_WALKER_InlineData_bits  32
   144801 #define GEN7_MEDIA_OBJECT_WALKER_InlineData_bits  32
   144802 #define GEN6_MEDIA_OBJECT_WALKER_InlineData_bits  32
   144803 
   144804 static inline uint32_t ATTRIBUTE_PURE
   144805 MEDIA_OBJECT_WALKER_InlineData_bits(const struct gen_device_info *devinfo)
   144806 {
   144807    switch (devinfo->gen) {
   144808    case 10: return 32;
   144809    case 9: return 32;
   144810    case 8: return 32;
   144811    case 7:
   144812       if (devinfo->is_haswell) {
   144813          return 32;
   144814       } else {
   144815          return 32;
   144816       }
   144817    case 6: return 32;
   144818    case 5: return 0;
   144819    case 4:
   144820       if (devinfo->is_g4x) {
   144821          return 0;
   144822       } else {
   144823          return 0;
   144824       }
   144825    default:
   144826       unreachable("Invalid hardware generation");
   144827    }
   144828 }
   144829 
   144830 
   144831 
   144832 #define GEN10_MEDIA_OBJECT_WALKER_InlineData_start  0
   144833 #define GEN9_MEDIA_OBJECT_WALKER_InlineData_start  0
   144834 #define GEN8_MEDIA_OBJECT_WALKER_InlineData_start  0
   144835 #define GEN75_MEDIA_OBJECT_WALKER_InlineData_start  0
   144836 #define GEN7_MEDIA_OBJECT_WALKER_InlineData_start  0
   144837 #define GEN6_MEDIA_OBJECT_WALKER_InlineData_start  0
   144838 
   144839 static inline uint32_t ATTRIBUTE_PURE
   144840 MEDIA_OBJECT_WALKER_InlineData_start(const struct gen_device_info *devinfo)
   144841 {
   144842    switch (devinfo->gen) {
   144843    case 10: return 0;
   144844    case 9: return 0;
   144845    case 8: return 0;
   144846    case 7:
   144847       if (devinfo->is_haswell) {
   144848          return 0;
   144849       } else {
   144850          return 0;
   144851       }
   144852    case 6: return 0;
   144853    case 5: return 0;
   144854    case 4:
   144855       if (devinfo->is_g4x) {
   144856          return 0;
   144857       } else {
   144858          return 0;
   144859       }
   144860    default:
   144861       unreachable("Invalid hardware generation");
   144862    }
   144863 }
   144864 
   144865 
   144866 
   144867 /* MEDIA_OBJECT_WALKER::Interface Descriptor Offset */
   144868 
   144869 
   144870 #define GEN10_MEDIA_OBJECT_WALKER_InterfaceDescriptorOffset_bits  6
   144871 #define GEN9_MEDIA_OBJECT_WALKER_InterfaceDescriptorOffset_bits  6
   144872 #define GEN8_MEDIA_OBJECT_WALKER_InterfaceDescriptorOffset_bits  6
   144873 #define GEN75_MEDIA_OBJECT_WALKER_InterfaceDescriptorOffset_bits  6
   144874 #define GEN7_MEDIA_OBJECT_WALKER_InterfaceDescriptorOffset_bits  5
   144875 #define GEN6_MEDIA_OBJECT_WALKER_InterfaceDescriptorOffset_bits  5
   144876 
   144877 static inline uint32_t ATTRIBUTE_PURE
   144878 MEDIA_OBJECT_WALKER_InterfaceDescriptorOffset_bits(const struct gen_device_info *devinfo)
   144879 {
   144880    switch (devinfo->gen) {
   144881    case 10: return 6;
   144882    case 9: return 6;
   144883    case 8: return 6;
   144884    case 7:
   144885       if (devinfo->is_haswell) {
   144886          return 6;
   144887       } else {
   144888          return 5;
   144889       }
   144890    case 6: return 5;
   144891    case 5: return 0;
   144892    case 4:
   144893       if (devinfo->is_g4x) {
   144894          return 0;
   144895       } else {
   144896          return 0;
   144897       }
   144898    default:
   144899       unreachable("Invalid hardware generation");
   144900    }
   144901 }
   144902 
   144903 
   144904 
   144905 #define GEN10_MEDIA_OBJECT_WALKER_InterfaceDescriptorOffset_start  32
   144906 #define GEN9_MEDIA_OBJECT_WALKER_InterfaceDescriptorOffset_start  32
   144907 #define GEN8_MEDIA_OBJECT_WALKER_InterfaceDescriptorOffset_start  32
   144908 #define GEN75_MEDIA_OBJECT_WALKER_InterfaceDescriptorOffset_start  32
   144909 #define GEN7_MEDIA_OBJECT_WALKER_InterfaceDescriptorOffset_start  32
   144910 #define GEN6_MEDIA_OBJECT_WALKER_InterfaceDescriptorOffset_start  32
   144911 
   144912 static inline uint32_t ATTRIBUTE_PURE
   144913 MEDIA_OBJECT_WALKER_InterfaceDescriptorOffset_start(const struct gen_device_info *devinfo)
   144914 {
   144915    switch (devinfo->gen) {
   144916    case 10: return 32;
   144917    case 9: return 32;
   144918    case 8: return 32;
   144919    case 7:
   144920       if (devinfo->is_haswell) {
   144921          return 32;
   144922       } else {
   144923          return 32;
   144924       }
   144925    case 6: return 32;
   144926    case 5: return 0;
   144927    case 4:
   144928       if (devinfo->is_g4x) {
   144929          return 0;
   144930       } else {
   144931          return 0;
   144932       }
   144933    default:
   144934       unreachable("Invalid hardware generation");
   144935    }
   144936 }
   144937 
   144938 
   144939 
   144940 /* MEDIA_OBJECT_WALKER::Local End X */
   144941 
   144942 
   144943 #define GEN7_MEDIA_OBJECT_WALKER_LocalEndX_bits  9
   144944 #define GEN6_MEDIA_OBJECT_WALKER_LocalEndX_bits  9
   144945 
   144946 static inline uint32_t ATTRIBUTE_PURE
   144947 MEDIA_OBJECT_WALKER_LocalEndX_bits(const struct gen_device_info *devinfo)
   144948 {
   144949    switch (devinfo->gen) {
   144950    case 10: return 0;
   144951    case 9: return 0;
   144952    case 8: return 0;
   144953    case 7:
   144954       if (devinfo->is_haswell) {
   144955          return 0;
   144956       } else {
   144957          return 9;
   144958       }
   144959    case 6: return 9;
   144960    case 5: return 0;
   144961    case 4:
   144962       if (devinfo->is_g4x) {
   144963          return 0;
   144964       } else {
   144965          return 0;
   144966       }
   144967    default:
   144968       unreachable("Invalid hardware generation");
   144969    }
   144970 }
   144971 
   144972 
   144973 
   144974 #define GEN7_MEDIA_OBJECT_WALKER_LocalEndX_start  320
   144975 #define GEN6_MEDIA_OBJECT_WALKER_LocalEndX_start  320
   144976 
   144977 static inline uint32_t ATTRIBUTE_PURE
   144978 MEDIA_OBJECT_WALKER_LocalEndX_start(const struct gen_device_info *devinfo)
   144979 {
   144980    switch (devinfo->gen) {
   144981    case 10: return 0;
   144982    case 9: return 0;
   144983    case 8: return 0;
   144984    case 7:
   144985       if (devinfo->is_haswell) {
   144986          return 0;
   144987       } else {
   144988          return 320;
   144989       }
   144990    case 6: return 320;
   144991    case 5: return 0;
   144992    case 4:
   144993       if (devinfo->is_g4x) {
   144994          return 0;
   144995       } else {
   144996          return 0;
   144997       }
   144998    default:
   144999       unreachable("Invalid hardware generation");
   145000    }
   145001 }
   145002 
   145003 
   145004 
   145005 /* MEDIA_OBJECT_WALKER::Local End Y */
   145006 
   145007 
   145008 #define GEN7_MEDIA_OBJECT_WALKER_LocalEndY_bits  9
   145009 #define GEN6_MEDIA_OBJECT_WALKER_LocalEndY_bits  9
   145010 
   145011 static inline uint32_t ATTRIBUTE_PURE
   145012 MEDIA_OBJECT_WALKER_LocalEndY_bits(const struct gen_device_info *devinfo)
   145013 {
   145014    switch (devinfo->gen) {
   145015    case 10: return 0;
   145016    case 9: return 0;
   145017    case 8: return 0;
   145018    case 7:
   145019       if (devinfo->is_haswell) {
   145020          return 0;
   145021       } else {
   145022          return 9;
   145023       }
   145024    case 6: return 9;
   145025    case 5: return 0;
   145026    case 4:
   145027       if (devinfo->is_g4x) {
   145028          return 0;
   145029       } else {
   145030          return 0;
   145031       }
   145032    default:
   145033       unreachable("Invalid hardware generation");
   145034    }
   145035 }
   145036 
   145037 
   145038 
   145039 #define GEN7_MEDIA_OBJECT_WALKER_LocalEndY_start  336
   145040 #define GEN6_MEDIA_OBJECT_WALKER_LocalEndY_start  336
   145041 
   145042 static inline uint32_t ATTRIBUTE_PURE
   145043 MEDIA_OBJECT_WALKER_LocalEndY_start(const struct gen_device_info *devinfo)
   145044 {
   145045    switch (devinfo->gen) {
   145046    case 10: return 0;
   145047    case 9: return 0;
   145048    case 8: return 0;
   145049    case 7:
   145050       if (devinfo->is_haswell) {
   145051          return 0;
   145052       } else {
   145053          return 336;
   145054       }
   145055    case 6: return 336;
   145056    case 5: return 0;
   145057    case 4:
   145058       if (devinfo->is_g4x) {
   145059          return 0;
   145060       } else {
   145061          return 0;
   145062       }
   145063    default:
   145064       unreachable("Invalid hardware generation");
   145065    }
   145066 }
   145067 
   145068 
   145069 
   145070 /* MEDIA_OBJECT_WALKER::Local Inner Loop Unit X */
   145071 
   145072 
   145073 #define GEN10_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitX_bits  12
   145074 #define GEN9_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitX_bits  12
   145075 #define GEN8_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitX_bits  10
   145076 #define GEN75_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitX_bits  10
   145077 #define GEN7_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitX_bits  10
   145078 #define GEN6_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitX_bits  10
   145079 
   145080 static inline uint32_t ATTRIBUTE_PURE
   145081 MEDIA_OBJECT_WALKER_LocalInnerLoopUnitX_bits(const struct gen_device_info *devinfo)
   145082 {
   145083    switch (devinfo->gen) {
   145084    case 10: return 12;
   145085    case 9: return 12;
   145086    case 8: return 10;
   145087    case 7:
   145088       if (devinfo->is_haswell) {
   145089          return 10;
   145090       } else {
   145091          return 10;
   145092       }
   145093    case 6: return 10;
   145094    case 5: return 0;
   145095    case 4:
   145096       if (devinfo->is_g4x) {
   145097          return 0;
   145098       } else {
   145099          return 0;
   145100       }
   145101    default:
   145102       unreachable("Invalid hardware generation");
   145103    }
   145104 }
   145105 
   145106 
   145107 
   145108 #define GEN10_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitX_start  384
   145109 #define GEN9_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitX_start  384
   145110 #define GEN8_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitX_start  384
   145111 #define GEN75_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitX_start  384
   145112 #define GEN7_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitX_start  384
   145113 #define GEN6_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitX_start  384
   145114 
   145115 static inline uint32_t ATTRIBUTE_PURE
   145116 MEDIA_OBJECT_WALKER_LocalInnerLoopUnitX_start(const struct gen_device_info *devinfo)
   145117 {
   145118    switch (devinfo->gen) {
   145119    case 10: return 384;
   145120    case 9: return 384;
   145121    case 8: return 384;
   145122    case 7:
   145123       if (devinfo->is_haswell) {
   145124          return 384;
   145125       } else {
   145126          return 384;
   145127       }
   145128    case 6: return 384;
   145129    case 5: return 0;
   145130    case 4:
   145131       if (devinfo->is_g4x) {
   145132          return 0;
   145133       } else {
   145134          return 0;
   145135       }
   145136    default:
   145137       unreachable("Invalid hardware generation");
   145138    }
   145139 }
   145140 
   145141 
   145142 
   145143 /* MEDIA_OBJECT_WALKER::Local Inner Loop Unit Y */
   145144 
   145145 
   145146 #define GEN10_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitY_bits  12
   145147 #define GEN9_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitY_bits  12
   145148 #define GEN8_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitY_bits  10
   145149 #define GEN75_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitY_bits  10
   145150 #define GEN7_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitY_bits  10
   145151 #define GEN6_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitY_bits  10
   145152 
   145153 static inline uint32_t ATTRIBUTE_PURE
   145154 MEDIA_OBJECT_WALKER_LocalInnerLoopUnitY_bits(const struct gen_device_info *devinfo)
   145155 {
   145156    switch (devinfo->gen) {
   145157    case 10: return 12;
   145158    case 9: return 12;
   145159    case 8: return 10;
   145160    case 7:
   145161       if (devinfo->is_haswell) {
   145162          return 10;
   145163       } else {
   145164          return 10;
   145165       }
   145166    case 6: return 10;
   145167    case 5: return 0;
   145168    case 4:
   145169       if (devinfo->is_g4x) {
   145170          return 0;
   145171       } else {
   145172          return 0;
   145173       }
   145174    default:
   145175       unreachable("Invalid hardware generation");
   145176    }
   145177 }
   145178 
   145179 
   145180 
   145181 #define GEN10_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitY_start  400
   145182 #define GEN9_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitY_start  400
   145183 #define GEN8_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitY_start  400
   145184 #define GEN75_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitY_start  400
   145185 #define GEN7_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitY_start  400
   145186 #define GEN6_MEDIA_OBJECT_WALKER_LocalInnerLoopUnitY_start  400
   145187 
   145188 static inline uint32_t ATTRIBUTE_PURE
   145189 MEDIA_OBJECT_WALKER_LocalInnerLoopUnitY_start(const struct gen_device_info *devinfo)
   145190 {
   145191    switch (devinfo->gen) {
   145192    case 10: return 400;
   145193    case 9: return 400;
   145194    case 8: return 400;
   145195    case 7:
   145196       if (devinfo->is_haswell) {
   145197          return 400;
   145198       } else {
   145199          return 400;
   145200       }
   145201    case 6: return 400;
   145202    case 5: return 0;
   145203    case 4:
   145204       if (devinfo->is_g4x) {
   145205          return 0;
   145206       } else {
   145207          return 0;
   145208       }
   145209    default:
   145210       unreachable("Invalid hardware generation");
   145211    }
   145212 }
   145213 
   145214 
   145215 
   145216 /* MEDIA_OBJECT_WALKER::Local Loop Exec Count */
   145217 
   145218 
   145219 #define GEN10_MEDIA_OBJECT_WALKER_LocalLoopExecCount_bits  12
   145220 #define GEN9_MEDIA_OBJECT_WALKER_LocalLoopExecCount_bits  12
   145221 #define GEN8_MEDIA_OBJECT_WALKER_LocalLoopExecCount_bits  10
   145222 #define GEN75_MEDIA_OBJECT_WALKER_LocalLoopExecCount_bits  10
   145223 #define GEN7_MEDIA_OBJECT_WALKER_LocalLoopExecCount_bits  10
   145224 #define GEN6_MEDIA_OBJECT_WALKER_LocalLoopExecCount_bits  10
   145225 
   145226 static inline uint32_t ATTRIBUTE_PURE
   145227 MEDIA_OBJECT_WALKER_LocalLoopExecCount_bits(const struct gen_device_info *devinfo)
   145228 {
   145229    switch (devinfo->gen) {
   145230    case 10: return 12;
   145231    case 9: return 12;
   145232    case 8: return 10;
   145233    case 7:
   145234       if (devinfo->is_haswell) {
   145235          return 10;
   145236       } else {
   145237          return 10;
   145238       }
   145239    case 6: return 10;
   145240    case 5: return 0;
   145241    case 4:
   145242       if (devinfo->is_g4x) {
   145243          return 0;
   145244       } else {
   145245          return 0;
   145246       }
   145247    default:
   145248       unreachable("Invalid hardware generation");
   145249    }
   145250 }
   145251 
   145252 
   145253 
   145254 #define GEN10_MEDIA_OBJECT_WALKER_LocalLoopExecCount_start  224
   145255 #define GEN9_MEDIA_OBJECT_WALKER_LocalLoopExecCount_start  224
   145256 #define GEN8_MEDIA_OBJECT_WALKER_LocalLoopExecCount_start  224
   145257 #define GEN75_MEDIA_OBJECT_WALKER_LocalLoopExecCount_start  224
   145258 #define GEN7_MEDIA_OBJECT_WALKER_LocalLoopExecCount_start  224
   145259 #define GEN6_MEDIA_OBJECT_WALKER_LocalLoopExecCount_start  224
   145260 
   145261 static inline uint32_t ATTRIBUTE_PURE
   145262 MEDIA_OBJECT_WALKER_LocalLoopExecCount_start(const struct gen_device_info *devinfo)
   145263 {
   145264    switch (devinfo->gen) {
   145265    case 10: return 224;
   145266    case 9: return 224;
   145267    case 8: return 224;
   145268    case 7:
   145269       if (devinfo->is_haswell) {
   145270          return 224;
   145271       } else {
   145272          return 224;
   145273       }
   145274    case 6: return 224;
   145275    case 5: return 0;
   145276    case 4:
   145277       if (devinfo->is_g4x) {
   145278          return 0;
   145279       } else {
   145280          return 0;
   145281       }
   145282    default:
   145283       unreachable("Invalid hardware generation");
   145284    }
   145285 }
   145286 
   145287 
   145288 
   145289 /* MEDIA_OBJECT_WALKER::Local Mid-Loop Unit Y */
   145290 
   145291 
   145292 #define GEN10_MEDIA_OBJECT_WALKER_LocalMidLoopUnitY_bits  2
   145293 #define GEN9_MEDIA_OBJECT_WALKER_LocalMidLoopUnitY_bits  2
   145294 #define GEN8_MEDIA_OBJECT_WALKER_LocalMidLoopUnitY_bits  2
   145295 #define GEN75_MEDIA_OBJECT_WALKER_LocalMidLoopUnitY_bits  2
   145296 #define GEN7_MEDIA_OBJECT_WALKER_LocalMidLoopUnitY_bits  2
   145297 #define GEN6_MEDIA_OBJECT_WALKER_LocalMidLoopUnitY_bits  2
   145298 
   145299 static inline uint32_t ATTRIBUTE_PURE
   145300 MEDIA_OBJECT_WALKER_LocalMidLoopUnitY_bits(const struct gen_device_info *devinfo)
   145301 {
   145302    switch (devinfo->gen) {
   145303    case 10: return 2;
   145304    case 9: return 2;
   145305    case 8: return 2;
   145306    case 7:
   145307       if (devinfo->is_haswell) {
   145308          return 2;
   145309       } else {
   145310          return 2;
   145311       }
   145312    case 6: return 2;
   145313    case 5: return 0;
   145314    case 4:
   145315       if (devinfo->is_g4x) {
   145316          return 0;
   145317       } else {
   145318          return 0;
   145319       }
   145320    default:
   145321       unreachable("Invalid hardware generation");
   145322    }
   145323 }
   145324 
   145325 
   145326 
   145327 #define GEN10_MEDIA_OBJECT_WALKER_LocalMidLoopUnitY_start  204
   145328 #define GEN9_MEDIA_OBJECT_WALKER_LocalMidLoopUnitY_start  204
   145329 #define GEN8_MEDIA_OBJECT_WALKER_LocalMidLoopUnitY_start  204
   145330 #define GEN75_MEDIA_OBJECT_WALKER_LocalMidLoopUnitY_start  204
   145331 #define GEN7_MEDIA_OBJECT_WALKER_LocalMidLoopUnitY_start  204
   145332 #define GEN6_MEDIA_OBJECT_WALKER_LocalMidLoopUnitY_start  204
   145333 
   145334 static inline uint32_t ATTRIBUTE_PURE
   145335 MEDIA_OBJECT_WALKER_LocalMidLoopUnitY_start(const struct gen_device_info *devinfo)
   145336 {
   145337    switch (devinfo->gen) {
   145338    case 10: return 204;
   145339    case 9: return 204;
   145340    case 8: return 204;
   145341    case 7:
   145342       if (devinfo->is_haswell) {
   145343          return 204;
   145344       } else {
   145345          return 204;
   145346       }
   145347    case 6: return 204;
   145348    case 5: return 0;
   145349    case 4:
   145350       if (devinfo->is_g4x) {
   145351          return 0;
   145352       } else {
   145353          return 0;
   145354       }
   145355    default:
   145356       unreachable("Invalid hardware generation");
   145357    }
   145358 }
   145359 
   145360 
   145361 
   145362 /* MEDIA_OBJECT_WALKER::Local Outer Loop Stride X */
   145363 
   145364 
   145365 #define GEN10_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideX_bits  12
   145366 #define GEN9_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideX_bits  12
   145367 #define GEN8_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideX_bits  10
   145368 #define GEN75_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideX_bits  10
   145369 #define GEN7_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideX_bits  10
   145370 #define GEN6_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideX_bits  10
   145371 
   145372 static inline uint32_t ATTRIBUTE_PURE
   145373 MEDIA_OBJECT_WALKER_LocalOuterLoopStrideX_bits(const struct gen_device_info *devinfo)
   145374 {
   145375    switch (devinfo->gen) {
   145376    case 10: return 12;
   145377    case 9: return 12;
   145378    case 8: return 10;
   145379    case 7:
   145380       if (devinfo->is_haswell) {
   145381          return 10;
   145382       } else {
   145383          return 10;
   145384       }
   145385    case 6: return 10;
   145386    case 5: return 0;
   145387    case 4:
   145388       if (devinfo->is_g4x) {
   145389          return 0;
   145390       } else {
   145391          return 0;
   145392       }
   145393    default:
   145394       unreachable("Invalid hardware generation");
   145395    }
   145396 }
   145397 
   145398 
   145399 
   145400 #define GEN10_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideX_start  352
   145401 #define GEN9_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideX_start  352
   145402 #define GEN8_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideX_start  352
   145403 #define GEN75_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideX_start  352
   145404 #define GEN7_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideX_start  352
   145405 #define GEN6_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideX_start  352
   145406 
   145407 static inline uint32_t ATTRIBUTE_PURE
   145408 MEDIA_OBJECT_WALKER_LocalOuterLoopStrideX_start(const struct gen_device_info *devinfo)
   145409 {
   145410    switch (devinfo->gen) {
   145411    case 10: return 352;
   145412    case 9: return 352;
   145413    case 8: return 352;
   145414    case 7:
   145415       if (devinfo->is_haswell) {
   145416          return 352;
   145417       } else {
   145418          return 352;
   145419       }
   145420    case 6: return 352;
   145421    case 5: return 0;
   145422    case 4:
   145423       if (devinfo->is_g4x) {
   145424          return 0;
   145425       } else {
   145426          return 0;
   145427       }
   145428    default:
   145429       unreachable("Invalid hardware generation");
   145430    }
   145431 }
   145432 
   145433 
   145434 
   145435 /* MEDIA_OBJECT_WALKER::Local Outer Loop Stride Y */
   145436 
   145437 
   145438 #define GEN10_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideY_bits  12
   145439 #define GEN9_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideY_bits  12
   145440 #define GEN8_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideY_bits  10
   145441 #define GEN75_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideY_bits  10
   145442 #define GEN7_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideY_bits  10
   145443 #define GEN6_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideY_bits  10
   145444 
   145445 static inline uint32_t ATTRIBUTE_PURE
   145446 MEDIA_OBJECT_WALKER_LocalOuterLoopStrideY_bits(const struct gen_device_info *devinfo)
   145447 {
   145448    switch (devinfo->gen) {
   145449    case 10: return 12;
   145450    case 9: return 12;
   145451    case 8: return 10;
   145452    case 7:
   145453       if (devinfo->is_haswell) {
   145454          return 10;
   145455       } else {
   145456          return 10;
   145457       }
   145458    case 6: return 10;
   145459    case 5: return 0;
   145460    case 4:
   145461       if (devinfo->is_g4x) {
   145462          return 0;
   145463       } else {
   145464          return 0;
   145465       }
   145466    default:
   145467       unreachable("Invalid hardware generation");
   145468    }
   145469 }
   145470 
   145471 
   145472 
   145473 #define GEN10_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideY_start  368
   145474 #define GEN9_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideY_start  368
   145475 #define GEN8_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideY_start  368
   145476 #define GEN75_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideY_start  368
   145477 #define GEN7_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideY_start  368
   145478 #define GEN6_MEDIA_OBJECT_WALKER_LocalOuterLoopStrideY_start  368
   145479 
   145480 static inline uint32_t ATTRIBUTE_PURE
   145481 MEDIA_OBJECT_WALKER_LocalOuterLoopStrideY_start(const struct gen_device_info *devinfo)
   145482 {
   145483    switch (devinfo->gen) {
   145484    case 10: return 368;
   145485    case 9: return 368;
   145486    case 8: return 368;
   145487    case 7:
   145488       if (devinfo->is_haswell) {
   145489          return 368;
   145490       } else {
   145491          return 368;
   145492       }
   145493    case 6: return 368;
   145494    case 5: return 0;
   145495    case 4:
   145496       if (devinfo->is_g4x) {
   145497          return 0;
   145498       } else {
   145499          return 0;
   145500       }
   145501    default:
   145502       unreachable("Invalid hardware generation");
   145503    }
   145504 }
   145505 
   145506 
   145507 
   145508 /* MEDIA_OBJECT_WALKER::Local Start X */
   145509 
   145510 
   145511 #define GEN10_MEDIA_OBJECT_WALKER_LocalStartX_bits  11
   145512 #define GEN9_MEDIA_OBJECT_WALKER_LocalStartX_bits  11
   145513 #define GEN8_MEDIA_OBJECT_WALKER_LocalStartX_bits  9
   145514 #define GEN75_MEDIA_OBJECT_WALKER_LocalStartX_bits  9
   145515 #define GEN7_MEDIA_OBJECT_WALKER_LocalStartX_bits  9
   145516 #define GEN6_MEDIA_OBJECT_WALKER_LocalStartX_bits  9
   145517 
   145518 static inline uint32_t ATTRIBUTE_PURE
   145519 MEDIA_OBJECT_WALKER_LocalStartX_bits(const struct gen_device_info *devinfo)
   145520 {
   145521    switch (devinfo->gen) {
   145522    case 10: return 11;
   145523    case 9: return 11;
   145524    case 8: return 9;
   145525    case 7:
   145526       if (devinfo->is_haswell) {
   145527          return 9;
   145528       } else {
   145529          return 9;
   145530       }
   145531    case 6: return 9;
   145532    case 5: return 0;
   145533    case 4:
   145534       if (devinfo->is_g4x) {
   145535          return 0;
   145536       } else {
   145537          return 0;
   145538       }
   145539    default:
   145540       unreachable("Invalid hardware generation");
   145541    }
   145542 }
   145543 
   145544 
   145545 
   145546 #define GEN10_MEDIA_OBJECT_WALKER_LocalStartX_start  288
   145547 #define GEN9_MEDIA_OBJECT_WALKER_LocalStartX_start  288
   145548 #define GEN8_MEDIA_OBJECT_WALKER_LocalStartX_start  288
   145549 #define GEN75_MEDIA_OBJECT_WALKER_LocalStartX_start  288
   145550 #define GEN7_MEDIA_OBJECT_WALKER_LocalStartX_start  288
   145551 #define GEN6_MEDIA_OBJECT_WALKER_LocalStartX_start  288
   145552 
   145553 static inline uint32_t ATTRIBUTE_PURE
   145554 MEDIA_OBJECT_WALKER_LocalStartX_start(const struct gen_device_info *devinfo)
   145555 {
   145556    switch (devinfo->gen) {
   145557    case 10: return 288;
   145558    case 9: return 288;
   145559    case 8: return 288;
   145560    case 7:
   145561       if (devinfo->is_haswell) {
   145562          return 288;
   145563       } else {
   145564          return 288;
   145565       }
   145566    case 6: return 288;
   145567    case 5: return 0;
   145568    case 4:
   145569       if (devinfo->is_g4x) {
   145570          return 0;
   145571       } else {
   145572          return 0;
   145573       }
   145574    default:
   145575       unreachable("Invalid hardware generation");
   145576    }
   145577 }
   145578 
   145579 
   145580 
   145581 /* MEDIA_OBJECT_WALKER::Local Start Y */
   145582 
   145583 
   145584 #define GEN10_MEDIA_OBJECT_WALKER_LocalStartY_bits  11
   145585 #define GEN9_MEDIA_OBJECT_WALKER_LocalStartY_bits  11
   145586 #define GEN8_MEDIA_OBJECT_WALKER_LocalStartY_bits  9
   145587 #define GEN75_MEDIA_OBJECT_WALKER_LocalStartY_bits  9
   145588 #define GEN7_MEDIA_OBJECT_WALKER_LocalStartY_bits  9
   145589 #define GEN6_MEDIA_OBJECT_WALKER_LocalStartY_bits  9
   145590 
   145591 static inline uint32_t ATTRIBUTE_PURE
   145592 MEDIA_OBJECT_WALKER_LocalStartY_bits(const struct gen_device_info *devinfo)
   145593 {
   145594    switch (devinfo->gen) {
   145595    case 10: return 11;
   145596    case 9: return 11;
   145597    case 8: return 9;
   145598    case 7:
   145599       if (devinfo->is_haswell) {
   145600          return 9;
   145601       } else {
   145602          return 9;
   145603       }
   145604    case 6: return 9;
   145605    case 5: return 0;
   145606    case 4:
   145607       if (devinfo->is_g4x) {
   145608          return 0;
   145609       } else {
   145610          return 0;
   145611       }
   145612    default:
   145613       unreachable("Invalid hardware generation");
   145614    }
   145615 }
   145616 
   145617 
   145618 
   145619 #define GEN10_MEDIA_OBJECT_WALKER_LocalStartY_start  304
   145620 #define GEN9_MEDIA_OBJECT_WALKER_LocalStartY_start  304
   145621 #define GEN8_MEDIA_OBJECT_WALKER_LocalStartY_start  304
   145622 #define GEN75_MEDIA_OBJECT_WALKER_LocalStartY_start  304
   145623 #define GEN7_MEDIA_OBJECT_WALKER_LocalStartY_start  304
   145624 #define GEN6_MEDIA_OBJECT_WALKER_LocalStartY_start  304
   145625 
   145626 static inline uint32_t ATTRIBUTE_PURE
   145627 MEDIA_OBJECT_WALKER_LocalStartY_start(const struct gen_device_info *devinfo)
   145628 {
   145629    switch (devinfo->gen) {
   145630    case 10: return 304;
   145631    case 9: return 304;
   145632    case 8: return 304;
   145633    case 7:
   145634       if (devinfo->is_haswell) {
   145635          return 304;
   145636       } else {
   145637          return 304;
   145638       }
   145639    case 6: return 304;
   145640    case 5: return 0;
   145641    case 4:
   145642       if (devinfo->is_g4x) {
   145643          return 0;
   145644       } else {
   145645          return 0;
   145646       }
   145647    default:
   145648       unreachable("Invalid hardware generation");
   145649    }
   145650 }
   145651 
   145652 
   145653 
   145654 /* MEDIA_OBJECT_WALKER::Masked Dispatch */
   145655 
   145656 
   145657 #define GEN10_MEDIA_OBJECT_WALKER_MaskedDispatch_bits  2
   145658 #define GEN9_MEDIA_OBJECT_WALKER_MaskedDispatch_bits  2
   145659 
   145660 static inline uint32_t ATTRIBUTE_PURE
   145661 MEDIA_OBJECT_WALKER_MaskedDispatch_bits(const struct gen_device_info *devinfo)
   145662 {
   145663    switch (devinfo->gen) {
   145664    case 10: return 2;
   145665    case 9: return 2;
   145666    case 8: return 0;
   145667    case 7:
   145668       if (devinfo->is_haswell) {
   145669          return 0;
   145670       } else {
   145671          return 0;
   145672       }
   145673    case 6: return 0;
   145674    case 5: return 0;
   145675    case 4:
   145676       if (devinfo->is_g4x) {
   145677          return 0;
   145678       } else {
   145679          return 0;
   145680       }
   145681    default:
   145682       unreachable("Invalid hardware generation");
   145683    }
   145684 }
   145685 
   145686 
   145687 
   145688 #define GEN10_MEDIA_OBJECT_WALKER_MaskedDispatch_start  86
   145689 #define GEN9_MEDIA_OBJECT_WALKER_MaskedDispatch_start  86
   145690 
   145691 static inline uint32_t ATTRIBUTE_PURE
   145692 MEDIA_OBJECT_WALKER_MaskedDispatch_start(const struct gen_device_info *devinfo)
   145693 {
   145694    switch (devinfo->gen) {
   145695    case 10: return 86;
   145696    case 9: return 86;
   145697    case 8: return 0;
   145698    case 7:
   145699       if (devinfo->is_haswell) {
   145700          return 0;
   145701       } else {
   145702          return 0;
   145703       }
   145704    case 6: return 0;
   145705    case 5: return 0;
   145706    case 4:
   145707       if (devinfo->is_g4x) {
   145708          return 0;
   145709       } else {
   145710          return 0;
   145711       }
   145712    default:
   145713       unreachable("Invalid hardware generation");
   145714    }
   145715 }
   145716 
   145717 
   145718 
   145719 /* MEDIA_OBJECT_WALKER::Media Command Opcode */
   145720 
   145721 
   145722 #define GEN10_MEDIA_OBJECT_WALKER_MediaCommandOpcode_bits  3
   145723 #define GEN9_MEDIA_OBJECT_WALKER_MediaCommandOpcode_bits  3
   145724 #define GEN8_MEDIA_OBJECT_WALKER_MediaCommandOpcode_bits  3
   145725 #define GEN75_MEDIA_OBJECT_WALKER_MediaCommandOpcode_bits  3
   145726 #define GEN7_MEDIA_OBJECT_WALKER_MediaCommandOpcode_bits  3
   145727 #define GEN6_MEDIA_OBJECT_WALKER_MediaCommandOpcode_bits  3
   145728 
   145729 static inline uint32_t ATTRIBUTE_PURE
   145730 MEDIA_OBJECT_WALKER_MediaCommandOpcode_bits(const struct gen_device_info *devinfo)
   145731 {
   145732    switch (devinfo->gen) {
   145733    case 10: return 3;
   145734    case 9: return 3;
   145735    case 8: return 3;
   145736    case 7:
   145737       if (devinfo->is_haswell) {
   145738          return 3;
   145739       } else {
   145740          return 3;
   145741       }
   145742    case 6: return 3;
   145743    case 5: return 0;
   145744    case 4:
   145745       if (devinfo->is_g4x) {
   145746          return 0;
   145747       } else {
   145748          return 0;
   145749       }
   145750    default:
   145751       unreachable("Invalid hardware generation");
   145752    }
   145753 }
   145754 
   145755 
   145756 
   145757 #define GEN10_MEDIA_OBJECT_WALKER_MediaCommandOpcode_start  24
   145758 #define GEN9_MEDIA_OBJECT_WALKER_MediaCommandOpcode_start  24
   145759 #define GEN8_MEDIA_OBJECT_WALKER_MediaCommandOpcode_start  24
   145760 #define GEN75_MEDIA_OBJECT_WALKER_MediaCommandOpcode_start  24
   145761 #define GEN7_MEDIA_OBJECT_WALKER_MediaCommandOpcode_start  24
   145762 #define GEN6_MEDIA_OBJECT_WALKER_MediaCommandOpcode_start  24
   145763 
   145764 static inline uint32_t ATTRIBUTE_PURE
   145765 MEDIA_OBJECT_WALKER_MediaCommandOpcode_start(const struct gen_device_info *devinfo)
   145766 {
   145767    switch (devinfo->gen) {
   145768    case 10: return 24;
   145769    case 9: return 24;
   145770    case 8: return 24;
   145771    case 7:
   145772       if (devinfo->is_haswell) {
   145773          return 24;
   145774       } else {
   145775          return 24;
   145776       }
   145777    case 6: return 24;
   145778    case 5: return 0;
   145779    case 4:
   145780       if (devinfo->is_g4x) {
   145781          return 0;
   145782       } else {
   145783          return 0;
   145784       }
   145785    default:
   145786       unreachable("Invalid hardware generation");
   145787    }
   145788 }
   145789 
   145790 
   145791 
   145792 /* MEDIA_OBJECT_WALKER::Mid-Loop Unit X */
   145793 
   145794 
   145795 #define GEN10_MEDIA_OBJECT_WALKER_MidLoopUnitX_bits  2
   145796 #define GEN9_MEDIA_OBJECT_WALKER_MidLoopUnitX_bits  2
   145797 #define GEN8_MEDIA_OBJECT_WALKER_MidLoopUnitX_bits  2
   145798 #define GEN75_MEDIA_OBJECT_WALKER_MidLoopUnitX_bits  2
   145799 #define GEN7_MEDIA_OBJECT_WALKER_MidLoopUnitX_bits  2
   145800 #define GEN6_MEDIA_OBJECT_WALKER_MidLoopUnitX_bits  2
   145801 
   145802 static inline uint32_t ATTRIBUTE_PURE
   145803 MEDIA_OBJECT_WALKER_MidLoopUnitX_bits(const struct gen_device_info *devinfo)
   145804 {
   145805    switch (devinfo->gen) {
   145806    case 10: return 2;
   145807    case 9: return 2;
   145808    case 8: return 2;
   145809    case 7:
   145810       if (devinfo->is_haswell) {
   145811          return 2;
   145812       } else {
   145813          return 2;
   145814       }
   145815    case 6: return 2;
   145816    case 5: return 0;
   145817    case 4:
   145818       if (devinfo->is_g4x) {
   145819          return 0;
   145820       } else {
   145821          return 0;
   145822       }
   145823    default:
   145824       unreachable("Invalid hardware generation");
   145825    }
   145826 }
   145827 
   145828 
   145829 
   145830 #define GEN10_MEDIA_OBJECT_WALKER_MidLoopUnitX_start  200
   145831 #define GEN9_MEDIA_OBJECT_WALKER_MidLoopUnitX_start  200
   145832 #define GEN8_MEDIA_OBJECT_WALKER_MidLoopUnitX_start  200
   145833 #define GEN75_MEDIA_OBJECT_WALKER_MidLoopUnitX_start  200
   145834 #define GEN7_MEDIA_OBJECT_WALKER_MidLoopUnitX_start  200
   145835 #define GEN6_MEDIA_OBJECT_WALKER_MidLoopUnitX_start  200
   145836 
   145837 static inline uint32_t ATTRIBUTE_PURE
   145838 MEDIA_OBJECT_WALKER_MidLoopUnitX_start(const struct gen_device_info *devinfo)
   145839 {
   145840    switch (devinfo->gen) {
   145841    case 10: return 200;
   145842    case 9: return 200;
   145843    case 8: return 200;
   145844    case 7:
   145845       if (devinfo->is_haswell) {
   145846          return 200;
   145847       } else {
   145848          return 200;
   145849       }
   145850    case 6: return 200;
   145851    case 5: return 0;
   145852    case 4:
   145853       if (devinfo->is_g4x) {
   145854          return 0;
   145855       } else {
   145856          return 0;
   145857       }
   145858    default:
   145859       unreachable("Invalid hardware generation");
   145860    }
   145861 }
   145862 
   145863 
   145864 
   145865 /* MEDIA_OBJECT_WALKER::Middle Loop Extra Steps */
   145866 
   145867 
   145868 #define GEN10_MEDIA_OBJECT_WALKER_MiddleLoopExtraSteps_bits  5
   145869 #define GEN9_MEDIA_OBJECT_WALKER_MiddleLoopExtraSteps_bits  5
   145870 #define GEN8_MEDIA_OBJECT_WALKER_MiddleLoopExtraSteps_bits  5
   145871 #define GEN75_MEDIA_OBJECT_WALKER_MiddleLoopExtraSteps_bits  5
   145872 #define GEN7_MEDIA_OBJECT_WALKER_MiddleLoopExtraSteps_bits  5
   145873 #define GEN6_MEDIA_OBJECT_WALKER_MiddleLoopExtraSteps_bits  5
   145874 
   145875 static inline uint32_t ATTRIBUTE_PURE
   145876 MEDIA_OBJECT_WALKER_MiddleLoopExtraSteps_bits(const struct gen_device_info *devinfo)
   145877 {
   145878    switch (devinfo->gen) {
   145879    case 10: return 5;
   145880    case 9: return 5;
   145881    case 8: return 5;
   145882    case 7:
   145883       if (devinfo->is_haswell) {
   145884          return 5;
   145885       } else {
   145886          return 5;
   145887       }
   145888    case 6: return 5;
   145889    case 5: return 0;
   145890    case 4:
   145891       if (devinfo->is_g4x) {
   145892          return 0;
   145893       } else {
   145894          return 0;
   145895       }
   145896    default:
   145897       unreachable("Invalid hardware generation");
   145898    }
   145899 }
   145900 
   145901 
   145902 
   145903 #define GEN10_MEDIA_OBJECT_WALKER_MiddleLoopExtraSteps_start  208
   145904 #define GEN9_MEDIA_OBJECT_WALKER_MiddleLoopExtraSteps_start  208
   145905 #define GEN8_MEDIA_OBJECT_WALKER_MiddleLoopExtraSteps_start  208
   145906 #define GEN75_MEDIA_OBJECT_WALKER_MiddleLoopExtraSteps_start  208
   145907 #define GEN7_MEDIA_OBJECT_WALKER_MiddleLoopExtraSteps_start  208
   145908 #define GEN6_MEDIA_OBJECT_WALKER_MiddleLoopExtraSteps_start  208
   145909 
   145910 static inline uint32_t ATTRIBUTE_PURE
   145911 MEDIA_OBJECT_WALKER_MiddleLoopExtraSteps_start(const struct gen_device_info *devinfo)
   145912 {
   145913    switch (devinfo->gen) {
   145914    case 10: return 208;
   145915    case 9: return 208;
   145916    case 8: return 208;
   145917    case 7:
   145918       if (devinfo->is_haswell) {
   145919          return 208;
   145920       } else {
   145921          return 208;
   145922       }
   145923    case 6: return 208;
   145924    case 5: return 0;
   145925    case 4:
   145926       if (devinfo->is_g4x) {
   145927          return 0;
   145928       } else {
   145929          return 0;
   145930       }
   145931    default:
   145932       unreachable("Invalid hardware generation");
   145933    }
   145934 }
   145935 
   145936 
   145937 
   145938 /* MEDIA_OBJECT_WALKER::Pipeline */
   145939 
   145940 
   145941 #define GEN10_MEDIA_OBJECT_WALKER_Pipeline_bits  2
   145942 #define GEN9_MEDIA_OBJECT_WALKER_Pipeline_bits  2
   145943 #define GEN8_MEDIA_OBJECT_WALKER_Pipeline_bits  2
   145944 #define GEN75_MEDIA_OBJECT_WALKER_Pipeline_bits  2
   145945 #define GEN7_MEDIA_OBJECT_WALKER_Pipeline_bits  2
   145946 #define GEN6_MEDIA_OBJECT_WALKER_Pipeline_bits  2
   145947 
   145948 static inline uint32_t ATTRIBUTE_PURE
   145949 MEDIA_OBJECT_WALKER_Pipeline_bits(const struct gen_device_info *devinfo)
   145950 {
   145951    switch (devinfo->gen) {
   145952    case 10: return 2;
   145953    case 9: return 2;
   145954    case 8: return 2;
   145955    case 7:
   145956       if (devinfo->is_haswell) {
   145957          return 2;
   145958       } else {
   145959          return 2;
   145960       }
   145961    case 6: return 2;
   145962    case 5: return 0;
   145963    case 4:
   145964       if (devinfo->is_g4x) {
   145965          return 0;
   145966       } else {
   145967          return 0;
   145968       }
   145969    default:
   145970       unreachable("Invalid hardware generation");
   145971    }
   145972 }
   145973 
   145974 
   145975 
   145976 #define GEN10_MEDIA_OBJECT_WALKER_Pipeline_start  27
   145977 #define GEN9_MEDIA_OBJECT_WALKER_Pipeline_start  27
   145978 #define GEN8_MEDIA_OBJECT_WALKER_Pipeline_start  27
   145979 #define GEN75_MEDIA_OBJECT_WALKER_Pipeline_start  27
   145980 #define GEN7_MEDIA_OBJECT_WALKER_Pipeline_start  27
   145981 #define GEN6_MEDIA_OBJECT_WALKER_Pipeline_start  27
   145982 
   145983 static inline uint32_t ATTRIBUTE_PURE
   145984 MEDIA_OBJECT_WALKER_Pipeline_start(const struct gen_device_info *devinfo)
   145985 {
   145986    switch (devinfo->gen) {
   145987    case 10: return 27;
   145988    case 9: return 27;
   145989    case 8: return 27;
   145990    case 7:
   145991       if (devinfo->is_haswell) {
   145992          return 27;
   145993       } else {
   145994          return 27;
   145995       }
   145996    case 6: return 27;
   145997    case 5: return 0;
   145998    case 4:
   145999       if (devinfo->is_g4x) {
   146000          return 0;
   146001       } else {
   146002          return 0;
   146003       }
   146004    default:
   146005       unreachable("Invalid hardware generation");
   146006    }
   146007 }
   146008 
   146009 
   146010 
   146011 /* MEDIA_OBJECT_WALKER::Quad Mode */
   146012 
   146013 
   146014 #define GEN75_MEDIA_OBJECT_WALKER_QuadMode_bits  1
   146015 
   146016 static inline uint32_t ATTRIBUTE_PURE
   146017 MEDIA_OBJECT_WALKER_QuadMode_bits(const struct gen_device_info *devinfo)
   146018 {
   146019    switch (devinfo->gen) {
   146020    case 10: return 0;
   146021    case 9: return 0;
   146022    case 8: return 0;
   146023    case 7:
   146024       if (devinfo->is_haswell) {
   146025          return 1;
   146026       } else {
   146027          return 0;
   146028       }
   146029    case 6: return 0;
   146030    case 5: return 0;
   146031    case 4:
   146032       if (devinfo->is_g4x) {
   146033          return 0;
   146034       } else {
   146035          return 0;
   146036       }
   146037    default:
   146038       unreachable("Invalid hardware generation");
   146039    }
   146040 }
   146041 
   146042 
   146043 
   146044 #define GEN75_MEDIA_OBJECT_WALKER_QuadMode_start  221
   146045 
   146046 static inline uint32_t ATTRIBUTE_PURE
   146047 MEDIA_OBJECT_WALKER_QuadMode_start(const struct gen_device_info *devinfo)
   146048 {
   146049    switch (devinfo->gen) {
   146050    case 10: return 0;
   146051    case 9: return 0;
   146052    case 8: return 0;
   146053    case 7:
   146054       if (devinfo->is_haswell) {
   146055          return 221;
   146056       } else {
   146057          return 0;
   146058       }
   146059    case 6: return 0;
   146060    case 5: return 0;
   146061    case 4:
   146062       if (devinfo->is_g4x) {
   146063          return 0;
   146064       } else {
   146065          return 0;
   146066       }
   146067    default:
   146068       unreachable("Invalid hardware generation");
   146069    }
   146070 }
   146071 
   146072 
   146073 
   146074 /* MEDIA_OBJECT_WALKER::Repel */
   146075 
   146076 
   146077 #define GEN75_MEDIA_OBJECT_WALKER_Repel_bits  1
   146078 #define GEN7_MEDIA_OBJECT_WALKER_Repel_bits  1
   146079 #define GEN6_MEDIA_OBJECT_WALKER_Repel_bits  1
   146080 
   146081 static inline uint32_t ATTRIBUTE_PURE
   146082 MEDIA_OBJECT_WALKER_Repel_bits(const struct gen_device_info *devinfo)
   146083 {
   146084    switch (devinfo->gen) {
   146085    case 10: return 0;
   146086    case 9: return 0;
   146087    case 8: return 0;
   146088    case 7:
   146089       if (devinfo->is_haswell) {
   146090          return 1;
   146091       } else {
   146092          return 1;
   146093       }
   146094    case 6: return 1;
   146095    case 5: return 0;
   146096    case 4:
   146097       if (devinfo->is_g4x) {
   146098          return 0;
   146099       } else {
   146100          return 0;
   146101       }
   146102    default:
   146103       unreachable("Invalid hardware generation");
   146104    }
   146105 }
   146106 
   146107 
   146108 
   146109 #define GEN75_MEDIA_OBJECT_WALKER_Repel_start  222
   146110 #define GEN7_MEDIA_OBJECT_WALKER_Repel_start  222
   146111 #define GEN6_MEDIA_OBJECT_WALKER_Repel_start  222
   146112 
   146113 static inline uint32_t ATTRIBUTE_PURE
   146114 MEDIA_OBJECT_WALKER_Repel_start(const struct gen_device_info *devinfo)
   146115 {
   146116    switch (devinfo->gen) {
   146117    case 10: return 0;
   146118    case 9: return 0;
   146119    case 8: return 0;
   146120    case 7:
   146121       if (devinfo->is_haswell) {
   146122          return 222;
   146123       } else {
   146124          return 222;
   146125       }
   146126    case 6: return 222;
   146127    case 5: return 0;
   146128    case 4:
   146129       if (devinfo->is_g4x) {
   146130          return 0;
   146131       } else {
   146132          return 0;
   146133       }
   146134    default:
   146135       unreachable("Invalid hardware generation");
   146136    }
   146137 }
   146138 
   146139 
   146140 
   146141 /* MEDIA_OBJECT_WALKER::Scoreboard Mask */
   146142 
   146143 
   146144 #define GEN10_MEDIA_OBJECT_WALKER_ScoreboardMask_bits  8
   146145 #define GEN9_MEDIA_OBJECT_WALKER_ScoreboardMask_bits  8
   146146 #define GEN8_MEDIA_OBJECT_WALKER_ScoreboardMask_bits  8
   146147 #define GEN75_MEDIA_OBJECT_WALKER_ScoreboardMask_bits  8
   146148 #define GEN7_MEDIA_OBJECT_WALKER_ScoreboardMask_bits  8
   146149 #define GEN6_MEDIA_OBJECT_WALKER_ScoreboardMask_bits  8
   146150 
   146151 static inline uint32_t ATTRIBUTE_PURE
   146152 MEDIA_OBJECT_WALKER_ScoreboardMask_bits(const struct gen_device_info *devinfo)
   146153 {
   146154    switch (devinfo->gen) {
   146155    case 10: return 8;
   146156    case 9: return 8;
   146157    case 8: return 8;
   146158    case 7:
   146159       if (devinfo->is_haswell) {
   146160          return 8;
   146161       } else {
   146162          return 8;
   146163       }
   146164    case 6: return 8;
   146165    case 5: return 0;
   146166    case 4:
   146167       if (devinfo->is_g4x) {
   146168          return 0;
   146169       } else {
   146170          return 0;
   146171       }
   146172    default:
   146173       unreachable("Invalid hardware generation");
   146174    }
   146175 }
   146176 
   146177 
   146178 
   146179 #define GEN10_MEDIA_OBJECT_WALKER_ScoreboardMask_start  160
   146180 #define GEN9_MEDIA_OBJECT_WALKER_ScoreboardMask_start  160
   146181 #define GEN8_MEDIA_OBJECT_WALKER_ScoreboardMask_start  160
   146182 #define GEN75_MEDIA_OBJECT_WALKER_ScoreboardMask_start  160
   146183 #define GEN7_MEDIA_OBJECT_WALKER_ScoreboardMask_start  160
   146184 #define GEN6_MEDIA_OBJECT_WALKER_ScoreboardMask_start  160
   146185 
   146186 static inline uint32_t ATTRIBUTE_PURE
   146187 MEDIA_OBJECT_WALKER_ScoreboardMask_start(const struct gen_device_info *devinfo)
   146188 {
   146189    switch (devinfo->gen) {
   146190    case 10: return 160;
   146191    case 9: return 160;
   146192    case 8: return 160;
   146193    case 7:
   146194       if (devinfo->is_haswell) {
   146195          return 160;
   146196       } else {
   146197          return 160;
   146198       }
   146199    case 6: return 160;
   146200    case 5: return 0;
   146201    case 4:
   146202       if (devinfo->is_g4x) {
   146203          return 0;
   146204       } else {
   146205          return 0;
   146206       }
   146207    default:
   146208       unreachable("Invalid hardware generation");
   146209    }
   146210 }
   146211 
   146212 
   146213 
   146214 /* MEDIA_OBJECT_WALKER::SubOpcode */
   146215 
   146216 
   146217 #define GEN10_MEDIA_OBJECT_WALKER_SubOpcode_bits  8
   146218 #define GEN9_MEDIA_OBJECT_WALKER_SubOpcode_bits  8
   146219 #define GEN8_MEDIA_OBJECT_WALKER_SubOpcode_bits  8
   146220 #define GEN75_MEDIA_OBJECT_WALKER_SubOpcode_bits  8
   146221 #define GEN7_MEDIA_OBJECT_WALKER_SubOpcode_bits  8
   146222 #define GEN6_MEDIA_OBJECT_WALKER_SubOpcode_bits  8
   146223 
   146224 static inline uint32_t ATTRIBUTE_PURE
   146225 MEDIA_OBJECT_WALKER_SubOpcode_bits(const struct gen_device_info *devinfo)
   146226 {
   146227    switch (devinfo->gen) {
   146228    case 10: return 8;
   146229    case 9: return 8;
   146230    case 8: return 8;
   146231    case 7:
   146232       if (devinfo->is_haswell) {
   146233          return 8;
   146234       } else {
   146235          return 8;
   146236       }
   146237    case 6: return 8;
   146238    case 5: return 0;
   146239    case 4:
   146240       if (devinfo->is_g4x) {
   146241          return 0;
   146242       } else {
   146243          return 0;
   146244       }
   146245    default:
   146246       unreachable("Invalid hardware generation");
   146247    }
   146248 }
   146249 
   146250 
   146251 
   146252 #define GEN10_MEDIA_OBJECT_WALKER_SubOpcode_start  16
   146253 #define GEN9_MEDIA_OBJECT_WALKER_SubOpcode_start  16
   146254 #define GEN8_MEDIA_OBJECT_WALKER_SubOpcode_start  16
   146255 #define GEN75_MEDIA_OBJECT_WALKER_SubOpcode_start  16
   146256 #define GEN7_MEDIA_OBJECT_WALKER_SubOpcode_start  16
   146257 #define GEN6_MEDIA_OBJECT_WALKER_SubOpcode_start  16
   146258 
   146259 static inline uint32_t ATTRIBUTE_PURE
   146260 MEDIA_OBJECT_WALKER_SubOpcode_start(const struct gen_device_info *devinfo)
   146261 {
   146262    switch (devinfo->gen) {
   146263    case 10: return 16;
   146264    case 9: return 16;
   146265    case 8: return 16;
   146266    case 7:
   146267       if (devinfo->is_haswell) {
   146268          return 16;
   146269       } else {
   146270          return 16;
   146271       }
   146272    case 6: return 16;
   146273    case 5: return 0;
   146274    case 4:
   146275       if (devinfo->is_g4x) {
   146276          return 0;
   146277       } else {
   146278          return 0;
   146279       }
   146280    default:
   146281       unreachable("Invalid hardware generation");
   146282    }
   146283 }
   146284 
   146285 
   146286 
   146287 /* MEDIA_OBJECT_WALKER::Thread Synchronization */
   146288 
   146289 
   146290 #define GEN10_MEDIA_OBJECT_WALKER_ThreadSynchronization_bits  1
   146291 #define GEN9_MEDIA_OBJECT_WALKER_ThreadSynchronization_bits  1
   146292 #define GEN8_MEDIA_OBJECT_WALKER_ThreadSynchronization_bits  1
   146293 #define GEN75_MEDIA_OBJECT_WALKER_ThreadSynchronization_bits  1
   146294 #define GEN7_MEDIA_OBJECT_WALKER_ThreadSynchronization_bits  1
   146295 #define GEN6_MEDIA_OBJECT_WALKER_ThreadSynchronization_bits  1
   146296 
   146297 static inline uint32_t ATTRIBUTE_PURE
   146298 MEDIA_OBJECT_WALKER_ThreadSynchronization_bits(const struct gen_device_info *devinfo)
   146299 {
   146300    switch (devinfo->gen) {
   146301    case 10: return 1;
   146302    case 9: return 1;
   146303    case 8: return 1;
   146304    case 7:
   146305       if (devinfo->is_haswell) {
   146306          return 1;
   146307       } else {
   146308          return 1;
   146309       }
   146310    case 6: return 1;
   146311    case 5: return 0;
   146312    case 4:
   146313       if (devinfo->is_g4x) {
   146314          return 0;
   146315       } else {
   146316          return 0;
   146317       }
   146318    default:
   146319       unreachable("Invalid hardware generation");
   146320    }
   146321 }
   146322 
   146323 
   146324 
   146325 #define GEN10_MEDIA_OBJECT_WALKER_ThreadSynchronization_start  88
   146326 #define GEN9_MEDIA_OBJECT_WALKER_ThreadSynchronization_start  88
   146327 #define GEN8_MEDIA_OBJECT_WALKER_ThreadSynchronization_start  88
   146328 #define GEN75_MEDIA_OBJECT_WALKER_ThreadSynchronization_start  88
   146329 #define GEN7_MEDIA_OBJECT_WALKER_ThreadSynchronization_start  88
   146330 #define GEN6_MEDIA_OBJECT_WALKER_ThreadSynchronization_start  88
   146331 
   146332 static inline uint32_t ATTRIBUTE_PURE
   146333 MEDIA_OBJECT_WALKER_ThreadSynchronization_start(const struct gen_device_info *devinfo)
   146334 {
   146335    switch (devinfo->gen) {
   146336    case 10: return 88;
   146337    case 9: return 88;
   146338    case 8: return 88;
   146339    case 7:
   146340       if (devinfo->is_haswell) {
   146341          return 88;
   146342       } else {
   146343          return 88;
   146344       }
   146345    case 6: return 88;
   146346    case 5: return 0;
   146347    case 4:
   146348       if (devinfo->is_g4x) {
   146349          return 0;
   146350       } else {
   146351          return 0;
   146352       }
   146353    default:
   146354       unreachable("Invalid hardware generation");
   146355    }
   146356 }
   146357 
   146358 
   146359 
   146360 /* MEDIA_OBJECT_WALKER::Use Scoreboard */
   146361 
   146362 
   146363 #define GEN10_MEDIA_OBJECT_WALKER_UseScoreboard_bits  1
   146364 #define GEN9_MEDIA_OBJECT_WALKER_UseScoreboard_bits  1
   146365 #define GEN8_MEDIA_OBJECT_WALKER_UseScoreboard_bits  1
   146366 #define GEN75_MEDIA_OBJECT_WALKER_UseScoreboard_bits  1
   146367 #define GEN7_MEDIA_OBJECT_WALKER_UseScoreboard_bits  1
   146368 #define GEN6_MEDIA_OBJECT_WALKER_UseScoreboard_bits  1
   146369 
   146370 static inline uint32_t ATTRIBUTE_PURE
   146371 MEDIA_OBJECT_WALKER_UseScoreboard_bits(const struct gen_device_info *devinfo)
   146372 {
   146373    switch (devinfo->gen) {
   146374    case 10: return 1;
   146375    case 9: return 1;
   146376    case 8: return 1;
   146377    case 7:
   146378       if (devinfo->is_haswell) {
   146379          return 1;
   146380       } else {
   146381          return 1;
   146382       }
   146383    case 6: return 1;
   146384    case 5: return 0;
   146385    case 4:
   146386       if (devinfo->is_g4x) {
   146387          return 0;
   146388       } else {
   146389          return 0;
   146390       }
   146391    default:
   146392       unreachable("Invalid hardware generation");
   146393    }
   146394 }
   146395 
   146396 
   146397 
   146398 #define GEN10_MEDIA_OBJECT_WALKER_UseScoreboard_start  85
   146399 #define GEN9_MEDIA_OBJECT_WALKER_UseScoreboard_start  85
   146400 #define GEN8_MEDIA_OBJECT_WALKER_UseScoreboard_start  85
   146401 #define GEN75_MEDIA_OBJECT_WALKER_UseScoreboard_start  85
   146402 #define GEN7_MEDIA_OBJECT_WALKER_UseScoreboard_start  85
   146403 #define GEN6_MEDIA_OBJECT_WALKER_UseScoreboard_start  85
   146404 
   146405 static inline uint32_t ATTRIBUTE_PURE
   146406 MEDIA_OBJECT_WALKER_UseScoreboard_start(const struct gen_device_info *devinfo)
   146407 {
   146408    switch (devinfo->gen) {
   146409    case 10: return 85;
   146410    case 9: return 85;
   146411    case 8: return 85;
   146412    case 7:
   146413       if (devinfo->is_haswell) {
   146414          return 85;
   146415       } else {
   146416          return 85;
   146417       }
   146418    case 6: return 85;
   146419    case 5: return 0;
   146420    case 4:
   146421       if (devinfo->is_g4x) {
   146422          return 0;
   146423       } else {
   146424          return 0;
   146425       }
   146426    default:
   146427       unreachable("Invalid hardware generation");
   146428    }
   146429 }
   146430 
   146431 
   146432 
   146433 /* MEDIA_STATE_FLUSH */
   146434 
   146435 
   146436 #define GEN10_MEDIA_STATE_FLUSH_length  2
   146437 #define GEN9_MEDIA_STATE_FLUSH_length  2
   146438 #define GEN8_MEDIA_STATE_FLUSH_length  2
   146439 #define GEN75_MEDIA_STATE_FLUSH_length  2
   146440 #define GEN7_MEDIA_STATE_FLUSH_length  2
   146441 #define GEN6_MEDIA_STATE_FLUSH_length  2
   146442 
   146443 static inline uint32_t ATTRIBUTE_PURE
   146444 MEDIA_STATE_FLUSH_length(const struct gen_device_info *devinfo)
   146445 {
   146446    switch (devinfo->gen) {
   146447    case 10: return 2;
   146448    case 9: return 2;
   146449    case 8: return 2;
   146450    case 7:
   146451       if (devinfo->is_haswell) {
   146452          return 2;
   146453       } else {
   146454          return 2;
   146455       }
   146456    case 6: return 2;
   146457    case 5: return 0;
   146458    case 4:
   146459       if (devinfo->is_g4x) {
   146460          return 0;
   146461       } else {
   146462          return 0;
   146463       }
   146464    default:
   146465       unreachable("Invalid hardware generation");
   146466    }
   146467 }
   146468 
   146469 
   146470 
   146471 /* MEDIA_STATE_FLUSH::Barrier Mask */
   146472 
   146473 
   146474 #define GEN6_MEDIA_STATE_FLUSH_BarrierMask_bits  16
   146475 
   146476 static inline uint32_t ATTRIBUTE_PURE
   146477 MEDIA_STATE_FLUSH_BarrierMask_bits(const struct gen_device_info *devinfo)
   146478 {
   146479    switch (devinfo->gen) {
   146480    case 10: return 0;
   146481    case 9: return 0;
   146482    case 8: return 0;
   146483    case 7:
   146484       if (devinfo->is_haswell) {
   146485          return 0;
   146486       } else {
   146487          return 0;
   146488       }
   146489    case 6: return 16;
   146490    case 5: return 0;
   146491    case 4:
   146492       if (devinfo->is_g4x) {
   146493          return 0;
   146494       } else {
   146495          return 0;
   146496       }
   146497    default:
   146498       unreachable("Invalid hardware generation");
   146499    }
   146500 }
   146501 
   146502 
   146503 
   146504 #define GEN6_MEDIA_STATE_FLUSH_BarrierMask_start  32
   146505 
   146506 static inline uint32_t ATTRIBUTE_PURE
   146507 MEDIA_STATE_FLUSH_BarrierMask_start(const struct gen_device_info *devinfo)
   146508 {
   146509    switch (devinfo->gen) {
   146510    case 10: return 0;
   146511    case 9: return 0;
   146512    case 8: return 0;
   146513    case 7:
   146514       if (devinfo->is_haswell) {
   146515          return 0;
   146516       } else {
   146517          return 0;
   146518       }
   146519    case 6: return 32;
   146520    case 5: return 0;
   146521    case 4:
   146522       if (devinfo->is_g4x) {
   146523          return 0;
   146524       } else {
   146525          return 0;
   146526       }
   146527    default:
   146528       unreachable("Invalid hardware generation");
   146529    }
   146530 }
   146531 
   146532 
   146533 
   146534 /* MEDIA_STATE_FLUSH::Command Type */
   146535 
   146536 
   146537 #define GEN10_MEDIA_STATE_FLUSH_CommandType_bits  3
   146538 #define GEN9_MEDIA_STATE_FLUSH_CommandType_bits  3
   146539 #define GEN8_MEDIA_STATE_FLUSH_CommandType_bits  3
   146540 #define GEN75_MEDIA_STATE_FLUSH_CommandType_bits  3
   146541 #define GEN7_MEDIA_STATE_FLUSH_CommandType_bits  3
   146542 #define GEN6_MEDIA_STATE_FLUSH_CommandType_bits  3
   146543 
   146544 static inline uint32_t ATTRIBUTE_PURE
   146545 MEDIA_STATE_FLUSH_CommandType_bits(const struct gen_device_info *devinfo)
   146546 {
   146547    switch (devinfo->gen) {
   146548    case 10: return 3;
   146549    case 9: return 3;
   146550    case 8: return 3;
   146551    case 7:
   146552       if (devinfo->is_haswell) {
   146553          return 3;
   146554       } else {
   146555          return 3;
   146556       }
   146557    case 6: return 3;
   146558    case 5: return 0;
   146559    case 4:
   146560       if (devinfo->is_g4x) {
   146561          return 0;
   146562       } else {
   146563          return 0;
   146564       }
   146565    default:
   146566       unreachable("Invalid hardware generation");
   146567    }
   146568 }
   146569 
   146570 
   146571 
   146572 #define GEN10_MEDIA_STATE_FLUSH_CommandType_start  29
   146573 #define GEN9_MEDIA_STATE_FLUSH_CommandType_start  29
   146574 #define GEN8_MEDIA_STATE_FLUSH_CommandType_start  29
   146575 #define GEN75_MEDIA_STATE_FLUSH_CommandType_start  29
   146576 #define GEN7_MEDIA_STATE_FLUSH_CommandType_start  29
   146577 #define GEN6_MEDIA_STATE_FLUSH_CommandType_start  29
   146578 
   146579 static inline uint32_t ATTRIBUTE_PURE
   146580 MEDIA_STATE_FLUSH_CommandType_start(const struct gen_device_info *devinfo)
   146581 {
   146582    switch (devinfo->gen) {
   146583    case 10: return 29;
   146584    case 9: return 29;
   146585    case 8: return 29;
   146586    case 7:
   146587       if (devinfo->is_haswell) {
   146588          return 29;
   146589       } else {
   146590          return 29;
   146591       }
   146592    case 6: return 29;
   146593    case 5: return 0;
   146594    case 4:
   146595       if (devinfo->is_g4x) {
   146596          return 0;
   146597       } else {
   146598          return 0;
   146599       }
   146600    default:
   146601       unreachable("Invalid hardware generation");
   146602    }
   146603 }
   146604 
   146605 
   146606 
   146607 /* MEDIA_STATE_FLUSH::DWord Length */
   146608 
   146609 
   146610 #define GEN10_MEDIA_STATE_FLUSH_DWordLength_bits  16
   146611 #define GEN9_MEDIA_STATE_FLUSH_DWordLength_bits  16
   146612 #define GEN8_MEDIA_STATE_FLUSH_DWordLength_bits  16
   146613 #define GEN75_MEDIA_STATE_FLUSH_DWordLength_bits  16
   146614 #define GEN7_MEDIA_STATE_FLUSH_DWordLength_bits  16
   146615 #define GEN6_MEDIA_STATE_FLUSH_DWordLength_bits  16
   146616 
   146617 static inline uint32_t ATTRIBUTE_PURE
   146618 MEDIA_STATE_FLUSH_DWordLength_bits(const struct gen_device_info *devinfo)
   146619 {
   146620    switch (devinfo->gen) {
   146621    case 10: return 16;
   146622    case 9: return 16;
   146623    case 8: return 16;
   146624    case 7:
   146625       if (devinfo->is_haswell) {
   146626          return 16;
   146627       } else {
   146628          return 16;
   146629       }
   146630    case 6: return 16;
   146631    case 5: return 0;
   146632    case 4:
   146633       if (devinfo->is_g4x) {
   146634          return 0;
   146635       } else {
   146636          return 0;
   146637       }
   146638    default:
   146639       unreachable("Invalid hardware generation");
   146640    }
   146641 }
   146642 
   146643 
   146644 
   146645 #define GEN10_MEDIA_STATE_FLUSH_DWordLength_start  0
   146646 #define GEN9_MEDIA_STATE_FLUSH_DWordLength_start  0
   146647 #define GEN8_MEDIA_STATE_FLUSH_DWordLength_start  0
   146648 #define GEN75_MEDIA_STATE_FLUSH_DWordLength_start  0
   146649 #define GEN7_MEDIA_STATE_FLUSH_DWordLength_start  0
   146650 #define GEN6_MEDIA_STATE_FLUSH_DWordLength_start  0
   146651 
   146652 static inline uint32_t ATTRIBUTE_PURE
   146653 MEDIA_STATE_FLUSH_DWordLength_start(const struct gen_device_info *devinfo)
   146654 {
   146655    switch (devinfo->gen) {
   146656    case 10: return 0;
   146657    case 9: return 0;
   146658    case 8: return 0;
   146659    case 7:
   146660       if (devinfo->is_haswell) {
   146661          return 0;
   146662       } else {
   146663          return 0;
   146664       }
   146665    case 6: return 0;
   146666    case 5: return 0;
   146667    case 4:
   146668       if (devinfo->is_g4x) {
   146669          return 0;
   146670       } else {
   146671          return 0;
   146672       }
   146673    default:
   146674       unreachable("Invalid hardware generation");
   146675    }
   146676 }
   146677 
   146678 
   146679 
   146680 /* MEDIA_STATE_FLUSH::Disable Preemption */
   146681 
   146682 
   146683 #define GEN75_MEDIA_STATE_FLUSH_DisablePreemption_bits  1
   146684 
   146685 static inline uint32_t ATTRIBUTE_PURE
   146686 MEDIA_STATE_FLUSH_DisablePreemption_bits(const struct gen_device_info *devinfo)
   146687 {
   146688    switch (devinfo->gen) {
   146689    case 10: return 0;
   146690    case 9: return 0;
   146691    case 8: return 0;
   146692    case 7:
   146693       if (devinfo->is_haswell) {
   146694          return 1;
   146695       } else {
   146696          return 0;
   146697       }
   146698    case 6: return 0;
   146699    case 5: return 0;
   146700    case 4:
   146701       if (devinfo->is_g4x) {
   146702          return 0;
   146703       } else {
   146704          return 0;
   146705       }
   146706    default:
   146707       unreachable("Invalid hardware generation");
   146708    }
   146709 }
   146710 
   146711 
   146712 
   146713 #define GEN75_MEDIA_STATE_FLUSH_DisablePreemption_start  40
   146714 
   146715 static inline uint32_t ATTRIBUTE_PURE
   146716 MEDIA_STATE_FLUSH_DisablePreemption_start(const struct gen_device_info *devinfo)
   146717 {
   146718    switch (devinfo->gen) {
   146719    case 10: return 0;
   146720    case 9: return 0;
   146721    case 8: return 0;
   146722    case 7:
   146723       if (devinfo->is_haswell) {
   146724          return 40;
   146725       } else {
   146726          return 0;
   146727       }
   146728    case 6: return 0;
   146729    case 5: return 0;
   146730    case 4:
   146731       if (devinfo->is_g4x) {
   146732          return 0;
   146733       } else {
   146734          return 0;
   146735       }
   146736    default:
   146737       unreachable("Invalid hardware generation");
   146738    }
   146739 }
   146740 
   146741 
   146742 
   146743 /* MEDIA_STATE_FLUSH::Flush to GO */
   146744 
   146745 
   146746 #define GEN10_MEDIA_STATE_FLUSH_FlushtoGO_bits  1
   146747 #define GEN9_MEDIA_STATE_FLUSH_FlushtoGO_bits  1
   146748 #define GEN8_MEDIA_STATE_FLUSH_FlushtoGO_bits  1
   146749 #define GEN75_MEDIA_STATE_FLUSH_FlushtoGO_bits  1
   146750 
   146751 static inline uint32_t ATTRIBUTE_PURE
   146752 MEDIA_STATE_FLUSH_FlushtoGO_bits(const struct gen_device_info *devinfo)
   146753 {
   146754    switch (devinfo->gen) {
   146755    case 10: return 1;
   146756    case 9: return 1;
   146757    case 8: return 1;
   146758    case 7:
   146759       if (devinfo->is_haswell) {
   146760          return 1;
   146761       } else {
   146762          return 0;
   146763       }
   146764    case 6: return 0;
   146765    case 5: return 0;
   146766    case 4:
   146767       if (devinfo->is_g4x) {
   146768          return 0;
   146769       } else {
   146770          return 0;
   146771       }
   146772    default:
   146773       unreachable("Invalid hardware generation");
   146774    }
   146775 }
   146776 
   146777 
   146778 
   146779 #define GEN10_MEDIA_STATE_FLUSH_FlushtoGO_start  39
   146780 #define GEN9_MEDIA_STATE_FLUSH_FlushtoGO_start  39
   146781 #define GEN8_MEDIA_STATE_FLUSH_FlushtoGO_start  39
   146782 #define GEN75_MEDIA_STATE_FLUSH_FlushtoGO_start  39
   146783 
   146784 static inline uint32_t ATTRIBUTE_PURE
   146785 MEDIA_STATE_FLUSH_FlushtoGO_start(const struct gen_device_info *devinfo)
   146786 {
   146787    switch (devinfo->gen) {
   146788    case 10: return 39;
   146789    case 9: return 39;
   146790    case 8: return 39;
   146791    case 7:
   146792       if (devinfo->is_haswell) {
   146793          return 39;
   146794       } else {
   146795          return 0;
   146796       }
   146797    case 6: return 0;
   146798    case 5: return 0;
   146799    case 4:
   146800       if (devinfo->is_g4x) {
   146801          return 0;
   146802       } else {
   146803          return 0;
   146804       }
   146805    default:
   146806       unreachable("Invalid hardware generation");
   146807    }
   146808 }
   146809 
   146810 
   146811 
   146812 /* MEDIA_STATE_FLUSH::Interface Descriptor Offset */
   146813 
   146814 
   146815 #define GEN10_MEDIA_STATE_FLUSH_InterfaceDescriptorOffset_bits  6
   146816 #define GEN9_MEDIA_STATE_FLUSH_InterfaceDescriptorOffset_bits  6
   146817 #define GEN8_MEDIA_STATE_FLUSH_InterfaceDescriptorOffset_bits  6
   146818 #define GEN75_MEDIA_STATE_FLUSH_InterfaceDescriptorOffset_bits  6
   146819 #define GEN7_MEDIA_STATE_FLUSH_InterfaceDescriptorOffset_bits  6
   146820 
   146821 static inline uint32_t ATTRIBUTE_PURE
   146822 MEDIA_STATE_FLUSH_InterfaceDescriptorOffset_bits(const struct gen_device_info *devinfo)
   146823 {
   146824    switch (devinfo->gen) {
   146825    case 10: return 6;
   146826    case 9: return 6;
   146827    case 8: return 6;
   146828    case 7:
   146829       if (devinfo->is_haswell) {
   146830          return 6;
   146831       } else {
   146832          return 6;
   146833       }
   146834    case 6: return 0;
   146835    case 5: return 0;
   146836    case 4:
   146837       if (devinfo->is_g4x) {
   146838          return 0;
   146839       } else {
   146840          return 0;
   146841       }
   146842    default:
   146843       unreachable("Invalid hardware generation");
   146844    }
   146845 }
   146846 
   146847 
   146848 
   146849 #define GEN10_MEDIA_STATE_FLUSH_InterfaceDescriptorOffset_start  32
   146850 #define GEN9_MEDIA_STATE_FLUSH_InterfaceDescriptorOffset_start  32
   146851 #define GEN8_MEDIA_STATE_FLUSH_InterfaceDescriptorOffset_start  32
   146852 #define GEN75_MEDIA_STATE_FLUSH_InterfaceDescriptorOffset_start  32
   146853 #define GEN7_MEDIA_STATE_FLUSH_InterfaceDescriptorOffset_start  32
   146854 
   146855 static inline uint32_t ATTRIBUTE_PURE
   146856 MEDIA_STATE_FLUSH_InterfaceDescriptorOffset_start(const struct gen_device_info *devinfo)
   146857 {
   146858    switch (devinfo->gen) {
   146859    case 10: return 32;
   146860    case 9: return 32;
   146861    case 8: return 32;
   146862    case 7:
   146863       if (devinfo->is_haswell) {
   146864          return 32;
   146865       } else {
   146866          return 32;
   146867       }
   146868    case 6: return 0;
   146869    case 5: return 0;
   146870    case 4:
   146871       if (devinfo->is_g4x) {
   146872          return 0;
   146873       } else {
   146874          return 0;
   146875       }
   146876    default:
   146877       unreachable("Invalid hardware generation");
   146878    }
   146879 }
   146880 
   146881 
   146882 
   146883 /* MEDIA_STATE_FLUSH::Media Command Opcode */
   146884 
   146885 
   146886 #define GEN10_MEDIA_STATE_FLUSH_MediaCommandOpcode_bits  3
   146887 #define GEN9_MEDIA_STATE_FLUSH_MediaCommandOpcode_bits  3
   146888 #define GEN8_MEDIA_STATE_FLUSH_MediaCommandOpcode_bits  3
   146889 #define GEN75_MEDIA_STATE_FLUSH_MediaCommandOpcode_bits  3
   146890 #define GEN7_MEDIA_STATE_FLUSH_MediaCommandOpcode_bits  3
   146891 #define GEN6_MEDIA_STATE_FLUSH_MediaCommandOpcode_bits  3
   146892 
   146893 static inline uint32_t ATTRIBUTE_PURE
   146894 MEDIA_STATE_FLUSH_MediaCommandOpcode_bits(const struct gen_device_info *devinfo)
   146895 {
   146896    switch (devinfo->gen) {
   146897    case 10: return 3;
   146898    case 9: return 3;
   146899    case 8: return 3;
   146900    case 7:
   146901       if (devinfo->is_haswell) {
   146902          return 3;
   146903       } else {
   146904          return 3;
   146905       }
   146906    case 6: return 3;
   146907    case 5: return 0;
   146908    case 4:
   146909       if (devinfo->is_g4x) {
   146910          return 0;
   146911       } else {
   146912          return 0;
   146913       }
   146914    default:
   146915       unreachable("Invalid hardware generation");
   146916    }
   146917 }
   146918 
   146919 
   146920 
   146921 #define GEN10_MEDIA_STATE_FLUSH_MediaCommandOpcode_start  24
   146922 #define GEN9_MEDIA_STATE_FLUSH_MediaCommandOpcode_start  24
   146923 #define GEN8_MEDIA_STATE_FLUSH_MediaCommandOpcode_start  24
   146924 #define GEN75_MEDIA_STATE_FLUSH_MediaCommandOpcode_start  24
   146925 #define GEN7_MEDIA_STATE_FLUSH_MediaCommandOpcode_start  24
   146926 #define GEN6_MEDIA_STATE_FLUSH_MediaCommandOpcode_start  24
   146927 
   146928 static inline uint32_t ATTRIBUTE_PURE
   146929 MEDIA_STATE_FLUSH_MediaCommandOpcode_start(const struct gen_device_info *devinfo)
   146930 {
   146931    switch (devinfo->gen) {
   146932    case 10: return 24;
   146933    case 9: return 24;
   146934    case 8: return 24;
   146935    case 7:
   146936       if (devinfo->is_haswell) {
   146937          return 24;
   146938       } else {
   146939          return 24;
   146940       }
   146941    case 6: return 24;
   146942    case 5: return 0;
   146943    case 4:
   146944       if (devinfo->is_g4x) {
   146945          return 0;
   146946       } else {
   146947          return 0;
   146948       }
   146949    default:
   146950       unreachable("Invalid hardware generation");
   146951    }
   146952 }
   146953 
   146954 
   146955 
   146956 /* MEDIA_STATE_FLUSH::Pipeline */
   146957 
   146958 
   146959 #define GEN10_MEDIA_STATE_FLUSH_Pipeline_bits  2
   146960 #define GEN9_MEDIA_STATE_FLUSH_Pipeline_bits  2
   146961 #define GEN8_MEDIA_STATE_FLUSH_Pipeline_bits  2
   146962 #define GEN75_MEDIA_STATE_FLUSH_Pipeline_bits  2
   146963 #define GEN7_MEDIA_STATE_FLUSH_Pipeline_bits  2
   146964 #define GEN6_MEDIA_STATE_FLUSH_Pipeline_bits  2
   146965 
   146966 static inline uint32_t ATTRIBUTE_PURE
   146967 MEDIA_STATE_FLUSH_Pipeline_bits(const struct gen_device_info *devinfo)
   146968 {
   146969    switch (devinfo->gen) {
   146970    case 10: return 2;
   146971    case 9: return 2;
   146972    case 8: return 2;
   146973    case 7:
   146974       if (devinfo->is_haswell) {
   146975          return 2;
   146976       } else {
   146977          return 2;
   146978       }
   146979    case 6: return 2;
   146980    case 5: return 0;
   146981    case 4:
   146982       if (devinfo->is_g4x) {
   146983          return 0;
   146984       } else {
   146985          return 0;
   146986       }
   146987    default:
   146988       unreachable("Invalid hardware generation");
   146989    }
   146990 }
   146991 
   146992 
   146993 
   146994 #define GEN10_MEDIA_STATE_FLUSH_Pipeline_start  27
   146995 #define GEN9_MEDIA_STATE_FLUSH_Pipeline_start  27
   146996 #define GEN8_MEDIA_STATE_FLUSH_Pipeline_start  27
   146997 #define GEN75_MEDIA_STATE_FLUSH_Pipeline_start  27
   146998 #define GEN7_MEDIA_STATE_FLUSH_Pipeline_start  27
   146999 #define GEN6_MEDIA_STATE_FLUSH_Pipeline_start  27
   147000 
   147001 static inline uint32_t ATTRIBUTE_PURE
   147002 MEDIA_STATE_FLUSH_Pipeline_start(const struct gen_device_info *devinfo)
   147003 {
   147004    switch (devinfo->gen) {
   147005    case 10: return 27;
   147006    case 9: return 27;
   147007    case 8: return 27;
   147008    case 7:
   147009       if (devinfo->is_haswell) {
   147010          return 27;
   147011       } else {
   147012          return 27;
   147013       }
   147014    case 6: return 27;
   147015    case 5: return 0;
   147016    case 4:
   147017       if (devinfo->is_g4x) {
   147018          return 0;
   147019       } else {
   147020          return 0;
   147021       }
   147022    default:
   147023       unreachable("Invalid hardware generation");
   147024    }
   147025 }
   147026 
   147027 
   147028 
   147029 /* MEDIA_STATE_FLUSH::SubOpcode */
   147030 
   147031 
   147032 #define GEN10_MEDIA_STATE_FLUSH_SubOpcode_bits  8
   147033 #define GEN9_MEDIA_STATE_FLUSH_SubOpcode_bits  8
   147034 #define GEN8_MEDIA_STATE_FLUSH_SubOpcode_bits  8
   147035 #define GEN75_MEDIA_STATE_FLUSH_SubOpcode_bits  8
   147036 #define GEN7_MEDIA_STATE_FLUSH_SubOpcode_bits  8
   147037 #define GEN6_MEDIA_STATE_FLUSH_SubOpcode_bits  8
   147038 
   147039 static inline uint32_t ATTRIBUTE_PURE
   147040 MEDIA_STATE_FLUSH_SubOpcode_bits(const struct gen_device_info *devinfo)
   147041 {
   147042    switch (devinfo->gen) {
   147043    case 10: return 8;
   147044    case 9: return 8;
   147045    case 8: return 8;
   147046    case 7:
   147047       if (devinfo->is_haswell) {
   147048          return 8;
   147049       } else {
   147050          return 8;
   147051       }
   147052    case 6: return 8;
   147053    case 5: return 0;
   147054    case 4:
   147055       if (devinfo->is_g4x) {
   147056          return 0;
   147057       } else {
   147058          return 0;
   147059       }
   147060    default:
   147061       unreachable("Invalid hardware generation");
   147062    }
   147063 }
   147064 
   147065 
   147066 
   147067 #define GEN10_MEDIA_STATE_FLUSH_SubOpcode_start  16
   147068 #define GEN9_MEDIA_STATE_FLUSH_SubOpcode_start  16
   147069 #define GEN8_MEDIA_STATE_FLUSH_SubOpcode_start  16
   147070 #define GEN75_MEDIA_STATE_FLUSH_SubOpcode_start  16
   147071 #define GEN7_MEDIA_STATE_FLUSH_SubOpcode_start  16
   147072 #define GEN6_MEDIA_STATE_FLUSH_SubOpcode_start  16
   147073 
   147074 static inline uint32_t ATTRIBUTE_PURE
   147075 MEDIA_STATE_FLUSH_SubOpcode_start(const struct gen_device_info *devinfo)
   147076 {
   147077    switch (devinfo->gen) {
   147078    case 10: return 16;
   147079    case 9: return 16;
   147080    case 8: return 16;
   147081    case 7:
   147082       if (devinfo->is_haswell) {
   147083          return 16;
   147084       } else {
   147085          return 16;
   147086       }
   147087    case 6: return 16;
   147088    case 5: return 0;
   147089    case 4:
   147090       if (devinfo->is_g4x) {
   147091          return 0;
   147092       } else {
   147093          return 0;
   147094       }
   147095    default:
   147096       unreachable("Invalid hardware generation");
   147097    }
   147098 }
   147099 
   147100 
   147101 
   147102 /* MEDIA_STATE_FLUSH::Thread Count WaterMark */
   147103 
   147104 
   147105 #define GEN6_MEDIA_STATE_FLUSH_ThreadCountWaterMark_bits  8
   147106 
   147107 static inline uint32_t ATTRIBUTE_PURE
   147108 MEDIA_STATE_FLUSH_ThreadCountWaterMark_bits(const struct gen_device_info *devinfo)
   147109 {
   147110    switch (devinfo->gen) {
   147111    case 10: return 0;
   147112    case 9: return 0;
   147113    case 8: return 0;
   147114    case 7:
   147115       if (devinfo->is_haswell) {
   147116          return 0;
   147117       } else {
   147118          return 0;
   147119       }
   147120    case 6: return 8;
   147121    case 5: return 0;
   147122    case 4:
   147123       if (devinfo->is_g4x) {
   147124          return 0;
   147125       } else {
   147126          return 0;
   147127       }
   147128    default:
   147129       unreachable("Invalid hardware generation");
   147130    }
   147131 }
   147132 
   147133 
   147134 
   147135 #define GEN6_MEDIA_STATE_FLUSH_ThreadCountWaterMark_start  48
   147136 
   147137 static inline uint32_t ATTRIBUTE_PURE
   147138 MEDIA_STATE_FLUSH_ThreadCountWaterMark_start(const struct gen_device_info *devinfo)
   147139 {
   147140    switch (devinfo->gen) {
   147141    case 10: return 0;
   147142    case 9: return 0;
   147143    case 8: return 0;
   147144    case 7:
   147145       if (devinfo->is_haswell) {
   147146          return 0;
   147147       } else {
   147148          return 0;
   147149       }
   147150    case 6: return 48;
   147151    case 5: return 0;
   147152    case 4:
   147153       if (devinfo->is_g4x) {
   147154          return 0;
   147155       } else {
   147156          return 0;
   147157       }
   147158    default:
   147159       unreachable("Invalid hardware generation");
   147160    }
   147161 }
   147162 
   147163 
   147164 
   147165 /* MEDIA_STATE_FLUSH::Watermark Required */
   147166 
   147167 
   147168 #define GEN10_MEDIA_STATE_FLUSH_WatermarkRequired_bits  1
   147169 #define GEN9_MEDIA_STATE_FLUSH_WatermarkRequired_bits  1
   147170 #define GEN8_MEDIA_STATE_FLUSH_WatermarkRequired_bits  1
   147171 #define GEN75_MEDIA_STATE_FLUSH_WatermarkRequired_bits  1
   147172 #define GEN7_MEDIA_STATE_FLUSH_WatermarkRequired_bits  1
   147173 
   147174 static inline uint32_t ATTRIBUTE_PURE
   147175 MEDIA_STATE_FLUSH_WatermarkRequired_bits(const struct gen_device_info *devinfo)
   147176 {
   147177    switch (devinfo->gen) {
   147178    case 10: return 1;
   147179    case 9: return 1;
   147180    case 8: return 1;
   147181    case 7:
   147182       if (devinfo->is_haswell) {
   147183          return 1;
   147184       } else {
   147185          return 1;
   147186       }
   147187    case 6: return 0;
   147188    case 5: return 0;
   147189    case 4:
   147190       if (devinfo->is_g4x) {
   147191          return 0;
   147192       } else {
   147193          return 0;
   147194       }
   147195    default:
   147196       unreachable("Invalid hardware generation");
   147197    }
   147198 }
   147199 
   147200 
   147201 
   147202 #define GEN10_MEDIA_STATE_FLUSH_WatermarkRequired_start  38
   147203 #define GEN9_MEDIA_STATE_FLUSH_WatermarkRequired_start  38
   147204 #define GEN8_MEDIA_STATE_FLUSH_WatermarkRequired_start  38
   147205 #define GEN75_MEDIA_STATE_FLUSH_WatermarkRequired_start  38
   147206 #define GEN7_MEDIA_STATE_FLUSH_WatermarkRequired_start  38
   147207 
   147208 static inline uint32_t ATTRIBUTE_PURE
   147209 MEDIA_STATE_FLUSH_WatermarkRequired_start(const struct gen_device_info *devinfo)
   147210 {
   147211    switch (devinfo->gen) {
   147212    case 10: return 38;
   147213    case 9: return 38;
   147214    case 8: return 38;
   147215    case 7:
   147216       if (devinfo->is_haswell) {
   147217          return 38;
   147218       } else {
   147219          return 38;
   147220       }
   147221    case 6: return 0;
   147222    case 5: return 0;
   147223    case 4:
   147224       if (devinfo->is_g4x) {
   147225          return 0;
   147226       } else {
   147227          return 0;
   147228       }
   147229    default:
   147230       unreachable("Invalid hardware generation");
   147231    }
   147232 }
   147233 
   147234 
   147235 
   147236 /* MEDIA_VFE_STATE */
   147237 
   147238 
   147239 #define GEN10_MEDIA_VFE_STATE_length  9
   147240 #define GEN9_MEDIA_VFE_STATE_length  9
   147241 #define GEN8_MEDIA_VFE_STATE_length  9
   147242 #define GEN75_MEDIA_VFE_STATE_length  8
   147243 #define GEN7_MEDIA_VFE_STATE_length  8
   147244 #define GEN6_MEDIA_VFE_STATE_length  8
   147245 
   147246 static inline uint32_t ATTRIBUTE_PURE
   147247 MEDIA_VFE_STATE_length(const struct gen_device_info *devinfo)
   147248 {
   147249    switch (devinfo->gen) {
   147250    case 10: return 9;
   147251    case 9: return 9;
   147252    case 8: return 9;
   147253    case 7:
   147254       if (devinfo->is_haswell) {
   147255          return 8;
   147256       } else {
   147257          return 8;
   147258       }
   147259    case 6: return 8;
   147260    case 5: return 0;
   147261    case 4:
   147262       if (devinfo->is_g4x) {
   147263          return 0;
   147264       } else {
   147265          return 0;
   147266       }
   147267    default:
   147268       unreachable("Invalid hardware generation");
   147269    }
   147270 }
   147271 
   147272 
   147273 
   147274 /* MEDIA_VFE_STATE::Bypass Gateway Control */
   147275 
   147276 
   147277 #define GEN8_MEDIA_VFE_STATE_BypassGatewayControl_bits  1
   147278 #define GEN75_MEDIA_VFE_STATE_BypassGatewayControl_bits  1
   147279 #define GEN7_MEDIA_VFE_STATE_BypassGatewayControl_bits  1
   147280 #define GEN6_MEDIA_VFE_STATE_BypassGatewayControl_bits  1
   147281 
   147282 static inline uint32_t ATTRIBUTE_PURE
   147283 MEDIA_VFE_STATE_BypassGatewayControl_bits(const struct gen_device_info *devinfo)
   147284 {
   147285    switch (devinfo->gen) {
   147286    case 10: return 0;
   147287    case 9: return 0;
   147288    case 8: return 1;
   147289    case 7:
   147290       if (devinfo->is_haswell) {
   147291          return 1;
   147292       } else {
   147293          return 1;
   147294       }
   147295    case 6: return 1;
   147296    case 5: return 0;
   147297    case 4:
   147298       if (devinfo->is_g4x) {
   147299          return 0;
   147300       } else {
   147301          return 0;
   147302       }
   147303    default:
   147304       unreachable("Invalid hardware generation");
   147305    }
   147306 }
   147307 
   147308 
   147309 
   147310 #define GEN8_MEDIA_VFE_STATE_BypassGatewayControl_start  102
   147311 #define GEN75_MEDIA_VFE_STATE_BypassGatewayControl_start  70
   147312 #define GEN7_MEDIA_VFE_STATE_BypassGatewayControl_start  70
   147313 #define GEN6_MEDIA_VFE_STATE_BypassGatewayControl_start  70
   147314 
   147315 static inline uint32_t ATTRIBUTE_PURE
   147316 MEDIA_VFE_STATE_BypassGatewayControl_start(const struct gen_device_info *devinfo)
   147317 {
   147318    switch (devinfo->gen) {
   147319    case 10: return 0;
   147320    case 9: return 0;
   147321    case 8: return 102;
   147322    case 7:
   147323       if (devinfo->is_haswell) {
   147324          return 70;
   147325       } else {
   147326          return 70;
   147327       }
   147328    case 6: return 70;
   147329    case 5: return 0;
   147330    case 4:
   147331       if (devinfo->is_g4x) {
   147332          return 0;
   147333       } else {
   147334          return 0;
   147335       }
   147336    default:
   147337       unreachable("Invalid hardware generation");
   147338    }
   147339 }
   147340 
   147341 
   147342 
   147343 /* MEDIA_VFE_STATE::CURBE Allocation Size */
   147344 
   147345 
   147346 #define GEN10_MEDIA_VFE_STATE_CURBEAllocationSize_bits  16
   147347 #define GEN9_MEDIA_VFE_STATE_CURBEAllocationSize_bits  16
   147348 #define GEN8_MEDIA_VFE_STATE_CURBEAllocationSize_bits  16
   147349 #define GEN75_MEDIA_VFE_STATE_CURBEAllocationSize_bits  16
   147350 #define GEN7_MEDIA_VFE_STATE_CURBEAllocationSize_bits  16
   147351 #define GEN6_MEDIA_VFE_STATE_CURBEAllocationSize_bits  16
   147352 
   147353 static inline uint32_t ATTRIBUTE_PURE
   147354 MEDIA_VFE_STATE_CURBEAllocationSize_bits(const struct gen_device_info *devinfo)
   147355 {
   147356    switch (devinfo->gen) {
   147357    case 10: return 16;
   147358    case 9: return 16;
   147359    case 8: return 16;
   147360    case 7:
   147361       if (devinfo->is_haswell) {
   147362          return 16;
   147363       } else {
   147364          return 16;
   147365       }
   147366    case 6: return 16;
   147367    case 5: return 0;
   147368    case 4:
   147369       if (devinfo->is_g4x) {
   147370          return 0;
   147371       } else {
   147372          return 0;
   147373       }
   147374    default:
   147375       unreachable("Invalid hardware generation");
   147376    }
   147377 }
   147378 
   147379 
   147380 
   147381 #define GEN10_MEDIA_VFE_STATE_CURBEAllocationSize_start  160
   147382 #define GEN9_MEDIA_VFE_STATE_CURBEAllocationSize_start  160
   147383 #define GEN8_MEDIA_VFE_STATE_CURBEAllocationSize_start  160
   147384 #define GEN75_MEDIA_VFE_STATE_CURBEAllocationSize_start  128
   147385 #define GEN7_MEDIA_VFE_STATE_CURBEAllocationSize_start  128
   147386 #define GEN6_MEDIA_VFE_STATE_CURBEAllocationSize_start  128
   147387 
   147388 static inline uint32_t ATTRIBUTE_PURE
   147389 MEDIA_VFE_STATE_CURBEAllocationSize_start(const struct gen_device_info *devinfo)
   147390 {
   147391    switch (devinfo->gen) {
   147392    case 10: return 160;
   147393    case 9: return 160;
   147394    case 8: return 160;
   147395    case 7:
   147396       if (devinfo->is_haswell) {
   147397          return 128;
   147398       } else {
   147399          return 128;
   147400       }
   147401    case 6: return 128;
   147402    case 5: return 0;
   147403    case 4:
   147404       if (devinfo->is_g4x) {
   147405          return 0;
   147406       } else {
   147407          return 0;
   147408       }
   147409    default:
   147410       unreachable("Invalid hardware generation");
   147411    }
   147412 }
   147413 
   147414 
   147415 
   147416 /* MEDIA_VFE_STATE::Command Type */
   147417 
   147418 
   147419 #define GEN10_MEDIA_VFE_STATE_CommandType_bits  3
   147420 #define GEN9_MEDIA_VFE_STATE_CommandType_bits  3
   147421 #define GEN8_MEDIA_VFE_STATE_CommandType_bits  3
   147422 #define GEN75_MEDIA_VFE_STATE_CommandType_bits  3
   147423 #define GEN7_MEDIA_VFE_STATE_CommandType_bits  3
   147424 #define GEN6_MEDIA_VFE_STATE_CommandType_bits  3
   147425 
   147426 static inline uint32_t ATTRIBUTE_PURE
   147427 MEDIA_VFE_STATE_CommandType_bits(const struct gen_device_info *devinfo)
   147428 {
   147429    switch (devinfo->gen) {
   147430    case 10: return 3;
   147431    case 9: return 3;
   147432    case 8: return 3;
   147433    case 7:
   147434       if (devinfo->is_haswell) {
   147435          return 3;
   147436       } else {
   147437          return 3;
   147438       }
   147439    case 6: return 3;
   147440    case 5: return 0;
   147441    case 4:
   147442       if (devinfo->is_g4x) {
   147443          return 0;
   147444       } else {
   147445          return 0;
   147446       }
   147447    default:
   147448       unreachable("Invalid hardware generation");
   147449    }
   147450 }
   147451 
   147452 
   147453 
   147454 #define GEN10_MEDIA_VFE_STATE_CommandType_start  29
   147455 #define GEN9_MEDIA_VFE_STATE_CommandType_start  29
   147456 #define GEN8_MEDIA_VFE_STATE_CommandType_start  29
   147457 #define GEN75_MEDIA_VFE_STATE_CommandType_start  29
   147458 #define GEN7_MEDIA_VFE_STATE_CommandType_start  29
   147459 #define GEN6_MEDIA_VFE_STATE_CommandType_start  29
   147460 
   147461 static inline uint32_t ATTRIBUTE_PURE
   147462 MEDIA_VFE_STATE_CommandType_start(const struct gen_device_info *devinfo)
   147463 {
   147464    switch (devinfo->gen) {
   147465    case 10: return 29;
   147466    case 9: return 29;
   147467    case 8: return 29;
   147468    case 7:
   147469       if (devinfo->is_haswell) {
   147470          return 29;
   147471       } else {
   147472          return 29;
   147473       }
   147474    case 6: return 29;
   147475    case 5: return 0;
   147476    case 4:
   147477       if (devinfo->is_g4x) {
   147478          return 0;
   147479       } else {
   147480          return 0;
   147481       }
   147482    default:
   147483       unreachable("Invalid hardware generation");
   147484    }
   147485 }
   147486 
   147487 
   147488 
   147489 /* MEDIA_VFE_STATE::DWord Length */
   147490 
   147491 
   147492 #define GEN10_MEDIA_VFE_STATE_DWordLength_bits  16
   147493 #define GEN9_MEDIA_VFE_STATE_DWordLength_bits  16
   147494 #define GEN8_MEDIA_VFE_STATE_DWordLength_bits  16
   147495 #define GEN75_MEDIA_VFE_STATE_DWordLength_bits  16
   147496 #define GEN7_MEDIA_VFE_STATE_DWordLength_bits  16
   147497 #define GEN6_MEDIA_VFE_STATE_DWordLength_bits  16
   147498 
   147499 static inline uint32_t ATTRIBUTE_PURE
   147500 MEDIA_VFE_STATE_DWordLength_bits(const struct gen_device_info *devinfo)
   147501 {
   147502    switch (devinfo->gen) {
   147503    case 10: return 16;
   147504    case 9: return 16;
   147505    case 8: return 16;
   147506    case 7:
   147507       if (devinfo->is_haswell) {
   147508          return 16;
   147509       } else {
   147510          return 16;
   147511       }
   147512    case 6: return 16;
   147513    case 5: return 0;
   147514    case 4:
   147515       if (devinfo->is_g4x) {
   147516          return 0;
   147517       } else {
   147518          return 0;
   147519       }
   147520    default:
   147521       unreachable("Invalid hardware generation");
   147522    }
   147523 }
   147524 
   147525 
   147526 
   147527 #define GEN10_MEDIA_VFE_STATE_DWordLength_start  0
   147528 #define GEN9_MEDIA_VFE_STATE_DWordLength_start  0
   147529 #define GEN8_MEDIA_VFE_STATE_DWordLength_start  0
   147530 #define GEN75_MEDIA_VFE_STATE_DWordLength_start  0
   147531 #define GEN7_MEDIA_VFE_STATE_DWordLength_start  0
   147532 #define GEN6_MEDIA_VFE_STATE_DWordLength_start  0
   147533 
   147534 static inline uint32_t ATTRIBUTE_PURE
   147535 MEDIA_VFE_STATE_DWordLength_start(const struct gen_device_info *devinfo)
   147536 {
   147537    switch (devinfo->gen) {
   147538    case 10: return 0;
   147539    case 9: return 0;
   147540    case 8: return 0;
   147541    case 7:
   147542       if (devinfo->is_haswell) {
   147543          return 0;
   147544       } else {
   147545          return 0;
   147546       }
   147547    case 6: return 0;
   147548    case 5: return 0;
   147549    case 4:
   147550       if (devinfo->is_g4x) {
   147551          return 0;
   147552       } else {
   147553          return 0;
   147554       }
   147555    default:
   147556       unreachable("Invalid hardware generation");
   147557    }
   147558 }
   147559 
   147560 
   147561 
   147562 /* MEDIA_VFE_STATE::Fast Preempt */
   147563 
   147564 
   147565 #define GEN6_MEDIA_VFE_STATE_FastPreempt_bits  1
   147566 
   147567 static inline uint32_t ATTRIBUTE_PURE
   147568 MEDIA_VFE_STATE_FastPreempt_bits(const struct gen_device_info *devinfo)
   147569 {
   147570    switch (devinfo->gen) {
   147571    case 10: return 0;
   147572    case 9: return 0;
   147573    case 8: return 0;
   147574    case 7:
   147575       if (devinfo->is_haswell) {
   147576          return 0;
   147577       } else {
   147578          return 0;
   147579       }
   147580    case 6: return 1;
   147581    case 5: return 0;
   147582    case 4:
   147583       if (devinfo->is_g4x) {
   147584          return 0;
   147585       } else {
   147586          return 0;
   147587       }
   147588    default:
   147589       unreachable("Invalid hardware generation");
   147590    }
   147591 }
   147592 
   147593 
   147594 
   147595 #define GEN6_MEDIA_VFE_STATE_FastPreempt_start  69
   147596 
   147597 static inline uint32_t ATTRIBUTE_PURE
   147598 MEDIA_VFE_STATE_FastPreempt_start(const struct gen_device_info *devinfo)
   147599 {
   147600    switch (devinfo->gen) {
   147601    case 10: return 0;
   147602    case 9: return 0;
   147603    case 8: return 0;
   147604    case 7:
   147605       if (devinfo->is_haswell) {
   147606          return 0;
   147607       } else {
   147608          return 0;
   147609       }
   147610    case 6: return 69;
   147611    case 5: return 0;
   147612    case 4:
   147613       if (devinfo->is_g4x) {
   147614          return 0;
   147615       } else {
   147616          return 0;
   147617       }
   147618    default:
   147619       unreachable("Invalid hardware generation");
   147620    }
   147621 }
   147622 
   147623 
   147624 
   147625 /* MEDIA_VFE_STATE::GPGPU Mode */
   147626 
   147627 
   147628 #define GEN75_MEDIA_VFE_STATE_GPGPUMode_bits  1
   147629 #define GEN7_MEDIA_VFE_STATE_GPGPUMode_bits  1
   147630 
   147631 static inline uint32_t ATTRIBUTE_PURE
   147632 MEDIA_VFE_STATE_GPGPUMode_bits(const struct gen_device_info *devinfo)
   147633 {
   147634    switch (devinfo->gen) {
   147635    case 10: return 0;
   147636    case 9: return 0;
   147637    case 8: return 0;
   147638    case 7:
   147639       if (devinfo->is_haswell) {
   147640          return 1;
   147641       } else {
   147642          return 1;
   147643       }
   147644    case 6: return 0;
   147645    case 5: return 0;
   147646    case 4:
   147647       if (devinfo->is_g4x) {
   147648          return 0;
   147649       } else {
   147650          return 0;
   147651       }
   147652    default:
   147653       unreachable("Invalid hardware generation");
   147654    }
   147655 }
   147656 
   147657 
   147658 
   147659 #define GEN75_MEDIA_VFE_STATE_GPGPUMode_start  66
   147660 #define GEN7_MEDIA_VFE_STATE_GPGPUMode_start  66
   147661 
   147662 static inline uint32_t ATTRIBUTE_PURE
   147663 MEDIA_VFE_STATE_GPGPUMode_start(const struct gen_device_info *devinfo)
   147664 {
   147665    switch (devinfo->gen) {
   147666    case 10: return 0;
   147667    case 9: return 0;
   147668    case 8: return 0;
   147669    case 7:
   147670       if (devinfo->is_haswell) {
   147671          return 66;
   147672       } else {
   147673          return 66;
   147674       }
   147675    case 6: return 0;
   147676    case 5: return 0;
   147677    case 4:
   147678       if (devinfo->is_g4x) {
   147679          return 0;
   147680       } else {
   147681          return 0;
   147682       }
   147683    default:
   147684       unreachable("Invalid hardware generation");
   147685    }
   147686 }
   147687 
   147688 
   147689 
   147690 /* MEDIA_VFE_STATE::Gateway MMIO Access Control */
   147691 
   147692 
   147693 #define GEN7_MEDIA_VFE_STATE_GatewayMMIOAccessControl_bits  2
   147694 
   147695 static inline uint32_t ATTRIBUTE_PURE
   147696 MEDIA_VFE_STATE_GatewayMMIOAccessControl_bits(const struct gen_device_info *devinfo)
   147697 {
   147698    switch (devinfo->gen) {
   147699    case 10: return 0;
   147700    case 9: return 0;
   147701    case 8: return 0;
   147702    case 7:
   147703       if (devinfo->is_haswell) {
   147704          return 0;
   147705       } else {
   147706          return 2;
   147707       }
   147708    case 6: return 0;
   147709    case 5: return 0;
   147710    case 4:
   147711       if (devinfo->is_g4x) {
   147712          return 0;
   147713       } else {
   147714          return 0;
   147715       }
   147716    default:
   147717       unreachable("Invalid hardware generation");
   147718    }
   147719 }
   147720 
   147721 
   147722 
   147723 #define GEN7_MEDIA_VFE_STATE_GatewayMMIOAccessControl_start  67
   147724 
   147725 static inline uint32_t ATTRIBUTE_PURE
   147726 MEDIA_VFE_STATE_GatewayMMIOAccessControl_start(const struct gen_device_info *devinfo)
   147727 {
   147728    switch (devinfo->gen) {
   147729    case 10: return 0;
   147730    case 9: return 0;
   147731    case 8: return 0;
   147732    case 7:
   147733       if (devinfo->is_haswell) {
   147734          return 0;
   147735       } else {
   147736          return 67;
   147737       }
   147738    case 6: return 0;
   147739    case 5: return 0;
   147740    case 4:
   147741       if (devinfo->is_g4x) {
   147742          return 0;
   147743       } else {
   147744          return 0;
   147745       }
   147746    default:
   147747       unreachable("Invalid hardware generation");
   147748    }
   147749 }
   147750 
   147751 
   147752 
   147753 /* MEDIA_VFE_STATE::Half-Slice Disable */
   147754 
   147755 
   147756 #define GEN75_MEDIA_VFE_STATE_HalfSliceDisable_bits  2
   147757 
   147758 static inline uint32_t ATTRIBUTE_PURE
   147759 MEDIA_VFE_STATE_HalfSliceDisable_bits(const struct gen_device_info *devinfo)
   147760 {
   147761    switch (devinfo->gen) {
   147762    case 10: return 0;
   147763    case 9: return 0;
   147764    case 8: return 0;
   147765    case 7:
   147766       if (devinfo->is_haswell) {
   147767          return 2;
   147768       } else {
   147769          return 0;
   147770       }
   147771    case 6: return 0;
   147772    case 5: return 0;
   147773    case 4:
   147774       if (devinfo->is_g4x) {
   147775          return 0;
   147776       } else {
   147777          return 0;
   147778       }
   147779    default:
   147780       unreachable("Invalid hardware generation");
   147781    }
   147782 }
   147783 
   147784 
   147785 
   147786 #define GEN75_MEDIA_VFE_STATE_HalfSliceDisable_start  96
   147787 
   147788 static inline uint32_t ATTRIBUTE_PURE
   147789 MEDIA_VFE_STATE_HalfSliceDisable_start(const struct gen_device_info *devinfo)
   147790 {
   147791    switch (devinfo->gen) {
   147792    case 10: return 0;
   147793    case 9: return 0;
   147794    case 8: return 0;
   147795    case 7:
   147796       if (devinfo->is_haswell) {
   147797          return 96;
   147798       } else {
   147799          return 0;
   147800       }
   147801    case 6: return 0;
   147802    case 5: return 0;
   147803    case 4:
   147804       if (devinfo->is_g4x) {
   147805          return 0;
   147806       } else {
   147807          return 0;
   147808       }
   147809    default:
   147810       unreachable("Invalid hardware generation");
   147811    }
   147812 }
   147813 
   147814 
   147815 
   147816 /* MEDIA_VFE_STATE::Maximum Number of Threads */
   147817 
   147818 
   147819 #define GEN10_MEDIA_VFE_STATE_MaximumNumberofThreads_bits  16
   147820 #define GEN9_MEDIA_VFE_STATE_MaximumNumberofThreads_bits  16
   147821 #define GEN8_MEDIA_VFE_STATE_MaximumNumberofThreads_bits  16
   147822 #define GEN75_MEDIA_VFE_STATE_MaximumNumberofThreads_bits  16
   147823 #define GEN7_MEDIA_VFE_STATE_MaximumNumberofThreads_bits  16
   147824 #define GEN6_MEDIA_VFE_STATE_MaximumNumberofThreads_bits  16
   147825 
   147826 static inline uint32_t ATTRIBUTE_PURE
   147827 MEDIA_VFE_STATE_MaximumNumberofThreads_bits(const struct gen_device_info *devinfo)
   147828 {
   147829    switch (devinfo->gen) {
   147830    case 10: return 16;
   147831    case 9: return 16;
   147832    case 8: return 16;
   147833    case 7:
   147834       if (devinfo->is_haswell) {
   147835          return 16;
   147836       } else {
   147837          return 16;
   147838       }
   147839    case 6: return 16;
   147840    case 5: return 0;
   147841    case 4:
   147842       if (devinfo->is_g4x) {
   147843          return 0;
   147844       } else {
   147845          return 0;
   147846       }
   147847    default:
   147848       unreachable("Invalid hardware generation");
   147849    }
   147850 }
   147851 
   147852 
   147853 
   147854 #define GEN10_MEDIA_VFE_STATE_MaximumNumberofThreads_start  112
   147855 #define GEN9_MEDIA_VFE_STATE_MaximumNumberofThreads_start  112
   147856 #define GEN8_MEDIA_VFE_STATE_MaximumNumberofThreads_start  112
   147857 #define GEN75_MEDIA_VFE_STATE_MaximumNumberofThreads_start  80
   147858 #define GEN7_MEDIA_VFE_STATE_MaximumNumberofThreads_start  80
   147859 #define GEN6_MEDIA_VFE_STATE_MaximumNumberofThreads_start  80
   147860 
   147861 static inline uint32_t ATTRIBUTE_PURE
   147862 MEDIA_VFE_STATE_MaximumNumberofThreads_start(const struct gen_device_info *devinfo)
   147863 {
   147864    switch (devinfo->gen) {
   147865    case 10: return 112;
   147866    case 9: return 112;
   147867    case 8: return 112;
   147868    case 7:
   147869       if (devinfo->is_haswell) {
   147870          return 80;
   147871       } else {
   147872          return 80;
   147873       }
   147874    case 6: return 80;
   147875    case 5: return 0;
   147876    case 4:
   147877       if (devinfo->is_g4x) {
   147878          return 0;
   147879       } else {
   147880          return 0;
   147881       }
   147882    default:
   147883       unreachable("Invalid hardware generation");
   147884    }
   147885 }
   147886 
   147887 
   147888 
   147889 /* MEDIA_VFE_STATE::Media Command Opcode */
   147890 
   147891 
   147892 #define GEN10_MEDIA_VFE_STATE_MediaCommandOpcode_bits  3
   147893 #define GEN9_MEDIA_VFE_STATE_MediaCommandOpcode_bits  3
   147894 #define GEN8_MEDIA_VFE_STATE_MediaCommandOpcode_bits  3
   147895 #define GEN75_MEDIA_VFE_STATE_MediaCommandOpcode_bits  3
   147896 #define GEN7_MEDIA_VFE_STATE_MediaCommandOpcode_bits  3
   147897 #define GEN6_MEDIA_VFE_STATE_MediaCommandOpcode_bits  3
   147898 
   147899 static inline uint32_t ATTRIBUTE_PURE
   147900 MEDIA_VFE_STATE_MediaCommandOpcode_bits(const struct gen_device_info *devinfo)
   147901 {
   147902    switch (devinfo->gen) {
   147903    case 10: return 3;
   147904    case 9: return 3;
   147905    case 8: return 3;
   147906    case 7:
   147907       if (devinfo->is_haswell) {
   147908          return 3;
   147909       } else {
   147910          return 3;
   147911       }
   147912    case 6: return 3;
   147913    case 5: return 0;
   147914    case 4:
   147915       if (devinfo->is_g4x) {
   147916          return 0;
   147917       } else {
   147918          return 0;
   147919       }
   147920    default:
   147921       unreachable("Invalid hardware generation");
   147922    }
   147923 }
   147924 
   147925 
   147926 
   147927 #define GEN10_MEDIA_VFE_STATE_MediaCommandOpcode_start  24
   147928 #define GEN9_MEDIA_VFE_STATE_MediaCommandOpcode_start  24
   147929 #define GEN8_MEDIA_VFE_STATE_MediaCommandOpcode_start  24
   147930 #define GEN75_MEDIA_VFE_STATE_MediaCommandOpcode_start  24
   147931 #define GEN7_MEDIA_VFE_STATE_MediaCommandOpcode_start  24
   147932 #define GEN6_MEDIA_VFE_STATE_MediaCommandOpcode_start  24
   147933 
   147934 static inline uint32_t ATTRIBUTE_PURE
   147935 MEDIA_VFE_STATE_MediaCommandOpcode_start(const struct gen_device_info *devinfo)
   147936 {
   147937    switch (devinfo->gen) {
   147938    case 10: return 24;
   147939    case 9: return 24;
   147940    case 8: return 24;
   147941    case 7:
   147942       if (devinfo->is_haswell) {
   147943          return 24;
   147944       } else {
   147945          return 24;
   147946       }
   147947    case 6: return 24;
   147948    case 5: return 0;
   147949    case 4:
   147950       if (devinfo->is_g4x) {
   147951          return 0;
   147952       } else {
   147953          return 0;
   147954       }
   147955    default:
   147956       unreachable("Invalid hardware generation");
   147957    }
   147958 }
   147959 
   147960 
   147961 
   147962 /* MEDIA_VFE_STATE::Number of Media Objects per Pre-Emption Checkpoint */
   147963 
   147964 
   147965 #define GEN10_MEDIA_VFE_STATE_NumberofMediaObjectsperPreEmptionCheckpoint_bits  8
   147966 
   147967 static inline uint32_t ATTRIBUTE_PURE
   147968 MEDIA_VFE_STATE_NumberofMediaObjectsperPreEmptionCheckpoint_bits(const struct gen_device_info *devinfo)
   147969 {
   147970    switch (devinfo->gen) {
   147971    case 10: return 8;
   147972    case 9: return 0;
   147973    case 8: return 0;
   147974    case 7:
   147975       if (devinfo->is_haswell) {
   147976          return 0;
   147977       } else {
   147978          return 0;
   147979       }
   147980    case 6: return 0;
   147981    case 5: return 0;
   147982    case 4:
   147983       if (devinfo->is_g4x) {
   147984          return 0;
   147985       } else {
   147986          return 0;
   147987       }
   147988    default:
   147989       unreachable("Invalid hardware generation");
   147990    }
   147991 }
   147992 
   147993 
   147994 
   147995 #define GEN10_MEDIA_VFE_STATE_NumberofMediaObjectsperPreEmptionCheckpoint_start  200
   147996 
   147997 static inline uint32_t ATTRIBUTE_PURE
   147998 MEDIA_VFE_STATE_NumberofMediaObjectsperPreEmptionCheckpoint_start(const struct gen_device_info *devinfo)
   147999 {
   148000    switch (devinfo->gen) {
   148001    case 10: return 200;
   148002    case 9: return 0;
   148003    case 8: return 0;
   148004    case 7:
   148005       if (devinfo->is_haswell) {
   148006          return 0;
   148007       } else {
   148008          return 0;
   148009       }
   148010    case 6: return 0;
   148011    case 5: return 0;
   148012    case 4:
   148013       if (devinfo->is_g4x) {
   148014          return 0;
   148015       } else {
   148016          return 0;
   148017       }
   148018    default:
   148019       unreachable("Invalid hardware generation");
   148020    }
   148021 }
   148022 
   148023 
   148024 
   148025 /* MEDIA_VFE_STATE::Number of URB Entries */
   148026 
   148027 
   148028 #define GEN10_MEDIA_VFE_STATE_NumberofURBEntries_bits  8
   148029 #define GEN9_MEDIA_VFE_STATE_NumberofURBEntries_bits  8
   148030 #define GEN8_MEDIA_VFE_STATE_NumberofURBEntries_bits  8
   148031 #define GEN75_MEDIA_VFE_STATE_NumberofURBEntries_bits  8
   148032 #define GEN7_MEDIA_VFE_STATE_NumberofURBEntries_bits  8
   148033 #define GEN6_MEDIA_VFE_STATE_NumberofURBEntries_bits  8
   148034 
   148035 static inline uint32_t ATTRIBUTE_PURE
   148036 MEDIA_VFE_STATE_NumberofURBEntries_bits(const struct gen_device_info *devinfo)
   148037 {
   148038    switch (devinfo->gen) {
   148039    case 10: return 8;
   148040    case 9: return 8;
   148041    case 8: return 8;
   148042    case 7:
   148043       if (devinfo->is_haswell) {
   148044          return 8;
   148045       } else {
   148046          return 8;
   148047       }
   148048    case 6: return 8;
   148049    case 5: return 0;
   148050    case 4:
   148051       if (devinfo->is_g4x) {
   148052          return 0;
   148053       } else {
   148054          return 0;
   148055       }
   148056    default:
   148057       unreachable("Invalid hardware generation");
   148058    }
   148059 }
   148060 
   148061 
   148062 
   148063 #define GEN10_MEDIA_VFE_STATE_NumberofURBEntries_start  104
   148064 #define GEN9_MEDIA_VFE_STATE_NumberofURBEntries_start  104
   148065 #define GEN8_MEDIA_VFE_STATE_NumberofURBEntries_start  104
   148066 #define GEN75_MEDIA_VFE_STATE_NumberofURBEntries_start  72
   148067 #define GEN7_MEDIA_VFE_STATE_NumberofURBEntries_start  72
   148068 #define GEN6_MEDIA_VFE_STATE_NumberofURBEntries_start  72
   148069 
   148070 static inline uint32_t ATTRIBUTE_PURE
   148071 MEDIA_VFE_STATE_NumberofURBEntries_start(const struct gen_device_info *devinfo)
   148072 {
   148073    switch (devinfo->gen) {
   148074    case 10: return 104;
   148075    case 9: return 104;
   148076    case 8: return 104;
   148077    case 7:
   148078       if (devinfo->is_haswell) {
   148079          return 72;
   148080       } else {
   148081          return 72;
   148082       }
   148083    case 6: return 72;
   148084    case 5: return 0;
   148085    case 4:
   148086       if (devinfo->is_g4x) {
   148087          return 0;
   148088       } else {
   148089          return 0;
   148090       }
   148091    default:
   148092       unreachable("Invalid hardware generation");
   148093    }
   148094 }
   148095 
   148096 
   148097 
   148098 /* MEDIA_VFE_STATE::Per Thread Scratch Space */
   148099 
   148100 
   148101 #define GEN10_MEDIA_VFE_STATE_PerThreadScratchSpace_bits  4
   148102 #define GEN9_MEDIA_VFE_STATE_PerThreadScratchSpace_bits  4
   148103 #define GEN8_MEDIA_VFE_STATE_PerThreadScratchSpace_bits  4
   148104 #define GEN75_MEDIA_VFE_STATE_PerThreadScratchSpace_bits  4
   148105 #define GEN7_MEDIA_VFE_STATE_PerThreadScratchSpace_bits  4
   148106 #define GEN6_MEDIA_VFE_STATE_PerThreadScratchSpace_bits  4
   148107 
   148108 static inline uint32_t ATTRIBUTE_PURE
   148109 MEDIA_VFE_STATE_PerThreadScratchSpace_bits(const struct gen_device_info *devinfo)
   148110 {
   148111    switch (devinfo->gen) {
   148112    case 10: return 4;
   148113    case 9: return 4;
   148114    case 8: return 4;
   148115    case 7:
   148116       if (devinfo->is_haswell) {
   148117          return 4;
   148118       } else {
   148119          return 4;
   148120       }
   148121    case 6: return 4;
   148122    case 5: return 0;
   148123    case 4:
   148124       if (devinfo->is_g4x) {
   148125          return 0;
   148126       } else {
   148127          return 0;
   148128       }
   148129    default:
   148130       unreachable("Invalid hardware generation");
   148131    }
   148132 }
   148133 
   148134 
   148135 
   148136 #define GEN10_MEDIA_VFE_STATE_PerThreadScratchSpace_start  32
   148137 #define GEN9_MEDIA_VFE_STATE_PerThreadScratchSpace_start  32
   148138 #define GEN8_MEDIA_VFE_STATE_PerThreadScratchSpace_start  32
   148139 #define GEN75_MEDIA_VFE_STATE_PerThreadScratchSpace_start  32
   148140 #define GEN7_MEDIA_VFE_STATE_PerThreadScratchSpace_start  32
   148141 #define GEN6_MEDIA_VFE_STATE_PerThreadScratchSpace_start  32
   148142 
   148143 static inline uint32_t ATTRIBUTE_PURE
   148144 MEDIA_VFE_STATE_PerThreadScratchSpace_start(const struct gen_device_info *devinfo)
   148145 {
   148146    switch (devinfo->gen) {
   148147    case 10: return 32;
   148148    case 9: return 32;
   148149    case 8: return 32;
   148150    case 7:
   148151       if (devinfo->is_haswell) {
   148152          return 32;
   148153       } else {
   148154          return 32;
   148155       }
   148156    case 6: return 32;
   148157    case 5: return 0;
   148158    case 4:
   148159       if (devinfo->is_g4x) {
   148160          return 0;
   148161       } else {
   148162          return 0;
   148163       }
   148164    default:
   148165       unreachable("Invalid hardware generation");
   148166    }
   148167 }
   148168 
   148169 
   148170 
   148171 /* MEDIA_VFE_STATE::Pipeline */
   148172 
   148173 
   148174 #define GEN10_MEDIA_VFE_STATE_Pipeline_bits  2
   148175 #define GEN9_MEDIA_VFE_STATE_Pipeline_bits  2
   148176 #define GEN8_MEDIA_VFE_STATE_Pipeline_bits  2
   148177 #define GEN75_MEDIA_VFE_STATE_Pipeline_bits  2
   148178 #define GEN7_MEDIA_VFE_STATE_Pipeline_bits  2
   148179 #define GEN6_MEDIA_VFE_STATE_Pipeline_bits  2
   148180 
   148181 static inline uint32_t ATTRIBUTE_PURE
   148182 MEDIA_VFE_STATE_Pipeline_bits(const struct gen_device_info *devinfo)
   148183 {
   148184    switch (devinfo->gen) {
   148185    case 10: return 2;
   148186    case 9: return 2;
   148187    case 8: return 2;
   148188    case 7:
   148189       if (devinfo->is_haswell) {
   148190          return 2;
   148191       } else {
   148192          return 2;
   148193       }
   148194    case 6: return 2;
   148195    case 5: return 0;
   148196    case 4:
   148197       if (devinfo->is_g4x) {
   148198          return 0;
   148199       } else {
   148200          return 0;
   148201       }
   148202    default:
   148203       unreachable("Invalid hardware generation");
   148204    }
   148205 }
   148206 
   148207 
   148208 
   148209 #define GEN10_MEDIA_VFE_STATE_Pipeline_start  27
   148210 #define GEN9_MEDIA_VFE_STATE_Pipeline_start  27
   148211 #define GEN8_MEDIA_VFE_STATE_Pipeline_start  27
   148212 #define GEN75_MEDIA_VFE_STATE_Pipeline_start  27
   148213 #define GEN7_MEDIA_VFE_STATE_Pipeline_start  27
   148214 #define GEN6_MEDIA_VFE_STATE_Pipeline_start  27
   148215 
   148216 static inline uint32_t ATTRIBUTE_PURE
   148217 MEDIA_VFE_STATE_Pipeline_start(const struct gen_device_info *devinfo)
   148218 {
   148219    switch (devinfo->gen) {
   148220    case 10: return 27;
   148221    case 9: return 27;
   148222    case 8: return 27;
   148223    case 7:
   148224       if (devinfo->is_haswell) {
   148225          return 27;
   148226       } else {
   148227          return 27;
   148228       }
   148229    case 6: return 27;
   148230    case 5: return 0;
   148231    case 4:
   148232       if (devinfo->is_g4x) {
   148233          return 0;
   148234       } else {
   148235          return 0;
   148236       }
   148237    default:
   148238       unreachable("Invalid hardware generation");
   148239    }
   148240 }
   148241 
   148242 
   148243 
   148244 /* MEDIA_VFE_STATE::Reset Gateway Timer */
   148245 
   148246 
   148247 #define GEN10_MEDIA_VFE_STATE_ResetGatewayTimer_bits  1
   148248 #define GEN9_MEDIA_VFE_STATE_ResetGatewayTimer_bits  1
   148249 #define GEN8_MEDIA_VFE_STATE_ResetGatewayTimer_bits  1
   148250 #define GEN75_MEDIA_VFE_STATE_ResetGatewayTimer_bits  1
   148251 #define GEN7_MEDIA_VFE_STATE_ResetGatewayTimer_bits  1
   148252 #define GEN6_MEDIA_VFE_STATE_ResetGatewayTimer_bits  1
   148253 
   148254 static inline uint32_t ATTRIBUTE_PURE
   148255 MEDIA_VFE_STATE_ResetGatewayTimer_bits(const struct gen_device_info *devinfo)
   148256 {
   148257    switch (devinfo->gen) {
   148258    case 10: return 1;
   148259    case 9: return 1;
   148260    case 8: return 1;
   148261    case 7:
   148262       if (devinfo->is_haswell) {
   148263          return 1;
   148264       } else {
   148265          return 1;
   148266       }
   148267    case 6: return 1;
   148268    case 5: return 0;
   148269    case 4:
   148270       if (devinfo->is_g4x) {
   148271          return 0;
   148272       } else {
   148273          return 0;
   148274       }
   148275    default:
   148276       unreachable("Invalid hardware generation");
   148277    }
   148278 }
   148279 
   148280 
   148281 
   148282 #define GEN10_MEDIA_VFE_STATE_ResetGatewayTimer_start  103
   148283 #define GEN9_MEDIA_VFE_STATE_ResetGatewayTimer_start  103
   148284 #define GEN8_MEDIA_VFE_STATE_ResetGatewayTimer_start  103
   148285 #define GEN75_MEDIA_VFE_STATE_ResetGatewayTimer_start  71
   148286 #define GEN7_MEDIA_VFE_STATE_ResetGatewayTimer_start  71
   148287 #define GEN6_MEDIA_VFE_STATE_ResetGatewayTimer_start  71
   148288 
   148289 static inline uint32_t ATTRIBUTE_PURE
   148290 MEDIA_VFE_STATE_ResetGatewayTimer_start(const struct gen_device_info *devinfo)
   148291 {
   148292    switch (devinfo->gen) {
   148293    case 10: return 103;
   148294    case 9: return 103;
   148295    case 8: return 103;
   148296    case 7:
   148297       if (devinfo->is_haswell) {
   148298          return 71;
   148299       } else {
   148300          return 71;
   148301       }
   148302    case 6: return 71;
   148303    case 5: return 0;
   148304    case 4:
   148305       if (devinfo->is_g4x) {
   148306          return 0;
   148307       } else {
   148308          return 0;
   148309       }
   148310    default:
   148311       unreachable("Invalid hardware generation");
   148312    }
   148313 }
   148314 
   148315 
   148316 
   148317 /* MEDIA_VFE_STATE::SLM Bank Selection Policy */
   148318 
   148319 
   148320 #define GEN10_MEDIA_VFE_STATE_SLMBankSelectionPolicy_bits  1
   148321 
   148322 static inline uint32_t ATTRIBUTE_PURE
   148323 MEDIA_VFE_STATE_SLMBankSelectionPolicy_bits(const struct gen_device_info *devinfo)
   148324 {
   148325    switch (devinfo->gen) {
   148326    case 10: return 1;
   148327    case 9: return 0;
   148328    case 8: return 0;
   148329    case 7:
   148330       if (devinfo->is_haswell) {
   148331          return 0;
   148332       } else {
   148333          return 0;
   148334       }
   148335    case 6: return 0;
   148336    case 5: return 0;
   148337    case 4:
   148338       if (devinfo->is_g4x) {
   148339          return 0;
   148340       } else {
   148341          return 0;
   148342       }
   148343    default:
   148344       unreachable("Invalid hardware generation");
   148345    }
   148346 }
   148347 
   148348 
   148349 
   148350 #define GEN10_MEDIA_VFE_STATE_SLMBankSelectionPolicy_start  99
   148351 
   148352 static inline uint32_t ATTRIBUTE_PURE
   148353 MEDIA_VFE_STATE_SLMBankSelectionPolicy_start(const struct gen_device_info *devinfo)
   148354 {
   148355    switch (devinfo->gen) {
   148356    case 10: return 99;
   148357    case 9: return 0;
   148358    case 8: return 0;
   148359    case 7:
   148360       if (devinfo->is_haswell) {
   148361          return 0;
   148362       } else {
   148363          return 0;
   148364       }
   148365    case 6: return 0;
   148366    case 5: return 0;
   148367    case 4:
   148368       if (devinfo->is_g4x) {
   148369          return 0;
   148370       } else {
   148371          return 0;
   148372       }
   148373    default:
   148374       unreachable("Invalid hardware generation");
   148375    }
   148376 }
   148377 
   148378 
   148379 
   148380 /* MEDIA_VFE_STATE::Scoreboard 0 Delta X */
   148381 
   148382 
   148383 #define GEN10_MEDIA_VFE_STATE_Scoreboard0DeltaX_bits  4
   148384 #define GEN9_MEDIA_VFE_STATE_Scoreboard0DeltaX_bits  4
   148385 #define GEN8_MEDIA_VFE_STATE_Scoreboard0DeltaX_bits  4
   148386 #define GEN75_MEDIA_VFE_STATE_Scoreboard0DeltaX_bits  4
   148387 #define GEN7_MEDIA_VFE_STATE_Scoreboard0DeltaX_bits  4
   148388 #define GEN6_MEDIA_VFE_STATE_Scoreboard0DeltaX_bits  4
   148389 
   148390 static inline uint32_t ATTRIBUTE_PURE
   148391 MEDIA_VFE_STATE_Scoreboard0DeltaX_bits(const struct gen_device_info *devinfo)
   148392 {
   148393    switch (devinfo->gen) {
   148394    case 10: return 4;
   148395    case 9: return 4;
   148396    case 8: return 4;
   148397    case 7:
   148398       if (devinfo->is_haswell) {
   148399          return 4;
   148400       } else {
   148401          return 4;
   148402       }
   148403    case 6: return 4;
   148404    case 5: return 0;
   148405    case 4:
   148406       if (devinfo->is_g4x) {
   148407          return 0;
   148408       } else {
   148409          return 0;
   148410       }
   148411    default:
   148412       unreachable("Invalid hardware generation");
   148413    }
   148414 }
   148415 
   148416 
   148417 
   148418 #define GEN10_MEDIA_VFE_STATE_Scoreboard0DeltaX_start  224
   148419 #define GEN9_MEDIA_VFE_STATE_Scoreboard0DeltaX_start  224
   148420 #define GEN8_MEDIA_VFE_STATE_Scoreboard0DeltaX_start  224
   148421 #define GEN75_MEDIA_VFE_STATE_Scoreboard0DeltaX_start  192
   148422 #define GEN7_MEDIA_VFE_STATE_Scoreboard0DeltaX_start  192
   148423 #define GEN6_MEDIA_VFE_STATE_Scoreboard0DeltaX_start  192
   148424 
   148425 static inline uint32_t ATTRIBUTE_PURE
   148426 MEDIA_VFE_STATE_Scoreboard0DeltaX_start(const struct gen_device_info *devinfo)
   148427 {
   148428    switch (devinfo->gen) {
   148429    case 10: return 224;
   148430    case 9: return 224;
   148431    case 8: return 224;
   148432    case 7:
   148433       if (devinfo->is_haswell) {
   148434          return 192;
   148435       } else {
   148436          return 192;
   148437       }
   148438    case 6: return 192;
   148439    case 5: return 0;
   148440    case 4:
   148441       if (devinfo->is_g4x) {
   148442          return 0;
   148443       } else {
   148444          return 0;
   148445       }
   148446    default:
   148447       unreachable("Invalid hardware generation");
   148448    }
   148449 }
   148450 
   148451 
   148452 
   148453 /* MEDIA_VFE_STATE::Scoreboard 0 Delta Y */
   148454 
   148455 
   148456 #define GEN10_MEDIA_VFE_STATE_Scoreboard0DeltaY_bits  4
   148457 #define GEN9_MEDIA_VFE_STATE_Scoreboard0DeltaY_bits  4
   148458 #define GEN8_MEDIA_VFE_STATE_Scoreboard0DeltaY_bits  4
   148459 #define GEN75_MEDIA_VFE_STATE_Scoreboard0DeltaY_bits  4
   148460 #define GEN7_MEDIA_VFE_STATE_Scoreboard0DeltaY_bits  4
   148461 #define GEN6_MEDIA_VFE_STATE_Scoreboard0DeltaY_bits  4
   148462 
   148463 static inline uint32_t ATTRIBUTE_PURE
   148464 MEDIA_VFE_STATE_Scoreboard0DeltaY_bits(const struct gen_device_info *devinfo)
   148465 {
   148466    switch (devinfo->gen) {
   148467    case 10: return 4;
   148468    case 9: return 4;
   148469    case 8: return 4;
   148470    case 7:
   148471       if (devinfo->is_haswell) {
   148472          return 4;
   148473       } else {
   148474          return 4;
   148475       }
   148476    case 6: return 4;
   148477    case 5: return 0;
   148478    case 4:
   148479       if (devinfo->is_g4x) {
   148480          return 0;
   148481       } else {
   148482          return 0;
   148483       }
   148484    default:
   148485       unreachable("Invalid hardware generation");
   148486    }
   148487 }
   148488 
   148489 
   148490 
   148491 #define GEN10_MEDIA_VFE_STATE_Scoreboard0DeltaY_start  228
   148492 #define GEN9_MEDIA_VFE_STATE_Scoreboard0DeltaY_start  228
   148493 #define GEN8_MEDIA_VFE_STATE_Scoreboard0DeltaY_start  228
   148494 #define GEN75_MEDIA_VFE_STATE_Scoreboard0DeltaY_start  196
   148495 #define GEN7_MEDIA_VFE_STATE_Scoreboard0DeltaY_start  196
   148496 #define GEN6_MEDIA_VFE_STATE_Scoreboard0DeltaY_start  196
   148497 
   148498 static inline uint32_t ATTRIBUTE_PURE
   148499 MEDIA_VFE_STATE_Scoreboard0DeltaY_start(const struct gen_device_info *devinfo)
   148500 {
   148501    switch (devinfo->gen) {
   148502    case 10: return 228;
   148503    case 9: return 228;
   148504    case 8: return 228;
   148505    case 7:
   148506       if (devinfo->is_haswell) {
   148507          return 196;
   148508       } else {
   148509          return 196;
   148510       }
   148511    case 6: return 196;
   148512    case 5: return 0;
   148513    case 4:
   148514       if (devinfo->is_g4x) {
   148515          return 0;
   148516       } else {
   148517          return 0;
   148518       }
   148519    default:
   148520       unreachable("Invalid hardware generation");
   148521    }
   148522 }
   148523 
   148524 
   148525 
   148526 /* MEDIA_VFE_STATE::Scoreboard 1 Delta X */
   148527 
   148528 
   148529 #define GEN10_MEDIA_VFE_STATE_Scoreboard1DeltaX_bits  4
   148530 #define GEN9_MEDIA_VFE_STATE_Scoreboard1DeltaX_bits  4
   148531 #define GEN8_MEDIA_VFE_STATE_Scoreboard1DeltaX_bits  4
   148532 #define GEN75_MEDIA_VFE_STATE_Scoreboard1DeltaX_bits  4
   148533 #define GEN7_MEDIA_VFE_STATE_Scoreboard1DeltaX_bits  4
   148534 #define GEN6_MEDIA_VFE_STATE_Scoreboard1DeltaX_bits  4
   148535 
   148536 static inline uint32_t ATTRIBUTE_PURE
   148537 MEDIA_VFE_STATE_Scoreboard1DeltaX_bits(const struct gen_device_info *devinfo)
   148538 {
   148539    switch (devinfo->gen) {
   148540    case 10: return 4;
   148541    case 9: return 4;
   148542    case 8: return 4;
   148543    case 7:
   148544       if (devinfo->is_haswell) {
   148545          return 4;
   148546       } else {
   148547          return 4;
   148548       }
   148549    case 6: return 4;
   148550    case 5: return 0;
   148551    case 4:
   148552       if (devinfo->is_g4x) {
   148553          return 0;
   148554       } else {
   148555          return 0;
   148556       }
   148557    default:
   148558       unreachable("Invalid hardware generation");
   148559    }
   148560 }
   148561 
   148562 
   148563 
   148564 #define GEN10_MEDIA_VFE_STATE_Scoreboard1DeltaX_start  232
   148565 #define GEN9_MEDIA_VFE_STATE_Scoreboard1DeltaX_start  232
   148566 #define GEN8_MEDIA_VFE_STATE_Scoreboard1DeltaX_start  232
   148567 #define GEN75_MEDIA_VFE_STATE_Scoreboard1DeltaX_start  200
   148568 #define GEN7_MEDIA_VFE_STATE_Scoreboard1DeltaX_start  200
   148569 #define GEN6_MEDIA_VFE_STATE_Scoreboard1DeltaX_start  200
   148570 
   148571 static inline uint32_t ATTRIBUTE_PURE
   148572 MEDIA_VFE_STATE_Scoreboard1DeltaX_start(const struct gen_device_info *devinfo)
   148573 {
   148574    switch (devinfo->gen) {
   148575    case 10: return 232;
   148576    case 9: return 232;
   148577    case 8: return 232;
   148578    case 7:
   148579       if (devinfo->is_haswell) {
   148580          return 200;
   148581       } else {
   148582          return 200;
   148583       }
   148584    case 6: return 200;
   148585    case 5: return 0;
   148586    case 4:
   148587       if (devinfo->is_g4x) {
   148588          return 0;
   148589       } else {
   148590          return 0;
   148591       }
   148592    default:
   148593       unreachable("Invalid hardware generation");
   148594    }
   148595 }
   148596 
   148597 
   148598 
   148599 /* MEDIA_VFE_STATE::Scoreboard 1 Delta Y */
   148600 
   148601 
   148602 #define GEN10_MEDIA_VFE_STATE_Scoreboard1DeltaY_bits  4
   148603 #define GEN9_MEDIA_VFE_STATE_Scoreboard1DeltaY_bits  4
   148604 #define GEN8_MEDIA_VFE_STATE_Scoreboard1DeltaY_bits  4
   148605 #define GEN75_MEDIA_VFE_STATE_Scoreboard1DeltaY_bits  4
   148606 #define GEN7_MEDIA_VFE_STATE_Scoreboard1DeltaY_bits  4
   148607 #define GEN6_MEDIA_VFE_STATE_Scoreboard1DeltaY_bits  4
   148608 
   148609 static inline uint32_t ATTRIBUTE_PURE
   148610 MEDIA_VFE_STATE_Scoreboard1DeltaY_bits(const struct gen_device_info *devinfo)
   148611 {
   148612    switch (devinfo->gen) {
   148613    case 10: return 4;
   148614    case 9: return 4;
   148615    case 8: return 4;
   148616    case 7:
   148617       if (devinfo->is_haswell) {
   148618          return 4;
   148619       } else {
   148620          return 4;
   148621       }
   148622    case 6: return 4;
   148623    case 5: return 0;
   148624    case 4:
   148625       if (devinfo->is_g4x) {
   148626          return 0;
   148627       } else {
   148628          return 0;
   148629       }
   148630    default:
   148631       unreachable("Invalid hardware generation");
   148632    }
   148633 }
   148634 
   148635 
   148636 
   148637 #define GEN10_MEDIA_VFE_STATE_Scoreboard1DeltaY_start  236
   148638 #define GEN9_MEDIA_VFE_STATE_Scoreboard1DeltaY_start  236
   148639 #define GEN8_MEDIA_VFE_STATE_Scoreboard1DeltaY_start  236
   148640 #define GEN75_MEDIA_VFE_STATE_Scoreboard1DeltaY_start  204
   148641 #define GEN7_MEDIA_VFE_STATE_Scoreboard1DeltaY_start  204
   148642 #define GEN6_MEDIA_VFE_STATE_Scoreboard1DeltaY_start  204
   148643 
   148644 static inline uint32_t ATTRIBUTE_PURE
   148645 MEDIA_VFE_STATE_Scoreboard1DeltaY_start(const struct gen_device_info *devinfo)
   148646 {
   148647    switch (devinfo->gen) {
   148648    case 10: return 236;
   148649    case 9: return 236;
   148650    case 8: return 236;
   148651    case 7:
   148652       if (devinfo->is_haswell) {
   148653          return 204;
   148654       } else {
   148655          return 204;
   148656       }
   148657    case 6: return 204;
   148658    case 5: return 0;
   148659    case 4:
   148660       if (devinfo->is_g4x) {
   148661          return 0;
   148662       } else {
   148663          return 0;
   148664       }
   148665    default:
   148666       unreachable("Invalid hardware generation");
   148667    }
   148668 }
   148669 
   148670 
   148671 
   148672 /* MEDIA_VFE_STATE::Scoreboard 2 Delta X */
   148673 
   148674 
   148675 #define GEN10_MEDIA_VFE_STATE_Scoreboard2DeltaX_bits  4
   148676 #define GEN9_MEDIA_VFE_STATE_Scoreboard2DeltaX_bits  4
   148677 #define GEN8_MEDIA_VFE_STATE_Scoreboard2DeltaX_bits  4
   148678 #define GEN75_MEDIA_VFE_STATE_Scoreboard2DeltaX_bits  4
   148679 #define GEN7_MEDIA_VFE_STATE_Scoreboard2DeltaX_bits  4
   148680 #define GEN6_MEDIA_VFE_STATE_Scoreboard2DeltaX_bits  4
   148681 
   148682 static inline uint32_t ATTRIBUTE_PURE
   148683 MEDIA_VFE_STATE_Scoreboard2DeltaX_bits(const struct gen_device_info *devinfo)
   148684 {
   148685    switch (devinfo->gen) {
   148686    case 10: return 4;
   148687    case 9: return 4;
   148688    case 8: return 4;
   148689    case 7:
   148690       if (devinfo->is_haswell) {
   148691          return 4;
   148692       } else {
   148693          return 4;
   148694       }
   148695    case 6: return 4;
   148696    case 5: return 0;
   148697    case 4:
   148698       if (devinfo->is_g4x) {
   148699          return 0;
   148700       } else {
   148701          return 0;
   148702       }
   148703    default:
   148704       unreachable("Invalid hardware generation");
   148705    }
   148706 }
   148707 
   148708 
   148709 
   148710 #define GEN10_MEDIA_VFE_STATE_Scoreboard2DeltaX_start  240
   148711 #define GEN9_MEDIA_VFE_STATE_Scoreboard2DeltaX_start  240
   148712 #define GEN8_MEDIA_VFE_STATE_Scoreboard2DeltaX_start  240
   148713 #define GEN75_MEDIA_VFE_STATE_Scoreboard2DeltaX_start  208
   148714 #define GEN7_MEDIA_VFE_STATE_Scoreboard2DeltaX_start  208
   148715 #define GEN6_MEDIA_VFE_STATE_Scoreboard2DeltaX_start  208
   148716 
   148717 static inline uint32_t ATTRIBUTE_PURE
   148718 MEDIA_VFE_STATE_Scoreboard2DeltaX_start(const struct gen_device_info *devinfo)
   148719 {
   148720    switch (devinfo->gen) {
   148721    case 10: return 240;
   148722    case 9: return 240;
   148723    case 8: return 240;
   148724    case 7:
   148725       if (devinfo->is_haswell) {
   148726          return 208;
   148727       } else {
   148728          return 208;
   148729       }
   148730    case 6: return 208;
   148731    case 5: return 0;
   148732    case 4:
   148733       if (devinfo->is_g4x) {
   148734          return 0;
   148735       } else {
   148736          return 0;
   148737       }
   148738    default:
   148739       unreachable("Invalid hardware generation");
   148740    }
   148741 }
   148742 
   148743 
   148744 
   148745 /* MEDIA_VFE_STATE::Scoreboard 2 Delta Y */
   148746 
   148747 
   148748 #define GEN10_MEDIA_VFE_STATE_Scoreboard2DeltaY_bits  4
   148749 #define GEN9_MEDIA_VFE_STATE_Scoreboard2DeltaY_bits  4
   148750 #define GEN8_MEDIA_VFE_STATE_Scoreboard2DeltaY_bits  4
   148751 #define GEN75_MEDIA_VFE_STATE_Scoreboard2DeltaY_bits  4
   148752 #define GEN7_MEDIA_VFE_STATE_Scoreboard2DeltaY_bits  4
   148753 #define GEN6_MEDIA_VFE_STATE_Scoreboard2DeltaY_bits  4
   148754 
   148755 static inline uint32_t ATTRIBUTE_PURE
   148756 MEDIA_VFE_STATE_Scoreboard2DeltaY_bits(const struct gen_device_info *devinfo)
   148757 {
   148758    switch (devinfo->gen) {
   148759    case 10: return 4;
   148760    case 9: return 4;
   148761    case 8: return 4;
   148762    case 7:
   148763       if (devinfo->is_haswell) {
   148764          return 4;
   148765       } else {
   148766          return 4;
   148767       }
   148768    case 6: return 4;
   148769    case 5: return 0;
   148770    case 4:
   148771       if (devinfo->is_g4x) {
   148772          return 0;
   148773       } else {
   148774          return 0;
   148775       }
   148776    default:
   148777       unreachable("Invalid hardware generation");
   148778    }
   148779 }
   148780 
   148781 
   148782 
   148783 #define GEN10_MEDIA_VFE_STATE_Scoreboard2DeltaY_start  244
   148784 #define GEN9_MEDIA_VFE_STATE_Scoreboard2DeltaY_start  244
   148785 #define GEN8_MEDIA_VFE_STATE_Scoreboard2DeltaY_start  244
   148786 #define GEN75_MEDIA_VFE_STATE_Scoreboard2DeltaY_start  212
   148787 #define GEN7_MEDIA_VFE_STATE_Scoreboard2DeltaY_start  212
   148788 #define GEN6_MEDIA_VFE_STATE_Scoreboard2DeltaY_start  212
   148789 
   148790 static inline uint32_t ATTRIBUTE_PURE
   148791 MEDIA_VFE_STATE_Scoreboard2DeltaY_start(const struct gen_device_info *devinfo)
   148792 {
   148793    switch (devinfo->gen) {
   148794    case 10: return 244;
   148795    case 9: return 244;
   148796    case 8: return 244;
   148797    case 7:
   148798       if (devinfo->is_haswell) {
   148799          return 212;
   148800       } else {
   148801          return 212;
   148802       }
   148803    case 6: return 212;
   148804    case 5: return 0;
   148805    case 4:
   148806       if (devinfo->is_g4x) {
   148807          return 0;
   148808       } else {
   148809          return 0;
   148810       }
   148811    default:
   148812       unreachable("Invalid hardware generation");
   148813    }
   148814 }
   148815 
   148816 
   148817 
   148818 /* MEDIA_VFE_STATE::Scoreboard 3 Delta X */
   148819 
   148820 
   148821 #define GEN10_MEDIA_VFE_STATE_Scoreboard3DeltaX_bits  4
   148822 #define GEN9_MEDIA_VFE_STATE_Scoreboard3DeltaX_bits  4
   148823 #define GEN8_MEDIA_VFE_STATE_Scoreboard3DeltaX_bits  4
   148824 #define GEN75_MEDIA_VFE_STATE_Scoreboard3DeltaX_bits  4
   148825 #define GEN7_MEDIA_VFE_STATE_Scoreboard3DeltaX_bits  4
   148826 #define GEN6_MEDIA_VFE_STATE_Scoreboard3DeltaX_bits  4
   148827 
   148828 static inline uint32_t ATTRIBUTE_PURE
   148829 MEDIA_VFE_STATE_Scoreboard3DeltaX_bits(const struct gen_device_info *devinfo)
   148830 {
   148831    switch (devinfo->gen) {
   148832    case 10: return 4;
   148833    case 9: return 4;
   148834    case 8: return 4;
   148835    case 7:
   148836       if (devinfo->is_haswell) {
   148837          return 4;
   148838       } else {
   148839          return 4;
   148840       }
   148841    case 6: return 4;
   148842    case 5: return 0;
   148843    case 4:
   148844       if (devinfo->is_g4x) {
   148845          return 0;
   148846       } else {
   148847          return 0;
   148848       }
   148849    default:
   148850       unreachable("Invalid hardware generation");
   148851    }
   148852 }
   148853 
   148854 
   148855 
   148856 #define GEN10_MEDIA_VFE_STATE_Scoreboard3DeltaX_start  248
   148857 #define GEN9_MEDIA_VFE_STATE_Scoreboard3DeltaX_start  248
   148858 #define GEN8_MEDIA_VFE_STATE_Scoreboard3DeltaX_start  248
   148859 #define GEN75_MEDIA_VFE_STATE_Scoreboard3DeltaX_start  216
   148860 #define GEN7_MEDIA_VFE_STATE_Scoreboard3DeltaX_start  216
   148861 #define GEN6_MEDIA_VFE_STATE_Scoreboard3DeltaX_start  216
   148862 
   148863 static inline uint32_t ATTRIBUTE_PURE
   148864 MEDIA_VFE_STATE_Scoreboard3DeltaX_start(const struct gen_device_info *devinfo)
   148865 {
   148866    switch (devinfo->gen) {
   148867    case 10: return 248;
   148868    case 9: return 248;
   148869    case 8: return 248;
   148870    case 7:
   148871       if (devinfo->is_haswell) {
   148872          return 216;
   148873       } else {
   148874          return 216;
   148875       }
   148876    case 6: return 216;
   148877    case 5: return 0;
   148878    case 4:
   148879       if (devinfo->is_g4x) {
   148880          return 0;
   148881       } else {
   148882          return 0;
   148883       }
   148884    default:
   148885       unreachable("Invalid hardware generation");
   148886    }
   148887 }
   148888 
   148889 
   148890 
   148891 /* MEDIA_VFE_STATE::Scoreboard 3 Delta Y */
   148892 
   148893 
   148894 #define GEN10_MEDIA_VFE_STATE_Scoreboard3DeltaY_bits  4
   148895 #define GEN9_MEDIA_VFE_STATE_Scoreboard3DeltaY_bits  4
   148896 #define GEN8_MEDIA_VFE_STATE_Scoreboard3DeltaY_bits  4
   148897 #define GEN75_MEDIA_VFE_STATE_Scoreboard3DeltaY_bits  4
   148898 #define GEN7_MEDIA_VFE_STATE_Scoreboard3DeltaY_bits  4
   148899 #define GEN6_MEDIA_VFE_STATE_Scoreboard3DeltaY_bits  4
   148900 
   148901 static inline uint32_t ATTRIBUTE_PURE
   148902 MEDIA_VFE_STATE_Scoreboard3DeltaY_bits(const struct gen_device_info *devinfo)
   148903 {
   148904    switch (devinfo->gen) {
   148905    case 10: return 4;
   148906    case 9: return 4;
   148907    case 8: return 4;
   148908    case 7:
   148909       if (devinfo->is_haswell) {
   148910          return 4;
   148911       } else {
   148912          return 4;
   148913       }
   148914    case 6: return 4;
   148915    case 5: return 0;
   148916    case 4:
   148917       if (devinfo->is_g4x) {
   148918          return 0;
   148919       } else {
   148920          return 0;
   148921       }
   148922    default:
   148923       unreachable("Invalid hardware generation");
   148924    }
   148925 }
   148926 
   148927 
   148928 
   148929 #define GEN10_MEDIA_VFE_STATE_Scoreboard3DeltaY_start  252
   148930 #define GEN9_MEDIA_VFE_STATE_Scoreboard3DeltaY_start  252
   148931 #define GEN8_MEDIA_VFE_STATE_Scoreboard3DeltaY_start  252
   148932 #define GEN75_MEDIA_VFE_STATE_Scoreboard3DeltaY_start  220
   148933 #define GEN7_MEDIA_VFE_STATE_Scoreboard3DeltaY_start  220
   148934 #define GEN6_MEDIA_VFE_STATE_Scoreboard3DeltaY_start  220
   148935 
   148936 static inline uint32_t ATTRIBUTE_PURE
   148937 MEDIA_VFE_STATE_Scoreboard3DeltaY_start(const struct gen_device_info *devinfo)
   148938 {
   148939    switch (devinfo->gen) {
   148940    case 10: return 252;
   148941    case 9: return 252;
   148942    case 8: return 252;
   148943    case 7:
   148944       if (devinfo->is_haswell) {
   148945          return 220;
   148946       } else {
   148947          return 220;
   148948       }
   148949    case 6: return 220;
   148950    case 5: return 0;
   148951    case 4:
   148952       if (devinfo->is_g4x) {
   148953          return 0;
   148954       } else {
   148955          return 0;
   148956       }
   148957    default:
   148958       unreachable("Invalid hardware generation");
   148959    }
   148960 }
   148961 
   148962 
   148963 
   148964 /* MEDIA_VFE_STATE::Scoreboard 4 Delta X */
   148965 
   148966 
   148967 #define GEN10_MEDIA_VFE_STATE_Scoreboard4DeltaX_bits  4
   148968 #define GEN9_MEDIA_VFE_STATE_Scoreboard4DeltaX_bits  4
   148969 #define GEN8_MEDIA_VFE_STATE_Scoreboard4DeltaX_bits  4
   148970 #define GEN75_MEDIA_VFE_STATE_Scoreboard4DeltaX_bits  4
   148971 #define GEN7_MEDIA_VFE_STATE_Scoreboard4DeltaX_bits  4
   148972 #define GEN6_MEDIA_VFE_STATE_Scoreboard4DeltaX_bits  4
   148973 
   148974 static inline uint32_t ATTRIBUTE_PURE
   148975 MEDIA_VFE_STATE_Scoreboard4DeltaX_bits(const struct gen_device_info *devinfo)
   148976 {
   148977    switch (devinfo->gen) {
   148978    case 10: return 4;
   148979    case 9: return 4;
   148980    case 8: return 4;
   148981    case 7:
   148982       if (devinfo->is_haswell) {
   148983          return 4;
   148984       } else {
   148985          return 4;
   148986       }
   148987    case 6: return 4;
   148988    case 5: return 0;
   148989    case 4:
   148990       if (devinfo->is_g4x) {
   148991          return 0;
   148992       } else {
   148993          return 0;
   148994       }
   148995    default:
   148996       unreachable("Invalid hardware generation");
   148997    }
   148998 }
   148999 
   149000 
   149001 
   149002 #define GEN10_MEDIA_VFE_STATE_Scoreboard4DeltaX_start  256
   149003 #define GEN9_MEDIA_VFE_STATE_Scoreboard4DeltaX_start  256
   149004 #define GEN8_MEDIA_VFE_STATE_Scoreboard4DeltaX_start  256
   149005 #define GEN75_MEDIA_VFE_STATE_Scoreboard4DeltaX_start  224
   149006 #define GEN7_MEDIA_VFE_STATE_Scoreboard4DeltaX_start  224
   149007 #define GEN6_MEDIA_VFE_STATE_Scoreboard4DeltaX_start  224
   149008 
   149009 static inline uint32_t ATTRIBUTE_PURE
   149010 MEDIA_VFE_STATE_Scoreboard4DeltaX_start(const struct gen_device_info *devinfo)
   149011 {
   149012    switch (devinfo->gen) {
   149013    case 10: return 256;
   149014    case 9: return 256;
   149015    case 8: return 256;
   149016    case 7:
   149017       if (devinfo->is_haswell) {
   149018          return 224;
   149019       } else {
   149020          return 224;
   149021       }
   149022    case 6: return 224;
   149023    case 5: return 0;
   149024    case 4:
   149025       if (devinfo->is_g4x) {
   149026          return 0;
   149027       } else {
   149028          return 0;
   149029       }
   149030    default:
   149031       unreachable("Invalid hardware generation");
   149032    }
   149033 }
   149034 
   149035 
   149036 
   149037 /* MEDIA_VFE_STATE::Scoreboard 4 Delta Y */
   149038 
   149039 
   149040 #define GEN10_MEDIA_VFE_STATE_Scoreboard4DeltaY_bits  4
   149041 #define GEN9_MEDIA_VFE_STATE_Scoreboard4DeltaY_bits  4
   149042 #define GEN8_MEDIA_VFE_STATE_Scoreboard4DeltaY_bits  4
   149043 #define GEN75_MEDIA_VFE_STATE_Scoreboard4DeltaY_bits  4
   149044 #define GEN7_MEDIA_VFE_STATE_Scoreboard4DeltaY_bits  4
   149045 #define GEN6_MEDIA_VFE_STATE_Scoreboard4DeltaY_bits  4
   149046 
   149047 static inline uint32_t ATTRIBUTE_PURE
   149048 MEDIA_VFE_STATE_Scoreboard4DeltaY_bits(const struct gen_device_info *devinfo)
   149049 {
   149050    switch (devinfo->gen) {
   149051    case 10: return 4;
   149052    case 9: return 4;
   149053    case 8: return 4;
   149054    case 7:
   149055       if (devinfo->is_haswell) {
   149056          return 4;
   149057       } else {
   149058          return 4;
   149059       }
   149060    case 6: return 4;
   149061    case 5: return 0;
   149062    case 4:
   149063       if (devinfo->is_g4x) {
   149064          return 0;
   149065       } else {
   149066          return 0;
   149067       }
   149068    default:
   149069       unreachable("Invalid hardware generation");
   149070    }
   149071 }
   149072 
   149073 
   149074 
   149075 #define GEN10_MEDIA_VFE_STATE_Scoreboard4DeltaY_start  260
   149076 #define GEN9_MEDIA_VFE_STATE_Scoreboard4DeltaY_start  260
   149077 #define GEN8_MEDIA_VFE_STATE_Scoreboard4DeltaY_start  260
   149078 #define GEN75_MEDIA_VFE_STATE_Scoreboard4DeltaY_start  228
   149079 #define GEN7_MEDIA_VFE_STATE_Scoreboard4DeltaY_start  228
   149080 #define GEN6_MEDIA_VFE_STATE_Scoreboard4DeltaY_start  228
   149081 
   149082 static inline uint32_t ATTRIBUTE_PURE
   149083 MEDIA_VFE_STATE_Scoreboard4DeltaY_start(const struct gen_device_info *devinfo)
   149084 {
   149085    switch (devinfo->gen) {
   149086    case 10: return 260;
   149087    case 9: return 260;
   149088    case 8: return 260;
   149089    case 7:
   149090       if (devinfo->is_haswell) {
   149091          return 228;
   149092       } else {
   149093          return 228;
   149094       }
   149095    case 6: return 228;
   149096    case 5: return 0;
   149097    case 4:
   149098       if (devinfo->is_g4x) {
   149099          return 0;
   149100       } else {
   149101          return 0;
   149102       }
   149103    default:
   149104       unreachable("Invalid hardware generation");
   149105    }
   149106 }
   149107 
   149108 
   149109 
   149110 /* MEDIA_VFE_STATE::Scoreboard 5 Delta X */
   149111 
   149112 
   149113 #define GEN10_MEDIA_VFE_STATE_Scoreboard5DeltaX_bits  4
   149114 #define GEN9_MEDIA_VFE_STATE_Scoreboard5DeltaX_bits  4
   149115 #define GEN8_MEDIA_VFE_STATE_Scoreboard5DeltaX_bits  4
   149116 #define GEN75_MEDIA_VFE_STATE_Scoreboard5DeltaX_bits  4
   149117 #define GEN7_MEDIA_VFE_STATE_Scoreboard5DeltaX_bits  4
   149118 #define GEN6_MEDIA_VFE_STATE_Scoreboard5DeltaX_bits  4
   149119 
   149120 static inline uint32_t ATTRIBUTE_PURE
   149121 MEDIA_VFE_STATE_Scoreboard5DeltaX_bits(const struct gen_device_info *devinfo)
   149122 {
   149123    switch (devinfo->gen) {
   149124    case 10: return 4;
   149125    case 9: return 4;
   149126    case 8: return 4;
   149127    case 7:
   149128       if (devinfo->is_haswell) {
   149129          return 4;
   149130       } else {
   149131          return 4;
   149132       }
   149133    case 6: return 4;
   149134    case 5: return 0;
   149135    case 4:
   149136       if (devinfo->is_g4x) {
   149137          return 0;
   149138       } else {
   149139          return 0;
   149140       }
   149141    default:
   149142       unreachable("Invalid hardware generation");
   149143    }
   149144 }
   149145 
   149146 
   149147 
   149148 #define GEN10_MEDIA_VFE_STATE_Scoreboard5DeltaX_start  264
   149149 #define GEN9_MEDIA_VFE_STATE_Scoreboard5DeltaX_start  264
   149150 #define GEN8_MEDIA_VFE_STATE_Scoreboard5DeltaX_start  264
   149151 #define GEN75_MEDIA_VFE_STATE_Scoreboard5DeltaX_start  232
   149152 #define GEN7_MEDIA_VFE_STATE_Scoreboard5DeltaX_start  232
   149153 #define GEN6_MEDIA_VFE_STATE_Scoreboard5DeltaX_start  232
   149154 
   149155 static inline uint32_t ATTRIBUTE_PURE
   149156 MEDIA_VFE_STATE_Scoreboard5DeltaX_start(const struct gen_device_info *devinfo)
   149157 {
   149158    switch (devinfo->gen) {
   149159    case 10: return 264;
   149160    case 9: return 264;
   149161    case 8: return 264;
   149162    case 7:
   149163       if (devinfo->is_haswell) {
   149164          return 232;
   149165       } else {
   149166          return 232;
   149167       }
   149168    case 6: return 232;
   149169    case 5: return 0;
   149170    case 4:
   149171       if (devinfo->is_g4x) {
   149172          return 0;
   149173       } else {
   149174          return 0;
   149175       }
   149176    default:
   149177       unreachable("Invalid hardware generation");
   149178    }
   149179 }
   149180 
   149181 
   149182 
   149183 /* MEDIA_VFE_STATE::Scoreboard 5 Delta Y */
   149184 
   149185 
   149186 #define GEN10_MEDIA_VFE_STATE_Scoreboard5DeltaY_bits  4
   149187 #define GEN9_MEDIA_VFE_STATE_Scoreboard5DeltaY_bits  4
   149188 #define GEN8_MEDIA_VFE_STATE_Scoreboard5DeltaY_bits  4
   149189 #define GEN75_MEDIA_VFE_STATE_Scoreboard5DeltaY_bits  4
   149190 #define GEN7_MEDIA_VFE_STATE_Scoreboard5DeltaY_bits  4
   149191 #define GEN6_MEDIA_VFE_STATE_Scoreboard5DeltaY_bits  4
   149192 
   149193 static inline uint32_t ATTRIBUTE_PURE
   149194 MEDIA_VFE_STATE_Scoreboard5DeltaY_bits(const struct gen_device_info *devinfo)
   149195 {
   149196    switch (devinfo->gen) {
   149197    case 10: return 4;
   149198    case 9: return 4;
   149199    case 8: return 4;
   149200    case 7:
   149201       if (devinfo->is_haswell) {
   149202          return 4;
   149203       } else {
   149204          return 4;
   149205       }
   149206    case 6: return 4;
   149207    case 5: return 0;
   149208    case 4:
   149209       if (devinfo->is_g4x) {
   149210          return 0;
   149211       } else {
   149212          return 0;
   149213       }
   149214    default:
   149215       unreachable("Invalid hardware generation");
   149216    }
   149217 }
   149218 
   149219 
   149220 
   149221 #define GEN10_MEDIA_VFE_STATE_Scoreboard5DeltaY_start  268
   149222 #define GEN9_MEDIA_VFE_STATE_Scoreboard5DeltaY_start  268
   149223 #define GEN8_MEDIA_VFE_STATE_Scoreboard5DeltaY_start  268
   149224 #define GEN75_MEDIA_VFE_STATE_Scoreboard5DeltaY_start  236
   149225 #define GEN7_MEDIA_VFE_STATE_Scoreboard5DeltaY_start  236
   149226 #define GEN6_MEDIA_VFE_STATE_Scoreboard5DeltaY_start  236
   149227 
   149228 static inline uint32_t ATTRIBUTE_PURE
   149229 MEDIA_VFE_STATE_Scoreboard5DeltaY_start(const struct gen_device_info *devinfo)
   149230 {
   149231    switch (devinfo->gen) {
   149232    case 10: return 268;
   149233    case 9: return 268;
   149234    case 8: return 268;
   149235    case 7:
   149236       if (devinfo->is_haswell) {
   149237          return 236;
   149238       } else {
   149239          return 236;
   149240       }
   149241    case 6: return 236;
   149242    case 5: return 0;
   149243    case 4:
   149244       if (devinfo->is_g4x) {
   149245          return 0;
   149246       } else {
   149247          return 0;
   149248       }
   149249    default:
   149250       unreachable("Invalid hardware generation");
   149251    }
   149252 }
   149253 
   149254 
   149255 
   149256 /* MEDIA_VFE_STATE::Scoreboard 6 Delta X */
   149257 
   149258 
   149259 #define GEN10_MEDIA_VFE_STATE_Scoreboard6DeltaX_bits  4
   149260 #define GEN9_MEDIA_VFE_STATE_Scoreboard6DeltaX_bits  4
   149261 #define GEN8_MEDIA_VFE_STATE_Scoreboard6DeltaX_bits  4
   149262 #define GEN75_MEDIA_VFE_STATE_Scoreboard6DeltaX_bits  4
   149263 #define GEN7_MEDIA_VFE_STATE_Scoreboard6DeltaX_bits  4
   149264 #define GEN6_MEDIA_VFE_STATE_Scoreboard6DeltaX_bits  4
   149265 
   149266 static inline uint32_t ATTRIBUTE_PURE
   149267 MEDIA_VFE_STATE_Scoreboard6DeltaX_bits(const struct gen_device_info *devinfo)
   149268 {
   149269    switch (devinfo->gen) {
   149270    case 10: return 4;
   149271    case 9: return 4;
   149272    case 8: return 4;
   149273    case 7:
   149274       if (devinfo->is_haswell) {
   149275          return 4;
   149276       } else {
   149277          return 4;
   149278       }
   149279    case 6: return 4;
   149280    case 5: return 0;
   149281    case 4:
   149282       if (devinfo->is_g4x) {
   149283          return 0;
   149284       } else {
   149285          return 0;
   149286       }
   149287    default:
   149288       unreachable("Invalid hardware generation");
   149289    }
   149290 }
   149291 
   149292 
   149293 
   149294 #define GEN10_MEDIA_VFE_STATE_Scoreboard6DeltaX_start  272
   149295 #define GEN9_MEDIA_VFE_STATE_Scoreboard6DeltaX_start  272
   149296 #define GEN8_MEDIA_VFE_STATE_Scoreboard6DeltaX_start  272
   149297 #define GEN75_MEDIA_VFE_STATE_Scoreboard6DeltaX_start  240
   149298 #define GEN7_MEDIA_VFE_STATE_Scoreboard6DeltaX_start  240
   149299 #define GEN6_MEDIA_VFE_STATE_Scoreboard6DeltaX_start  240
   149300 
   149301 static inline uint32_t ATTRIBUTE_PURE
   149302 MEDIA_VFE_STATE_Scoreboard6DeltaX_start(const struct gen_device_info *devinfo)
   149303 {
   149304    switch (devinfo->gen) {
   149305    case 10: return 272;
   149306    case 9: return 272;
   149307    case 8: return 272;
   149308    case 7:
   149309       if (devinfo->is_haswell) {
   149310          return 240;
   149311       } else {
   149312          return 240;
   149313       }
   149314    case 6: return 240;
   149315    case 5: return 0;
   149316    case 4:
   149317       if (devinfo->is_g4x) {
   149318          return 0;
   149319       } else {
   149320          return 0;
   149321       }
   149322    default:
   149323       unreachable("Invalid hardware generation");
   149324    }
   149325 }
   149326 
   149327 
   149328 
   149329 /* MEDIA_VFE_STATE::Scoreboard 6 Delta Y */
   149330 
   149331 
   149332 #define GEN10_MEDIA_VFE_STATE_Scoreboard6DeltaY_bits  4
   149333 #define GEN9_MEDIA_VFE_STATE_Scoreboard6DeltaY_bits  4
   149334 #define GEN8_MEDIA_VFE_STATE_Scoreboard6DeltaY_bits  4
   149335 #define GEN75_MEDIA_VFE_STATE_Scoreboard6DeltaY_bits  4
   149336 #define GEN7_MEDIA_VFE_STATE_Scoreboard6DeltaY_bits  4
   149337 #define GEN6_MEDIA_VFE_STATE_Scoreboard6DeltaY_bits  4
   149338 
   149339 static inline uint32_t ATTRIBUTE_PURE
   149340 MEDIA_VFE_STATE_Scoreboard6DeltaY_bits(const struct gen_device_info *devinfo)
   149341 {
   149342    switch (devinfo->gen) {
   149343    case 10: return 4;
   149344    case 9: return 4;
   149345    case 8: return 4;
   149346    case 7:
   149347       if (devinfo->is_haswell) {
   149348          return 4;
   149349       } else {
   149350          return 4;
   149351       }
   149352    case 6: return 4;
   149353    case 5: return 0;
   149354    case 4:
   149355       if (devinfo->is_g4x) {
   149356          return 0;
   149357       } else {
   149358          return 0;
   149359       }
   149360    default:
   149361       unreachable("Invalid hardware generation");
   149362    }
   149363 }
   149364 
   149365 
   149366 
   149367 #define GEN10_MEDIA_VFE_STATE_Scoreboard6DeltaY_start  276
   149368 #define GEN9_MEDIA_VFE_STATE_Scoreboard6DeltaY_start  276
   149369 #define GEN8_MEDIA_VFE_STATE_Scoreboard6DeltaY_start  276
   149370 #define GEN75_MEDIA_VFE_STATE_Scoreboard6DeltaY_start  244
   149371 #define GEN7_MEDIA_VFE_STATE_Scoreboard6DeltaY_start  244
   149372 #define GEN6_MEDIA_VFE_STATE_Scoreboard6DeltaY_start  244
   149373 
   149374 static inline uint32_t ATTRIBUTE_PURE
   149375 MEDIA_VFE_STATE_Scoreboard6DeltaY_start(const struct gen_device_info *devinfo)
   149376 {
   149377    switch (devinfo->gen) {
   149378    case 10: return 276;
   149379    case 9: return 276;
   149380    case 8: return 276;
   149381    case 7:
   149382       if (devinfo->is_haswell) {
   149383          return 244;
   149384       } else {
   149385          return 244;
   149386       }
   149387    case 6: return 244;
   149388    case 5: return 0;
   149389    case 4:
   149390       if (devinfo->is_g4x) {
   149391          return 0;
   149392       } else {
   149393          return 0;
   149394       }
   149395    default:
   149396       unreachable("Invalid hardware generation");
   149397    }
   149398 }
   149399 
   149400 
   149401 
   149402 /* MEDIA_VFE_STATE::Scoreboard 7 Delta X */
   149403 
   149404 
   149405 #define GEN10_MEDIA_VFE_STATE_Scoreboard7DeltaX_bits  4
   149406 #define GEN9_MEDIA_VFE_STATE_Scoreboard7DeltaX_bits  4
   149407 #define GEN8_MEDIA_VFE_STATE_Scoreboard7DeltaX_bits  4
   149408 #define GEN75_MEDIA_VFE_STATE_Scoreboard7DeltaX_bits  4
   149409 #define GEN7_MEDIA_VFE_STATE_Scoreboard7DeltaX_bits  4
   149410 #define GEN6_MEDIA_VFE_STATE_Scoreboard7DeltaX_bits  4
   149411 
   149412 static inline uint32_t ATTRIBUTE_PURE
   149413 MEDIA_VFE_STATE_Scoreboard7DeltaX_bits(const struct gen_device_info *devinfo)
   149414 {
   149415    switch (devinfo->gen) {
   149416    case 10: return 4;
   149417    case 9: return 4;
   149418    case 8: return 4;
   149419    case 7:
   149420       if (devinfo->is_haswell) {
   149421          return 4;
   149422       } else {
   149423          return 4;
   149424       }
   149425    case 6: return 4;
   149426    case 5: return 0;
   149427    case 4:
   149428       if (devinfo->is_g4x) {
   149429          return 0;
   149430       } else {
   149431          return 0;
   149432       }
   149433    default:
   149434       unreachable("Invalid hardware generation");
   149435    }
   149436 }
   149437 
   149438 
   149439 
   149440 #define GEN10_MEDIA_VFE_STATE_Scoreboard7DeltaX_start  280
   149441 #define GEN9_MEDIA_VFE_STATE_Scoreboard7DeltaX_start  280
   149442 #define GEN8_MEDIA_VFE_STATE_Scoreboard7DeltaX_start  280
   149443 #define GEN75_MEDIA_VFE_STATE_Scoreboard7DeltaX_start  248
   149444 #define GEN7_MEDIA_VFE_STATE_Scoreboard7DeltaX_start  248
   149445 #define GEN6_MEDIA_VFE_STATE_Scoreboard7DeltaX_start  248
   149446 
   149447 static inline uint32_t ATTRIBUTE_PURE
   149448 MEDIA_VFE_STATE_Scoreboard7DeltaX_start(const struct gen_device_info *devinfo)
   149449 {
   149450    switch (devinfo->gen) {
   149451    case 10: return 280;
   149452    case 9: return 280;
   149453    case 8: return 280;
   149454    case 7:
   149455       if (devinfo->is_haswell) {
   149456          return 248;
   149457       } else {
   149458          return 248;
   149459       }
   149460    case 6: return 248;
   149461    case 5: return 0;
   149462    case 4:
   149463       if (devinfo->is_g4x) {
   149464          return 0;
   149465       } else {
   149466          return 0;
   149467       }
   149468    default:
   149469       unreachable("Invalid hardware generation");
   149470    }
   149471 }
   149472 
   149473 
   149474 
   149475 /* MEDIA_VFE_STATE::Scoreboard 7 Delta Y */
   149476 
   149477 
   149478 #define GEN10_MEDIA_VFE_STATE_Scoreboard7DeltaY_bits  4
   149479 #define GEN9_MEDIA_VFE_STATE_Scoreboard7DeltaY_bits  4
   149480 #define GEN8_MEDIA_VFE_STATE_Scoreboard7DeltaY_bits  4
   149481 #define GEN75_MEDIA_VFE_STATE_Scoreboard7DeltaY_bits  4
   149482 #define GEN7_MEDIA_VFE_STATE_Scoreboard7DeltaY_bits  4
   149483 #define GEN6_MEDIA_VFE_STATE_Scoreboard7DeltaY_bits  4
   149484 
   149485 static inline uint32_t ATTRIBUTE_PURE
   149486 MEDIA_VFE_STATE_Scoreboard7DeltaY_bits(const struct gen_device_info *devinfo)
   149487 {
   149488    switch (devinfo->gen) {
   149489    case 10: return 4;
   149490    case 9: return 4;
   149491    case 8: return 4;
   149492    case 7:
   149493       if (devinfo->is_haswell) {
   149494          return 4;
   149495       } else {
   149496          return 4;
   149497       }
   149498    case 6: return 4;
   149499    case 5: return 0;
   149500    case 4:
   149501       if (devinfo->is_g4x) {
   149502          return 0;
   149503       } else {
   149504          return 0;
   149505       }
   149506    default:
   149507       unreachable("Invalid hardware generation");
   149508    }
   149509 }
   149510 
   149511 
   149512 
   149513 #define GEN10_MEDIA_VFE_STATE_Scoreboard7DeltaY_start  284
   149514 #define GEN9_MEDIA_VFE_STATE_Scoreboard7DeltaY_start  284
   149515 #define GEN8_MEDIA_VFE_STATE_Scoreboard7DeltaY_start  284
   149516 #define GEN75_MEDIA_VFE_STATE_Scoreboard7DeltaY_start  252
   149517 #define GEN7_MEDIA_VFE_STATE_Scoreboard7DeltaY_start  252
   149518 #define GEN6_MEDIA_VFE_STATE_Scoreboard7DeltaY_start  252
   149519 
   149520 static inline uint32_t ATTRIBUTE_PURE
   149521 MEDIA_VFE_STATE_Scoreboard7DeltaY_start(const struct gen_device_info *devinfo)
   149522 {
   149523    switch (devinfo->gen) {
   149524    case 10: return 284;
   149525    case 9: return 284;
   149526    case 8: return 284;
   149527    case 7:
   149528       if (devinfo->is_haswell) {
   149529          return 252;
   149530       } else {
   149531          return 252;
   149532       }
   149533    case 6: return 252;
   149534    case 5: return 0;
   149535    case 4:
   149536       if (devinfo->is_g4x) {
   149537          return 0;
   149538       } else {
   149539          return 0;
   149540       }
   149541    default:
   149542       unreachable("Invalid hardware generation");
   149543    }
   149544 }
   149545 
   149546 
   149547 
   149548 /* MEDIA_VFE_STATE::Scoreboard Enable */
   149549 
   149550 
   149551 #define GEN10_MEDIA_VFE_STATE_ScoreboardEnable_bits  1
   149552 #define GEN9_MEDIA_VFE_STATE_ScoreboardEnable_bits  1
   149553 #define GEN8_MEDIA_VFE_STATE_ScoreboardEnable_bits  1
   149554 #define GEN75_MEDIA_VFE_STATE_ScoreboardEnable_bits  1
   149555 #define GEN7_MEDIA_VFE_STATE_ScoreboardEnable_bits  1
   149556 #define GEN6_MEDIA_VFE_STATE_ScoreboardEnable_bits  1
   149557 
   149558 static inline uint32_t ATTRIBUTE_PURE
   149559 MEDIA_VFE_STATE_ScoreboardEnable_bits(const struct gen_device_info *devinfo)
   149560 {
   149561    switch (devinfo->gen) {
   149562    case 10: return 1;
   149563    case 9: return 1;
   149564    case 8: return 1;
   149565    case 7:
   149566       if (devinfo->is_haswell) {
   149567          return 1;
   149568       } else {
   149569          return 1;
   149570       }
   149571    case 6: return 1;
   149572    case 5: return 0;
   149573    case 4:
   149574       if (devinfo->is_g4x) {
   149575          return 0;
   149576       } else {
   149577          return 0;
   149578       }
   149579    default:
   149580       unreachable("Invalid hardware generation");
   149581    }
   149582 }
   149583 
   149584 
   149585 
   149586 #define GEN10_MEDIA_VFE_STATE_ScoreboardEnable_start  223
   149587 #define GEN9_MEDIA_VFE_STATE_ScoreboardEnable_start  223
   149588 #define GEN8_MEDIA_VFE_STATE_ScoreboardEnable_start  223
   149589 #define GEN75_MEDIA_VFE_STATE_ScoreboardEnable_start  191
   149590 #define GEN7_MEDIA_VFE_STATE_ScoreboardEnable_start  191
   149591 #define GEN6_MEDIA_VFE_STATE_ScoreboardEnable_start  191
   149592 
   149593 static inline uint32_t ATTRIBUTE_PURE
   149594 MEDIA_VFE_STATE_ScoreboardEnable_start(const struct gen_device_info *devinfo)
   149595 {
   149596    switch (devinfo->gen) {
   149597    case 10: return 223;
   149598    case 9: return 223;
   149599    case 8: return 223;
   149600    case 7:
   149601       if (devinfo->is_haswell) {
   149602          return 191;
   149603       } else {
   149604          return 191;
   149605       }
   149606    case 6: return 191;
   149607    case 5: return 0;
   149608    case 4:
   149609       if (devinfo->is_g4x) {
   149610          return 0;
   149611       } else {
   149612          return 0;
   149613       }
   149614    default:
   149615       unreachable("Invalid hardware generation");
   149616    }
   149617 }
   149618 
   149619 
   149620 
   149621 /* MEDIA_VFE_STATE::Scoreboard Mask */
   149622 
   149623 
   149624 #define GEN10_MEDIA_VFE_STATE_ScoreboardMask_bits  8
   149625 #define GEN9_MEDIA_VFE_STATE_ScoreboardMask_bits  8
   149626 #define GEN8_MEDIA_VFE_STATE_ScoreboardMask_bits  8
   149627 #define GEN75_MEDIA_VFE_STATE_ScoreboardMask_bits  8
   149628 #define GEN7_MEDIA_VFE_STATE_ScoreboardMask_bits  8
   149629 #define GEN6_MEDIA_VFE_STATE_ScoreboardMask_bits  8
   149630 
   149631 static inline uint32_t ATTRIBUTE_PURE
   149632 MEDIA_VFE_STATE_ScoreboardMask_bits(const struct gen_device_info *devinfo)
   149633 {
   149634    switch (devinfo->gen) {
   149635    case 10: return 8;
   149636    case 9: return 8;
   149637    case 8: return 8;
   149638    case 7:
   149639       if (devinfo->is_haswell) {
   149640          return 8;
   149641       } else {
   149642          return 8;
   149643       }
   149644    case 6: return 8;
   149645    case 5: return 0;
   149646    case 4:
   149647       if (devinfo->is_g4x) {
   149648          return 0;
   149649       } else {
   149650          return 0;
   149651       }
   149652    default:
   149653       unreachable("Invalid hardware generation");
   149654    }
   149655 }
   149656 
   149657 
   149658 
   149659 #define GEN10_MEDIA_VFE_STATE_ScoreboardMask_start  192
   149660 #define GEN9_MEDIA_VFE_STATE_ScoreboardMask_start  192
   149661 #define GEN8_MEDIA_VFE_STATE_ScoreboardMask_start  192
   149662 #define GEN75_MEDIA_VFE_STATE_ScoreboardMask_start  160
   149663 #define GEN7_MEDIA_VFE_STATE_ScoreboardMask_start  160
   149664 #define GEN6_MEDIA_VFE_STATE_ScoreboardMask_start  160
   149665 
   149666 static inline uint32_t ATTRIBUTE_PURE
   149667 MEDIA_VFE_STATE_ScoreboardMask_start(const struct gen_device_info *devinfo)
   149668 {
   149669    switch (devinfo->gen) {
   149670    case 10: return 192;
   149671    case 9: return 192;
   149672    case 8: return 192;
   149673    case 7:
   149674       if (devinfo->is_haswell) {
   149675          return 160;
   149676       } else {
   149677          return 160;
   149678       }
   149679    case 6: return 160;
   149680    case 5: return 0;
   149681    case 4:
   149682       if (devinfo->is_g4x) {
   149683          return 0;
   149684       } else {
   149685          return 0;
   149686       }
   149687    default:
   149688       unreachable("Invalid hardware generation");
   149689    }
   149690 }
   149691 
   149692 
   149693 
   149694 /* MEDIA_VFE_STATE::Scoreboard Type */
   149695 
   149696 
   149697 #define GEN10_MEDIA_VFE_STATE_ScoreboardType_bits  1
   149698 #define GEN9_MEDIA_VFE_STATE_ScoreboardType_bits  1
   149699 #define GEN8_MEDIA_VFE_STATE_ScoreboardType_bits  1
   149700 #define GEN75_MEDIA_VFE_STATE_ScoreboardType_bits  1
   149701 #define GEN7_MEDIA_VFE_STATE_ScoreboardType_bits  1
   149702 #define GEN6_MEDIA_VFE_STATE_ScoreboardType_bits  1
   149703 
   149704 static inline uint32_t ATTRIBUTE_PURE
   149705 MEDIA_VFE_STATE_ScoreboardType_bits(const struct gen_device_info *devinfo)
   149706 {
   149707    switch (devinfo->gen) {
   149708    case 10: return 1;
   149709    case 9: return 1;
   149710    case 8: return 1;
   149711    case 7:
   149712       if (devinfo->is_haswell) {
   149713          return 1;
   149714       } else {
   149715          return 1;
   149716       }
   149717    case 6: return 1;
   149718    case 5: return 0;
   149719    case 4:
   149720       if (devinfo->is_g4x) {
   149721          return 0;
   149722       } else {
   149723          return 0;
   149724       }
   149725    default:
   149726       unreachable("Invalid hardware generation");
   149727    }
   149728 }
   149729 
   149730 
   149731 
   149732 #define GEN10_MEDIA_VFE_STATE_ScoreboardType_start  222
   149733 #define GEN9_MEDIA_VFE_STATE_ScoreboardType_start  222
   149734 #define GEN8_MEDIA_VFE_STATE_ScoreboardType_start  222
   149735 #define GEN75_MEDIA_VFE_STATE_ScoreboardType_start  190
   149736 #define GEN7_MEDIA_VFE_STATE_ScoreboardType_start  190
   149737 #define GEN6_MEDIA_VFE_STATE_ScoreboardType_start  190
   149738 
   149739 static inline uint32_t ATTRIBUTE_PURE
   149740 MEDIA_VFE_STATE_ScoreboardType_start(const struct gen_device_info *devinfo)
   149741 {
   149742    switch (devinfo->gen) {
   149743    case 10: return 222;
   149744    case 9: return 222;
   149745    case 8: return 222;
   149746    case 7:
   149747       if (devinfo->is_haswell) {
   149748          return 190;
   149749       } else {
   149750          return 190;
   149751       }
   149752    case 6: return 190;
   149753    case 5: return 0;
   149754    case 4:
   149755       if (devinfo->is_g4x) {
   149756          return 0;
   149757       } else {
   149758          return 0;
   149759       }
   149760    default:
   149761       unreachable("Invalid hardware generation");
   149762    }
   149763 }
   149764 
   149765 
   149766 
   149767 /* MEDIA_VFE_STATE::Scratch Space Base Pointer */
   149768 
   149769 
   149770 #define GEN10_MEDIA_VFE_STATE_ScratchSpaceBasePointer_bits  38
   149771 #define GEN9_MEDIA_VFE_STATE_ScratchSpaceBasePointer_bits  38
   149772 #define GEN8_MEDIA_VFE_STATE_ScratchSpaceBasePointer_bits  38
   149773 #define GEN75_MEDIA_VFE_STATE_ScratchSpaceBasePointer_bits  22
   149774 #define GEN7_MEDIA_VFE_STATE_ScratchSpaceBasePointer_bits  22
   149775 #define GEN6_MEDIA_VFE_STATE_ScratchSpaceBasePointer_bits  22
   149776 
   149777 static inline uint32_t ATTRIBUTE_PURE
   149778 MEDIA_VFE_STATE_ScratchSpaceBasePointer_bits(const struct gen_device_info *devinfo)
   149779 {
   149780    switch (devinfo->gen) {
   149781    case 10: return 38;
   149782    case 9: return 38;
   149783    case 8: return 38;
   149784    case 7:
   149785       if (devinfo->is_haswell) {
   149786          return 22;
   149787       } else {
   149788          return 22;
   149789       }
   149790    case 6: return 22;
   149791    case 5: return 0;
   149792    case 4:
   149793       if (devinfo->is_g4x) {
   149794          return 0;
   149795       } else {
   149796          return 0;
   149797       }
   149798    default:
   149799       unreachable("Invalid hardware generation");
   149800    }
   149801 }
   149802 
   149803 
   149804 
   149805 #define GEN10_MEDIA_VFE_STATE_ScratchSpaceBasePointer_start  42
   149806 #define GEN9_MEDIA_VFE_STATE_ScratchSpaceBasePointer_start  42
   149807 #define GEN8_MEDIA_VFE_STATE_ScratchSpaceBasePointer_start  42
   149808 #define GEN75_MEDIA_VFE_STATE_ScratchSpaceBasePointer_start  42
   149809 #define GEN7_MEDIA_VFE_STATE_ScratchSpaceBasePointer_start  42
   149810 #define GEN6_MEDIA_VFE_STATE_ScratchSpaceBasePointer_start  42
   149811 
   149812 static inline uint32_t ATTRIBUTE_PURE
   149813 MEDIA_VFE_STATE_ScratchSpaceBasePointer_start(const struct gen_device_info *devinfo)
   149814 {
   149815    switch (devinfo->gen) {
   149816    case 10: return 42;
   149817    case 9: return 42;
   149818    case 8: return 42;
   149819    case 7:
   149820       if (devinfo->is_haswell) {
   149821          return 42;
   149822       } else {
   149823          return 42;
   149824       }
   149825    case 6: return 42;
   149826    case 5: return 0;
   149827    case 4:
   149828       if (devinfo->is_g4x) {
   149829          return 0;
   149830       } else {
   149831          return 0;
   149832       }
   149833    default:
   149834       unreachable("Invalid hardware generation");
   149835    }
   149836 }
   149837 
   149838 
   149839 
   149840 /* MEDIA_VFE_STATE::Slice Disable */
   149841 
   149842 
   149843 #define GEN10_MEDIA_VFE_STATE_SliceDisable_bits  2
   149844 #define GEN9_MEDIA_VFE_STATE_SliceDisable_bits  2
   149845 #define GEN8_MEDIA_VFE_STATE_SliceDisable_bits  2
   149846 
   149847 static inline uint32_t ATTRIBUTE_PURE
   149848 MEDIA_VFE_STATE_SliceDisable_bits(const struct gen_device_info *devinfo)
   149849 {
   149850    switch (devinfo->gen) {
   149851    case 10: return 2;
   149852    case 9: return 2;
   149853    case 8: return 2;
   149854    case 7:
   149855       if (devinfo->is_haswell) {
   149856          return 0;
   149857       } else {
   149858          return 0;
   149859       }
   149860    case 6: return 0;
   149861    case 5: return 0;
   149862    case 4:
   149863       if (devinfo->is_g4x) {
   149864          return 0;
   149865       } else {
   149866          return 0;
   149867       }
   149868    default:
   149869       unreachable("Invalid hardware generation");
   149870    }
   149871 }
   149872 
   149873 
   149874 
   149875 #define GEN10_MEDIA_VFE_STATE_SliceDisable_start  128
   149876 #define GEN9_MEDIA_VFE_STATE_SliceDisable_start  128
   149877 #define GEN8_MEDIA_VFE_STATE_SliceDisable_start  128
   149878 
   149879 static inline uint32_t ATTRIBUTE_PURE
   149880 MEDIA_VFE_STATE_SliceDisable_start(const struct gen_device_info *devinfo)
   149881 {
   149882    switch (devinfo->gen) {
   149883    case 10: return 128;
   149884    case 9: return 128;
   149885    case 8: return 128;
   149886    case 7:
   149887       if (devinfo->is_haswell) {
   149888          return 0;
   149889       } else {
   149890          return 0;
   149891       }
   149892    case 6: return 0;
   149893    case 5: return 0;
   149894    case 4:
   149895       if (devinfo->is_g4x) {
   149896          return 0;
   149897       } else {
   149898          return 0;
   149899       }
   149900    default:
   149901       unreachable("Invalid hardware generation");
   149902    }
   149903 }
   149904 
   149905 
   149906 
   149907 /* MEDIA_VFE_STATE::Stack Size */
   149908 
   149909 
   149910 #define GEN10_MEDIA_VFE_STATE_StackSize_bits  4
   149911 #define GEN9_MEDIA_VFE_STATE_StackSize_bits  4
   149912 #define GEN8_MEDIA_VFE_STATE_StackSize_bits  4
   149913 #define GEN75_MEDIA_VFE_STATE_StackSize_bits  4
   149914 
   149915 static inline uint32_t ATTRIBUTE_PURE
   149916 MEDIA_VFE_STATE_StackSize_bits(const struct gen_device_info *devinfo)
   149917 {
   149918    switch (devinfo->gen) {
   149919    case 10: return 4;
   149920    case 9: return 4;
   149921    case 8: return 4;
   149922    case 7:
   149923       if (devinfo->is_haswell) {
   149924          return 4;
   149925       } else {
   149926          return 0;
   149927       }
   149928    case 6: return 0;
   149929    case 5: return 0;
   149930    case 4:
   149931       if (devinfo->is_g4x) {
   149932          return 0;
   149933       } else {
   149934          return 0;
   149935       }
   149936    default:
   149937       unreachable("Invalid hardware generation");
   149938    }
   149939 }
   149940 
   149941 
   149942 
   149943 #define GEN10_MEDIA_VFE_STATE_StackSize_start  36
   149944 #define GEN9_MEDIA_VFE_STATE_StackSize_start  36
   149945 #define GEN8_MEDIA_VFE_STATE_StackSize_start  36
   149946 #define GEN75_MEDIA_VFE_STATE_StackSize_start  36
   149947 
   149948 static inline uint32_t ATTRIBUTE_PURE
   149949 MEDIA_VFE_STATE_StackSize_start(const struct gen_device_info *devinfo)
   149950 {
   149951    switch (devinfo->gen) {
   149952    case 10: return 36;
   149953    case 9: return 36;
   149954    case 8: return 36;
   149955    case 7:
   149956       if (devinfo->is_haswell) {
   149957          return 36;
   149958       } else {
   149959          return 0;
   149960       }
   149961    case 6: return 0;
   149962    case 5: return 0;
   149963    case 4:
   149964       if (devinfo->is_g4x) {
   149965          return 0;
   149966       } else {
   149967          return 0;
   149968       }
   149969    default:
   149970       unreachable("Invalid hardware generation");
   149971    }
   149972 }
   149973 
   149974 
   149975 
   149976 /* MEDIA_VFE_STATE::SubOpcode */
   149977 
   149978 
   149979 #define GEN10_MEDIA_VFE_STATE_SubOpcode_bits  8
   149980 #define GEN9_MEDIA_VFE_STATE_SubOpcode_bits  8
   149981 #define GEN8_MEDIA_VFE_STATE_SubOpcode_bits  8
   149982 #define GEN75_MEDIA_VFE_STATE_SubOpcode_bits  8
   149983 #define GEN7_MEDIA_VFE_STATE_SubOpcode_bits  8
   149984 #define GEN6_MEDIA_VFE_STATE_SubOpcode_bits  8
   149985 
   149986 static inline uint32_t ATTRIBUTE_PURE
   149987 MEDIA_VFE_STATE_SubOpcode_bits(const struct gen_device_info *devinfo)
   149988 {
   149989    switch (devinfo->gen) {
   149990    case 10: return 8;
   149991    case 9: return 8;
   149992    case 8: return 8;
   149993    case 7:
   149994       if (devinfo->is_haswell) {
   149995          return 8;
   149996       } else {
   149997          return 8;
   149998       }
   149999    case 6: return 8;
   150000    case 5: return 0;
   150001    case 4:
   150002       if (devinfo->is_g4x) {
   150003          return 0;
   150004       } else {
   150005          return 0;
   150006       }
   150007    default:
   150008       unreachable("Invalid hardware generation");
   150009    }
   150010 }
   150011 
   150012 
   150013 
   150014 #define GEN10_MEDIA_VFE_STATE_SubOpcode_start  16
   150015 #define GEN9_MEDIA_VFE_STATE_SubOpcode_start  16
   150016 #define GEN8_MEDIA_VFE_STATE_SubOpcode_start  16
   150017 #define GEN75_MEDIA_VFE_STATE_SubOpcode_start  16
   150018 #define GEN7_MEDIA_VFE_STATE_SubOpcode_start  16
   150019 #define GEN6_MEDIA_VFE_STATE_SubOpcode_start  16
   150020 
   150021 static inline uint32_t ATTRIBUTE_PURE
   150022 MEDIA_VFE_STATE_SubOpcode_start(const struct gen_device_info *devinfo)
   150023 {
   150024    switch (devinfo->gen) {
   150025    case 10: return 16;
   150026    case 9: return 16;
   150027    case 8: return 16;
   150028    case 7:
   150029       if (devinfo->is_haswell) {
   150030          return 16;
   150031       } else {
   150032          return 16;
   150033       }
   150034    case 6: return 16;
   150035    case 5: return 0;
   150036    case 4:
   150037       if (devinfo->is_g4x) {
   150038          return 0;
   150039       } else {
   150040          return 0;
   150041       }
   150042    default:
   150043       unreachable("Invalid hardware generation");
   150044    }
   150045 }
   150046 
   150047 
   150048 
   150049 /* MEDIA_VFE_STATE::Thread Dispatch Selection Policy */
   150050 
   150051 
   150052 #define GEN10_MEDIA_VFE_STATE_ThreadDispatchSelectionPolicy_bits  2
   150053 
   150054 static inline uint32_t ATTRIBUTE_PURE
   150055 MEDIA_VFE_STATE_ThreadDispatchSelectionPolicy_bits(const struct gen_device_info *devinfo)
   150056 {
   150057    switch (devinfo->gen) {
   150058    case 10: return 2;
   150059    case 9: return 0;
   150060    case 8: return 0;
   150061    case 7:
   150062       if (devinfo->is_haswell) {
   150063          return 0;
   150064       } else {
   150065          return 0;
   150066       }
   150067    case 6: return 0;
   150068    case 5: return 0;
   150069    case 4:
   150070       if (devinfo->is_g4x) {
   150071          return 0;
   150072       } else {
   150073          return 0;
   150074       }
   150075    default:
   150076       unreachable("Invalid hardware generation");
   150077    }
   150078 }
   150079 
   150080 
   150081 
   150082 #define GEN10_MEDIA_VFE_STATE_ThreadDispatchSelectionPolicy_start  100
   150083 
   150084 static inline uint32_t ATTRIBUTE_PURE
   150085 MEDIA_VFE_STATE_ThreadDispatchSelectionPolicy_start(const struct gen_device_info *devinfo)
   150086 {
   150087    switch (devinfo->gen) {
   150088    case 10: return 100;
   150089    case 9: return 0;
   150090    case 8: return 0;
   150091    case 7:
   150092       if (devinfo->is_haswell) {
   150093          return 0;
   150094       } else {
   150095          return 0;
   150096       }
   150097    case 6: return 0;
   150098    case 5: return 0;
   150099    case 4:
   150100       if (devinfo->is_g4x) {
   150101          return 0;
   150102       } else {
   150103          return 0;
   150104       }
   150105    default:
   150106       unreachable("Invalid hardware generation");
   150107    }
   150108 }
   150109 
   150110 
   150111 
   150112 /* MEDIA_VFE_STATE::URB Entry Allocation Size */
   150113 
   150114 
   150115 #define GEN10_MEDIA_VFE_STATE_URBEntryAllocationSize_bits  16
   150116 #define GEN9_MEDIA_VFE_STATE_URBEntryAllocationSize_bits  16
   150117 #define GEN8_MEDIA_VFE_STATE_URBEntryAllocationSize_bits  16
   150118 #define GEN75_MEDIA_VFE_STATE_URBEntryAllocationSize_bits  16
   150119 #define GEN7_MEDIA_VFE_STATE_URBEntryAllocationSize_bits  16
   150120 #define GEN6_MEDIA_VFE_STATE_URBEntryAllocationSize_bits  16
   150121 
   150122 static inline uint32_t ATTRIBUTE_PURE
   150123 MEDIA_VFE_STATE_URBEntryAllocationSize_bits(const struct gen_device_info *devinfo)
   150124 {
   150125    switch (devinfo->gen) {
   150126    case 10: return 16;
   150127    case 9: return 16;
   150128    case 8: return 16;
   150129    case 7:
   150130       if (devinfo->is_haswell) {
   150131          return 16;
   150132       } else {
   150133          return 16;
   150134       }
   150135    case 6: return 16;
   150136    case 5: return 0;
   150137    case 4:
   150138       if (devinfo->is_g4x) {
   150139          return 0;
   150140       } else {
   150141          return 0;
   150142       }
   150143    default:
   150144       unreachable("Invalid hardware generation");
   150145    }
   150146 }
   150147 
   150148 
   150149 
   150150 #define GEN10_MEDIA_VFE_STATE_URBEntryAllocationSize_start  176
   150151 #define GEN9_MEDIA_VFE_STATE_URBEntryAllocationSize_start  176
   150152 #define GEN8_MEDIA_VFE_STATE_URBEntryAllocationSize_start  176
   150153 #define GEN75_MEDIA_VFE_STATE_URBEntryAllocationSize_start  144
   150154 #define GEN7_MEDIA_VFE_STATE_URBEntryAllocationSize_start  144
   150155 #define GEN6_MEDIA_VFE_STATE_URBEntryAllocationSize_start  144
   150156 
   150157 static inline uint32_t ATTRIBUTE_PURE
   150158 MEDIA_VFE_STATE_URBEntryAllocationSize_start(const struct gen_device_info *devinfo)
   150159 {
   150160    switch (devinfo->gen) {
   150161    case 10: return 176;
   150162    case 9: return 176;
   150163    case 8: return 176;
   150164    case 7:
   150165       if (devinfo->is_haswell) {
   150166          return 144;
   150167       } else {
   150168          return 144;
   150169       }
   150170    case 6: return 144;
   150171    case 5: return 0;
   150172    case 4:
   150173       if (devinfo->is_g4x) {
   150174          return 0;
   150175       } else {
   150176          return 0;
   150177       }
   150178    default:
   150179       unreachable("Invalid hardware generation");
   150180    }
   150181 }
   150182 
   150183 
   150184 
   150185 /* MEMORY_OBJECT_CONTROL_STATE */
   150186 
   150187 
   150188 #define GEN10_MEMORY_OBJECT_CONTROL_STATE_length  1
   150189 #define GEN9_MEMORY_OBJECT_CONTROL_STATE_length  1
   150190 #define GEN8_MEMORY_OBJECT_CONTROL_STATE_length  1
   150191 #define GEN75_MEMORY_OBJECT_CONTROL_STATE_length  1
   150192 #define GEN7_MEMORY_OBJECT_CONTROL_STATE_length  1
   150193 #define GEN6_MEMORY_OBJECT_CONTROL_STATE_length  1
   150194 #define GEN5_MEMORY_OBJECT_CONTROL_STATE_length  1
   150195 
   150196 static inline uint32_t ATTRIBUTE_PURE
   150197 MEMORY_OBJECT_CONTROL_STATE_length(const struct gen_device_info *devinfo)
   150198 {
   150199    switch (devinfo->gen) {
   150200    case 10: return 1;
   150201    case 9: return 1;
   150202    case 8: return 1;
   150203    case 7:
   150204       if (devinfo->is_haswell) {
   150205          return 1;
   150206       } else {
   150207          return 1;
   150208       }
   150209    case 6: return 1;
   150210    case 5: return 1;
   150211    case 4:
   150212       if (devinfo->is_g4x) {
   150213          return 0;
   150214       } else {
   150215          return 0;
   150216       }
   150217    default:
   150218       unreachable("Invalid hardware generation");
   150219    }
   150220 }
   150221 
   150222 
   150223 
   150224 /* MEMORY_OBJECT_CONTROL_STATE::Age for QUADLRU */
   150225 
   150226 
   150227 #define GEN8_MEMORY_OBJECT_CONTROL_STATE_AgeforQUADLRU_bits  2
   150228 
   150229 static inline uint32_t ATTRIBUTE_PURE
   150230 MEMORY_OBJECT_CONTROL_STATE_AgeforQUADLRU_bits(const struct gen_device_info *devinfo)
   150231 {
   150232    switch (devinfo->gen) {
   150233    case 10: return 0;
   150234    case 9: return 0;
   150235    case 8: return 2;
   150236    case 7:
   150237       if (devinfo->is_haswell) {
   150238          return 0;
   150239       } else {
   150240          return 0;
   150241       }
   150242    case 6: return 0;
   150243    case 5: return 0;
   150244    case 4:
   150245       if (devinfo->is_g4x) {
   150246          return 0;
   150247       } else {
   150248          return 0;
   150249       }
   150250    default:
   150251       unreachable("Invalid hardware generation");
   150252    }
   150253 }
   150254 
   150255 
   150256 
   150257 #define GEN8_MEMORY_OBJECT_CONTROL_STATE_AgeforQUADLRU_start  0
   150258 
   150259 static inline uint32_t ATTRIBUTE_PURE
   150260 MEMORY_OBJECT_CONTROL_STATE_AgeforQUADLRU_start(const struct gen_device_info *devinfo)
   150261 {
   150262    switch (devinfo->gen) {
   150263    case 10: return 0;
   150264    case 9: return 0;
   150265    case 8: return 0;
   150266    case 7:
   150267       if (devinfo->is_haswell) {
   150268          return 0;
   150269       } else {
   150270          return 0;
   150271       }
   150272    case 6: return 0;
   150273    case 5: return 0;
   150274    case 4:
   150275       if (devinfo->is_g4x) {
   150276          return 0;
   150277       } else {
   150278          return 0;
   150279       }
   150280    default:
   150281       unreachable("Invalid hardware generation");
   150282    }
   150283 }
   150284 
   150285 
   150286 
   150287 /* MEMORY_OBJECT_CONTROL_STATE::Cacheability Control */
   150288 
   150289 
   150290 #define GEN6_MEMORY_OBJECT_CONTROL_STATE_CacheabilityControl_bits  2
   150291 #define GEN5_MEMORY_OBJECT_CONTROL_STATE_CacheabilityControl_bits  2
   150292 
   150293 static inline uint32_t ATTRIBUTE_PURE
   150294 MEMORY_OBJECT_CONTROL_STATE_CacheabilityControl_bits(const struct gen_device_info *devinfo)
   150295 {
   150296    switch (devinfo->gen) {
   150297    case 10: return 0;
   150298    case 9: return 0;
   150299    case 8: return 0;
   150300    case 7:
   150301       if (devinfo->is_haswell) {
   150302          return 0;
   150303       } else {
   150304          return 0;
   150305       }
   150306    case 6: return 2;
   150307    case 5: return 2;
   150308    case 4:
   150309       if (devinfo->is_g4x) {
   150310          return 0;
   150311       } else {
   150312          return 0;
   150313       }
   150314    default:
   150315       unreachable("Invalid hardware generation");
   150316    }
   150317 }
   150318 
   150319 
   150320 
   150321 #define GEN6_MEMORY_OBJECT_CONTROL_STATE_CacheabilityControl_start  0
   150322 #define GEN5_MEMORY_OBJECT_CONTROL_STATE_CacheabilityControl_start  0
   150323 
   150324 static inline uint32_t ATTRIBUTE_PURE
   150325 MEMORY_OBJECT_CONTROL_STATE_CacheabilityControl_start(const struct gen_device_info *devinfo)
   150326 {
   150327    switch (devinfo->gen) {
   150328    case 10: return 0;
   150329    case 9: return 0;
   150330    case 8: return 0;
   150331    case 7:
   150332       if (devinfo->is_haswell) {
   150333          return 0;
   150334       } else {
   150335          return 0;
   150336       }
   150337    case 6: return 0;
   150338    case 5: return 0;
   150339    case 4:
   150340       if (devinfo->is_g4x) {
   150341          return 0;
   150342       } else {
   150343          return 0;
   150344       }
   150345    default:
   150346       unreachable("Invalid hardware generation");
   150347    }
   150348 }
   150349 
   150350 
   150351 
   150352 /* MEMORY_OBJECT_CONTROL_STATE::Encrypted Data */
   150353 
   150354 
   150355 #define GEN5_MEMORY_OBJECT_CONTROL_STATE_EncryptedData_bits  1
   150356 
   150357 static inline uint32_t ATTRIBUTE_PURE
   150358 MEMORY_OBJECT_CONTROL_STATE_EncryptedData_bits(const struct gen_device_info *devinfo)
   150359 {
   150360    switch (devinfo->gen) {
   150361    case 10: return 0;
   150362    case 9: return 0;
   150363    case 8: return 0;
   150364    case 7:
   150365       if (devinfo->is_haswell) {
   150366          return 0;
   150367       } else {
   150368          return 0;
   150369       }
   150370    case 6: return 0;
   150371    case 5: return 1;
   150372    case 4:
   150373       if (devinfo->is_g4x) {
   150374          return 0;
   150375       } else {
   150376          return 0;
   150377       }
   150378    default:
   150379       unreachable("Invalid hardware generation");
   150380    }
   150381 }
   150382 
   150383 
   150384 
   150385 #define GEN5_MEMORY_OBJECT_CONTROL_STATE_EncryptedData_start  3
   150386 
   150387 static inline uint32_t ATTRIBUTE_PURE
   150388 MEMORY_OBJECT_CONTROL_STATE_EncryptedData_start(const struct gen_device_info *devinfo)
   150389 {
   150390    switch (devinfo->gen) {
   150391    case 10: return 0;
   150392    case 9: return 0;
   150393    case 8: return 0;
   150394    case 7:
   150395       if (devinfo->is_haswell) {
   150396          return 0;
   150397       } else {
   150398          return 0;
   150399       }
   150400    case 6: return 0;
   150401    case 5: return 3;
   150402    case 4:
   150403       if (devinfo->is_g4x) {
   150404          return 0;
   150405       } else {
   150406          return 0;
   150407       }
   150408    default:
   150409       unreachable("Invalid hardware generation");
   150410    }
   150411 }
   150412 
   150413 
   150414 
   150415 /* MEMORY_OBJECT_CONTROL_STATE::Graphics Data Type (GFDT) */
   150416 
   150417 
   150418 #define GEN7_MEMORY_OBJECT_CONTROL_STATE_GraphicsDataTypeGFDT_bits  1
   150419 #define GEN6_MEMORY_OBJECT_CONTROL_STATE_GraphicsDataTypeGFDT_bits  1
   150420 #define GEN5_MEMORY_OBJECT_CONTROL_STATE_GraphicsDataTypeGFDT_bits  1
   150421 
   150422 static inline uint32_t ATTRIBUTE_PURE
   150423 MEMORY_OBJECT_CONTROL_STATE_GraphicsDataTypeGFDT_bits(const struct gen_device_info *devinfo)
   150424 {
   150425    switch (devinfo->gen) {
   150426    case 10: return 0;
   150427    case 9: return 0;
   150428    case 8: return 0;
   150429    case 7:
   150430       if (devinfo->is_haswell) {
   150431          return 0;
   150432       } else {
   150433          return 1;
   150434       }
   150435    case 6: return 1;
   150436    case 5: return 1;
   150437    case 4:
   150438       if (devinfo->is_g4x) {
   150439          return 0;
   150440       } else {
   150441          return 0;
   150442       }
   150443    default:
   150444       unreachable("Invalid hardware generation");
   150445    }
   150446 }
   150447 
   150448 
   150449 
   150450 #define GEN7_MEMORY_OBJECT_CONTROL_STATE_GraphicsDataTypeGFDT_start  2
   150451 #define GEN6_MEMORY_OBJECT_CONTROL_STATE_GraphicsDataTypeGFDT_start  2
   150452 #define GEN5_MEMORY_OBJECT_CONTROL_STATE_GraphicsDataTypeGFDT_start  2
   150453 
   150454 static inline uint32_t ATTRIBUTE_PURE
   150455 MEMORY_OBJECT_CONTROL_STATE_GraphicsDataTypeGFDT_start(const struct gen_device_info *devinfo)
   150456 {
   150457    switch (devinfo->gen) {
   150458    case 10: return 0;
   150459    case 9: return 0;
   150460    case 8: return 0;
   150461    case 7:
   150462       if (devinfo->is_haswell) {
   150463          return 0;
   150464       } else {
   150465          return 2;
   150466       }
   150467    case 6: return 2;
   150468    case 5: return 2;
   150469    case 4:
   150470       if (devinfo->is_g4x) {
   150471          return 0;
   150472       } else {
   150473          return 0;
   150474       }
   150475    default:
   150476       unreachable("Invalid hardware generation");
   150477    }
   150478 }
   150479 
   150480 
   150481 
   150482 /* MEMORY_OBJECT_CONTROL_STATE::Index to MOCS Tables */
   150483 
   150484 
   150485 #define GEN10_MEMORY_OBJECT_CONTROL_STATE_IndextoMOCSTables_bits  6
   150486 #define GEN9_MEMORY_OBJECT_CONTROL_STATE_IndextoMOCSTables_bits  6
   150487 
   150488 static inline uint32_t ATTRIBUTE_PURE
   150489 MEMORY_OBJECT_CONTROL_STATE_IndextoMOCSTables_bits(const struct gen_device_info *devinfo)
   150490 {
   150491    switch (devinfo->gen) {
   150492    case 10: return 6;
   150493    case 9: return 6;
   150494    case 8: return 0;
   150495    case 7:
   150496       if (devinfo->is_haswell) {
   150497          return 0;
   150498       } else {
   150499          return 0;
   150500       }
   150501    case 6: return 0;
   150502    case 5: return 0;
   150503    case 4:
   150504       if (devinfo->is_g4x) {
   150505          return 0;
   150506       } else {
   150507          return 0;
   150508       }
   150509    default:
   150510       unreachable("Invalid hardware generation");
   150511    }
   150512 }
   150513 
   150514 
   150515 
   150516 #define GEN10_MEMORY_OBJECT_CONTROL_STATE_IndextoMOCSTables_start  1
   150517 #define GEN9_MEMORY_OBJECT_CONTROL_STATE_IndextoMOCSTables_start  1
   150518 
   150519 static inline uint32_t ATTRIBUTE_PURE
   150520 MEMORY_OBJECT_CONTROL_STATE_IndextoMOCSTables_start(const struct gen_device_info *devinfo)
   150521 {
   150522    switch (devinfo->gen) {
   150523    case 10: return 1;
   150524    case 9: return 1;
   150525    case 8: return 0;
   150526    case 7:
   150527       if (devinfo->is_haswell) {
   150528          return 0;
   150529       } else {
   150530          return 0;
   150531       }
   150532    case 6: return 0;
   150533    case 5: return 0;
   150534    case 4:
   150535       if (devinfo->is_g4x) {
   150536          return 0;
   150537       } else {
   150538          return 0;
   150539       }
   150540    default:
   150541       unreachable("Invalid hardware generation");
   150542    }
   150543 }
   150544 
   150545 
   150546 
   150547 /* MEMORY_OBJECT_CONTROL_STATE::L3 Cacheability Control (L3CC) */
   150548 
   150549 
   150550 #define GEN75_MEMORY_OBJECT_CONTROL_STATE_L3CacheabilityControlL3CC_bits  1
   150551 #define GEN7_MEMORY_OBJECT_CONTROL_STATE_L3CacheabilityControlL3CC_bits  1
   150552 
   150553 static inline uint32_t ATTRIBUTE_PURE
   150554 MEMORY_OBJECT_CONTROL_STATE_L3CacheabilityControlL3CC_bits(const struct gen_device_info *devinfo)
   150555 {
   150556    switch (devinfo->gen) {
   150557    case 10: return 0;
   150558    case 9: return 0;
   150559    case 8: return 0;
   150560    case 7:
   150561       if (devinfo->is_haswell) {
   150562          return 1;
   150563       } else {
   150564          return 1;
   150565       }
   150566    case 6: return 0;
   150567    case 5: return 0;
   150568    case 4:
   150569       if (devinfo->is_g4x) {
   150570          return 0;
   150571       } else {
   150572          return 0;
   150573       }
   150574    default:
   150575       unreachable("Invalid hardware generation");
   150576    }
   150577 }
   150578 
   150579 
   150580 
   150581 #define GEN75_MEMORY_OBJECT_CONTROL_STATE_L3CacheabilityControlL3CC_start  0
   150582 #define GEN7_MEMORY_OBJECT_CONTROL_STATE_L3CacheabilityControlL3CC_start  0
   150583 
   150584 static inline uint32_t ATTRIBUTE_PURE
   150585 MEMORY_OBJECT_CONTROL_STATE_L3CacheabilityControlL3CC_start(const struct gen_device_info *devinfo)
   150586 {
   150587    switch (devinfo->gen) {
   150588    case 10: return 0;
   150589    case 9: return 0;
   150590    case 8: return 0;
   150591    case 7:
   150592       if (devinfo->is_haswell) {
   150593          return 0;
   150594       } else {
   150595          return 0;
   150596       }
   150597    case 6: return 0;
   150598    case 5: return 0;
   150599    case 4:
   150600       if (devinfo->is_g4x) {
   150601          return 0;
   150602       } else {
   150603          return 0;
   150604       }
   150605    default:
   150606       unreachable("Invalid hardware generation");
   150607    }
   150608 }
   150609 
   150610 
   150611 
   150612 /* MEMORY_OBJECT_CONTROL_STATE::LLC Cacheability Control (LLCCC) */
   150613 
   150614 
   150615 #define GEN7_MEMORY_OBJECT_CONTROL_STATE_LLCCacheabilityControlLLCCC_bits  1
   150616 
   150617 static inline uint32_t ATTRIBUTE_PURE
   150618 MEMORY_OBJECT_CONTROL_STATE_LLCCacheabilityControlLLCCC_bits(const struct gen_device_info *devinfo)
   150619 {
   150620    switch (devinfo->gen) {
   150621    case 10: return 0;
   150622    case 9: return 0;
   150623    case 8: return 0;
   150624    case 7:
   150625       if (devinfo->is_haswell) {
   150626          return 0;
   150627       } else {
   150628          return 1;
   150629       }
   150630    case 6: return 0;
   150631    case 5: return 0;
   150632    case 4:
   150633       if (devinfo->is_g4x) {
   150634          return 0;
   150635       } else {
   150636          return 0;
   150637       }
   150638    default:
   150639       unreachable("Invalid hardware generation");
   150640    }
   150641 }
   150642 
   150643 
   150644 
   150645 #define GEN7_MEMORY_OBJECT_CONTROL_STATE_LLCCacheabilityControlLLCCC_start  1
   150646 
   150647 static inline uint32_t ATTRIBUTE_PURE
   150648 MEMORY_OBJECT_CONTROL_STATE_LLCCacheabilityControlLLCCC_start(const struct gen_device_info *devinfo)
   150649 {
   150650    switch (devinfo->gen) {
   150651    case 10: return 0;
   150652    case 9: return 0;
   150653    case 8: return 0;
   150654    case 7:
   150655       if (devinfo->is_haswell) {
   150656          return 0;
   150657       } else {
   150658          return 1;
   150659       }
   150660    case 6: return 0;
   150661    case 5: return 0;
   150662    case 4:
   150663       if (devinfo->is_g4x) {
   150664          return 0;
   150665       } else {
   150666          return 0;
   150667       }
   150668    default:
   150669       unreachable("Invalid hardware generation");
   150670    }
   150671 }
   150672 
   150673 
   150674 
   150675 /* MEMORY_OBJECT_CONTROL_STATE::LLC/eLLC Cacheability Control (LLCCC) */
   150676 
   150677 
   150678 #define GEN75_MEMORY_OBJECT_CONTROL_STATE_LLCeLLCCacheabilityControlLLCCC_bits  2
   150679 
   150680 static inline uint32_t ATTRIBUTE_PURE
   150681 MEMORY_OBJECT_CONTROL_STATE_LLCeLLCCacheabilityControlLLCCC_bits(const struct gen_device_info *devinfo)
   150682 {
   150683    switch (devinfo->gen) {
   150684    case 10: return 0;
   150685    case 9: return 0;
   150686    case 8: return 0;
   150687    case 7:
   150688       if (devinfo->is_haswell) {
   150689          return 2;
   150690       } else {
   150691          return 0;
   150692       }
   150693    case 6: return 0;
   150694    case 5: return 0;
   150695    case 4:
   150696       if (devinfo->is_g4x) {
   150697          return 0;
   150698       } else {
   150699          return 0;
   150700       }
   150701    default:
   150702       unreachable("Invalid hardware generation");
   150703    }
   150704 }
   150705 
   150706 
   150707 
   150708 #define GEN75_MEMORY_OBJECT_CONTROL_STATE_LLCeLLCCacheabilityControlLLCCC_start  1
   150709 
   150710 static inline uint32_t ATTRIBUTE_PURE
   150711 MEMORY_OBJECT_CONTROL_STATE_LLCeLLCCacheabilityControlLLCCC_start(const struct gen_device_info *devinfo)
   150712 {
   150713    switch (devinfo->gen) {
   150714    case 10: return 0;
   150715    case 9: return 0;
   150716    case 8: return 0;
   150717    case 7:
   150718       if (devinfo->is_haswell) {
   150719          return 1;
   150720       } else {
   150721          return 0;
   150722       }
   150723    case 6: return 0;
   150724    case 5: return 0;
   150725    case 4:
   150726       if (devinfo->is_g4x) {
   150727          return 0;
   150728       } else {
   150729          return 0;
   150730       }
   150731    default:
   150732       unreachable("Invalid hardware generation");
   150733    }
   150734 }
   150735 
   150736 
   150737 
   150738 /* MEMORY_OBJECT_CONTROL_STATE::Memory Type:LLC/eLLC Cacheability Control */
   150739 
   150740 
   150741 #define GEN8_MEMORY_OBJECT_CONTROL_STATE_MemoryTypeLLCeLLCCacheabilityControl_bits  2
   150742 
   150743 static inline uint32_t ATTRIBUTE_PURE
   150744 MEMORY_OBJECT_CONTROL_STATE_MemoryTypeLLCeLLCCacheabilityControl_bits(const struct gen_device_info *devinfo)
   150745 {
   150746    switch (devinfo->gen) {
   150747    case 10: return 0;
   150748    case 9: return 0;
   150749    case 8: return 2;
   150750    case 7:
   150751       if (devinfo->is_haswell) {
   150752          return 0;
   150753       } else {
   150754          return 0;
   150755       }
   150756    case 6: return 0;
   150757    case 5: return 0;
   150758    case 4:
   150759       if (devinfo->is_g4x) {
   150760          return 0;
   150761       } else {
   150762          return 0;
   150763       }
   150764    default:
   150765       unreachable("Invalid hardware generation");
   150766    }
   150767 }
   150768 
   150769 
   150770 
   150771 #define GEN8_MEMORY_OBJECT_CONTROL_STATE_MemoryTypeLLCeLLCCacheabilityControl_start  5
   150772 
   150773 static inline uint32_t ATTRIBUTE_PURE
   150774 MEMORY_OBJECT_CONTROL_STATE_MemoryTypeLLCeLLCCacheabilityControl_start(const struct gen_device_info *devinfo)
   150775 {
   150776    switch (devinfo->gen) {
   150777    case 10: return 0;
   150778    case 9: return 0;
   150779    case 8: return 5;
   150780    case 7:
   150781       if (devinfo->is_haswell) {
   150782          return 0;
   150783       } else {
   150784          return 0;
   150785       }
   150786    case 6: return 0;
   150787    case 5: return 0;
   150788    case 4:
   150789       if (devinfo->is_g4x) {
   150790          return 0;
   150791       } else {
   150792          return 0;
   150793       }
   150794    default:
   150795       unreachable("Invalid hardware generation");
   150796    }
   150797 }
   150798 
   150799 
   150800 
   150801 /* MEMORY_OBJECT_CONTROL_STATE::Target Cache */
   150802 
   150803 
   150804 #define GEN8_MEMORY_OBJECT_CONTROL_STATE_TargetCache_bits  2
   150805 
   150806 static inline uint32_t ATTRIBUTE_PURE
   150807 MEMORY_OBJECT_CONTROL_STATE_TargetCache_bits(const struct gen_device_info *devinfo)
   150808 {
   150809    switch (devinfo->gen) {
   150810    case 10: return 0;
   150811    case 9: return 0;
   150812    case 8: return 2;
   150813    case 7:
   150814       if (devinfo->is_haswell) {
   150815          return 0;
   150816       } else {
   150817          return 0;
   150818       }
   150819    case 6: return 0;
   150820    case 5: return 0;
   150821    case 4:
   150822       if (devinfo->is_g4x) {
   150823          return 0;
   150824       } else {
   150825          return 0;
   150826       }
   150827    default:
   150828       unreachable("Invalid hardware generation");
   150829    }
   150830 }
   150831 
   150832 
   150833 
   150834 #define GEN8_MEMORY_OBJECT_CONTROL_STATE_TargetCache_start  3
   150835 
   150836 static inline uint32_t ATTRIBUTE_PURE
   150837 MEMORY_OBJECT_CONTROL_STATE_TargetCache_start(const struct gen_device_info *devinfo)
   150838 {
   150839    switch (devinfo->gen) {
   150840    case 10: return 0;
   150841    case 9: return 0;
   150842    case 8: return 3;
   150843    case 7:
   150844       if (devinfo->is_haswell) {
   150845          return 0;
   150846       } else {
   150847          return 0;
   150848       }
   150849    case 6: return 0;
   150850    case 5: return 0;
   150851    case 4:
   150852       if (devinfo->is_g4x) {
   150853          return 0;
   150854       } else {
   150855          return 0;
   150856       }
   150857    default:
   150858       unreachable("Invalid hardware generation");
   150859    }
   150860 }
   150861 
   150862 
   150863 
   150864 /* MI_ARB_CHECK */
   150865 
   150866 
   150867 #define GEN10_MI_ARB_CHECK_length  1
   150868 #define GEN9_MI_ARB_CHECK_length  1
   150869 #define GEN8_MI_ARB_CHECK_length  1
   150870 #define GEN75_MI_ARB_CHECK_length  1
   150871 #define GEN7_MI_ARB_CHECK_length  1
   150872 #define GEN6_MI_ARB_CHECK_length  1
   150873 
   150874 static inline uint32_t ATTRIBUTE_PURE
   150875 MI_ARB_CHECK_length(const struct gen_device_info *devinfo)
   150876 {
   150877    switch (devinfo->gen) {
   150878    case 10: return 1;
   150879    case 9: return 1;
   150880    case 8: return 1;
   150881    case 7:
   150882       if (devinfo->is_haswell) {
   150883          return 1;
   150884       } else {
   150885          return 1;
   150886       }
   150887    case 6: return 1;
   150888    case 5: return 0;
   150889    case 4:
   150890       if (devinfo->is_g4x) {
   150891          return 0;
   150892       } else {
   150893          return 0;
   150894       }
   150895    default:
   150896       unreachable("Invalid hardware generation");
   150897    }
   150898 }
   150899 
   150900 
   150901 
   150902 /* MI_ARB_CHECK::Command Type */
   150903 
   150904 
   150905 #define GEN10_MI_ARB_CHECK_CommandType_bits  3
   150906 #define GEN9_MI_ARB_CHECK_CommandType_bits  3
   150907 #define GEN8_MI_ARB_CHECK_CommandType_bits  3
   150908 #define GEN75_MI_ARB_CHECK_CommandType_bits  3
   150909 #define GEN7_MI_ARB_CHECK_CommandType_bits  3
   150910 #define GEN6_MI_ARB_CHECK_CommandType_bits  3
   150911 
   150912 static inline uint32_t ATTRIBUTE_PURE
   150913 MI_ARB_CHECK_CommandType_bits(const struct gen_device_info *devinfo)
   150914 {
   150915    switch (devinfo->gen) {
   150916    case 10: return 3;
   150917    case 9: return 3;
   150918    case 8: return 3;
   150919    case 7:
   150920       if (devinfo->is_haswell) {
   150921          return 3;
   150922       } else {
   150923          return 3;
   150924       }
   150925    case 6: return 3;
   150926    case 5: return 0;
   150927    case 4:
   150928       if (devinfo->is_g4x) {
   150929          return 0;
   150930       } else {
   150931          return 0;
   150932       }
   150933    default:
   150934       unreachable("Invalid hardware generation");
   150935    }
   150936 }
   150937 
   150938 
   150939 
   150940 #define GEN10_MI_ARB_CHECK_CommandType_start  29
   150941 #define GEN9_MI_ARB_CHECK_CommandType_start  29
   150942 #define GEN8_MI_ARB_CHECK_CommandType_start  29
   150943 #define GEN75_MI_ARB_CHECK_CommandType_start  29
   150944 #define GEN7_MI_ARB_CHECK_CommandType_start  29
   150945 #define GEN6_MI_ARB_CHECK_CommandType_start  29
   150946 
   150947 static inline uint32_t ATTRIBUTE_PURE
   150948 MI_ARB_CHECK_CommandType_start(const struct gen_device_info *devinfo)
   150949 {
   150950    switch (devinfo->gen) {
   150951    case 10: return 29;
   150952    case 9: return 29;
   150953    case 8: return 29;
   150954    case 7:
   150955       if (devinfo->is_haswell) {
   150956          return 29;
   150957       } else {
   150958          return 29;
   150959       }
   150960    case 6: return 29;
   150961    case 5: return 0;
   150962    case 4:
   150963       if (devinfo->is_g4x) {
   150964          return 0;
   150965       } else {
   150966          return 0;
   150967       }
   150968    default:
   150969       unreachable("Invalid hardware generation");
   150970    }
   150971 }
   150972 
   150973 
   150974 
   150975 /* MI_ARB_CHECK::MI Command Opcode */
   150976 
   150977 
   150978 #define GEN10_MI_ARB_CHECK_MICommandOpcode_bits  6
   150979 #define GEN9_MI_ARB_CHECK_MICommandOpcode_bits  6
   150980 #define GEN8_MI_ARB_CHECK_MICommandOpcode_bits  6
   150981 #define GEN75_MI_ARB_CHECK_MICommandOpcode_bits  6
   150982 #define GEN7_MI_ARB_CHECK_MICommandOpcode_bits  6
   150983 #define GEN6_MI_ARB_CHECK_MICommandOpcode_bits  6
   150984 
   150985 static inline uint32_t ATTRIBUTE_PURE
   150986 MI_ARB_CHECK_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   150987 {
   150988    switch (devinfo->gen) {
   150989    case 10: return 6;
   150990    case 9: return 6;
   150991    case 8: return 6;
   150992    case 7:
   150993       if (devinfo->is_haswell) {
   150994          return 6;
   150995       } else {
   150996          return 6;
   150997       }
   150998    case 6: return 6;
   150999    case 5: return 0;
   151000    case 4:
   151001       if (devinfo->is_g4x) {
   151002          return 0;
   151003       } else {
   151004          return 0;
   151005       }
   151006    default:
   151007       unreachable("Invalid hardware generation");
   151008    }
   151009 }
   151010 
   151011 
   151012 
   151013 #define GEN10_MI_ARB_CHECK_MICommandOpcode_start  23
   151014 #define GEN9_MI_ARB_CHECK_MICommandOpcode_start  23
   151015 #define GEN8_MI_ARB_CHECK_MICommandOpcode_start  23
   151016 #define GEN75_MI_ARB_CHECK_MICommandOpcode_start  23
   151017 #define GEN7_MI_ARB_CHECK_MICommandOpcode_start  23
   151018 #define GEN6_MI_ARB_CHECK_MICommandOpcode_start  23
   151019 
   151020 static inline uint32_t ATTRIBUTE_PURE
   151021 MI_ARB_CHECK_MICommandOpcode_start(const struct gen_device_info *devinfo)
   151022 {
   151023    switch (devinfo->gen) {
   151024    case 10: return 23;
   151025    case 9: return 23;
   151026    case 8: return 23;
   151027    case 7:
   151028       if (devinfo->is_haswell) {
   151029          return 23;
   151030       } else {
   151031          return 23;
   151032       }
   151033    case 6: return 23;
   151034    case 5: return 0;
   151035    case 4:
   151036       if (devinfo->is_g4x) {
   151037          return 0;
   151038       } else {
   151039          return 0;
   151040       }
   151041    default:
   151042       unreachable("Invalid hardware generation");
   151043    }
   151044 }
   151045 
   151046 
   151047 
   151048 /* MI_ARB_ON_OFF */
   151049 
   151050 
   151051 #define GEN75_MI_ARB_ON_OFF_length  1
   151052 #define GEN7_MI_ARB_ON_OFF_length  1
   151053 #define GEN6_MI_ARB_ON_OFF_length  1
   151054 
   151055 static inline uint32_t ATTRIBUTE_PURE
   151056 MI_ARB_ON_OFF_length(const struct gen_device_info *devinfo)
   151057 {
   151058    switch (devinfo->gen) {
   151059    case 10: return 0;
   151060    case 9: return 0;
   151061    case 8: return 0;
   151062    case 7:
   151063       if (devinfo->is_haswell) {
   151064          return 1;
   151065       } else {
   151066          return 1;
   151067       }
   151068    case 6: return 1;
   151069    case 5: return 0;
   151070    case 4:
   151071       if (devinfo->is_g4x) {
   151072          return 0;
   151073       } else {
   151074          return 0;
   151075       }
   151076    default:
   151077       unreachable("Invalid hardware generation");
   151078    }
   151079 }
   151080 
   151081 
   151082 
   151083 /* MI_ARB_ON_OFF::Arbitration Enable */
   151084 
   151085 
   151086 #define GEN75_MI_ARB_ON_OFF_ArbitrationEnable_bits  1
   151087 #define GEN7_MI_ARB_ON_OFF_ArbitrationEnable_bits  1
   151088 #define GEN6_MI_ARB_ON_OFF_ArbitrationEnable_bits  1
   151089 
   151090 static inline uint32_t ATTRIBUTE_PURE
   151091 MI_ARB_ON_OFF_ArbitrationEnable_bits(const struct gen_device_info *devinfo)
   151092 {
   151093    switch (devinfo->gen) {
   151094    case 10: return 0;
   151095    case 9: return 0;
   151096    case 8: return 0;
   151097    case 7:
   151098       if (devinfo->is_haswell) {
   151099          return 1;
   151100       } else {
   151101          return 1;
   151102       }
   151103    case 6: return 1;
   151104    case 5: return 0;
   151105    case 4:
   151106       if (devinfo->is_g4x) {
   151107          return 0;
   151108       } else {
   151109          return 0;
   151110       }
   151111    default:
   151112       unreachable("Invalid hardware generation");
   151113    }
   151114 }
   151115 
   151116 
   151117 
   151118 #define GEN75_MI_ARB_ON_OFF_ArbitrationEnable_start  0
   151119 #define GEN7_MI_ARB_ON_OFF_ArbitrationEnable_start  0
   151120 #define GEN6_MI_ARB_ON_OFF_ArbitrationEnable_start  0
   151121 
   151122 static inline uint32_t ATTRIBUTE_PURE
   151123 MI_ARB_ON_OFF_ArbitrationEnable_start(const struct gen_device_info *devinfo)
   151124 {
   151125    switch (devinfo->gen) {
   151126    case 10: return 0;
   151127    case 9: return 0;
   151128    case 8: return 0;
   151129    case 7:
   151130       if (devinfo->is_haswell) {
   151131          return 0;
   151132       } else {
   151133          return 0;
   151134       }
   151135    case 6: return 0;
   151136    case 5: return 0;
   151137    case 4:
   151138       if (devinfo->is_g4x) {
   151139          return 0;
   151140       } else {
   151141          return 0;
   151142       }
   151143    default:
   151144       unreachable("Invalid hardware generation");
   151145    }
   151146 }
   151147 
   151148 
   151149 
   151150 /* MI_ARB_ON_OFF::Command Type */
   151151 
   151152 
   151153 #define GEN75_MI_ARB_ON_OFF_CommandType_bits  3
   151154 #define GEN7_MI_ARB_ON_OFF_CommandType_bits  3
   151155 #define GEN6_MI_ARB_ON_OFF_CommandType_bits  3
   151156 
   151157 static inline uint32_t ATTRIBUTE_PURE
   151158 MI_ARB_ON_OFF_CommandType_bits(const struct gen_device_info *devinfo)
   151159 {
   151160    switch (devinfo->gen) {
   151161    case 10: return 0;
   151162    case 9: return 0;
   151163    case 8: return 0;
   151164    case 7:
   151165       if (devinfo->is_haswell) {
   151166          return 3;
   151167       } else {
   151168          return 3;
   151169       }
   151170    case 6: return 3;
   151171    case 5: return 0;
   151172    case 4:
   151173       if (devinfo->is_g4x) {
   151174          return 0;
   151175       } else {
   151176          return 0;
   151177       }
   151178    default:
   151179       unreachable("Invalid hardware generation");
   151180    }
   151181 }
   151182 
   151183 
   151184 
   151185 #define GEN75_MI_ARB_ON_OFF_CommandType_start  29
   151186 #define GEN7_MI_ARB_ON_OFF_CommandType_start  29
   151187 #define GEN6_MI_ARB_ON_OFF_CommandType_start  29
   151188 
   151189 static inline uint32_t ATTRIBUTE_PURE
   151190 MI_ARB_ON_OFF_CommandType_start(const struct gen_device_info *devinfo)
   151191 {
   151192    switch (devinfo->gen) {
   151193    case 10: return 0;
   151194    case 9: return 0;
   151195    case 8: return 0;
   151196    case 7:
   151197       if (devinfo->is_haswell) {
   151198          return 29;
   151199       } else {
   151200          return 29;
   151201       }
   151202    case 6: return 29;
   151203    case 5: return 0;
   151204    case 4:
   151205       if (devinfo->is_g4x) {
   151206          return 0;
   151207       } else {
   151208          return 0;
   151209       }
   151210    default:
   151211       unreachable("Invalid hardware generation");
   151212    }
   151213 }
   151214 
   151215 
   151216 
   151217 /* MI_ARB_ON_OFF::MI Command Opcode */
   151218 
   151219 
   151220 #define GEN75_MI_ARB_ON_OFF_MICommandOpcode_bits  6
   151221 #define GEN7_MI_ARB_ON_OFF_MICommandOpcode_bits  6
   151222 #define GEN6_MI_ARB_ON_OFF_MICommandOpcode_bits  6
   151223 
   151224 static inline uint32_t ATTRIBUTE_PURE
   151225 MI_ARB_ON_OFF_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   151226 {
   151227    switch (devinfo->gen) {
   151228    case 10: return 0;
   151229    case 9: return 0;
   151230    case 8: return 0;
   151231    case 7:
   151232       if (devinfo->is_haswell) {
   151233          return 6;
   151234       } else {
   151235          return 6;
   151236       }
   151237    case 6: return 6;
   151238    case 5: return 0;
   151239    case 4:
   151240       if (devinfo->is_g4x) {
   151241          return 0;
   151242       } else {
   151243          return 0;
   151244       }
   151245    default:
   151246       unreachable("Invalid hardware generation");
   151247    }
   151248 }
   151249 
   151250 
   151251 
   151252 #define GEN75_MI_ARB_ON_OFF_MICommandOpcode_start  23
   151253 #define GEN7_MI_ARB_ON_OFF_MICommandOpcode_start  23
   151254 #define GEN6_MI_ARB_ON_OFF_MICommandOpcode_start  23
   151255 
   151256 static inline uint32_t ATTRIBUTE_PURE
   151257 MI_ARB_ON_OFF_MICommandOpcode_start(const struct gen_device_info *devinfo)
   151258 {
   151259    switch (devinfo->gen) {
   151260    case 10: return 0;
   151261    case 9: return 0;
   151262    case 8: return 0;
   151263    case 7:
   151264       if (devinfo->is_haswell) {
   151265          return 23;
   151266       } else {
   151267          return 23;
   151268       }
   151269    case 6: return 23;
   151270    case 5: return 0;
   151271    case 4:
   151272       if (devinfo->is_g4x) {
   151273          return 0;
   151274       } else {
   151275          return 0;
   151276       }
   151277    default:
   151278       unreachable("Invalid hardware generation");
   151279    }
   151280 }
   151281 
   151282 
   151283 
   151284 /* MI_ATOMIC */
   151285 
   151286 
   151287 #define GEN10_MI_ATOMIC_length  3
   151288 #define GEN9_MI_ATOMIC_length  3
   151289 #define GEN8_MI_ATOMIC_length  3
   151290 
   151291 static inline uint32_t ATTRIBUTE_PURE
   151292 MI_ATOMIC_length(const struct gen_device_info *devinfo)
   151293 {
   151294    switch (devinfo->gen) {
   151295    case 10: return 3;
   151296    case 9: return 3;
   151297    case 8: return 3;
   151298    case 7:
   151299       if (devinfo->is_haswell) {
   151300          return 0;
   151301       } else {
   151302          return 0;
   151303       }
   151304    case 6: return 0;
   151305    case 5: return 0;
   151306    case 4:
   151307       if (devinfo->is_g4x) {
   151308          return 0;
   151309       } else {
   151310          return 0;
   151311       }
   151312    default:
   151313       unreachable("Invalid hardware generation");
   151314    }
   151315 }
   151316 
   151317 
   151318 
   151319 /* MI_ATOMIC::ATOMIC OPCODE */
   151320 
   151321 
   151322 #define GEN10_MI_ATOMIC_ATOMICOPCODE_bits  8
   151323 #define GEN9_MI_ATOMIC_ATOMICOPCODE_bits  8
   151324 #define GEN8_MI_ATOMIC_ATOMICOPCODE_bits  8
   151325 
   151326 static inline uint32_t ATTRIBUTE_PURE
   151327 MI_ATOMIC_ATOMICOPCODE_bits(const struct gen_device_info *devinfo)
   151328 {
   151329    switch (devinfo->gen) {
   151330    case 10: return 8;
   151331    case 9: return 8;
   151332    case 8: return 8;
   151333    case 7:
   151334       if (devinfo->is_haswell) {
   151335          return 0;
   151336       } else {
   151337          return 0;
   151338       }
   151339    case 6: return 0;
   151340    case 5: return 0;
   151341    case 4:
   151342       if (devinfo->is_g4x) {
   151343          return 0;
   151344       } else {
   151345          return 0;
   151346       }
   151347    default:
   151348       unreachable("Invalid hardware generation");
   151349    }
   151350 }
   151351 
   151352 
   151353 
   151354 #define GEN10_MI_ATOMIC_ATOMICOPCODE_start  8
   151355 #define GEN9_MI_ATOMIC_ATOMICOPCODE_start  8
   151356 #define GEN8_MI_ATOMIC_ATOMICOPCODE_start  8
   151357 
   151358 static inline uint32_t ATTRIBUTE_PURE
   151359 MI_ATOMIC_ATOMICOPCODE_start(const struct gen_device_info *devinfo)
   151360 {
   151361    switch (devinfo->gen) {
   151362    case 10: return 8;
   151363    case 9: return 8;
   151364    case 8: return 8;
   151365    case 7:
   151366       if (devinfo->is_haswell) {
   151367          return 0;
   151368       } else {
   151369          return 0;
   151370       }
   151371    case 6: return 0;
   151372    case 5: return 0;
   151373    case 4:
   151374       if (devinfo->is_g4x) {
   151375          return 0;
   151376       } else {
   151377          return 0;
   151378       }
   151379    default:
   151380       unreachable("Invalid hardware generation");
   151381    }
   151382 }
   151383 
   151384 
   151385 
   151386 /* MI_ATOMIC::CS STALL */
   151387 
   151388 
   151389 #define GEN10_MI_ATOMIC_CSSTALL_bits  1
   151390 #define GEN9_MI_ATOMIC_CSSTALL_bits  1
   151391 #define GEN8_MI_ATOMIC_CSSTALL_bits  1
   151392 
   151393 static inline uint32_t ATTRIBUTE_PURE
   151394 MI_ATOMIC_CSSTALL_bits(const struct gen_device_info *devinfo)
   151395 {
   151396    switch (devinfo->gen) {
   151397    case 10: return 1;
   151398    case 9: return 1;
   151399    case 8: return 1;
   151400    case 7:
   151401       if (devinfo->is_haswell) {
   151402          return 0;
   151403       } else {
   151404          return 0;
   151405       }
   151406    case 6: return 0;
   151407    case 5: return 0;
   151408    case 4:
   151409       if (devinfo->is_g4x) {
   151410          return 0;
   151411       } else {
   151412          return 0;
   151413       }
   151414    default:
   151415       unreachable("Invalid hardware generation");
   151416    }
   151417 }
   151418 
   151419 
   151420 
   151421 #define GEN10_MI_ATOMIC_CSSTALL_start  17
   151422 #define GEN9_MI_ATOMIC_CSSTALL_start  17
   151423 #define GEN8_MI_ATOMIC_CSSTALL_start  17
   151424 
   151425 static inline uint32_t ATTRIBUTE_PURE
   151426 MI_ATOMIC_CSSTALL_start(const struct gen_device_info *devinfo)
   151427 {
   151428    switch (devinfo->gen) {
   151429    case 10: return 17;
   151430    case 9: return 17;
   151431    case 8: return 17;
   151432    case 7:
   151433       if (devinfo->is_haswell) {
   151434          return 0;
   151435       } else {
   151436          return 0;
   151437       }
   151438    case 6: return 0;
   151439    case 5: return 0;
   151440    case 4:
   151441       if (devinfo->is_g4x) {
   151442          return 0;
   151443       } else {
   151444          return 0;
   151445       }
   151446    default:
   151447       unreachable("Invalid hardware generation");
   151448    }
   151449 }
   151450 
   151451 
   151452 
   151453 /* MI_ATOMIC::Command Type */
   151454 
   151455 
   151456 #define GEN10_MI_ATOMIC_CommandType_bits  3
   151457 #define GEN9_MI_ATOMIC_CommandType_bits  3
   151458 #define GEN8_MI_ATOMIC_CommandType_bits  3
   151459 
   151460 static inline uint32_t ATTRIBUTE_PURE
   151461 MI_ATOMIC_CommandType_bits(const struct gen_device_info *devinfo)
   151462 {
   151463    switch (devinfo->gen) {
   151464    case 10: return 3;
   151465    case 9: return 3;
   151466    case 8: return 3;
   151467    case 7:
   151468       if (devinfo->is_haswell) {
   151469          return 0;
   151470       } else {
   151471          return 0;
   151472       }
   151473    case 6: return 0;
   151474    case 5: return 0;
   151475    case 4:
   151476       if (devinfo->is_g4x) {
   151477          return 0;
   151478       } else {
   151479          return 0;
   151480       }
   151481    default:
   151482       unreachable("Invalid hardware generation");
   151483    }
   151484 }
   151485 
   151486 
   151487 
   151488 #define GEN10_MI_ATOMIC_CommandType_start  29
   151489 #define GEN9_MI_ATOMIC_CommandType_start  29
   151490 #define GEN8_MI_ATOMIC_CommandType_start  29
   151491 
   151492 static inline uint32_t ATTRIBUTE_PURE
   151493 MI_ATOMIC_CommandType_start(const struct gen_device_info *devinfo)
   151494 {
   151495    switch (devinfo->gen) {
   151496    case 10: return 29;
   151497    case 9: return 29;
   151498    case 8: return 29;
   151499    case 7:
   151500       if (devinfo->is_haswell) {
   151501          return 0;
   151502       } else {
   151503          return 0;
   151504       }
   151505    case 6: return 0;
   151506    case 5: return 0;
   151507    case 4:
   151508       if (devinfo->is_g4x) {
   151509          return 0;
   151510       } else {
   151511          return 0;
   151512       }
   151513    default:
   151514       unreachable("Invalid hardware generation");
   151515    }
   151516 }
   151517 
   151518 
   151519 
   151520 /* MI_ATOMIC::DWord Length */
   151521 
   151522 
   151523 #define GEN10_MI_ATOMIC_DWordLength_bits  8
   151524 #define GEN9_MI_ATOMIC_DWordLength_bits  8
   151525 #define GEN8_MI_ATOMIC_DWordLength_bits  8
   151526 
   151527 static inline uint32_t ATTRIBUTE_PURE
   151528 MI_ATOMIC_DWordLength_bits(const struct gen_device_info *devinfo)
   151529 {
   151530    switch (devinfo->gen) {
   151531    case 10: return 8;
   151532    case 9: return 8;
   151533    case 8: return 8;
   151534    case 7:
   151535       if (devinfo->is_haswell) {
   151536          return 0;
   151537       } else {
   151538          return 0;
   151539       }
   151540    case 6: return 0;
   151541    case 5: return 0;
   151542    case 4:
   151543       if (devinfo->is_g4x) {
   151544          return 0;
   151545       } else {
   151546          return 0;
   151547       }
   151548    default:
   151549       unreachable("Invalid hardware generation");
   151550    }
   151551 }
   151552 
   151553 
   151554 
   151555 #define GEN10_MI_ATOMIC_DWordLength_start  0
   151556 #define GEN9_MI_ATOMIC_DWordLength_start  0
   151557 #define GEN8_MI_ATOMIC_DWordLength_start  0
   151558 
   151559 static inline uint32_t ATTRIBUTE_PURE
   151560 MI_ATOMIC_DWordLength_start(const struct gen_device_info *devinfo)
   151561 {
   151562    switch (devinfo->gen) {
   151563    case 10: return 0;
   151564    case 9: return 0;
   151565    case 8: return 0;
   151566    case 7:
   151567       if (devinfo->is_haswell) {
   151568          return 0;
   151569       } else {
   151570          return 0;
   151571       }
   151572    case 6: return 0;
   151573    case 5: return 0;
   151574    case 4:
   151575       if (devinfo->is_g4x) {
   151576          return 0;
   151577       } else {
   151578          return 0;
   151579       }
   151580    default:
   151581       unreachable("Invalid hardware generation");
   151582    }
   151583 }
   151584 
   151585 
   151586 
   151587 /* MI_ATOMIC::Data Size */
   151588 
   151589 
   151590 #define GEN10_MI_ATOMIC_DataSize_bits  2
   151591 #define GEN9_MI_ATOMIC_DataSize_bits  2
   151592 #define GEN8_MI_ATOMIC_DataSize_bits  2
   151593 
   151594 static inline uint32_t ATTRIBUTE_PURE
   151595 MI_ATOMIC_DataSize_bits(const struct gen_device_info *devinfo)
   151596 {
   151597    switch (devinfo->gen) {
   151598    case 10: return 2;
   151599    case 9: return 2;
   151600    case 8: return 2;
   151601    case 7:
   151602       if (devinfo->is_haswell) {
   151603          return 0;
   151604       } else {
   151605          return 0;
   151606       }
   151607    case 6: return 0;
   151608    case 5: return 0;
   151609    case 4:
   151610       if (devinfo->is_g4x) {
   151611          return 0;
   151612       } else {
   151613          return 0;
   151614       }
   151615    default:
   151616       unreachable("Invalid hardware generation");
   151617    }
   151618 }
   151619 
   151620 
   151621 
   151622 #define GEN10_MI_ATOMIC_DataSize_start  19
   151623 #define GEN9_MI_ATOMIC_DataSize_start  19
   151624 #define GEN8_MI_ATOMIC_DataSize_start  19
   151625 
   151626 static inline uint32_t ATTRIBUTE_PURE
   151627 MI_ATOMIC_DataSize_start(const struct gen_device_info *devinfo)
   151628 {
   151629    switch (devinfo->gen) {
   151630    case 10: return 19;
   151631    case 9: return 19;
   151632    case 8: return 19;
   151633    case 7:
   151634       if (devinfo->is_haswell) {
   151635          return 0;
   151636       } else {
   151637          return 0;
   151638       }
   151639    case 6: return 0;
   151640    case 5: return 0;
   151641    case 4:
   151642       if (devinfo->is_g4x) {
   151643          return 0;
   151644       } else {
   151645          return 0;
   151646       }
   151647    default:
   151648       unreachable("Invalid hardware generation");
   151649    }
   151650 }
   151651 
   151652 
   151653 
   151654 /* MI_ATOMIC::Inline Data */
   151655 
   151656 
   151657 #define GEN10_MI_ATOMIC_InlineData_bits  1
   151658 #define GEN9_MI_ATOMIC_InlineData_bits  1
   151659 #define GEN8_MI_ATOMIC_InlineData_bits  1
   151660 
   151661 static inline uint32_t ATTRIBUTE_PURE
   151662 MI_ATOMIC_InlineData_bits(const struct gen_device_info *devinfo)
   151663 {
   151664    switch (devinfo->gen) {
   151665    case 10: return 1;
   151666    case 9: return 1;
   151667    case 8: return 1;
   151668    case 7:
   151669       if (devinfo->is_haswell) {
   151670          return 0;
   151671       } else {
   151672          return 0;
   151673       }
   151674    case 6: return 0;
   151675    case 5: return 0;
   151676    case 4:
   151677       if (devinfo->is_g4x) {
   151678          return 0;
   151679       } else {
   151680          return 0;
   151681       }
   151682    default:
   151683       unreachable("Invalid hardware generation");
   151684    }
   151685 }
   151686 
   151687 
   151688 
   151689 #define GEN10_MI_ATOMIC_InlineData_start  18
   151690 #define GEN9_MI_ATOMIC_InlineData_start  18
   151691 #define GEN8_MI_ATOMIC_InlineData_start  18
   151692 
   151693 static inline uint32_t ATTRIBUTE_PURE
   151694 MI_ATOMIC_InlineData_start(const struct gen_device_info *devinfo)
   151695 {
   151696    switch (devinfo->gen) {
   151697    case 10: return 18;
   151698    case 9: return 18;
   151699    case 8: return 18;
   151700    case 7:
   151701       if (devinfo->is_haswell) {
   151702          return 0;
   151703       } else {
   151704          return 0;
   151705       }
   151706    case 6: return 0;
   151707    case 5: return 0;
   151708    case 4:
   151709       if (devinfo->is_g4x) {
   151710          return 0;
   151711       } else {
   151712          return 0;
   151713       }
   151714    default:
   151715       unreachable("Invalid hardware generation");
   151716    }
   151717 }
   151718 
   151719 
   151720 
   151721 /* MI_ATOMIC::MI Command Opcode */
   151722 
   151723 
   151724 #define GEN10_MI_ATOMIC_MICommandOpcode_bits  6
   151725 #define GEN9_MI_ATOMIC_MICommandOpcode_bits  6
   151726 #define GEN8_MI_ATOMIC_MICommandOpcode_bits  6
   151727 
   151728 static inline uint32_t ATTRIBUTE_PURE
   151729 MI_ATOMIC_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   151730 {
   151731    switch (devinfo->gen) {
   151732    case 10: return 6;
   151733    case 9: return 6;
   151734    case 8: return 6;
   151735    case 7:
   151736       if (devinfo->is_haswell) {
   151737          return 0;
   151738       } else {
   151739          return 0;
   151740       }
   151741    case 6: return 0;
   151742    case 5: return 0;
   151743    case 4:
   151744       if (devinfo->is_g4x) {
   151745          return 0;
   151746       } else {
   151747          return 0;
   151748       }
   151749    default:
   151750       unreachable("Invalid hardware generation");
   151751    }
   151752 }
   151753 
   151754 
   151755 
   151756 #define GEN10_MI_ATOMIC_MICommandOpcode_start  23
   151757 #define GEN9_MI_ATOMIC_MICommandOpcode_start  23
   151758 #define GEN8_MI_ATOMIC_MICommandOpcode_start  23
   151759 
   151760 static inline uint32_t ATTRIBUTE_PURE
   151761 MI_ATOMIC_MICommandOpcode_start(const struct gen_device_info *devinfo)
   151762 {
   151763    switch (devinfo->gen) {
   151764    case 10: return 23;
   151765    case 9: return 23;
   151766    case 8: return 23;
   151767    case 7:
   151768       if (devinfo->is_haswell) {
   151769          return 0;
   151770       } else {
   151771          return 0;
   151772       }
   151773    case 6: return 0;
   151774    case 5: return 0;
   151775    case 4:
   151776       if (devinfo->is_g4x) {
   151777          return 0;
   151778       } else {
   151779          return 0;
   151780       }
   151781    default:
   151782       unreachable("Invalid hardware generation");
   151783    }
   151784 }
   151785 
   151786 
   151787 
   151788 /* MI_ATOMIC::Memory Address */
   151789 
   151790 
   151791 #define GEN10_MI_ATOMIC_MemoryAddress_bits  46
   151792 #define GEN9_MI_ATOMIC_MemoryAddress_bits  46
   151793 #define GEN8_MI_ATOMIC_MemoryAddress_bits  46
   151794 
   151795 static inline uint32_t ATTRIBUTE_PURE
   151796 MI_ATOMIC_MemoryAddress_bits(const struct gen_device_info *devinfo)
   151797 {
   151798    switch (devinfo->gen) {
   151799    case 10: return 46;
   151800    case 9: return 46;
   151801    case 8: return 46;
   151802    case 7:
   151803       if (devinfo->is_haswell) {
   151804          return 0;
   151805       } else {
   151806          return 0;
   151807       }
   151808    case 6: return 0;
   151809    case 5: return 0;
   151810    case 4:
   151811       if (devinfo->is_g4x) {
   151812          return 0;
   151813       } else {
   151814          return 0;
   151815       }
   151816    default:
   151817       unreachable("Invalid hardware generation");
   151818    }
   151819 }
   151820 
   151821 
   151822 
   151823 #define GEN10_MI_ATOMIC_MemoryAddress_start  34
   151824 #define GEN9_MI_ATOMIC_MemoryAddress_start  34
   151825 #define GEN8_MI_ATOMIC_MemoryAddress_start  34
   151826 
   151827 static inline uint32_t ATTRIBUTE_PURE
   151828 MI_ATOMIC_MemoryAddress_start(const struct gen_device_info *devinfo)
   151829 {
   151830    switch (devinfo->gen) {
   151831    case 10: return 34;
   151832    case 9: return 34;
   151833    case 8: return 34;
   151834    case 7:
   151835       if (devinfo->is_haswell) {
   151836          return 0;
   151837       } else {
   151838          return 0;
   151839       }
   151840    case 6: return 0;
   151841    case 5: return 0;
   151842    case 4:
   151843       if (devinfo->is_g4x) {
   151844          return 0;
   151845       } else {
   151846          return 0;
   151847       }
   151848    default:
   151849       unreachable("Invalid hardware generation");
   151850    }
   151851 }
   151852 
   151853 
   151854 
   151855 /* MI_ATOMIC::Memory Type */
   151856 
   151857 
   151858 #define GEN10_MI_ATOMIC_MemoryType_bits  1
   151859 #define GEN9_MI_ATOMIC_MemoryType_bits  1
   151860 #define GEN8_MI_ATOMIC_MemoryType_bits  1
   151861 
   151862 static inline uint32_t ATTRIBUTE_PURE
   151863 MI_ATOMIC_MemoryType_bits(const struct gen_device_info *devinfo)
   151864 {
   151865    switch (devinfo->gen) {
   151866    case 10: return 1;
   151867    case 9: return 1;
   151868    case 8: return 1;
   151869    case 7:
   151870       if (devinfo->is_haswell) {
   151871          return 0;
   151872       } else {
   151873          return 0;
   151874       }
   151875    case 6: return 0;
   151876    case 5: return 0;
   151877    case 4:
   151878       if (devinfo->is_g4x) {
   151879          return 0;
   151880       } else {
   151881          return 0;
   151882       }
   151883    default:
   151884       unreachable("Invalid hardware generation");
   151885    }
   151886 }
   151887 
   151888 
   151889 
   151890 #define GEN10_MI_ATOMIC_MemoryType_start  22
   151891 #define GEN9_MI_ATOMIC_MemoryType_start  22
   151892 #define GEN8_MI_ATOMIC_MemoryType_start  22
   151893 
   151894 static inline uint32_t ATTRIBUTE_PURE
   151895 MI_ATOMIC_MemoryType_start(const struct gen_device_info *devinfo)
   151896 {
   151897    switch (devinfo->gen) {
   151898    case 10: return 22;
   151899    case 9: return 22;
   151900    case 8: return 22;
   151901    case 7:
   151902       if (devinfo->is_haswell) {
   151903          return 0;
   151904       } else {
   151905          return 0;
   151906       }
   151907    case 6: return 0;
   151908    case 5: return 0;
   151909    case 4:
   151910       if (devinfo->is_g4x) {
   151911          return 0;
   151912       } else {
   151913          return 0;
   151914       }
   151915    default:
   151916       unreachable("Invalid hardware generation");
   151917    }
   151918 }
   151919 
   151920 
   151921 
   151922 /* MI_ATOMIC::Operand1 Data Dword 0 */
   151923 
   151924 
   151925 #define GEN10_MI_ATOMIC_Operand1DataDword0_bits  32
   151926 #define GEN9_MI_ATOMIC_Operand1DataDword0_bits  32
   151927 #define GEN8_MI_ATOMIC_Operand1DataDword0_bits  32
   151928 
   151929 static inline uint32_t ATTRIBUTE_PURE
   151930 MI_ATOMIC_Operand1DataDword0_bits(const struct gen_device_info *devinfo)
   151931 {
   151932    switch (devinfo->gen) {
   151933    case 10: return 32;
   151934    case 9: return 32;
   151935    case 8: return 32;
   151936    case 7:
   151937       if (devinfo->is_haswell) {
   151938          return 0;
   151939       } else {
   151940          return 0;
   151941       }
   151942    case 6: return 0;
   151943    case 5: return 0;
   151944    case 4:
   151945       if (devinfo->is_g4x) {
   151946          return 0;
   151947       } else {
   151948          return 0;
   151949       }
   151950    default:
   151951       unreachable("Invalid hardware generation");
   151952    }
   151953 }
   151954 
   151955 
   151956 
   151957 #define GEN10_MI_ATOMIC_Operand1DataDword0_start  96
   151958 #define GEN9_MI_ATOMIC_Operand1DataDword0_start  96
   151959 #define GEN8_MI_ATOMIC_Operand1DataDword0_start  96
   151960 
   151961 static inline uint32_t ATTRIBUTE_PURE
   151962 MI_ATOMIC_Operand1DataDword0_start(const struct gen_device_info *devinfo)
   151963 {
   151964    switch (devinfo->gen) {
   151965    case 10: return 96;
   151966    case 9: return 96;
   151967    case 8: return 96;
   151968    case 7:
   151969       if (devinfo->is_haswell) {
   151970          return 0;
   151971       } else {
   151972          return 0;
   151973       }
   151974    case 6: return 0;
   151975    case 5: return 0;
   151976    case 4:
   151977       if (devinfo->is_g4x) {
   151978          return 0;
   151979       } else {
   151980          return 0;
   151981       }
   151982    default:
   151983       unreachable("Invalid hardware generation");
   151984    }
   151985 }
   151986 
   151987 
   151988 
   151989 /* MI_ATOMIC::Operand1 Data Dword 1 */
   151990 
   151991 
   151992 #define GEN10_MI_ATOMIC_Operand1DataDword1_bits  32
   151993 #define GEN9_MI_ATOMIC_Operand1DataDword1_bits  32
   151994 #define GEN8_MI_ATOMIC_Operand1DataDword1_bits  32
   151995 
   151996 static inline uint32_t ATTRIBUTE_PURE
   151997 MI_ATOMIC_Operand1DataDword1_bits(const struct gen_device_info *devinfo)
   151998 {
   151999    switch (devinfo->gen) {
   152000    case 10: return 32;
   152001    case 9: return 32;
   152002    case 8: return 32;
   152003    case 7:
   152004       if (devinfo->is_haswell) {
   152005          return 0;
   152006       } else {
   152007          return 0;
   152008       }
   152009    case 6: return 0;
   152010    case 5: return 0;
   152011    case 4:
   152012       if (devinfo->is_g4x) {
   152013          return 0;
   152014       } else {
   152015          return 0;
   152016       }
   152017    default:
   152018       unreachable("Invalid hardware generation");
   152019    }
   152020 }
   152021 
   152022 
   152023 
   152024 #define GEN10_MI_ATOMIC_Operand1DataDword1_start  160
   152025 #define GEN9_MI_ATOMIC_Operand1DataDword1_start  160
   152026 #define GEN8_MI_ATOMIC_Operand1DataDword1_start  160
   152027 
   152028 static inline uint32_t ATTRIBUTE_PURE
   152029 MI_ATOMIC_Operand1DataDword1_start(const struct gen_device_info *devinfo)
   152030 {
   152031    switch (devinfo->gen) {
   152032    case 10: return 160;
   152033    case 9: return 160;
   152034    case 8: return 160;
   152035    case 7:
   152036       if (devinfo->is_haswell) {
   152037          return 0;
   152038       } else {
   152039          return 0;
   152040       }
   152041    case 6: return 0;
   152042    case 5: return 0;
   152043    case 4:
   152044       if (devinfo->is_g4x) {
   152045          return 0;
   152046       } else {
   152047          return 0;
   152048       }
   152049    default:
   152050       unreachable("Invalid hardware generation");
   152051    }
   152052 }
   152053 
   152054 
   152055 
   152056 /* MI_ATOMIC::Operand1 Data Dword 2 */
   152057 
   152058 
   152059 #define GEN10_MI_ATOMIC_Operand1DataDword2_bits  32
   152060 #define GEN9_MI_ATOMIC_Operand1DataDword2_bits  32
   152061 #define GEN8_MI_ATOMIC_Operand1DataDword2_bits  32
   152062 
   152063 static inline uint32_t ATTRIBUTE_PURE
   152064 MI_ATOMIC_Operand1DataDword2_bits(const struct gen_device_info *devinfo)
   152065 {
   152066    switch (devinfo->gen) {
   152067    case 10: return 32;
   152068    case 9: return 32;
   152069    case 8: return 32;
   152070    case 7:
   152071       if (devinfo->is_haswell) {
   152072          return 0;
   152073       } else {
   152074          return 0;
   152075       }
   152076    case 6: return 0;
   152077    case 5: return 0;
   152078    case 4:
   152079       if (devinfo->is_g4x) {
   152080          return 0;
   152081       } else {
   152082          return 0;
   152083       }
   152084    default:
   152085       unreachable("Invalid hardware generation");
   152086    }
   152087 }
   152088 
   152089 
   152090 
   152091 #define GEN10_MI_ATOMIC_Operand1DataDword2_start  224
   152092 #define GEN9_MI_ATOMIC_Operand1DataDword2_start  224
   152093 #define GEN8_MI_ATOMIC_Operand1DataDword2_start  224
   152094 
   152095 static inline uint32_t ATTRIBUTE_PURE
   152096 MI_ATOMIC_Operand1DataDword2_start(const struct gen_device_info *devinfo)
   152097 {
   152098    switch (devinfo->gen) {
   152099    case 10: return 224;
   152100    case 9: return 224;
   152101    case 8: return 224;
   152102    case 7:
   152103       if (devinfo->is_haswell) {
   152104          return 0;
   152105       } else {
   152106          return 0;
   152107       }
   152108    case 6: return 0;
   152109    case 5: return 0;
   152110    case 4:
   152111       if (devinfo->is_g4x) {
   152112          return 0;
   152113       } else {
   152114          return 0;
   152115       }
   152116    default:
   152117       unreachable("Invalid hardware generation");
   152118    }
   152119 }
   152120 
   152121 
   152122 
   152123 /* MI_ATOMIC::Operand1 Data Dword 3 */
   152124 
   152125 
   152126 #define GEN10_MI_ATOMIC_Operand1DataDword3_bits  32
   152127 #define GEN9_MI_ATOMIC_Operand1DataDword3_bits  32
   152128 #define GEN8_MI_ATOMIC_Operand1DataDword3_bits  32
   152129 
   152130 static inline uint32_t ATTRIBUTE_PURE
   152131 MI_ATOMIC_Operand1DataDword3_bits(const struct gen_device_info *devinfo)
   152132 {
   152133    switch (devinfo->gen) {
   152134    case 10: return 32;
   152135    case 9: return 32;
   152136    case 8: return 32;
   152137    case 7:
   152138       if (devinfo->is_haswell) {
   152139          return 0;
   152140       } else {
   152141          return 0;
   152142       }
   152143    case 6: return 0;
   152144    case 5: return 0;
   152145    case 4:
   152146       if (devinfo->is_g4x) {
   152147          return 0;
   152148       } else {
   152149          return 0;
   152150       }
   152151    default:
   152152       unreachable("Invalid hardware generation");
   152153    }
   152154 }
   152155 
   152156 
   152157 
   152158 #define GEN10_MI_ATOMIC_Operand1DataDword3_start  288
   152159 #define GEN9_MI_ATOMIC_Operand1DataDword3_start  288
   152160 #define GEN8_MI_ATOMIC_Operand1DataDword3_start  288
   152161 
   152162 static inline uint32_t ATTRIBUTE_PURE
   152163 MI_ATOMIC_Operand1DataDword3_start(const struct gen_device_info *devinfo)
   152164 {
   152165    switch (devinfo->gen) {
   152166    case 10: return 288;
   152167    case 9: return 288;
   152168    case 8: return 288;
   152169    case 7:
   152170       if (devinfo->is_haswell) {
   152171          return 0;
   152172       } else {
   152173          return 0;
   152174       }
   152175    case 6: return 0;
   152176    case 5: return 0;
   152177    case 4:
   152178       if (devinfo->is_g4x) {
   152179          return 0;
   152180       } else {
   152181          return 0;
   152182       }
   152183    default:
   152184       unreachable("Invalid hardware generation");
   152185    }
   152186 }
   152187 
   152188 
   152189 
   152190 /* MI_ATOMIC::Operand2 Data Dword 0 */
   152191 
   152192 
   152193 #define GEN10_MI_ATOMIC_Operand2DataDword0_bits  32
   152194 #define GEN9_MI_ATOMIC_Operand2DataDword0_bits  32
   152195 #define GEN8_MI_ATOMIC_Operand2DataDword0_bits  32
   152196 
   152197 static inline uint32_t ATTRIBUTE_PURE
   152198 MI_ATOMIC_Operand2DataDword0_bits(const struct gen_device_info *devinfo)
   152199 {
   152200    switch (devinfo->gen) {
   152201    case 10: return 32;
   152202    case 9: return 32;
   152203    case 8: return 32;
   152204    case 7:
   152205       if (devinfo->is_haswell) {
   152206          return 0;
   152207       } else {
   152208          return 0;
   152209       }
   152210    case 6: return 0;
   152211    case 5: return 0;
   152212    case 4:
   152213       if (devinfo->is_g4x) {
   152214          return 0;
   152215       } else {
   152216          return 0;
   152217       }
   152218    default:
   152219       unreachable("Invalid hardware generation");
   152220    }
   152221 }
   152222 
   152223 
   152224 
   152225 #define GEN10_MI_ATOMIC_Operand2DataDword0_start  128
   152226 #define GEN9_MI_ATOMIC_Operand2DataDword0_start  128
   152227 #define GEN8_MI_ATOMIC_Operand2DataDword0_start  128
   152228 
   152229 static inline uint32_t ATTRIBUTE_PURE
   152230 MI_ATOMIC_Operand2DataDword0_start(const struct gen_device_info *devinfo)
   152231 {
   152232    switch (devinfo->gen) {
   152233    case 10: return 128;
   152234    case 9: return 128;
   152235    case 8: return 128;
   152236    case 7:
   152237       if (devinfo->is_haswell) {
   152238          return 0;
   152239       } else {
   152240          return 0;
   152241       }
   152242    case 6: return 0;
   152243    case 5: return 0;
   152244    case 4:
   152245       if (devinfo->is_g4x) {
   152246          return 0;
   152247       } else {
   152248          return 0;
   152249       }
   152250    default:
   152251       unreachable("Invalid hardware generation");
   152252    }
   152253 }
   152254 
   152255 
   152256 
   152257 /* MI_ATOMIC::Operand2 Data Dword 1 */
   152258 
   152259 
   152260 #define GEN10_MI_ATOMIC_Operand2DataDword1_bits  32
   152261 #define GEN9_MI_ATOMIC_Operand2DataDword1_bits  32
   152262 #define GEN8_MI_ATOMIC_Operand2DataDword1_bits  32
   152263 
   152264 static inline uint32_t ATTRIBUTE_PURE
   152265 MI_ATOMIC_Operand2DataDword1_bits(const struct gen_device_info *devinfo)
   152266 {
   152267    switch (devinfo->gen) {
   152268    case 10: return 32;
   152269    case 9: return 32;
   152270    case 8: return 32;
   152271    case 7:
   152272       if (devinfo->is_haswell) {
   152273          return 0;
   152274       } else {
   152275          return 0;
   152276       }
   152277    case 6: return 0;
   152278    case 5: return 0;
   152279    case 4:
   152280       if (devinfo->is_g4x) {
   152281          return 0;
   152282       } else {
   152283          return 0;
   152284       }
   152285    default:
   152286       unreachable("Invalid hardware generation");
   152287    }
   152288 }
   152289 
   152290 
   152291 
   152292 #define GEN10_MI_ATOMIC_Operand2DataDword1_start  192
   152293 #define GEN9_MI_ATOMIC_Operand2DataDword1_start  192
   152294 #define GEN8_MI_ATOMIC_Operand2DataDword1_start  192
   152295 
   152296 static inline uint32_t ATTRIBUTE_PURE
   152297 MI_ATOMIC_Operand2DataDword1_start(const struct gen_device_info *devinfo)
   152298 {
   152299    switch (devinfo->gen) {
   152300    case 10: return 192;
   152301    case 9: return 192;
   152302    case 8: return 192;
   152303    case 7:
   152304       if (devinfo->is_haswell) {
   152305          return 0;
   152306       } else {
   152307          return 0;
   152308       }
   152309    case 6: return 0;
   152310    case 5: return 0;
   152311    case 4:
   152312       if (devinfo->is_g4x) {
   152313          return 0;
   152314       } else {
   152315          return 0;
   152316       }
   152317    default:
   152318       unreachable("Invalid hardware generation");
   152319    }
   152320 }
   152321 
   152322 
   152323 
   152324 /* MI_ATOMIC::Operand2 Data Dword 2 */
   152325 
   152326 
   152327 #define GEN10_MI_ATOMIC_Operand2DataDword2_bits  32
   152328 #define GEN9_MI_ATOMIC_Operand2DataDword2_bits  32
   152329 #define GEN8_MI_ATOMIC_Operand2DataDword2_bits  32
   152330 
   152331 static inline uint32_t ATTRIBUTE_PURE
   152332 MI_ATOMIC_Operand2DataDword2_bits(const struct gen_device_info *devinfo)
   152333 {
   152334    switch (devinfo->gen) {
   152335    case 10: return 32;
   152336    case 9: return 32;
   152337    case 8: return 32;
   152338    case 7:
   152339       if (devinfo->is_haswell) {
   152340          return 0;
   152341       } else {
   152342          return 0;
   152343       }
   152344    case 6: return 0;
   152345    case 5: return 0;
   152346    case 4:
   152347       if (devinfo->is_g4x) {
   152348          return 0;
   152349       } else {
   152350          return 0;
   152351       }
   152352    default:
   152353       unreachable("Invalid hardware generation");
   152354    }
   152355 }
   152356 
   152357 
   152358 
   152359 #define GEN10_MI_ATOMIC_Operand2DataDword2_start  256
   152360 #define GEN9_MI_ATOMIC_Operand2DataDword2_start  256
   152361 #define GEN8_MI_ATOMIC_Operand2DataDword2_start  256
   152362 
   152363 static inline uint32_t ATTRIBUTE_PURE
   152364 MI_ATOMIC_Operand2DataDword2_start(const struct gen_device_info *devinfo)
   152365 {
   152366    switch (devinfo->gen) {
   152367    case 10: return 256;
   152368    case 9: return 256;
   152369    case 8: return 256;
   152370    case 7:
   152371       if (devinfo->is_haswell) {
   152372          return 0;
   152373       } else {
   152374          return 0;
   152375       }
   152376    case 6: return 0;
   152377    case 5: return 0;
   152378    case 4:
   152379       if (devinfo->is_g4x) {
   152380          return 0;
   152381       } else {
   152382          return 0;
   152383       }
   152384    default:
   152385       unreachable("Invalid hardware generation");
   152386    }
   152387 }
   152388 
   152389 
   152390 
   152391 /* MI_ATOMIC::Operand2 Data Dword 3 */
   152392 
   152393 
   152394 #define GEN10_MI_ATOMIC_Operand2DataDword3_bits  32
   152395 #define GEN9_MI_ATOMIC_Operand2DataDword3_bits  32
   152396 #define GEN8_MI_ATOMIC_Operand2DataDword3_bits  32
   152397 
   152398 static inline uint32_t ATTRIBUTE_PURE
   152399 MI_ATOMIC_Operand2DataDword3_bits(const struct gen_device_info *devinfo)
   152400 {
   152401    switch (devinfo->gen) {
   152402    case 10: return 32;
   152403    case 9: return 32;
   152404    case 8: return 32;
   152405    case 7:
   152406       if (devinfo->is_haswell) {
   152407          return 0;
   152408       } else {
   152409          return 0;
   152410       }
   152411    case 6: return 0;
   152412    case 5: return 0;
   152413    case 4:
   152414       if (devinfo->is_g4x) {
   152415          return 0;
   152416       } else {
   152417          return 0;
   152418       }
   152419    default:
   152420       unreachable("Invalid hardware generation");
   152421    }
   152422 }
   152423 
   152424 
   152425 
   152426 #define GEN10_MI_ATOMIC_Operand2DataDword3_start  320
   152427 #define GEN9_MI_ATOMIC_Operand2DataDword3_start  320
   152428 #define GEN8_MI_ATOMIC_Operand2DataDword3_start  320
   152429 
   152430 static inline uint32_t ATTRIBUTE_PURE
   152431 MI_ATOMIC_Operand2DataDword3_start(const struct gen_device_info *devinfo)
   152432 {
   152433    switch (devinfo->gen) {
   152434    case 10: return 320;
   152435    case 9: return 320;
   152436    case 8: return 320;
   152437    case 7:
   152438       if (devinfo->is_haswell) {
   152439          return 0;
   152440       } else {
   152441          return 0;
   152442       }
   152443    case 6: return 0;
   152444    case 5: return 0;
   152445    case 4:
   152446       if (devinfo->is_g4x) {
   152447          return 0;
   152448       } else {
   152449          return 0;
   152450       }
   152451    default:
   152452       unreachable("Invalid hardware generation");
   152453    }
   152454 }
   152455 
   152456 
   152457 
   152458 /* MI_ATOMIC::Post-Sync Operation */
   152459 
   152460 
   152461 #define GEN10_MI_ATOMIC_PostSyncOperation_bits  1
   152462 #define GEN9_MI_ATOMIC_PostSyncOperation_bits  1
   152463 #define GEN8_MI_ATOMIC_PostSyncOperation_bits  1
   152464 
   152465 static inline uint32_t ATTRIBUTE_PURE
   152466 MI_ATOMIC_PostSyncOperation_bits(const struct gen_device_info *devinfo)
   152467 {
   152468    switch (devinfo->gen) {
   152469    case 10: return 1;
   152470    case 9: return 1;
   152471    case 8: return 1;
   152472    case 7:
   152473       if (devinfo->is_haswell) {
   152474          return 0;
   152475       } else {
   152476          return 0;
   152477       }
   152478    case 6: return 0;
   152479    case 5: return 0;
   152480    case 4:
   152481       if (devinfo->is_g4x) {
   152482          return 0;
   152483       } else {
   152484          return 0;
   152485       }
   152486    default:
   152487       unreachable("Invalid hardware generation");
   152488    }
   152489 }
   152490 
   152491 
   152492 
   152493 #define GEN10_MI_ATOMIC_PostSyncOperation_start  21
   152494 #define GEN9_MI_ATOMIC_PostSyncOperation_start  21
   152495 #define GEN8_MI_ATOMIC_PostSyncOperation_start  21
   152496 
   152497 static inline uint32_t ATTRIBUTE_PURE
   152498 MI_ATOMIC_PostSyncOperation_start(const struct gen_device_info *devinfo)
   152499 {
   152500    switch (devinfo->gen) {
   152501    case 10: return 21;
   152502    case 9: return 21;
   152503    case 8: return 21;
   152504    case 7:
   152505       if (devinfo->is_haswell) {
   152506          return 0;
   152507       } else {
   152508          return 0;
   152509       }
   152510    case 6: return 0;
   152511    case 5: return 0;
   152512    case 4:
   152513       if (devinfo->is_g4x) {
   152514          return 0;
   152515       } else {
   152516          return 0;
   152517       }
   152518    default:
   152519       unreachable("Invalid hardware generation");
   152520    }
   152521 }
   152522 
   152523 
   152524 
   152525 /* MI_ATOMIC::Return Data Control */
   152526 
   152527 
   152528 #define GEN10_MI_ATOMIC_ReturnDataControl_bits  1
   152529 #define GEN9_MI_ATOMIC_ReturnDataControl_bits  1
   152530 #define GEN8_MI_ATOMIC_ReturnDataControl_bits  1
   152531 
   152532 static inline uint32_t ATTRIBUTE_PURE
   152533 MI_ATOMIC_ReturnDataControl_bits(const struct gen_device_info *devinfo)
   152534 {
   152535    switch (devinfo->gen) {
   152536    case 10: return 1;
   152537    case 9: return 1;
   152538    case 8: return 1;
   152539    case 7:
   152540       if (devinfo->is_haswell) {
   152541          return 0;
   152542       } else {
   152543          return 0;
   152544       }
   152545    case 6: return 0;
   152546    case 5: return 0;
   152547    case 4:
   152548       if (devinfo->is_g4x) {
   152549          return 0;
   152550       } else {
   152551          return 0;
   152552       }
   152553    default:
   152554       unreachable("Invalid hardware generation");
   152555    }
   152556 }
   152557 
   152558 
   152559 
   152560 #define GEN10_MI_ATOMIC_ReturnDataControl_start  16
   152561 #define GEN9_MI_ATOMIC_ReturnDataControl_start  16
   152562 #define GEN8_MI_ATOMIC_ReturnDataControl_start  16
   152563 
   152564 static inline uint32_t ATTRIBUTE_PURE
   152565 MI_ATOMIC_ReturnDataControl_start(const struct gen_device_info *devinfo)
   152566 {
   152567    switch (devinfo->gen) {
   152568    case 10: return 16;
   152569    case 9: return 16;
   152570    case 8: return 16;
   152571    case 7:
   152572       if (devinfo->is_haswell) {
   152573          return 0;
   152574       } else {
   152575          return 0;
   152576       }
   152577    case 6: return 0;
   152578    case 5: return 0;
   152579    case 4:
   152580       if (devinfo->is_g4x) {
   152581          return 0;
   152582       } else {
   152583          return 0;
   152584       }
   152585    default:
   152586       unreachable("Invalid hardware generation");
   152587    }
   152588 }
   152589 
   152590 
   152591 
   152592 /* MI_BATCH_BUFFER_END */
   152593 
   152594 
   152595 #define GEN10_MI_BATCH_BUFFER_END_length  1
   152596 #define GEN9_MI_BATCH_BUFFER_END_length  1
   152597 #define GEN8_MI_BATCH_BUFFER_END_length  1
   152598 #define GEN75_MI_BATCH_BUFFER_END_length  1
   152599 #define GEN7_MI_BATCH_BUFFER_END_length  1
   152600 #define GEN6_MI_BATCH_BUFFER_END_length  1
   152601 
   152602 static inline uint32_t ATTRIBUTE_PURE
   152603 MI_BATCH_BUFFER_END_length(const struct gen_device_info *devinfo)
   152604 {
   152605    switch (devinfo->gen) {
   152606    case 10: return 1;
   152607    case 9: return 1;
   152608    case 8: return 1;
   152609    case 7:
   152610       if (devinfo->is_haswell) {
   152611          return 1;
   152612       } else {
   152613          return 1;
   152614       }
   152615    case 6: return 1;
   152616    case 5: return 0;
   152617    case 4:
   152618       if (devinfo->is_g4x) {
   152619          return 0;
   152620       } else {
   152621          return 0;
   152622       }
   152623    default:
   152624       unreachable("Invalid hardware generation");
   152625    }
   152626 }
   152627 
   152628 
   152629 
   152630 /* MI_BATCH_BUFFER_END::Command Type */
   152631 
   152632 
   152633 #define GEN10_MI_BATCH_BUFFER_END_CommandType_bits  3
   152634 #define GEN9_MI_BATCH_BUFFER_END_CommandType_bits  3
   152635 #define GEN8_MI_BATCH_BUFFER_END_CommandType_bits  3
   152636 #define GEN75_MI_BATCH_BUFFER_END_CommandType_bits  3
   152637 #define GEN7_MI_BATCH_BUFFER_END_CommandType_bits  3
   152638 #define GEN6_MI_BATCH_BUFFER_END_CommandType_bits  3
   152639 
   152640 static inline uint32_t ATTRIBUTE_PURE
   152641 MI_BATCH_BUFFER_END_CommandType_bits(const struct gen_device_info *devinfo)
   152642 {
   152643    switch (devinfo->gen) {
   152644    case 10: return 3;
   152645    case 9: return 3;
   152646    case 8: return 3;
   152647    case 7:
   152648       if (devinfo->is_haswell) {
   152649          return 3;
   152650       } else {
   152651          return 3;
   152652       }
   152653    case 6: return 3;
   152654    case 5: return 0;
   152655    case 4:
   152656       if (devinfo->is_g4x) {
   152657          return 0;
   152658       } else {
   152659          return 0;
   152660       }
   152661    default:
   152662       unreachable("Invalid hardware generation");
   152663    }
   152664 }
   152665 
   152666 
   152667 
   152668 #define GEN10_MI_BATCH_BUFFER_END_CommandType_start  29
   152669 #define GEN9_MI_BATCH_BUFFER_END_CommandType_start  29
   152670 #define GEN8_MI_BATCH_BUFFER_END_CommandType_start  29
   152671 #define GEN75_MI_BATCH_BUFFER_END_CommandType_start  29
   152672 #define GEN7_MI_BATCH_BUFFER_END_CommandType_start  29
   152673 #define GEN6_MI_BATCH_BUFFER_END_CommandType_start  29
   152674 
   152675 static inline uint32_t ATTRIBUTE_PURE
   152676 MI_BATCH_BUFFER_END_CommandType_start(const struct gen_device_info *devinfo)
   152677 {
   152678    switch (devinfo->gen) {
   152679    case 10: return 29;
   152680    case 9: return 29;
   152681    case 8: return 29;
   152682    case 7:
   152683       if (devinfo->is_haswell) {
   152684          return 29;
   152685       } else {
   152686          return 29;
   152687       }
   152688    case 6: return 29;
   152689    case 5: return 0;
   152690    case 4:
   152691       if (devinfo->is_g4x) {
   152692          return 0;
   152693       } else {
   152694          return 0;
   152695       }
   152696    default:
   152697       unreachable("Invalid hardware generation");
   152698    }
   152699 }
   152700 
   152701 
   152702 
   152703 /* MI_BATCH_BUFFER_END::End Context */
   152704 
   152705 
   152706 #define GEN10_MI_BATCH_BUFFER_END_EndContext_bits  1
   152707 
   152708 static inline uint32_t ATTRIBUTE_PURE
   152709 MI_BATCH_BUFFER_END_EndContext_bits(const struct gen_device_info *devinfo)
   152710 {
   152711    switch (devinfo->gen) {
   152712    case 10: return 1;
   152713    case 9: return 0;
   152714    case 8: return 0;
   152715    case 7:
   152716       if (devinfo->is_haswell) {
   152717          return 0;
   152718       } else {
   152719          return 0;
   152720       }
   152721    case 6: return 0;
   152722    case 5: return 0;
   152723    case 4:
   152724       if (devinfo->is_g4x) {
   152725          return 0;
   152726       } else {
   152727          return 0;
   152728       }
   152729    default:
   152730       unreachable("Invalid hardware generation");
   152731    }
   152732 }
   152733 
   152734 
   152735 
   152736 #define GEN10_MI_BATCH_BUFFER_END_EndContext_start  0
   152737 
   152738 static inline uint32_t ATTRIBUTE_PURE
   152739 MI_BATCH_BUFFER_END_EndContext_start(const struct gen_device_info *devinfo)
   152740 {
   152741    switch (devinfo->gen) {
   152742    case 10: return 0;
   152743    case 9: return 0;
   152744    case 8: return 0;
   152745    case 7:
   152746       if (devinfo->is_haswell) {
   152747          return 0;
   152748       } else {
   152749          return 0;
   152750       }
   152751    case 6: return 0;
   152752    case 5: return 0;
   152753    case 4:
   152754       if (devinfo->is_g4x) {
   152755          return 0;
   152756       } else {
   152757          return 0;
   152758       }
   152759    default:
   152760       unreachable("Invalid hardware generation");
   152761    }
   152762 }
   152763 
   152764 
   152765 
   152766 /* MI_BATCH_BUFFER_END::MI Command Opcode */
   152767 
   152768 
   152769 #define GEN10_MI_BATCH_BUFFER_END_MICommandOpcode_bits  6
   152770 #define GEN9_MI_BATCH_BUFFER_END_MICommandOpcode_bits  6
   152771 #define GEN8_MI_BATCH_BUFFER_END_MICommandOpcode_bits  6
   152772 #define GEN75_MI_BATCH_BUFFER_END_MICommandOpcode_bits  6
   152773 #define GEN7_MI_BATCH_BUFFER_END_MICommandOpcode_bits  6
   152774 #define GEN6_MI_BATCH_BUFFER_END_MICommandOpcode_bits  6
   152775 
   152776 static inline uint32_t ATTRIBUTE_PURE
   152777 MI_BATCH_BUFFER_END_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   152778 {
   152779    switch (devinfo->gen) {
   152780    case 10: return 6;
   152781    case 9: return 6;
   152782    case 8: return 6;
   152783    case 7:
   152784       if (devinfo->is_haswell) {
   152785          return 6;
   152786       } else {
   152787          return 6;
   152788       }
   152789    case 6: return 6;
   152790    case 5: return 0;
   152791    case 4:
   152792       if (devinfo->is_g4x) {
   152793          return 0;
   152794       } else {
   152795          return 0;
   152796       }
   152797    default:
   152798       unreachable("Invalid hardware generation");
   152799    }
   152800 }
   152801 
   152802 
   152803 
   152804 #define GEN10_MI_BATCH_BUFFER_END_MICommandOpcode_start  23
   152805 #define GEN9_MI_BATCH_BUFFER_END_MICommandOpcode_start  23
   152806 #define GEN8_MI_BATCH_BUFFER_END_MICommandOpcode_start  23
   152807 #define GEN75_MI_BATCH_BUFFER_END_MICommandOpcode_start  23
   152808 #define GEN7_MI_BATCH_BUFFER_END_MICommandOpcode_start  23
   152809 #define GEN6_MI_BATCH_BUFFER_END_MICommandOpcode_start  23
   152810 
   152811 static inline uint32_t ATTRIBUTE_PURE
   152812 MI_BATCH_BUFFER_END_MICommandOpcode_start(const struct gen_device_info *devinfo)
   152813 {
   152814    switch (devinfo->gen) {
   152815    case 10: return 23;
   152816    case 9: return 23;
   152817    case 8: return 23;
   152818    case 7:
   152819       if (devinfo->is_haswell) {
   152820          return 23;
   152821       } else {
   152822          return 23;
   152823       }
   152824    case 6: return 23;
   152825    case 5: return 0;
   152826    case 4:
   152827       if (devinfo->is_g4x) {
   152828          return 0;
   152829       } else {
   152830          return 0;
   152831       }
   152832    default:
   152833       unreachable("Invalid hardware generation");
   152834    }
   152835 }
   152836 
   152837 
   152838 
   152839 /* MI_BATCH_BUFFER_START */
   152840 
   152841 
   152842 #define GEN10_MI_BATCH_BUFFER_START_length  3
   152843 #define GEN9_MI_BATCH_BUFFER_START_length  3
   152844 #define GEN8_MI_BATCH_BUFFER_START_length  3
   152845 #define GEN75_MI_BATCH_BUFFER_START_length  2
   152846 #define GEN7_MI_BATCH_BUFFER_START_length  2
   152847 #define GEN6_MI_BATCH_BUFFER_START_length  2
   152848 
   152849 static inline uint32_t ATTRIBUTE_PURE
   152850 MI_BATCH_BUFFER_START_length(const struct gen_device_info *devinfo)
   152851 {
   152852    switch (devinfo->gen) {
   152853    case 10: return 3;
   152854    case 9: return 3;
   152855    case 8: return 3;
   152856    case 7:
   152857       if (devinfo->is_haswell) {
   152858          return 2;
   152859       } else {
   152860          return 2;
   152861       }
   152862    case 6: return 2;
   152863    case 5: return 0;
   152864    case 4:
   152865       if (devinfo->is_g4x) {
   152866          return 0;
   152867       } else {
   152868          return 0;
   152869       }
   152870    default:
   152871       unreachable("Invalid hardware generation");
   152872    }
   152873 }
   152874 
   152875 
   152876 
   152877 /* MI_BATCH_BUFFER_START::2nd Level Batch Buffer */
   152878 
   152879 
   152880 #define GEN8_MI_BATCH_BUFFER_START_2ndLevelBatchBuffer_bits  1
   152881 #define GEN75_MI_BATCH_BUFFER_START_2ndLevelBatchBuffer_bits  1
   152882 
   152883 static inline uint32_t ATTRIBUTE_PURE
   152884 MI_BATCH_BUFFER_START_2ndLevelBatchBuffer_bits(const struct gen_device_info *devinfo)
   152885 {
   152886    switch (devinfo->gen) {
   152887    case 10: return 0;
   152888    case 9: return 0;
   152889    case 8: return 1;
   152890    case 7:
   152891       if (devinfo->is_haswell) {
   152892          return 1;
   152893       } else {
   152894          return 0;
   152895       }
   152896    case 6: return 0;
   152897    case 5: return 0;
   152898    case 4:
   152899       if (devinfo->is_g4x) {
   152900          return 0;
   152901       } else {
   152902          return 0;
   152903       }
   152904    default:
   152905       unreachable("Invalid hardware generation");
   152906    }
   152907 }
   152908 
   152909 
   152910 
   152911 #define GEN8_MI_BATCH_BUFFER_START_2ndLevelBatchBuffer_start  22
   152912 #define GEN75_MI_BATCH_BUFFER_START_2ndLevelBatchBuffer_start  22
   152913 
   152914 static inline uint32_t ATTRIBUTE_PURE
   152915 MI_BATCH_BUFFER_START_2ndLevelBatchBuffer_start(const struct gen_device_info *devinfo)
   152916 {
   152917    switch (devinfo->gen) {
   152918    case 10: return 0;
   152919    case 9: return 0;
   152920    case 8: return 22;
   152921    case 7:
   152922       if (devinfo->is_haswell) {
   152923          return 22;
   152924       } else {
   152925          return 0;
   152926       }
   152927    case 6: return 0;
   152928    case 5: return 0;
   152929    case 4:
   152930       if (devinfo->is_g4x) {
   152931          return 0;
   152932       } else {
   152933          return 0;
   152934       }
   152935    default:
   152936       unreachable("Invalid hardware generation");
   152937    }
   152938 }
   152939 
   152940 
   152941 
   152942 /* MI_BATCH_BUFFER_START::Add Offset Enable */
   152943 
   152944 
   152945 #define GEN10_MI_BATCH_BUFFER_START_AddOffsetEnable_bits  1
   152946 #define GEN9_MI_BATCH_BUFFER_START_AddOffsetEnable_bits  1
   152947 #define GEN8_MI_BATCH_BUFFER_START_AddOffsetEnable_bits  1
   152948 #define GEN75_MI_BATCH_BUFFER_START_AddOffsetEnable_bits  1
   152949 
   152950 static inline uint32_t ATTRIBUTE_PURE
   152951 MI_BATCH_BUFFER_START_AddOffsetEnable_bits(const struct gen_device_info *devinfo)
   152952 {
   152953    switch (devinfo->gen) {
   152954    case 10: return 1;
   152955    case 9: return 1;
   152956    case 8: return 1;
   152957    case 7:
   152958       if (devinfo->is_haswell) {
   152959          return 1;
   152960       } else {
   152961          return 0;
   152962       }
   152963    case 6: return 0;
   152964    case 5: return 0;
   152965    case 4:
   152966       if (devinfo->is_g4x) {
   152967          return 0;
   152968       } else {
   152969          return 0;
   152970       }
   152971    default:
   152972       unreachable("Invalid hardware generation");
   152973    }
   152974 }
   152975 
   152976 
   152977 
   152978 #define GEN10_MI_BATCH_BUFFER_START_AddOffsetEnable_start  16
   152979 #define GEN9_MI_BATCH_BUFFER_START_AddOffsetEnable_start  16
   152980 #define GEN8_MI_BATCH_BUFFER_START_AddOffsetEnable_start  16
   152981 #define GEN75_MI_BATCH_BUFFER_START_AddOffsetEnable_start  16
   152982 
   152983 static inline uint32_t ATTRIBUTE_PURE
   152984 MI_BATCH_BUFFER_START_AddOffsetEnable_start(const struct gen_device_info *devinfo)
   152985 {
   152986    switch (devinfo->gen) {
   152987    case 10: return 16;
   152988    case 9: return 16;
   152989    case 8: return 16;
   152990    case 7:
   152991       if (devinfo->is_haswell) {
   152992          return 16;
   152993       } else {
   152994          return 0;
   152995       }
   152996    case 6: return 0;
   152997    case 5: return 0;
   152998    case 4:
   152999       if (devinfo->is_g4x) {
   153000          return 0;
   153001       } else {
   153002          return 0;
   153003       }
   153004    default:
   153005       unreachable("Invalid hardware generation");
   153006    }
   153007 }
   153008 
   153009 
   153010 
   153011 /* MI_BATCH_BUFFER_START::Address Space Indicator */
   153012 
   153013 
   153014 #define GEN10_MI_BATCH_BUFFER_START_AddressSpaceIndicator_bits  1
   153015 #define GEN9_MI_BATCH_BUFFER_START_AddressSpaceIndicator_bits  1
   153016 #define GEN8_MI_BATCH_BUFFER_START_AddressSpaceIndicator_bits  1
   153017 #define GEN75_MI_BATCH_BUFFER_START_AddressSpaceIndicator_bits  1
   153018 #define GEN7_MI_BATCH_BUFFER_START_AddressSpaceIndicator_bits  1
   153019 #define GEN6_MI_BATCH_BUFFER_START_AddressSpaceIndicator_bits  1
   153020 
   153021 static inline uint32_t ATTRIBUTE_PURE
   153022 MI_BATCH_BUFFER_START_AddressSpaceIndicator_bits(const struct gen_device_info *devinfo)
   153023 {
   153024    switch (devinfo->gen) {
   153025    case 10: return 1;
   153026    case 9: return 1;
   153027    case 8: return 1;
   153028    case 7:
   153029       if (devinfo->is_haswell) {
   153030          return 1;
   153031       } else {
   153032          return 1;
   153033       }
   153034    case 6: return 1;
   153035    case 5: return 0;
   153036    case 4:
   153037       if (devinfo->is_g4x) {
   153038          return 0;
   153039       } else {
   153040          return 0;
   153041       }
   153042    default:
   153043       unreachable("Invalid hardware generation");
   153044    }
   153045 }
   153046 
   153047 
   153048 
   153049 #define GEN10_MI_BATCH_BUFFER_START_AddressSpaceIndicator_start  8
   153050 #define GEN9_MI_BATCH_BUFFER_START_AddressSpaceIndicator_start  8
   153051 #define GEN8_MI_BATCH_BUFFER_START_AddressSpaceIndicator_start  8
   153052 #define GEN75_MI_BATCH_BUFFER_START_AddressSpaceIndicator_start  8
   153053 #define GEN7_MI_BATCH_BUFFER_START_AddressSpaceIndicator_start  8
   153054 #define GEN6_MI_BATCH_BUFFER_START_AddressSpaceIndicator_start  8
   153055 
   153056 static inline uint32_t ATTRIBUTE_PURE
   153057 MI_BATCH_BUFFER_START_AddressSpaceIndicator_start(const struct gen_device_info *devinfo)
   153058 {
   153059    switch (devinfo->gen) {
   153060    case 10: return 8;
   153061    case 9: return 8;
   153062    case 8: return 8;
   153063    case 7:
   153064       if (devinfo->is_haswell) {
   153065          return 8;
   153066       } else {
   153067          return 8;
   153068       }
   153069    case 6: return 8;
   153070    case 5: return 0;
   153071    case 4:
   153072       if (devinfo->is_g4x) {
   153073          return 0;
   153074       } else {
   153075          return 0;
   153076       }
   153077    default:
   153078       unreachable("Invalid hardware generation");
   153079    }
   153080 }
   153081 
   153082 
   153083 
   153084 /* MI_BATCH_BUFFER_START::Batch Buffer Start Address */
   153085 
   153086 
   153087 #define GEN10_MI_BATCH_BUFFER_START_BatchBufferStartAddress_bits  62
   153088 #define GEN9_MI_BATCH_BUFFER_START_BatchBufferStartAddress_bits  62
   153089 #define GEN8_MI_BATCH_BUFFER_START_BatchBufferStartAddress_bits  46
   153090 #define GEN75_MI_BATCH_BUFFER_START_BatchBufferStartAddress_bits  30
   153091 #define GEN7_MI_BATCH_BUFFER_START_BatchBufferStartAddress_bits  30
   153092 #define GEN6_MI_BATCH_BUFFER_START_BatchBufferStartAddress_bits  30
   153093 
   153094 static inline uint32_t ATTRIBUTE_PURE
   153095 MI_BATCH_BUFFER_START_BatchBufferStartAddress_bits(const struct gen_device_info *devinfo)
   153096 {
   153097    switch (devinfo->gen) {
   153098    case 10: return 62;
   153099    case 9: return 62;
   153100    case 8: return 46;
   153101    case 7:
   153102       if (devinfo->is_haswell) {
   153103          return 30;
   153104       } else {
   153105          return 30;
   153106       }
   153107    case 6: return 30;
   153108    case 5: return 0;
   153109    case 4:
   153110       if (devinfo->is_g4x) {
   153111          return 0;
   153112       } else {
   153113          return 0;
   153114       }
   153115    default:
   153116       unreachable("Invalid hardware generation");
   153117    }
   153118 }
   153119 
   153120 
   153121 
   153122 #define GEN10_MI_BATCH_BUFFER_START_BatchBufferStartAddress_start  34
   153123 #define GEN9_MI_BATCH_BUFFER_START_BatchBufferStartAddress_start  34
   153124 #define GEN8_MI_BATCH_BUFFER_START_BatchBufferStartAddress_start  34
   153125 #define GEN75_MI_BATCH_BUFFER_START_BatchBufferStartAddress_start  34
   153126 #define GEN7_MI_BATCH_BUFFER_START_BatchBufferStartAddress_start  34
   153127 #define GEN6_MI_BATCH_BUFFER_START_BatchBufferStartAddress_start  34
   153128 
   153129 static inline uint32_t ATTRIBUTE_PURE
   153130 MI_BATCH_BUFFER_START_BatchBufferStartAddress_start(const struct gen_device_info *devinfo)
   153131 {
   153132    switch (devinfo->gen) {
   153133    case 10: return 34;
   153134    case 9: return 34;
   153135    case 8: return 34;
   153136    case 7:
   153137       if (devinfo->is_haswell) {
   153138          return 34;
   153139       } else {
   153140          return 34;
   153141       }
   153142    case 6: return 34;
   153143    case 5: return 0;
   153144    case 4:
   153145       if (devinfo->is_g4x) {
   153146          return 0;
   153147       } else {
   153148          return 0;
   153149       }
   153150    default:
   153151       unreachable("Invalid hardware generation");
   153152    }
   153153 }
   153154 
   153155 
   153156 
   153157 /* MI_BATCH_BUFFER_START::Clear Command Buffer Enable */
   153158 
   153159 
   153160 #define GEN75_MI_BATCH_BUFFER_START_ClearCommandBufferEnable_bits  1
   153161 #define GEN7_MI_BATCH_BUFFER_START_ClearCommandBufferEnable_bits  1
   153162 #define GEN6_MI_BATCH_BUFFER_START_ClearCommandBufferEnable_bits  1
   153163 
   153164 static inline uint32_t ATTRIBUTE_PURE
   153165 MI_BATCH_BUFFER_START_ClearCommandBufferEnable_bits(const struct gen_device_info *devinfo)
   153166 {
   153167    switch (devinfo->gen) {
   153168    case 10: return 0;
   153169    case 9: return 0;
   153170    case 8: return 0;
   153171    case 7:
   153172       if (devinfo->is_haswell) {
   153173          return 1;
   153174       } else {
   153175          return 1;
   153176       }
   153177    case 6: return 1;
   153178    case 5: return 0;
   153179    case 4:
   153180       if (devinfo->is_g4x) {
   153181          return 0;
   153182       } else {
   153183          return 0;
   153184       }
   153185    default:
   153186       unreachable("Invalid hardware generation");
   153187    }
   153188 }
   153189 
   153190 
   153191 
   153192 #define GEN75_MI_BATCH_BUFFER_START_ClearCommandBufferEnable_start  11
   153193 #define GEN7_MI_BATCH_BUFFER_START_ClearCommandBufferEnable_start  11
   153194 #define GEN6_MI_BATCH_BUFFER_START_ClearCommandBufferEnable_start  11
   153195 
   153196 static inline uint32_t ATTRIBUTE_PURE
   153197 MI_BATCH_BUFFER_START_ClearCommandBufferEnable_start(const struct gen_device_info *devinfo)
   153198 {
   153199    switch (devinfo->gen) {
   153200    case 10: return 0;
   153201    case 9: return 0;
   153202    case 8: return 0;
   153203    case 7:
   153204       if (devinfo->is_haswell) {
   153205          return 11;
   153206       } else {
   153207          return 11;
   153208       }
   153209    case 6: return 11;
   153210    case 5: return 0;
   153211    case 4:
   153212       if (devinfo->is_g4x) {
   153213          return 0;
   153214       } else {
   153215          return 0;
   153216       }
   153217    default:
   153218       unreachable("Invalid hardware generation");
   153219    }
   153220 }
   153221 
   153222 
   153223 
   153224 /* MI_BATCH_BUFFER_START::Command Type */
   153225 
   153226 
   153227 #define GEN10_MI_BATCH_BUFFER_START_CommandType_bits  3
   153228 #define GEN9_MI_BATCH_BUFFER_START_CommandType_bits  3
   153229 #define GEN8_MI_BATCH_BUFFER_START_CommandType_bits  3
   153230 #define GEN75_MI_BATCH_BUFFER_START_CommandType_bits  3
   153231 #define GEN7_MI_BATCH_BUFFER_START_CommandType_bits  3
   153232 #define GEN6_MI_BATCH_BUFFER_START_CommandType_bits  3
   153233 
   153234 static inline uint32_t ATTRIBUTE_PURE
   153235 MI_BATCH_BUFFER_START_CommandType_bits(const struct gen_device_info *devinfo)
   153236 {
   153237    switch (devinfo->gen) {
   153238    case 10: return 3;
   153239    case 9: return 3;
   153240    case 8: return 3;
   153241    case 7:
   153242       if (devinfo->is_haswell) {
   153243          return 3;
   153244       } else {
   153245          return 3;
   153246       }
   153247    case 6: return 3;
   153248    case 5: return 0;
   153249    case 4:
   153250       if (devinfo->is_g4x) {
   153251          return 0;
   153252       } else {
   153253          return 0;
   153254       }
   153255    default:
   153256       unreachable("Invalid hardware generation");
   153257    }
   153258 }
   153259 
   153260 
   153261 
   153262 #define GEN10_MI_BATCH_BUFFER_START_CommandType_start  29
   153263 #define GEN9_MI_BATCH_BUFFER_START_CommandType_start  29
   153264 #define GEN8_MI_BATCH_BUFFER_START_CommandType_start  29
   153265 #define GEN75_MI_BATCH_BUFFER_START_CommandType_start  29
   153266 #define GEN7_MI_BATCH_BUFFER_START_CommandType_start  29
   153267 #define GEN6_MI_BATCH_BUFFER_START_CommandType_start  29
   153268 
   153269 static inline uint32_t ATTRIBUTE_PURE
   153270 MI_BATCH_BUFFER_START_CommandType_start(const struct gen_device_info *devinfo)
   153271 {
   153272    switch (devinfo->gen) {
   153273    case 10: return 29;
   153274    case 9: return 29;
   153275    case 8: return 29;
   153276    case 7:
   153277       if (devinfo->is_haswell) {
   153278          return 29;
   153279       } else {
   153280          return 29;
   153281       }
   153282    case 6: return 29;
   153283    case 5: return 0;
   153284    case 4:
   153285       if (devinfo->is_g4x) {
   153286          return 0;
   153287       } else {
   153288          return 0;
   153289       }
   153290    default:
   153291       unreachable("Invalid hardware generation");
   153292    }
   153293 }
   153294 
   153295 
   153296 
   153297 /* MI_BATCH_BUFFER_START::DWord Length */
   153298 
   153299 
   153300 #define GEN10_MI_BATCH_BUFFER_START_DWordLength_bits  8
   153301 #define GEN9_MI_BATCH_BUFFER_START_DWordLength_bits  8
   153302 #define GEN8_MI_BATCH_BUFFER_START_DWordLength_bits  8
   153303 #define GEN75_MI_BATCH_BUFFER_START_DWordLength_bits  8
   153304 #define GEN7_MI_BATCH_BUFFER_START_DWordLength_bits  8
   153305 #define GEN6_MI_BATCH_BUFFER_START_DWordLength_bits  8
   153306 
   153307 static inline uint32_t ATTRIBUTE_PURE
   153308 MI_BATCH_BUFFER_START_DWordLength_bits(const struct gen_device_info *devinfo)
   153309 {
   153310    switch (devinfo->gen) {
   153311    case 10: return 8;
   153312    case 9: return 8;
   153313    case 8: return 8;
   153314    case 7:
   153315       if (devinfo->is_haswell) {
   153316          return 8;
   153317       } else {
   153318          return 8;
   153319       }
   153320    case 6: return 8;
   153321    case 5: return 0;
   153322    case 4:
   153323       if (devinfo->is_g4x) {
   153324          return 0;
   153325       } else {
   153326          return 0;
   153327       }
   153328    default:
   153329       unreachable("Invalid hardware generation");
   153330    }
   153331 }
   153332 
   153333 
   153334 
   153335 #define GEN10_MI_BATCH_BUFFER_START_DWordLength_start  0
   153336 #define GEN9_MI_BATCH_BUFFER_START_DWordLength_start  0
   153337 #define GEN8_MI_BATCH_BUFFER_START_DWordLength_start  0
   153338 #define GEN75_MI_BATCH_BUFFER_START_DWordLength_start  0
   153339 #define GEN7_MI_BATCH_BUFFER_START_DWordLength_start  0
   153340 #define GEN6_MI_BATCH_BUFFER_START_DWordLength_start  0
   153341 
   153342 static inline uint32_t ATTRIBUTE_PURE
   153343 MI_BATCH_BUFFER_START_DWordLength_start(const struct gen_device_info *devinfo)
   153344 {
   153345    switch (devinfo->gen) {
   153346    case 10: return 0;
   153347    case 9: return 0;
   153348    case 8: return 0;
   153349    case 7:
   153350       if (devinfo->is_haswell) {
   153351          return 0;
   153352       } else {
   153353          return 0;
   153354       }
   153355    case 6: return 0;
   153356    case 5: return 0;
   153357    case 4:
   153358       if (devinfo->is_g4x) {
   153359          return 0;
   153360       } else {
   153361          return 0;
   153362       }
   153363    default:
   153364       unreachable("Invalid hardware generation");
   153365    }
   153366 }
   153367 
   153368 
   153369 
   153370 /* MI_BATCH_BUFFER_START::MI Command Opcode */
   153371 
   153372 
   153373 #define GEN10_MI_BATCH_BUFFER_START_MICommandOpcode_bits  6
   153374 #define GEN9_MI_BATCH_BUFFER_START_MICommandOpcode_bits  6
   153375 #define GEN8_MI_BATCH_BUFFER_START_MICommandOpcode_bits  6
   153376 #define GEN75_MI_BATCH_BUFFER_START_MICommandOpcode_bits  6
   153377 #define GEN7_MI_BATCH_BUFFER_START_MICommandOpcode_bits  6
   153378 #define GEN6_MI_BATCH_BUFFER_START_MICommandOpcode_bits  6
   153379 
   153380 static inline uint32_t ATTRIBUTE_PURE
   153381 MI_BATCH_BUFFER_START_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   153382 {
   153383    switch (devinfo->gen) {
   153384    case 10: return 6;
   153385    case 9: return 6;
   153386    case 8: return 6;
   153387    case 7:
   153388       if (devinfo->is_haswell) {
   153389          return 6;
   153390       } else {
   153391          return 6;
   153392       }
   153393    case 6: return 6;
   153394    case 5: return 0;
   153395    case 4:
   153396       if (devinfo->is_g4x) {
   153397          return 0;
   153398       } else {
   153399          return 0;
   153400       }
   153401    default:
   153402       unreachable("Invalid hardware generation");
   153403    }
   153404 }
   153405 
   153406 
   153407 
   153408 #define GEN10_MI_BATCH_BUFFER_START_MICommandOpcode_start  23
   153409 #define GEN9_MI_BATCH_BUFFER_START_MICommandOpcode_start  23
   153410 #define GEN8_MI_BATCH_BUFFER_START_MICommandOpcode_start  23
   153411 #define GEN75_MI_BATCH_BUFFER_START_MICommandOpcode_start  23
   153412 #define GEN7_MI_BATCH_BUFFER_START_MICommandOpcode_start  23
   153413 #define GEN6_MI_BATCH_BUFFER_START_MICommandOpcode_start  23
   153414 
   153415 static inline uint32_t ATTRIBUTE_PURE
   153416 MI_BATCH_BUFFER_START_MICommandOpcode_start(const struct gen_device_info *devinfo)
   153417 {
   153418    switch (devinfo->gen) {
   153419    case 10: return 23;
   153420    case 9: return 23;
   153421    case 8: return 23;
   153422    case 7:
   153423       if (devinfo->is_haswell) {
   153424          return 23;
   153425       } else {
   153426          return 23;
   153427       }
   153428    case 6: return 23;
   153429    case 5: return 0;
   153430    case 4:
   153431       if (devinfo->is_g4x) {
   153432          return 0;
   153433       } else {
   153434          return 0;
   153435       }
   153436    default:
   153437       unreachable("Invalid hardware generation");
   153438    }
   153439 }
   153440 
   153441 
   153442 
   153443 /* MI_BATCH_BUFFER_START::Non-Privileged */
   153444 
   153445 
   153446 #define GEN75_MI_BATCH_BUFFER_START_NonPrivileged_bits  1
   153447 
   153448 static inline uint32_t ATTRIBUTE_PURE
   153449 MI_BATCH_BUFFER_START_NonPrivileged_bits(const struct gen_device_info *devinfo)
   153450 {
   153451    switch (devinfo->gen) {
   153452    case 10: return 0;
   153453    case 9: return 0;
   153454    case 8: return 0;
   153455    case 7:
   153456       if (devinfo->is_haswell) {
   153457          return 1;
   153458       } else {
   153459          return 0;
   153460       }
   153461    case 6: return 0;
   153462    case 5: return 0;
   153463    case 4:
   153464       if (devinfo->is_g4x) {
   153465          return 0;
   153466       } else {
   153467          return 0;
   153468       }
   153469    default:
   153470       unreachable("Invalid hardware generation");
   153471    }
   153472 }
   153473 
   153474 
   153475 
   153476 #define GEN75_MI_BATCH_BUFFER_START_NonPrivileged_start  13
   153477 
   153478 static inline uint32_t ATTRIBUTE_PURE
   153479 MI_BATCH_BUFFER_START_NonPrivileged_start(const struct gen_device_info *devinfo)
   153480 {
   153481    switch (devinfo->gen) {
   153482    case 10: return 0;
   153483    case 9: return 0;
   153484    case 8: return 0;
   153485    case 7:
   153486       if (devinfo->is_haswell) {
   153487          return 13;
   153488       } else {
   153489          return 0;
   153490       }
   153491    case 6: return 0;
   153492    case 5: return 0;
   153493    case 4:
   153494       if (devinfo->is_g4x) {
   153495          return 0;
   153496       } else {
   153497          return 0;
   153498       }
   153499    default:
   153500       unreachable("Invalid hardware generation");
   153501    }
   153502 }
   153503 
   153504 
   153505 
   153506 /* MI_BATCH_BUFFER_START::Predication Enable */
   153507 
   153508 
   153509 #define GEN10_MI_BATCH_BUFFER_START_PredicationEnable_bits  1
   153510 #define GEN9_MI_BATCH_BUFFER_START_PredicationEnable_bits  1
   153511 #define GEN8_MI_BATCH_BUFFER_START_PredicationEnable_bits  1
   153512 #define GEN75_MI_BATCH_BUFFER_START_PredicationEnable_bits  1
   153513 
   153514 static inline uint32_t ATTRIBUTE_PURE
   153515 MI_BATCH_BUFFER_START_PredicationEnable_bits(const struct gen_device_info *devinfo)
   153516 {
   153517    switch (devinfo->gen) {
   153518    case 10: return 1;
   153519    case 9: return 1;
   153520    case 8: return 1;
   153521    case 7:
   153522       if (devinfo->is_haswell) {
   153523          return 1;
   153524       } else {
   153525          return 0;
   153526       }
   153527    case 6: return 0;
   153528    case 5: return 0;
   153529    case 4:
   153530       if (devinfo->is_g4x) {
   153531          return 0;
   153532       } else {
   153533          return 0;
   153534       }
   153535    default:
   153536       unreachable("Invalid hardware generation");
   153537    }
   153538 }
   153539 
   153540 
   153541 
   153542 #define GEN10_MI_BATCH_BUFFER_START_PredicationEnable_start  15
   153543 #define GEN9_MI_BATCH_BUFFER_START_PredicationEnable_start  15
   153544 #define GEN8_MI_BATCH_BUFFER_START_PredicationEnable_start  15
   153545 #define GEN75_MI_BATCH_BUFFER_START_PredicationEnable_start  15
   153546 
   153547 static inline uint32_t ATTRIBUTE_PURE
   153548 MI_BATCH_BUFFER_START_PredicationEnable_start(const struct gen_device_info *devinfo)
   153549 {
   153550    switch (devinfo->gen) {
   153551    case 10: return 15;
   153552    case 9: return 15;
   153553    case 8: return 15;
   153554    case 7:
   153555       if (devinfo->is_haswell) {
   153556          return 15;
   153557       } else {
   153558          return 0;
   153559       }
   153560    case 6: return 0;
   153561    case 5: return 0;
   153562    case 4:
   153563       if (devinfo->is_g4x) {
   153564          return 0;
   153565       } else {
   153566          return 0;
   153567       }
   153568    default:
   153569       unreachable("Invalid hardware generation");
   153570    }
   153571 }
   153572 
   153573 
   153574 
   153575 /* MI_BATCH_BUFFER_START::Resource Streamer Enable */
   153576 
   153577 
   153578 #define GEN10_MI_BATCH_BUFFER_START_ResourceStreamerEnable_bits  1
   153579 #define GEN9_MI_BATCH_BUFFER_START_ResourceStreamerEnable_bits  1
   153580 #define GEN8_MI_BATCH_BUFFER_START_ResourceStreamerEnable_bits  1
   153581 #define GEN75_MI_BATCH_BUFFER_START_ResourceStreamerEnable_bits  1
   153582 
   153583 static inline uint32_t ATTRIBUTE_PURE
   153584 MI_BATCH_BUFFER_START_ResourceStreamerEnable_bits(const struct gen_device_info *devinfo)
   153585 {
   153586    switch (devinfo->gen) {
   153587    case 10: return 1;
   153588    case 9: return 1;
   153589    case 8: return 1;
   153590    case 7:
   153591       if (devinfo->is_haswell) {
   153592          return 1;
   153593       } else {
   153594          return 0;
   153595       }
   153596    case 6: return 0;
   153597    case 5: return 0;
   153598    case 4:
   153599       if (devinfo->is_g4x) {
   153600          return 0;
   153601       } else {
   153602          return 0;
   153603       }
   153604    default:
   153605       unreachable("Invalid hardware generation");
   153606    }
   153607 }
   153608 
   153609 
   153610 
   153611 #define GEN10_MI_BATCH_BUFFER_START_ResourceStreamerEnable_start  10
   153612 #define GEN9_MI_BATCH_BUFFER_START_ResourceStreamerEnable_start  10
   153613 #define GEN8_MI_BATCH_BUFFER_START_ResourceStreamerEnable_start  10
   153614 #define GEN75_MI_BATCH_BUFFER_START_ResourceStreamerEnable_start  10
   153615 
   153616 static inline uint32_t ATTRIBUTE_PURE
   153617 MI_BATCH_BUFFER_START_ResourceStreamerEnable_start(const struct gen_device_info *devinfo)
   153618 {
   153619    switch (devinfo->gen) {
   153620    case 10: return 10;
   153621    case 9: return 10;
   153622    case 8: return 10;
   153623    case 7:
   153624       if (devinfo->is_haswell) {
   153625          return 10;
   153626       } else {
   153627          return 0;
   153628       }
   153629    case 6: return 0;
   153630    case 5: return 0;
   153631    case 4:
   153632       if (devinfo->is_g4x) {
   153633          return 0;
   153634       } else {
   153635          return 0;
   153636       }
   153637    default:
   153638       unreachable("Invalid hardware generation");
   153639    }
   153640 }
   153641 
   153642 
   153643 
   153644 /* MI_BATCH_BUFFER_START::Second Level Batch Buffer */
   153645 
   153646 
   153647 #define GEN10_MI_BATCH_BUFFER_START_SecondLevelBatchBuffer_bits  1
   153648 #define GEN9_MI_BATCH_BUFFER_START_SecondLevelBatchBuffer_bits  1
   153649 
   153650 static inline uint32_t ATTRIBUTE_PURE
   153651 MI_BATCH_BUFFER_START_SecondLevelBatchBuffer_bits(const struct gen_device_info *devinfo)
   153652 {
   153653    switch (devinfo->gen) {
   153654    case 10: return 1;
   153655    case 9: return 1;
   153656    case 8: return 0;
   153657    case 7:
   153658       if (devinfo->is_haswell) {
   153659          return 0;
   153660       } else {
   153661          return 0;
   153662       }
   153663    case 6: return 0;
   153664    case 5: return 0;
   153665    case 4:
   153666       if (devinfo->is_g4x) {
   153667          return 0;
   153668       } else {
   153669          return 0;
   153670       }
   153671    default:
   153672       unreachable("Invalid hardware generation");
   153673    }
   153674 }
   153675 
   153676 
   153677 
   153678 #define GEN10_MI_BATCH_BUFFER_START_SecondLevelBatchBuffer_start  22
   153679 #define GEN9_MI_BATCH_BUFFER_START_SecondLevelBatchBuffer_start  22
   153680 
   153681 static inline uint32_t ATTRIBUTE_PURE
   153682 MI_BATCH_BUFFER_START_SecondLevelBatchBuffer_start(const struct gen_device_info *devinfo)
   153683 {
   153684    switch (devinfo->gen) {
   153685    case 10: return 22;
   153686    case 9: return 22;
   153687    case 8: return 0;
   153688    case 7:
   153689       if (devinfo->is_haswell) {
   153690          return 0;
   153691       } else {
   153692          return 0;
   153693       }
   153694    case 6: return 0;
   153695    case 5: return 0;
   153696    case 4:
   153697       if (devinfo->is_g4x) {
   153698          return 0;
   153699       } else {
   153700          return 0;
   153701       }
   153702    default:
   153703       unreachable("Invalid hardware generation");
   153704    }
   153705 }
   153706 
   153707 
   153708 
   153709 /* MI_CLFLUSH */
   153710 
   153711 
   153712 
   153713 
   153714 
   153715 /* MI_CLFLUSH::Command Type */
   153716 
   153717 
   153718 #define GEN10_MI_CLFLUSH_CommandType_bits  3
   153719 #define GEN9_MI_CLFLUSH_CommandType_bits  3
   153720 #define GEN8_MI_CLFLUSH_CommandType_bits  3
   153721 #define GEN75_MI_CLFLUSH_CommandType_bits  3
   153722 #define GEN7_MI_CLFLUSH_CommandType_bits  3
   153723 #define GEN6_MI_CLFLUSH_CommandType_bits  3
   153724 
   153725 static inline uint32_t ATTRIBUTE_PURE
   153726 MI_CLFLUSH_CommandType_bits(const struct gen_device_info *devinfo)
   153727 {
   153728    switch (devinfo->gen) {
   153729    case 10: return 3;
   153730    case 9: return 3;
   153731    case 8: return 3;
   153732    case 7:
   153733       if (devinfo->is_haswell) {
   153734          return 3;
   153735       } else {
   153736          return 3;
   153737       }
   153738    case 6: return 3;
   153739    case 5: return 0;
   153740    case 4:
   153741       if (devinfo->is_g4x) {
   153742          return 0;
   153743       } else {
   153744          return 0;
   153745       }
   153746    default:
   153747       unreachable("Invalid hardware generation");
   153748    }
   153749 }
   153750 
   153751 
   153752 
   153753 #define GEN10_MI_CLFLUSH_CommandType_start  29
   153754 #define GEN9_MI_CLFLUSH_CommandType_start  29
   153755 #define GEN8_MI_CLFLUSH_CommandType_start  29
   153756 #define GEN75_MI_CLFLUSH_CommandType_start  29
   153757 #define GEN7_MI_CLFLUSH_CommandType_start  29
   153758 #define GEN6_MI_CLFLUSH_CommandType_start  29
   153759 
   153760 static inline uint32_t ATTRIBUTE_PURE
   153761 MI_CLFLUSH_CommandType_start(const struct gen_device_info *devinfo)
   153762 {
   153763    switch (devinfo->gen) {
   153764    case 10: return 29;
   153765    case 9: return 29;
   153766    case 8: return 29;
   153767    case 7:
   153768       if (devinfo->is_haswell) {
   153769          return 29;
   153770       } else {
   153771          return 29;
   153772       }
   153773    case 6: return 29;
   153774    case 5: return 0;
   153775    case 4:
   153776       if (devinfo->is_g4x) {
   153777          return 0;
   153778       } else {
   153779          return 0;
   153780       }
   153781    default:
   153782       unreachable("Invalid hardware generation");
   153783    }
   153784 }
   153785 
   153786 
   153787 
   153788 /* MI_CLFLUSH::DW Representing a Half Cache Line */
   153789 
   153790 
   153791 #define GEN10_MI_CLFLUSH_DWRepresentingaHalfCacheLine_bits  32
   153792 #define GEN9_MI_CLFLUSH_DWRepresentingaHalfCacheLine_bits  32
   153793 #define GEN8_MI_CLFLUSH_DWRepresentingaHalfCacheLine_bits  32
   153794 #define GEN75_MI_CLFLUSH_DWRepresentingaHalfCacheLine_bits  32
   153795 #define GEN7_MI_CLFLUSH_DWRepresentingaHalfCacheLine_bits  32
   153796 #define GEN6_MI_CLFLUSH_DWRepresentingaHalfCacheLine_bits  32
   153797 
   153798 static inline uint32_t ATTRIBUTE_PURE
   153799 MI_CLFLUSH_DWRepresentingaHalfCacheLine_bits(const struct gen_device_info *devinfo)
   153800 {
   153801    switch (devinfo->gen) {
   153802    case 10: return 32;
   153803    case 9: return 32;
   153804    case 8: return 32;
   153805    case 7:
   153806       if (devinfo->is_haswell) {
   153807          return 32;
   153808       } else {
   153809          return 32;
   153810       }
   153811    case 6: return 32;
   153812    case 5: return 0;
   153813    case 4:
   153814       if (devinfo->is_g4x) {
   153815          return 0;
   153816       } else {
   153817          return 0;
   153818       }
   153819    default:
   153820       unreachable("Invalid hardware generation");
   153821    }
   153822 }
   153823 
   153824 
   153825 
   153826 #define GEN10_MI_CLFLUSH_DWRepresentingaHalfCacheLine_start  0
   153827 #define GEN9_MI_CLFLUSH_DWRepresentingaHalfCacheLine_start  0
   153828 #define GEN8_MI_CLFLUSH_DWRepresentingaHalfCacheLine_start  0
   153829 #define GEN75_MI_CLFLUSH_DWRepresentingaHalfCacheLine_start  0
   153830 #define GEN7_MI_CLFLUSH_DWRepresentingaHalfCacheLine_start  0
   153831 #define GEN6_MI_CLFLUSH_DWRepresentingaHalfCacheLine_start  0
   153832 
   153833 static inline uint32_t ATTRIBUTE_PURE
   153834 MI_CLFLUSH_DWRepresentingaHalfCacheLine_start(const struct gen_device_info *devinfo)
   153835 {
   153836    switch (devinfo->gen) {
   153837    case 10: return 0;
   153838    case 9: return 0;
   153839    case 8: return 0;
   153840    case 7:
   153841       if (devinfo->is_haswell) {
   153842          return 0;
   153843       } else {
   153844          return 0;
   153845       }
   153846    case 6: return 0;
   153847    case 5: return 0;
   153848    case 4:
   153849       if (devinfo->is_g4x) {
   153850          return 0;
   153851       } else {
   153852          return 0;
   153853       }
   153854    default:
   153855       unreachable("Invalid hardware generation");
   153856    }
   153857 }
   153858 
   153859 
   153860 
   153861 /* MI_CLFLUSH::DWord Length */
   153862 
   153863 
   153864 #define GEN10_MI_CLFLUSH_DWordLength_bits  10
   153865 #define GEN9_MI_CLFLUSH_DWordLength_bits  10
   153866 #define GEN8_MI_CLFLUSH_DWordLength_bits  10
   153867 #define GEN75_MI_CLFLUSH_DWordLength_bits  10
   153868 #define GEN7_MI_CLFLUSH_DWordLength_bits  10
   153869 #define GEN6_MI_CLFLUSH_DWordLength_bits  6
   153870 
   153871 static inline uint32_t ATTRIBUTE_PURE
   153872 MI_CLFLUSH_DWordLength_bits(const struct gen_device_info *devinfo)
   153873 {
   153874    switch (devinfo->gen) {
   153875    case 10: return 10;
   153876    case 9: return 10;
   153877    case 8: return 10;
   153878    case 7:
   153879       if (devinfo->is_haswell) {
   153880          return 10;
   153881       } else {
   153882          return 10;
   153883       }
   153884    case 6: return 6;
   153885    case 5: return 0;
   153886    case 4:
   153887       if (devinfo->is_g4x) {
   153888          return 0;
   153889       } else {
   153890          return 0;
   153891       }
   153892    default:
   153893       unreachable("Invalid hardware generation");
   153894    }
   153895 }
   153896 
   153897 
   153898 
   153899 #define GEN10_MI_CLFLUSH_DWordLength_start  0
   153900 #define GEN9_MI_CLFLUSH_DWordLength_start  0
   153901 #define GEN8_MI_CLFLUSH_DWordLength_start  0
   153902 #define GEN75_MI_CLFLUSH_DWordLength_start  0
   153903 #define GEN7_MI_CLFLUSH_DWordLength_start  0
   153904 #define GEN6_MI_CLFLUSH_DWordLength_start  0
   153905 
   153906 static inline uint32_t ATTRIBUTE_PURE
   153907 MI_CLFLUSH_DWordLength_start(const struct gen_device_info *devinfo)
   153908 {
   153909    switch (devinfo->gen) {
   153910    case 10: return 0;
   153911    case 9: return 0;
   153912    case 8: return 0;
   153913    case 7:
   153914       if (devinfo->is_haswell) {
   153915          return 0;
   153916       } else {
   153917          return 0;
   153918       }
   153919    case 6: return 0;
   153920    case 5: return 0;
   153921    case 4:
   153922       if (devinfo->is_g4x) {
   153923          return 0;
   153924       } else {
   153925          return 0;
   153926       }
   153927    default:
   153928       unreachable("Invalid hardware generation");
   153929    }
   153930 }
   153931 
   153932 
   153933 
   153934 /* MI_CLFLUSH::MI Command Opcode */
   153935 
   153936 
   153937 #define GEN10_MI_CLFLUSH_MICommandOpcode_bits  6
   153938 #define GEN9_MI_CLFLUSH_MICommandOpcode_bits  6
   153939 #define GEN8_MI_CLFLUSH_MICommandOpcode_bits  6
   153940 #define GEN75_MI_CLFLUSH_MICommandOpcode_bits  6
   153941 #define GEN7_MI_CLFLUSH_MICommandOpcode_bits  6
   153942 #define GEN6_MI_CLFLUSH_MICommandOpcode_bits  6
   153943 
   153944 static inline uint32_t ATTRIBUTE_PURE
   153945 MI_CLFLUSH_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   153946 {
   153947    switch (devinfo->gen) {
   153948    case 10: return 6;
   153949    case 9: return 6;
   153950    case 8: return 6;
   153951    case 7:
   153952       if (devinfo->is_haswell) {
   153953          return 6;
   153954       } else {
   153955          return 6;
   153956       }
   153957    case 6: return 6;
   153958    case 5: return 0;
   153959    case 4:
   153960       if (devinfo->is_g4x) {
   153961          return 0;
   153962       } else {
   153963          return 0;
   153964       }
   153965    default:
   153966       unreachable("Invalid hardware generation");
   153967    }
   153968 }
   153969 
   153970 
   153971 
   153972 #define GEN10_MI_CLFLUSH_MICommandOpcode_start  23
   153973 #define GEN9_MI_CLFLUSH_MICommandOpcode_start  23
   153974 #define GEN8_MI_CLFLUSH_MICommandOpcode_start  23
   153975 #define GEN75_MI_CLFLUSH_MICommandOpcode_start  23
   153976 #define GEN7_MI_CLFLUSH_MICommandOpcode_start  23
   153977 #define GEN6_MI_CLFLUSH_MICommandOpcode_start  23
   153978 
   153979 static inline uint32_t ATTRIBUTE_PURE
   153980 MI_CLFLUSH_MICommandOpcode_start(const struct gen_device_info *devinfo)
   153981 {
   153982    switch (devinfo->gen) {
   153983    case 10: return 23;
   153984    case 9: return 23;
   153985    case 8: return 23;
   153986    case 7:
   153987       if (devinfo->is_haswell) {
   153988          return 23;
   153989       } else {
   153990          return 23;
   153991       }
   153992    case 6: return 23;
   153993    case 5: return 0;
   153994    case 4:
   153995       if (devinfo->is_g4x) {
   153996          return 0;
   153997       } else {
   153998          return 0;
   153999       }
   154000    default:
   154001       unreachable("Invalid hardware generation");
   154002    }
   154003 }
   154004 
   154005 
   154006 
   154007 /* MI_CLFLUSH::Page Base Address */
   154008 
   154009 
   154010 #define GEN10_MI_CLFLUSH_PageBaseAddress_bits  36
   154011 #define GEN9_MI_CLFLUSH_PageBaseAddress_bits  36
   154012 #define GEN8_MI_CLFLUSH_PageBaseAddress_bits  36
   154013 #define GEN75_MI_CLFLUSH_PageBaseAddress_bits  20
   154014 #define GEN7_MI_CLFLUSH_PageBaseAddress_bits  20
   154015 #define GEN6_MI_CLFLUSH_PageBaseAddress_bits  20
   154016 
   154017 static inline uint32_t ATTRIBUTE_PURE
   154018 MI_CLFLUSH_PageBaseAddress_bits(const struct gen_device_info *devinfo)
   154019 {
   154020    switch (devinfo->gen) {
   154021    case 10: return 36;
   154022    case 9: return 36;
   154023    case 8: return 36;
   154024    case 7:
   154025       if (devinfo->is_haswell) {
   154026          return 20;
   154027       } else {
   154028          return 20;
   154029       }
   154030    case 6: return 20;
   154031    case 5: return 0;
   154032    case 4:
   154033       if (devinfo->is_g4x) {
   154034          return 0;
   154035       } else {
   154036          return 0;
   154037       }
   154038    default:
   154039       unreachable("Invalid hardware generation");
   154040    }
   154041 }
   154042 
   154043 
   154044 
   154045 #define GEN10_MI_CLFLUSH_PageBaseAddress_start  44
   154046 #define GEN9_MI_CLFLUSH_PageBaseAddress_start  44
   154047 #define GEN8_MI_CLFLUSH_PageBaseAddress_start  44
   154048 #define GEN75_MI_CLFLUSH_PageBaseAddress_start  44
   154049 #define GEN7_MI_CLFLUSH_PageBaseAddress_start  44
   154050 #define GEN6_MI_CLFLUSH_PageBaseAddress_start  44
   154051 
   154052 static inline uint32_t ATTRIBUTE_PURE
   154053 MI_CLFLUSH_PageBaseAddress_start(const struct gen_device_info *devinfo)
   154054 {
   154055    switch (devinfo->gen) {
   154056    case 10: return 44;
   154057    case 9: return 44;
   154058    case 8: return 44;
   154059    case 7:
   154060       if (devinfo->is_haswell) {
   154061          return 44;
   154062       } else {
   154063          return 44;
   154064       }
   154065    case 6: return 44;
   154066    case 5: return 0;
   154067    case 4:
   154068       if (devinfo->is_g4x) {
   154069          return 0;
   154070       } else {
   154071          return 0;
   154072       }
   154073    default:
   154074       unreachable("Invalid hardware generation");
   154075    }
   154076 }
   154077 
   154078 
   154079 
   154080 /* MI_CLFLUSH::Page Base Address High */
   154081 
   154082 
   154083 #define GEN75_MI_CLFLUSH_PageBaseAddressHigh_bits  16
   154084 #define GEN7_MI_CLFLUSH_PageBaseAddressHigh_bits  16
   154085 
   154086 static inline uint32_t ATTRIBUTE_PURE
   154087 MI_CLFLUSH_PageBaseAddressHigh_bits(const struct gen_device_info *devinfo)
   154088 {
   154089    switch (devinfo->gen) {
   154090    case 10: return 0;
   154091    case 9: return 0;
   154092    case 8: return 0;
   154093    case 7:
   154094       if (devinfo->is_haswell) {
   154095          return 16;
   154096       } else {
   154097          return 16;
   154098       }
   154099    case 6: return 0;
   154100    case 5: return 0;
   154101    case 4:
   154102       if (devinfo->is_g4x) {
   154103          return 0;
   154104       } else {
   154105          return 0;
   154106       }
   154107    default:
   154108       unreachable("Invalid hardware generation");
   154109    }
   154110 }
   154111 
   154112 
   154113 
   154114 #define GEN75_MI_CLFLUSH_PageBaseAddressHigh_start  64
   154115 #define GEN7_MI_CLFLUSH_PageBaseAddressHigh_start  64
   154116 
   154117 static inline uint32_t ATTRIBUTE_PURE
   154118 MI_CLFLUSH_PageBaseAddressHigh_start(const struct gen_device_info *devinfo)
   154119 {
   154120    switch (devinfo->gen) {
   154121    case 10: return 0;
   154122    case 9: return 0;
   154123    case 8: return 0;
   154124    case 7:
   154125       if (devinfo->is_haswell) {
   154126          return 64;
   154127       } else {
   154128          return 64;
   154129       }
   154130    case 6: return 0;
   154131    case 5: return 0;
   154132    case 4:
   154133       if (devinfo->is_g4x) {
   154134          return 0;
   154135       } else {
   154136          return 0;
   154137       }
   154138    default:
   154139       unreachable("Invalid hardware generation");
   154140    }
   154141 }
   154142 
   154143 
   154144 
   154145 /* MI_CLFLUSH::Starting Cacheline Offset */
   154146 
   154147 
   154148 #define GEN10_MI_CLFLUSH_StartingCachelineOffset_bits  6
   154149 #define GEN9_MI_CLFLUSH_StartingCachelineOffset_bits  6
   154150 #define GEN8_MI_CLFLUSH_StartingCachelineOffset_bits  6
   154151 #define GEN75_MI_CLFLUSH_StartingCachelineOffset_bits  6
   154152 #define GEN7_MI_CLFLUSH_StartingCachelineOffset_bits  6
   154153 #define GEN6_MI_CLFLUSH_StartingCachelineOffset_bits  6
   154154 
   154155 static inline uint32_t ATTRIBUTE_PURE
   154156 MI_CLFLUSH_StartingCachelineOffset_bits(const struct gen_device_info *devinfo)
   154157 {
   154158    switch (devinfo->gen) {
   154159    case 10: return 6;
   154160    case 9: return 6;
   154161    case 8: return 6;
   154162    case 7:
   154163       if (devinfo->is_haswell) {
   154164          return 6;
   154165       } else {
   154166          return 6;
   154167       }
   154168    case 6: return 6;
   154169    case 5: return 0;
   154170    case 4:
   154171       if (devinfo->is_g4x) {
   154172          return 0;
   154173       } else {
   154174          return 0;
   154175       }
   154176    default:
   154177       unreachable("Invalid hardware generation");
   154178    }
   154179 }
   154180 
   154181 
   154182 
   154183 #define GEN10_MI_CLFLUSH_StartingCachelineOffset_start  38
   154184 #define GEN9_MI_CLFLUSH_StartingCachelineOffset_start  38
   154185 #define GEN8_MI_CLFLUSH_StartingCachelineOffset_start  38
   154186 #define GEN75_MI_CLFLUSH_StartingCachelineOffset_start  38
   154187 #define GEN7_MI_CLFLUSH_StartingCachelineOffset_start  38
   154188 #define GEN6_MI_CLFLUSH_StartingCachelineOffset_start  38
   154189 
   154190 static inline uint32_t ATTRIBUTE_PURE
   154191 MI_CLFLUSH_StartingCachelineOffset_start(const struct gen_device_info *devinfo)
   154192 {
   154193    switch (devinfo->gen) {
   154194    case 10: return 38;
   154195    case 9: return 38;
   154196    case 8: return 38;
   154197    case 7:
   154198       if (devinfo->is_haswell) {
   154199          return 38;
   154200       } else {
   154201          return 38;
   154202       }
   154203    case 6: return 38;
   154204    case 5: return 0;
   154205    case 4:
   154206       if (devinfo->is_g4x) {
   154207          return 0;
   154208       } else {
   154209          return 0;
   154210       }
   154211    default:
   154212       unreachable("Invalid hardware generation");
   154213    }
   154214 }
   154215 
   154216 
   154217 
   154218 /* MI_CLFLUSH::Use Global GTT */
   154219 
   154220 
   154221 #define GEN10_MI_CLFLUSH_UseGlobalGTT_bits  1
   154222 #define GEN9_MI_CLFLUSH_UseGlobalGTT_bits  1
   154223 #define GEN8_MI_CLFLUSH_UseGlobalGTT_bits  1
   154224 #define GEN75_MI_CLFLUSH_UseGlobalGTT_bits  1
   154225 #define GEN7_MI_CLFLUSH_UseGlobalGTT_bits  1
   154226 #define GEN6_MI_CLFLUSH_UseGlobalGTT_bits  1
   154227 
   154228 static inline uint32_t ATTRIBUTE_PURE
   154229 MI_CLFLUSH_UseGlobalGTT_bits(const struct gen_device_info *devinfo)
   154230 {
   154231    switch (devinfo->gen) {
   154232    case 10: return 1;
   154233    case 9: return 1;
   154234    case 8: return 1;
   154235    case 7:
   154236       if (devinfo->is_haswell) {
   154237          return 1;
   154238       } else {
   154239          return 1;
   154240       }
   154241    case 6: return 1;
   154242    case 5: return 0;
   154243    case 4:
   154244       if (devinfo->is_g4x) {
   154245          return 0;
   154246       } else {
   154247          return 0;
   154248       }
   154249    default:
   154250       unreachable("Invalid hardware generation");
   154251    }
   154252 }
   154253 
   154254 
   154255 
   154256 #define GEN10_MI_CLFLUSH_UseGlobalGTT_start  22
   154257 #define GEN9_MI_CLFLUSH_UseGlobalGTT_start  22
   154258 #define GEN8_MI_CLFLUSH_UseGlobalGTT_start  22
   154259 #define GEN75_MI_CLFLUSH_UseGlobalGTT_start  22
   154260 #define GEN7_MI_CLFLUSH_UseGlobalGTT_start  22
   154261 #define GEN6_MI_CLFLUSH_UseGlobalGTT_start  22
   154262 
   154263 static inline uint32_t ATTRIBUTE_PURE
   154264 MI_CLFLUSH_UseGlobalGTT_start(const struct gen_device_info *devinfo)
   154265 {
   154266    switch (devinfo->gen) {
   154267    case 10: return 22;
   154268    case 9: return 22;
   154269    case 8: return 22;
   154270    case 7:
   154271       if (devinfo->is_haswell) {
   154272          return 22;
   154273       } else {
   154274          return 22;
   154275       }
   154276    case 6: return 22;
   154277    case 5: return 0;
   154278    case 4:
   154279       if (devinfo->is_g4x) {
   154280          return 0;
   154281       } else {
   154282          return 0;
   154283       }
   154284    default:
   154285       unreachable("Invalid hardware generation");
   154286    }
   154287 }
   154288 
   154289 
   154290 
   154291 /* MI_CONDITIONAL_BATCH_BUFFER_END */
   154292 
   154293 
   154294 #define GEN10_MI_CONDITIONAL_BATCH_BUFFER_END_length  4
   154295 #define GEN9_MI_CONDITIONAL_BATCH_BUFFER_END_length  4
   154296 #define GEN8_MI_CONDITIONAL_BATCH_BUFFER_END_length  3
   154297 #define GEN75_MI_CONDITIONAL_BATCH_BUFFER_END_length  2
   154298 #define GEN7_MI_CONDITIONAL_BATCH_BUFFER_END_length  2
   154299 #define GEN6_MI_CONDITIONAL_BATCH_BUFFER_END_length  2
   154300 
   154301 static inline uint32_t ATTRIBUTE_PURE
   154302 MI_CONDITIONAL_BATCH_BUFFER_END_length(const struct gen_device_info *devinfo)
   154303 {
   154304    switch (devinfo->gen) {
   154305    case 10: return 4;
   154306    case 9: return 4;
   154307    case 8: return 3;
   154308    case 7:
   154309       if (devinfo->is_haswell) {
   154310          return 2;
   154311       } else {
   154312          return 2;
   154313       }
   154314    case 6: return 2;
   154315    case 5: return 0;
   154316    case 4:
   154317       if (devinfo->is_g4x) {
   154318          return 0;
   154319       } else {
   154320          return 0;
   154321       }
   154322    default:
   154323       unreachable("Invalid hardware generation");
   154324    }
   154325 }
   154326 
   154327 
   154328 
   154329 /* MI_CONDITIONAL_BATCH_BUFFER_END::Command Type */
   154330 
   154331 
   154332 #define GEN10_MI_CONDITIONAL_BATCH_BUFFER_END_CommandType_bits  3
   154333 #define GEN9_MI_CONDITIONAL_BATCH_BUFFER_END_CommandType_bits  3
   154334 #define GEN8_MI_CONDITIONAL_BATCH_BUFFER_END_CommandType_bits  3
   154335 #define GEN75_MI_CONDITIONAL_BATCH_BUFFER_END_CommandType_bits  3
   154336 #define GEN7_MI_CONDITIONAL_BATCH_BUFFER_END_CommandType_bits  3
   154337 #define GEN6_MI_CONDITIONAL_BATCH_BUFFER_END_CommandType_bits  3
   154338 
   154339 static inline uint32_t ATTRIBUTE_PURE
   154340 MI_CONDITIONAL_BATCH_BUFFER_END_CommandType_bits(const struct gen_device_info *devinfo)
   154341 {
   154342    switch (devinfo->gen) {
   154343    case 10: return 3;
   154344    case 9: return 3;
   154345    case 8: return 3;
   154346    case 7:
   154347       if (devinfo->is_haswell) {
   154348          return 3;
   154349       } else {
   154350          return 3;
   154351       }
   154352    case 6: return 3;
   154353    case 5: return 0;
   154354    case 4:
   154355       if (devinfo->is_g4x) {
   154356          return 0;
   154357       } else {
   154358          return 0;
   154359       }
   154360    default:
   154361       unreachable("Invalid hardware generation");
   154362    }
   154363 }
   154364 
   154365 
   154366 
   154367 #define GEN10_MI_CONDITIONAL_BATCH_BUFFER_END_CommandType_start  29
   154368 #define GEN9_MI_CONDITIONAL_BATCH_BUFFER_END_CommandType_start  29
   154369 #define GEN8_MI_CONDITIONAL_BATCH_BUFFER_END_CommandType_start  29
   154370 #define GEN75_MI_CONDITIONAL_BATCH_BUFFER_END_CommandType_start  29
   154371 #define GEN7_MI_CONDITIONAL_BATCH_BUFFER_END_CommandType_start  29
   154372 #define GEN6_MI_CONDITIONAL_BATCH_BUFFER_END_CommandType_start  29
   154373 
   154374 static inline uint32_t ATTRIBUTE_PURE
   154375 MI_CONDITIONAL_BATCH_BUFFER_END_CommandType_start(const struct gen_device_info *devinfo)
   154376 {
   154377    switch (devinfo->gen) {
   154378    case 10: return 29;
   154379    case 9: return 29;
   154380    case 8: return 29;
   154381    case 7:
   154382       if (devinfo->is_haswell) {
   154383          return 29;
   154384       } else {
   154385          return 29;
   154386       }
   154387    case 6: return 29;
   154388    case 5: return 0;
   154389    case 4:
   154390       if (devinfo->is_g4x) {
   154391          return 0;
   154392       } else {
   154393          return 0;
   154394       }
   154395    default:
   154396       unreachable("Invalid hardware generation");
   154397    }
   154398 }
   154399 
   154400 
   154401 
   154402 /* MI_CONDITIONAL_BATCH_BUFFER_END::Compare Address */
   154403 
   154404 
   154405 #define GEN10_MI_CONDITIONAL_BATCH_BUFFER_END_CompareAddress_bits  61
   154406 #define GEN9_MI_CONDITIONAL_BATCH_BUFFER_END_CompareAddress_bits  61
   154407 #define GEN8_MI_CONDITIONAL_BATCH_BUFFER_END_CompareAddress_bits  45
   154408 #define GEN75_MI_CONDITIONAL_BATCH_BUFFER_END_CompareAddress_bits  29
   154409 #define GEN7_MI_CONDITIONAL_BATCH_BUFFER_END_CompareAddress_bits  29
   154410 #define GEN6_MI_CONDITIONAL_BATCH_BUFFER_END_CompareAddress_bits  29
   154411 
   154412 static inline uint32_t ATTRIBUTE_PURE
   154413 MI_CONDITIONAL_BATCH_BUFFER_END_CompareAddress_bits(const struct gen_device_info *devinfo)
   154414 {
   154415    switch (devinfo->gen) {
   154416    case 10: return 61;
   154417    case 9: return 61;
   154418    case 8: return 45;
   154419    case 7:
   154420       if (devinfo->is_haswell) {
   154421          return 29;
   154422       } else {
   154423          return 29;
   154424       }
   154425    case 6: return 29;
   154426    case 5: return 0;
   154427    case 4:
   154428       if (devinfo->is_g4x) {
   154429          return 0;
   154430       } else {
   154431          return 0;
   154432       }
   154433    default:
   154434       unreachable("Invalid hardware generation");
   154435    }
   154436 }
   154437 
   154438 
   154439 
   154440 #define GEN10_MI_CONDITIONAL_BATCH_BUFFER_END_CompareAddress_start  67
   154441 #define GEN9_MI_CONDITIONAL_BATCH_BUFFER_END_CompareAddress_start  67
   154442 #define GEN8_MI_CONDITIONAL_BATCH_BUFFER_END_CompareAddress_start  67
   154443 #define GEN75_MI_CONDITIONAL_BATCH_BUFFER_END_CompareAddress_start  67
   154444 #define GEN7_MI_CONDITIONAL_BATCH_BUFFER_END_CompareAddress_start  67
   154445 #define GEN6_MI_CONDITIONAL_BATCH_BUFFER_END_CompareAddress_start  67
   154446 
   154447 static inline uint32_t ATTRIBUTE_PURE
   154448 MI_CONDITIONAL_BATCH_BUFFER_END_CompareAddress_start(const struct gen_device_info *devinfo)
   154449 {
   154450    switch (devinfo->gen) {
   154451    case 10: return 67;
   154452    case 9: return 67;
   154453    case 8: return 67;
   154454    case 7:
   154455       if (devinfo->is_haswell) {
   154456          return 67;
   154457       } else {
   154458          return 67;
   154459       }
   154460    case 6: return 67;
   154461    case 5: return 0;
   154462    case 4:
   154463       if (devinfo->is_g4x) {
   154464          return 0;
   154465       } else {
   154466          return 0;
   154467       }
   154468    default:
   154469       unreachable("Invalid hardware generation");
   154470    }
   154471 }
   154472 
   154473 
   154474 
   154475 /* MI_CONDITIONAL_BATCH_BUFFER_END::Compare Data Dword */
   154476 
   154477 
   154478 #define GEN10_MI_CONDITIONAL_BATCH_BUFFER_END_CompareDataDword_bits  32
   154479 #define GEN9_MI_CONDITIONAL_BATCH_BUFFER_END_CompareDataDword_bits  32
   154480 #define GEN8_MI_CONDITIONAL_BATCH_BUFFER_END_CompareDataDword_bits  32
   154481 #define GEN75_MI_CONDITIONAL_BATCH_BUFFER_END_CompareDataDword_bits  32
   154482 #define GEN7_MI_CONDITIONAL_BATCH_BUFFER_END_CompareDataDword_bits  32
   154483 #define GEN6_MI_CONDITIONAL_BATCH_BUFFER_END_CompareDataDword_bits  32
   154484 
   154485 static inline uint32_t ATTRIBUTE_PURE
   154486 MI_CONDITIONAL_BATCH_BUFFER_END_CompareDataDword_bits(const struct gen_device_info *devinfo)
   154487 {
   154488    switch (devinfo->gen) {
   154489    case 10: return 32;
   154490    case 9: return 32;
   154491    case 8: return 32;
   154492    case 7:
   154493       if (devinfo->is_haswell) {
   154494          return 32;
   154495       } else {
   154496          return 32;
   154497       }
   154498    case 6: return 32;
   154499    case 5: return 0;
   154500    case 4:
   154501       if (devinfo->is_g4x) {
   154502          return 0;
   154503       } else {
   154504          return 0;
   154505       }
   154506    default:
   154507       unreachable("Invalid hardware generation");
   154508    }
   154509 }
   154510 
   154511 
   154512 
   154513 #define GEN10_MI_CONDITIONAL_BATCH_BUFFER_END_CompareDataDword_start  32
   154514 #define GEN9_MI_CONDITIONAL_BATCH_BUFFER_END_CompareDataDword_start  32
   154515 #define GEN8_MI_CONDITIONAL_BATCH_BUFFER_END_CompareDataDword_start  32
   154516 #define GEN75_MI_CONDITIONAL_BATCH_BUFFER_END_CompareDataDword_start  32
   154517 #define GEN7_MI_CONDITIONAL_BATCH_BUFFER_END_CompareDataDword_start  32
   154518 #define GEN6_MI_CONDITIONAL_BATCH_BUFFER_END_CompareDataDword_start  32
   154519 
   154520 static inline uint32_t ATTRIBUTE_PURE
   154521 MI_CONDITIONAL_BATCH_BUFFER_END_CompareDataDword_start(const struct gen_device_info *devinfo)
   154522 {
   154523    switch (devinfo->gen) {
   154524    case 10: return 32;
   154525    case 9: return 32;
   154526    case 8: return 32;
   154527    case 7:
   154528       if (devinfo->is_haswell) {
   154529          return 32;
   154530       } else {
   154531          return 32;
   154532       }
   154533    case 6: return 32;
   154534    case 5: return 0;
   154535    case 4:
   154536       if (devinfo->is_g4x) {
   154537          return 0;
   154538       } else {
   154539          return 0;
   154540       }
   154541    default:
   154542       unreachable("Invalid hardware generation");
   154543    }
   154544 }
   154545 
   154546 
   154547 
   154548 /* MI_CONDITIONAL_BATCH_BUFFER_END::Compare Mask Mode */
   154549 
   154550 
   154551 #define GEN10_MI_CONDITIONAL_BATCH_BUFFER_END_CompareMaskMode_bits  1
   154552 #define GEN9_MI_CONDITIONAL_BATCH_BUFFER_END_CompareMaskMode_bits  1
   154553 
   154554 static inline uint32_t ATTRIBUTE_PURE
   154555 MI_CONDITIONAL_BATCH_BUFFER_END_CompareMaskMode_bits(const struct gen_device_info *devinfo)
   154556 {
   154557    switch (devinfo->gen) {
   154558    case 10: return 1;
   154559    case 9: return 1;
   154560    case 8: return 0;
   154561    case 7:
   154562       if (devinfo->is_haswell) {
   154563          return 0;
   154564       } else {
   154565          return 0;
   154566       }
   154567    case 6: return 0;
   154568    case 5: return 0;
   154569    case 4:
   154570       if (devinfo->is_g4x) {
   154571          return 0;
   154572       } else {
   154573          return 0;
   154574       }
   154575    default:
   154576       unreachable("Invalid hardware generation");
   154577    }
   154578 }
   154579 
   154580 
   154581 
   154582 #define GEN10_MI_CONDITIONAL_BATCH_BUFFER_END_CompareMaskMode_start  19
   154583 #define GEN9_MI_CONDITIONAL_BATCH_BUFFER_END_CompareMaskMode_start  19
   154584 
   154585 static inline uint32_t ATTRIBUTE_PURE
   154586 MI_CONDITIONAL_BATCH_BUFFER_END_CompareMaskMode_start(const struct gen_device_info *devinfo)
   154587 {
   154588    switch (devinfo->gen) {
   154589    case 10: return 19;
   154590    case 9: return 19;
   154591    case 8: return 0;
   154592    case 7:
   154593       if (devinfo->is_haswell) {
   154594          return 0;
   154595       } else {
   154596          return 0;
   154597       }
   154598    case 6: return 0;
   154599    case 5: return 0;
   154600    case 4:
   154601       if (devinfo->is_g4x) {
   154602          return 0;
   154603       } else {
   154604          return 0;
   154605       }
   154606    default:
   154607       unreachable("Invalid hardware generation");
   154608    }
   154609 }
   154610 
   154611 
   154612 
   154613 /* MI_CONDITIONAL_BATCH_BUFFER_END::Compare Semaphore */
   154614 
   154615 
   154616 #define GEN10_MI_CONDITIONAL_BATCH_BUFFER_END_CompareSemaphore_bits  1
   154617 #define GEN9_MI_CONDITIONAL_BATCH_BUFFER_END_CompareSemaphore_bits  1
   154618 #define GEN8_MI_CONDITIONAL_BATCH_BUFFER_END_CompareSemaphore_bits  1
   154619 #define GEN75_MI_CONDITIONAL_BATCH_BUFFER_END_CompareSemaphore_bits  1
   154620 #define GEN7_MI_CONDITIONAL_BATCH_BUFFER_END_CompareSemaphore_bits  1
   154621 #define GEN6_MI_CONDITIONAL_BATCH_BUFFER_END_CompareSemaphore_bits  1
   154622 
   154623 static inline uint32_t ATTRIBUTE_PURE
   154624 MI_CONDITIONAL_BATCH_BUFFER_END_CompareSemaphore_bits(const struct gen_device_info *devinfo)
   154625 {
   154626    switch (devinfo->gen) {
   154627    case 10: return 1;
   154628    case 9: return 1;
   154629    case 8: return 1;
   154630    case 7:
   154631       if (devinfo->is_haswell) {
   154632          return 1;
   154633       } else {
   154634          return 1;
   154635       }
   154636    case 6: return 1;
   154637    case 5: return 0;
   154638    case 4:
   154639       if (devinfo->is_g4x) {
   154640          return 0;
   154641       } else {
   154642          return 0;
   154643       }
   154644    default:
   154645       unreachable("Invalid hardware generation");
   154646    }
   154647 }
   154648 
   154649 
   154650 
   154651 #define GEN10_MI_CONDITIONAL_BATCH_BUFFER_END_CompareSemaphore_start  21
   154652 #define GEN9_MI_CONDITIONAL_BATCH_BUFFER_END_CompareSemaphore_start  21
   154653 #define GEN8_MI_CONDITIONAL_BATCH_BUFFER_END_CompareSemaphore_start  21
   154654 #define GEN75_MI_CONDITIONAL_BATCH_BUFFER_END_CompareSemaphore_start  21
   154655 #define GEN7_MI_CONDITIONAL_BATCH_BUFFER_END_CompareSemaphore_start  21
   154656 #define GEN6_MI_CONDITIONAL_BATCH_BUFFER_END_CompareSemaphore_start  21
   154657 
   154658 static inline uint32_t ATTRIBUTE_PURE
   154659 MI_CONDITIONAL_BATCH_BUFFER_END_CompareSemaphore_start(const struct gen_device_info *devinfo)
   154660 {
   154661    switch (devinfo->gen) {
   154662    case 10: return 21;
   154663    case 9: return 21;
   154664    case 8: return 21;
   154665    case 7:
   154666       if (devinfo->is_haswell) {
   154667          return 21;
   154668       } else {
   154669          return 21;
   154670       }
   154671    case 6: return 21;
   154672    case 5: return 0;
   154673    case 4:
   154674       if (devinfo->is_g4x) {
   154675          return 0;
   154676       } else {
   154677          return 0;
   154678       }
   154679    default:
   154680       unreachable("Invalid hardware generation");
   154681    }
   154682 }
   154683 
   154684 
   154685 
   154686 /* MI_CONDITIONAL_BATCH_BUFFER_END::DWord Length */
   154687 
   154688 
   154689 #define GEN10_MI_CONDITIONAL_BATCH_BUFFER_END_DWordLength_bits  8
   154690 #define GEN9_MI_CONDITIONAL_BATCH_BUFFER_END_DWordLength_bits  8
   154691 #define GEN8_MI_CONDITIONAL_BATCH_BUFFER_END_DWordLength_bits  8
   154692 #define GEN75_MI_CONDITIONAL_BATCH_BUFFER_END_DWordLength_bits  8
   154693 #define GEN7_MI_CONDITIONAL_BATCH_BUFFER_END_DWordLength_bits  8
   154694 #define GEN6_MI_CONDITIONAL_BATCH_BUFFER_END_DWordLength_bits  8
   154695 
   154696 static inline uint32_t ATTRIBUTE_PURE
   154697 MI_CONDITIONAL_BATCH_BUFFER_END_DWordLength_bits(const struct gen_device_info *devinfo)
   154698 {
   154699    switch (devinfo->gen) {
   154700    case 10: return 8;
   154701    case 9: return 8;
   154702    case 8: return 8;
   154703    case 7:
   154704       if (devinfo->is_haswell) {
   154705          return 8;
   154706       } else {
   154707          return 8;
   154708       }
   154709    case 6: return 8;
   154710    case 5: return 0;
   154711    case 4:
   154712       if (devinfo->is_g4x) {
   154713          return 0;
   154714       } else {
   154715          return 0;
   154716       }
   154717    default:
   154718       unreachable("Invalid hardware generation");
   154719    }
   154720 }
   154721 
   154722 
   154723 
   154724 #define GEN10_MI_CONDITIONAL_BATCH_BUFFER_END_DWordLength_start  0
   154725 #define GEN9_MI_CONDITIONAL_BATCH_BUFFER_END_DWordLength_start  0
   154726 #define GEN8_MI_CONDITIONAL_BATCH_BUFFER_END_DWordLength_start  0
   154727 #define GEN75_MI_CONDITIONAL_BATCH_BUFFER_END_DWordLength_start  0
   154728 #define GEN7_MI_CONDITIONAL_BATCH_BUFFER_END_DWordLength_start  0
   154729 #define GEN6_MI_CONDITIONAL_BATCH_BUFFER_END_DWordLength_start  0
   154730 
   154731 static inline uint32_t ATTRIBUTE_PURE
   154732 MI_CONDITIONAL_BATCH_BUFFER_END_DWordLength_start(const struct gen_device_info *devinfo)
   154733 {
   154734    switch (devinfo->gen) {
   154735    case 10: return 0;
   154736    case 9: return 0;
   154737    case 8: return 0;
   154738    case 7:
   154739       if (devinfo->is_haswell) {
   154740          return 0;
   154741       } else {
   154742          return 0;
   154743       }
   154744    case 6: return 0;
   154745    case 5: return 0;
   154746    case 4:
   154747       if (devinfo->is_g4x) {
   154748          return 0;
   154749       } else {
   154750          return 0;
   154751       }
   154752    default:
   154753       unreachable("Invalid hardware generation");
   154754    }
   154755 }
   154756 
   154757 
   154758 
   154759 /* MI_CONDITIONAL_BATCH_BUFFER_END::MI Command Opcode */
   154760 
   154761 
   154762 #define GEN10_MI_CONDITIONAL_BATCH_BUFFER_END_MICommandOpcode_bits  6
   154763 #define GEN9_MI_CONDITIONAL_BATCH_BUFFER_END_MICommandOpcode_bits  6
   154764 #define GEN8_MI_CONDITIONAL_BATCH_BUFFER_END_MICommandOpcode_bits  6
   154765 #define GEN75_MI_CONDITIONAL_BATCH_BUFFER_END_MICommandOpcode_bits  6
   154766 #define GEN7_MI_CONDITIONAL_BATCH_BUFFER_END_MICommandOpcode_bits  6
   154767 #define GEN6_MI_CONDITIONAL_BATCH_BUFFER_END_MICommandOpcode_bits  6
   154768 
   154769 static inline uint32_t ATTRIBUTE_PURE
   154770 MI_CONDITIONAL_BATCH_BUFFER_END_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   154771 {
   154772    switch (devinfo->gen) {
   154773    case 10: return 6;
   154774    case 9: return 6;
   154775    case 8: return 6;
   154776    case 7:
   154777       if (devinfo->is_haswell) {
   154778          return 6;
   154779       } else {
   154780          return 6;
   154781       }
   154782    case 6: return 6;
   154783    case 5: return 0;
   154784    case 4:
   154785       if (devinfo->is_g4x) {
   154786          return 0;
   154787       } else {
   154788          return 0;
   154789       }
   154790    default:
   154791       unreachable("Invalid hardware generation");
   154792    }
   154793 }
   154794 
   154795 
   154796 
   154797 #define GEN10_MI_CONDITIONAL_BATCH_BUFFER_END_MICommandOpcode_start  23
   154798 #define GEN9_MI_CONDITIONAL_BATCH_BUFFER_END_MICommandOpcode_start  23
   154799 #define GEN8_MI_CONDITIONAL_BATCH_BUFFER_END_MICommandOpcode_start  23
   154800 #define GEN75_MI_CONDITIONAL_BATCH_BUFFER_END_MICommandOpcode_start  23
   154801 #define GEN7_MI_CONDITIONAL_BATCH_BUFFER_END_MICommandOpcode_start  23
   154802 #define GEN6_MI_CONDITIONAL_BATCH_BUFFER_END_MICommandOpcode_start  23
   154803 
   154804 static inline uint32_t ATTRIBUTE_PURE
   154805 MI_CONDITIONAL_BATCH_BUFFER_END_MICommandOpcode_start(const struct gen_device_info *devinfo)
   154806 {
   154807    switch (devinfo->gen) {
   154808    case 10: return 23;
   154809    case 9: return 23;
   154810    case 8: return 23;
   154811    case 7:
   154812       if (devinfo->is_haswell) {
   154813          return 23;
   154814       } else {
   154815          return 23;
   154816       }
   154817    case 6: return 23;
   154818    case 5: return 0;
   154819    case 4:
   154820       if (devinfo->is_g4x) {
   154821          return 0;
   154822       } else {
   154823          return 0;
   154824       }
   154825    default:
   154826       unreachable("Invalid hardware generation");
   154827    }
   154828 }
   154829 
   154830 
   154831 
   154832 /* MI_CONDITIONAL_BATCH_BUFFER_END::Use Global GTT */
   154833 
   154834 
   154835 #define GEN10_MI_CONDITIONAL_BATCH_BUFFER_END_UseGlobalGTT_bits  1
   154836 #define GEN9_MI_CONDITIONAL_BATCH_BUFFER_END_UseGlobalGTT_bits  1
   154837 #define GEN8_MI_CONDITIONAL_BATCH_BUFFER_END_UseGlobalGTT_bits  1
   154838 #define GEN75_MI_CONDITIONAL_BATCH_BUFFER_END_UseGlobalGTT_bits  1
   154839 #define GEN7_MI_CONDITIONAL_BATCH_BUFFER_END_UseGlobalGTT_bits  1
   154840 #define GEN6_MI_CONDITIONAL_BATCH_BUFFER_END_UseGlobalGTT_bits  1
   154841 
   154842 static inline uint32_t ATTRIBUTE_PURE
   154843 MI_CONDITIONAL_BATCH_BUFFER_END_UseGlobalGTT_bits(const struct gen_device_info *devinfo)
   154844 {
   154845    switch (devinfo->gen) {
   154846    case 10: return 1;
   154847    case 9: return 1;
   154848    case 8: return 1;
   154849    case 7:
   154850       if (devinfo->is_haswell) {
   154851          return 1;
   154852       } else {
   154853          return 1;
   154854       }
   154855    case 6: return 1;
   154856    case 5: return 0;
   154857    case 4:
   154858       if (devinfo->is_g4x) {
   154859          return 0;
   154860       } else {
   154861          return 0;
   154862       }
   154863    default:
   154864       unreachable("Invalid hardware generation");
   154865    }
   154866 }
   154867 
   154868 
   154869 
   154870 #define GEN10_MI_CONDITIONAL_BATCH_BUFFER_END_UseGlobalGTT_start  22
   154871 #define GEN9_MI_CONDITIONAL_BATCH_BUFFER_END_UseGlobalGTT_start  22
   154872 #define GEN8_MI_CONDITIONAL_BATCH_BUFFER_END_UseGlobalGTT_start  22
   154873 #define GEN75_MI_CONDITIONAL_BATCH_BUFFER_END_UseGlobalGTT_start  22
   154874 #define GEN7_MI_CONDITIONAL_BATCH_BUFFER_END_UseGlobalGTT_start  22
   154875 #define GEN6_MI_CONDITIONAL_BATCH_BUFFER_END_UseGlobalGTT_start  22
   154876 
   154877 static inline uint32_t ATTRIBUTE_PURE
   154878 MI_CONDITIONAL_BATCH_BUFFER_END_UseGlobalGTT_start(const struct gen_device_info *devinfo)
   154879 {
   154880    switch (devinfo->gen) {
   154881    case 10: return 22;
   154882    case 9: return 22;
   154883    case 8: return 22;
   154884    case 7:
   154885       if (devinfo->is_haswell) {
   154886          return 22;
   154887       } else {
   154888          return 22;
   154889       }
   154890    case 6: return 22;
   154891    case 5: return 0;
   154892    case 4:
   154893       if (devinfo->is_g4x) {
   154894          return 0;
   154895       } else {
   154896          return 0;
   154897       }
   154898    default:
   154899       unreachable("Invalid hardware generation");
   154900    }
   154901 }
   154902 
   154903 
   154904 
   154905 /* MI_COPY_MEM_MEM */
   154906 
   154907 
   154908 #define GEN10_MI_COPY_MEM_MEM_length  5
   154909 #define GEN9_MI_COPY_MEM_MEM_length  5
   154910 #define GEN8_MI_COPY_MEM_MEM_length  5
   154911 
   154912 static inline uint32_t ATTRIBUTE_PURE
   154913 MI_COPY_MEM_MEM_length(const struct gen_device_info *devinfo)
   154914 {
   154915    switch (devinfo->gen) {
   154916    case 10: return 5;
   154917    case 9: return 5;
   154918    case 8: return 5;
   154919    case 7:
   154920       if (devinfo->is_haswell) {
   154921          return 0;
   154922       } else {
   154923          return 0;
   154924       }
   154925    case 6: return 0;
   154926    case 5: return 0;
   154927    case 4:
   154928       if (devinfo->is_g4x) {
   154929          return 0;
   154930       } else {
   154931          return 0;
   154932       }
   154933    default:
   154934       unreachable("Invalid hardware generation");
   154935    }
   154936 }
   154937 
   154938 
   154939 
   154940 /* MI_COPY_MEM_MEM::Command Type */
   154941 
   154942 
   154943 #define GEN10_MI_COPY_MEM_MEM_CommandType_bits  3
   154944 #define GEN9_MI_COPY_MEM_MEM_CommandType_bits  3
   154945 #define GEN8_MI_COPY_MEM_MEM_CommandType_bits  3
   154946 
   154947 static inline uint32_t ATTRIBUTE_PURE
   154948 MI_COPY_MEM_MEM_CommandType_bits(const struct gen_device_info *devinfo)
   154949 {
   154950    switch (devinfo->gen) {
   154951    case 10: return 3;
   154952    case 9: return 3;
   154953    case 8: return 3;
   154954    case 7:
   154955       if (devinfo->is_haswell) {
   154956          return 0;
   154957       } else {
   154958          return 0;
   154959       }
   154960    case 6: return 0;
   154961    case 5: return 0;
   154962    case 4:
   154963       if (devinfo->is_g4x) {
   154964          return 0;
   154965       } else {
   154966          return 0;
   154967       }
   154968    default:
   154969       unreachable("Invalid hardware generation");
   154970    }
   154971 }
   154972 
   154973 
   154974 
   154975 #define GEN10_MI_COPY_MEM_MEM_CommandType_start  29
   154976 #define GEN9_MI_COPY_MEM_MEM_CommandType_start  29
   154977 #define GEN8_MI_COPY_MEM_MEM_CommandType_start  29
   154978 
   154979 static inline uint32_t ATTRIBUTE_PURE
   154980 MI_COPY_MEM_MEM_CommandType_start(const struct gen_device_info *devinfo)
   154981 {
   154982    switch (devinfo->gen) {
   154983    case 10: return 29;
   154984    case 9: return 29;
   154985    case 8: return 29;
   154986    case 7:
   154987       if (devinfo->is_haswell) {
   154988          return 0;
   154989       } else {
   154990          return 0;
   154991       }
   154992    case 6: return 0;
   154993    case 5: return 0;
   154994    case 4:
   154995       if (devinfo->is_g4x) {
   154996          return 0;
   154997       } else {
   154998          return 0;
   154999       }
   155000    default:
   155001       unreachable("Invalid hardware generation");
   155002    }
   155003 }
   155004 
   155005 
   155006 
   155007 /* MI_COPY_MEM_MEM::DWord Length */
   155008 
   155009 
   155010 #define GEN10_MI_COPY_MEM_MEM_DWordLength_bits  8
   155011 #define GEN9_MI_COPY_MEM_MEM_DWordLength_bits  8
   155012 #define GEN8_MI_COPY_MEM_MEM_DWordLength_bits  8
   155013 
   155014 static inline uint32_t ATTRIBUTE_PURE
   155015 MI_COPY_MEM_MEM_DWordLength_bits(const struct gen_device_info *devinfo)
   155016 {
   155017    switch (devinfo->gen) {
   155018    case 10: return 8;
   155019    case 9: return 8;
   155020    case 8: return 8;
   155021    case 7:
   155022       if (devinfo->is_haswell) {
   155023          return 0;
   155024       } else {
   155025          return 0;
   155026       }
   155027    case 6: return 0;
   155028    case 5: return 0;
   155029    case 4:
   155030       if (devinfo->is_g4x) {
   155031          return 0;
   155032       } else {
   155033          return 0;
   155034       }
   155035    default:
   155036       unreachable("Invalid hardware generation");
   155037    }
   155038 }
   155039 
   155040 
   155041 
   155042 #define GEN10_MI_COPY_MEM_MEM_DWordLength_start  0
   155043 #define GEN9_MI_COPY_MEM_MEM_DWordLength_start  0
   155044 #define GEN8_MI_COPY_MEM_MEM_DWordLength_start  0
   155045 
   155046 static inline uint32_t ATTRIBUTE_PURE
   155047 MI_COPY_MEM_MEM_DWordLength_start(const struct gen_device_info *devinfo)
   155048 {
   155049    switch (devinfo->gen) {
   155050    case 10: return 0;
   155051    case 9: return 0;
   155052    case 8: return 0;
   155053    case 7:
   155054       if (devinfo->is_haswell) {
   155055          return 0;
   155056       } else {
   155057          return 0;
   155058       }
   155059    case 6: return 0;
   155060    case 5: return 0;
   155061    case 4:
   155062       if (devinfo->is_g4x) {
   155063          return 0;
   155064       } else {
   155065          return 0;
   155066       }
   155067    default:
   155068       unreachable("Invalid hardware generation");
   155069    }
   155070 }
   155071 
   155072 
   155073 
   155074 /* MI_COPY_MEM_MEM::Destination Memory Address */
   155075 
   155076 
   155077 #define GEN10_MI_COPY_MEM_MEM_DestinationMemoryAddress_bits  62
   155078 #define GEN9_MI_COPY_MEM_MEM_DestinationMemoryAddress_bits  62
   155079 #define GEN8_MI_COPY_MEM_MEM_DestinationMemoryAddress_bits  62
   155080 
   155081 static inline uint32_t ATTRIBUTE_PURE
   155082 MI_COPY_MEM_MEM_DestinationMemoryAddress_bits(const struct gen_device_info *devinfo)
   155083 {
   155084    switch (devinfo->gen) {
   155085    case 10: return 62;
   155086    case 9: return 62;
   155087    case 8: return 62;
   155088    case 7:
   155089       if (devinfo->is_haswell) {
   155090          return 0;
   155091       } else {
   155092          return 0;
   155093       }
   155094    case 6: return 0;
   155095    case 5: return 0;
   155096    case 4:
   155097       if (devinfo->is_g4x) {
   155098          return 0;
   155099       } else {
   155100          return 0;
   155101       }
   155102    default:
   155103       unreachable("Invalid hardware generation");
   155104    }
   155105 }
   155106 
   155107 
   155108 
   155109 #define GEN10_MI_COPY_MEM_MEM_DestinationMemoryAddress_start  34
   155110 #define GEN9_MI_COPY_MEM_MEM_DestinationMemoryAddress_start  34
   155111 #define GEN8_MI_COPY_MEM_MEM_DestinationMemoryAddress_start  34
   155112 
   155113 static inline uint32_t ATTRIBUTE_PURE
   155114 MI_COPY_MEM_MEM_DestinationMemoryAddress_start(const struct gen_device_info *devinfo)
   155115 {
   155116    switch (devinfo->gen) {
   155117    case 10: return 34;
   155118    case 9: return 34;
   155119    case 8: return 34;
   155120    case 7:
   155121       if (devinfo->is_haswell) {
   155122          return 0;
   155123       } else {
   155124          return 0;
   155125       }
   155126    case 6: return 0;
   155127    case 5: return 0;
   155128    case 4:
   155129       if (devinfo->is_g4x) {
   155130          return 0;
   155131       } else {
   155132          return 0;
   155133       }
   155134    default:
   155135       unreachable("Invalid hardware generation");
   155136    }
   155137 }
   155138 
   155139 
   155140 
   155141 /* MI_COPY_MEM_MEM::MI Command Opcode */
   155142 
   155143 
   155144 #define GEN10_MI_COPY_MEM_MEM_MICommandOpcode_bits  6
   155145 #define GEN9_MI_COPY_MEM_MEM_MICommandOpcode_bits  6
   155146 #define GEN8_MI_COPY_MEM_MEM_MICommandOpcode_bits  6
   155147 
   155148 static inline uint32_t ATTRIBUTE_PURE
   155149 MI_COPY_MEM_MEM_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   155150 {
   155151    switch (devinfo->gen) {
   155152    case 10: return 6;
   155153    case 9: return 6;
   155154    case 8: return 6;
   155155    case 7:
   155156       if (devinfo->is_haswell) {
   155157          return 0;
   155158       } else {
   155159          return 0;
   155160       }
   155161    case 6: return 0;
   155162    case 5: return 0;
   155163    case 4:
   155164       if (devinfo->is_g4x) {
   155165          return 0;
   155166       } else {
   155167          return 0;
   155168       }
   155169    default:
   155170       unreachable("Invalid hardware generation");
   155171    }
   155172 }
   155173 
   155174 
   155175 
   155176 #define GEN10_MI_COPY_MEM_MEM_MICommandOpcode_start  23
   155177 #define GEN9_MI_COPY_MEM_MEM_MICommandOpcode_start  23
   155178 #define GEN8_MI_COPY_MEM_MEM_MICommandOpcode_start  23
   155179 
   155180 static inline uint32_t ATTRIBUTE_PURE
   155181 MI_COPY_MEM_MEM_MICommandOpcode_start(const struct gen_device_info *devinfo)
   155182 {
   155183    switch (devinfo->gen) {
   155184    case 10: return 23;
   155185    case 9: return 23;
   155186    case 8: return 23;
   155187    case 7:
   155188       if (devinfo->is_haswell) {
   155189          return 0;
   155190       } else {
   155191          return 0;
   155192       }
   155193    case 6: return 0;
   155194    case 5: return 0;
   155195    case 4:
   155196       if (devinfo->is_g4x) {
   155197          return 0;
   155198       } else {
   155199          return 0;
   155200       }
   155201    default:
   155202       unreachable("Invalid hardware generation");
   155203    }
   155204 }
   155205 
   155206 
   155207 
   155208 /* MI_COPY_MEM_MEM::Source Memory Address */
   155209 
   155210 
   155211 #define GEN10_MI_COPY_MEM_MEM_SourceMemoryAddress_bits  62
   155212 #define GEN9_MI_COPY_MEM_MEM_SourceMemoryAddress_bits  62
   155213 #define GEN8_MI_COPY_MEM_MEM_SourceMemoryAddress_bits  62
   155214 
   155215 static inline uint32_t ATTRIBUTE_PURE
   155216 MI_COPY_MEM_MEM_SourceMemoryAddress_bits(const struct gen_device_info *devinfo)
   155217 {
   155218    switch (devinfo->gen) {
   155219    case 10: return 62;
   155220    case 9: return 62;
   155221    case 8: return 62;
   155222    case 7:
   155223       if (devinfo->is_haswell) {
   155224          return 0;
   155225       } else {
   155226          return 0;
   155227       }
   155228    case 6: return 0;
   155229    case 5: return 0;
   155230    case 4:
   155231       if (devinfo->is_g4x) {
   155232          return 0;
   155233       } else {
   155234          return 0;
   155235       }
   155236    default:
   155237       unreachable("Invalid hardware generation");
   155238    }
   155239 }
   155240 
   155241 
   155242 
   155243 #define GEN10_MI_COPY_MEM_MEM_SourceMemoryAddress_start  98
   155244 #define GEN9_MI_COPY_MEM_MEM_SourceMemoryAddress_start  98
   155245 #define GEN8_MI_COPY_MEM_MEM_SourceMemoryAddress_start  98
   155246 
   155247 static inline uint32_t ATTRIBUTE_PURE
   155248 MI_COPY_MEM_MEM_SourceMemoryAddress_start(const struct gen_device_info *devinfo)
   155249 {
   155250    switch (devinfo->gen) {
   155251    case 10: return 98;
   155252    case 9: return 98;
   155253    case 8: return 98;
   155254    case 7:
   155255       if (devinfo->is_haswell) {
   155256          return 0;
   155257       } else {
   155258          return 0;
   155259       }
   155260    case 6: return 0;
   155261    case 5: return 0;
   155262    case 4:
   155263       if (devinfo->is_g4x) {
   155264          return 0;
   155265       } else {
   155266          return 0;
   155267       }
   155268    default:
   155269       unreachable("Invalid hardware generation");
   155270    }
   155271 }
   155272 
   155273 
   155274 
   155275 /* MI_COPY_MEM_MEM::Use Global GTT Destination */
   155276 
   155277 
   155278 #define GEN10_MI_COPY_MEM_MEM_UseGlobalGTTDestination_bits  1
   155279 #define GEN9_MI_COPY_MEM_MEM_UseGlobalGTTDestination_bits  1
   155280 #define GEN8_MI_COPY_MEM_MEM_UseGlobalGTTDestination_bits  1
   155281 
   155282 static inline uint32_t ATTRIBUTE_PURE
   155283 MI_COPY_MEM_MEM_UseGlobalGTTDestination_bits(const struct gen_device_info *devinfo)
   155284 {
   155285    switch (devinfo->gen) {
   155286    case 10: return 1;
   155287    case 9: return 1;
   155288    case 8: return 1;
   155289    case 7:
   155290       if (devinfo->is_haswell) {
   155291          return 0;
   155292       } else {
   155293          return 0;
   155294       }
   155295    case 6: return 0;
   155296    case 5: return 0;
   155297    case 4:
   155298       if (devinfo->is_g4x) {
   155299          return 0;
   155300       } else {
   155301          return 0;
   155302       }
   155303    default:
   155304       unreachable("Invalid hardware generation");
   155305    }
   155306 }
   155307 
   155308 
   155309 
   155310 #define GEN10_MI_COPY_MEM_MEM_UseGlobalGTTDestination_start  21
   155311 #define GEN9_MI_COPY_MEM_MEM_UseGlobalGTTDestination_start  21
   155312 #define GEN8_MI_COPY_MEM_MEM_UseGlobalGTTDestination_start  21
   155313 
   155314 static inline uint32_t ATTRIBUTE_PURE
   155315 MI_COPY_MEM_MEM_UseGlobalGTTDestination_start(const struct gen_device_info *devinfo)
   155316 {
   155317    switch (devinfo->gen) {
   155318    case 10: return 21;
   155319    case 9: return 21;
   155320    case 8: return 21;
   155321    case 7:
   155322       if (devinfo->is_haswell) {
   155323          return 0;
   155324       } else {
   155325          return 0;
   155326       }
   155327    case 6: return 0;
   155328    case 5: return 0;
   155329    case 4:
   155330       if (devinfo->is_g4x) {
   155331          return 0;
   155332       } else {
   155333          return 0;
   155334       }
   155335    default:
   155336       unreachable("Invalid hardware generation");
   155337    }
   155338 }
   155339 
   155340 
   155341 
   155342 /* MI_COPY_MEM_MEM::Use Global GTT Source */
   155343 
   155344 
   155345 #define GEN10_MI_COPY_MEM_MEM_UseGlobalGTTSource_bits  1
   155346 #define GEN9_MI_COPY_MEM_MEM_UseGlobalGTTSource_bits  1
   155347 #define GEN8_MI_COPY_MEM_MEM_UseGlobalGTTSource_bits  1
   155348 
   155349 static inline uint32_t ATTRIBUTE_PURE
   155350 MI_COPY_MEM_MEM_UseGlobalGTTSource_bits(const struct gen_device_info *devinfo)
   155351 {
   155352    switch (devinfo->gen) {
   155353    case 10: return 1;
   155354    case 9: return 1;
   155355    case 8: return 1;
   155356    case 7:
   155357       if (devinfo->is_haswell) {
   155358          return 0;
   155359       } else {
   155360          return 0;
   155361       }
   155362    case 6: return 0;
   155363    case 5: return 0;
   155364    case 4:
   155365       if (devinfo->is_g4x) {
   155366          return 0;
   155367       } else {
   155368          return 0;
   155369       }
   155370    default:
   155371       unreachable("Invalid hardware generation");
   155372    }
   155373 }
   155374 
   155375 
   155376 
   155377 #define GEN10_MI_COPY_MEM_MEM_UseGlobalGTTSource_start  22
   155378 #define GEN9_MI_COPY_MEM_MEM_UseGlobalGTTSource_start  22
   155379 #define GEN8_MI_COPY_MEM_MEM_UseGlobalGTTSource_start  22
   155380 
   155381 static inline uint32_t ATTRIBUTE_PURE
   155382 MI_COPY_MEM_MEM_UseGlobalGTTSource_start(const struct gen_device_info *devinfo)
   155383 {
   155384    switch (devinfo->gen) {
   155385    case 10: return 22;
   155386    case 9: return 22;
   155387    case 8: return 22;
   155388    case 7:
   155389       if (devinfo->is_haswell) {
   155390          return 0;
   155391       } else {
   155392          return 0;
   155393       }
   155394    case 6: return 0;
   155395    case 5: return 0;
   155396    case 4:
   155397       if (devinfo->is_g4x) {
   155398          return 0;
   155399       } else {
   155400          return 0;
   155401       }
   155402    default:
   155403       unreachable("Invalid hardware generation");
   155404    }
   155405 }
   155406 
   155407 
   155408 
   155409 /* MI_DISPLAY_FLIP */
   155410 
   155411 
   155412 #define GEN10_MI_DISPLAY_FLIP_length  3
   155413 #define GEN9_MI_DISPLAY_FLIP_length  3
   155414 
   155415 static inline uint32_t ATTRIBUTE_PURE
   155416 MI_DISPLAY_FLIP_length(const struct gen_device_info *devinfo)
   155417 {
   155418    switch (devinfo->gen) {
   155419    case 10: return 3;
   155420    case 9: return 3;
   155421    case 8: return 0;
   155422    case 7:
   155423       if (devinfo->is_haswell) {
   155424          return 0;
   155425       } else {
   155426          return 0;
   155427       }
   155428    case 6: return 0;
   155429    case 5: return 0;
   155430    case 4:
   155431       if (devinfo->is_g4x) {
   155432          return 0;
   155433       } else {
   155434          return 0;
   155435       }
   155436    default:
   155437       unreachable("Invalid hardware generation");
   155438    }
   155439 }
   155440 
   155441 
   155442 
   155443 /* MI_DISPLAY_FLIP::Async Flip Indicator */
   155444 
   155445 
   155446 #define GEN10_MI_DISPLAY_FLIP_AsyncFlipIndicator_bits  1
   155447 #define GEN9_MI_DISPLAY_FLIP_AsyncFlipIndicator_bits  1
   155448 
   155449 static inline uint32_t ATTRIBUTE_PURE
   155450 MI_DISPLAY_FLIP_AsyncFlipIndicator_bits(const struct gen_device_info *devinfo)
   155451 {
   155452    switch (devinfo->gen) {
   155453    case 10: return 1;
   155454    case 9: return 1;
   155455    case 8: return 0;
   155456    case 7:
   155457       if (devinfo->is_haswell) {
   155458          return 0;
   155459       } else {
   155460          return 0;
   155461       }
   155462    case 6: return 0;
   155463    case 5: return 0;
   155464    case 4:
   155465       if (devinfo->is_g4x) {
   155466          return 0;
   155467       } else {
   155468          return 0;
   155469       }
   155470    default:
   155471       unreachable("Invalid hardware generation");
   155472    }
   155473 }
   155474 
   155475 
   155476 
   155477 #define GEN10_MI_DISPLAY_FLIP_AsyncFlipIndicator_start  22
   155478 #define GEN9_MI_DISPLAY_FLIP_AsyncFlipIndicator_start  22
   155479 
   155480 static inline uint32_t ATTRIBUTE_PURE
   155481 MI_DISPLAY_FLIP_AsyncFlipIndicator_start(const struct gen_device_info *devinfo)
   155482 {
   155483    switch (devinfo->gen) {
   155484    case 10: return 22;
   155485    case 9: return 22;
   155486    case 8: return 0;
   155487    case 7:
   155488       if (devinfo->is_haswell) {
   155489          return 0;
   155490       } else {
   155491          return 0;
   155492       }
   155493    case 6: return 0;
   155494    case 5: return 0;
   155495    case 4:
   155496       if (devinfo->is_g4x) {
   155497          return 0;
   155498       } else {
   155499          return 0;
   155500       }
   155501    default:
   155502       unreachable("Invalid hardware generation");
   155503    }
   155504 }
   155505 
   155506 
   155507 
   155508 /* MI_DISPLAY_FLIP::Command Type */
   155509 
   155510 
   155511 #define GEN10_MI_DISPLAY_FLIP_CommandType_bits  3
   155512 #define GEN9_MI_DISPLAY_FLIP_CommandType_bits  3
   155513 
   155514 static inline uint32_t ATTRIBUTE_PURE
   155515 MI_DISPLAY_FLIP_CommandType_bits(const struct gen_device_info *devinfo)
   155516 {
   155517    switch (devinfo->gen) {
   155518    case 10: return 3;
   155519    case 9: return 3;
   155520    case 8: return 0;
   155521    case 7:
   155522       if (devinfo->is_haswell) {
   155523          return 0;
   155524       } else {
   155525          return 0;
   155526       }
   155527    case 6: return 0;
   155528    case 5: return 0;
   155529    case 4:
   155530       if (devinfo->is_g4x) {
   155531          return 0;
   155532       } else {
   155533          return 0;
   155534       }
   155535    default:
   155536       unreachable("Invalid hardware generation");
   155537    }
   155538 }
   155539 
   155540 
   155541 
   155542 #define GEN10_MI_DISPLAY_FLIP_CommandType_start  29
   155543 #define GEN9_MI_DISPLAY_FLIP_CommandType_start  29
   155544 
   155545 static inline uint32_t ATTRIBUTE_PURE
   155546 MI_DISPLAY_FLIP_CommandType_start(const struct gen_device_info *devinfo)
   155547 {
   155548    switch (devinfo->gen) {
   155549    case 10: return 29;
   155550    case 9: return 29;
   155551    case 8: return 0;
   155552    case 7:
   155553       if (devinfo->is_haswell) {
   155554          return 0;
   155555       } else {
   155556          return 0;
   155557       }
   155558    case 6: return 0;
   155559    case 5: return 0;
   155560    case 4:
   155561       if (devinfo->is_g4x) {
   155562          return 0;
   155563       } else {
   155564          return 0;
   155565       }
   155566    default:
   155567       unreachable("Invalid hardware generation");
   155568    }
   155569 }
   155570 
   155571 
   155572 
   155573 /* MI_DISPLAY_FLIP::DWord Length */
   155574 
   155575 
   155576 #define GEN10_MI_DISPLAY_FLIP_DWordLength_bits  8
   155577 #define GEN9_MI_DISPLAY_FLIP_DWordLength_bits  8
   155578 
   155579 static inline uint32_t ATTRIBUTE_PURE
   155580 MI_DISPLAY_FLIP_DWordLength_bits(const struct gen_device_info *devinfo)
   155581 {
   155582    switch (devinfo->gen) {
   155583    case 10: return 8;
   155584    case 9: return 8;
   155585    case 8: return 0;
   155586    case 7:
   155587       if (devinfo->is_haswell) {
   155588          return 0;
   155589       } else {
   155590          return 0;
   155591       }
   155592    case 6: return 0;
   155593    case 5: return 0;
   155594    case 4:
   155595       if (devinfo->is_g4x) {
   155596          return 0;
   155597       } else {
   155598          return 0;
   155599       }
   155600    default:
   155601       unreachable("Invalid hardware generation");
   155602    }
   155603 }
   155604 
   155605 
   155606 
   155607 #define GEN10_MI_DISPLAY_FLIP_DWordLength_start  0
   155608 #define GEN9_MI_DISPLAY_FLIP_DWordLength_start  0
   155609 
   155610 static inline uint32_t ATTRIBUTE_PURE
   155611 MI_DISPLAY_FLIP_DWordLength_start(const struct gen_device_info *devinfo)
   155612 {
   155613    switch (devinfo->gen) {
   155614    case 10: return 0;
   155615    case 9: return 0;
   155616    case 8: return 0;
   155617    case 7:
   155618       if (devinfo->is_haswell) {
   155619          return 0;
   155620       } else {
   155621          return 0;
   155622       }
   155623    case 6: return 0;
   155624    case 5: return 0;
   155625    case 4:
   155626       if (devinfo->is_g4x) {
   155627          return 0;
   155628       } else {
   155629          return 0;
   155630       }
   155631    default:
   155632       unreachable("Invalid hardware generation");
   155633    }
   155634 }
   155635 
   155636 
   155637 
   155638 /* MI_DISPLAY_FLIP::Display Buffer Base Address */
   155639 
   155640 
   155641 #define GEN10_MI_DISPLAY_FLIP_DisplayBufferBaseAddress_bits  20
   155642 #define GEN9_MI_DISPLAY_FLIP_DisplayBufferBaseAddress_bits  20
   155643 
   155644 static inline uint32_t ATTRIBUTE_PURE
   155645 MI_DISPLAY_FLIP_DisplayBufferBaseAddress_bits(const struct gen_device_info *devinfo)
   155646 {
   155647    switch (devinfo->gen) {
   155648    case 10: return 20;
   155649    case 9: return 20;
   155650    case 8: return 0;
   155651    case 7:
   155652       if (devinfo->is_haswell) {
   155653          return 0;
   155654       } else {
   155655          return 0;
   155656       }
   155657    case 6: return 0;
   155658    case 5: return 0;
   155659    case 4:
   155660       if (devinfo->is_g4x) {
   155661          return 0;
   155662       } else {
   155663          return 0;
   155664       }
   155665    default:
   155666       unreachable("Invalid hardware generation");
   155667    }
   155668 }
   155669 
   155670 
   155671 
   155672 #define GEN10_MI_DISPLAY_FLIP_DisplayBufferBaseAddress_start  76
   155673 #define GEN9_MI_DISPLAY_FLIP_DisplayBufferBaseAddress_start  76
   155674 
   155675 static inline uint32_t ATTRIBUTE_PURE
   155676 MI_DISPLAY_FLIP_DisplayBufferBaseAddress_start(const struct gen_device_info *devinfo)
   155677 {
   155678    switch (devinfo->gen) {
   155679    case 10: return 76;
   155680    case 9: return 76;
   155681    case 8: return 0;
   155682    case 7:
   155683       if (devinfo->is_haswell) {
   155684          return 0;
   155685       } else {
   155686          return 0;
   155687       }
   155688    case 6: return 0;
   155689    case 5: return 0;
   155690    case 4:
   155691       if (devinfo->is_g4x) {
   155692          return 0;
   155693       } else {
   155694          return 0;
   155695       }
   155696    default:
   155697       unreachable("Invalid hardware generation");
   155698    }
   155699 }
   155700 
   155701 
   155702 
   155703 /* MI_DISPLAY_FLIP::Display Buffer Pitch */
   155704 
   155705 
   155706 #define GEN10_MI_DISPLAY_FLIP_DisplayBufferPitch_bits  10
   155707 #define GEN9_MI_DISPLAY_FLIP_DisplayBufferPitch_bits  10
   155708 
   155709 static inline uint32_t ATTRIBUTE_PURE
   155710 MI_DISPLAY_FLIP_DisplayBufferPitch_bits(const struct gen_device_info *devinfo)
   155711 {
   155712    switch (devinfo->gen) {
   155713    case 10: return 10;
   155714    case 9: return 10;
   155715    case 8: return 0;
   155716    case 7:
   155717       if (devinfo->is_haswell) {
   155718          return 0;
   155719       } else {
   155720          return 0;
   155721       }
   155722    case 6: return 0;
   155723    case 5: return 0;
   155724    case 4:
   155725       if (devinfo->is_g4x) {
   155726          return 0;
   155727       } else {
   155728          return 0;
   155729       }
   155730    default:
   155731       unreachable("Invalid hardware generation");
   155732    }
   155733 }
   155734 
   155735 
   155736 
   155737 #define GEN10_MI_DISPLAY_FLIP_DisplayBufferPitch_start  38
   155738 #define GEN9_MI_DISPLAY_FLIP_DisplayBufferPitch_start  38
   155739 
   155740 static inline uint32_t ATTRIBUTE_PURE
   155741 MI_DISPLAY_FLIP_DisplayBufferPitch_start(const struct gen_device_info *devinfo)
   155742 {
   155743    switch (devinfo->gen) {
   155744    case 10: return 38;
   155745    case 9: return 38;
   155746    case 8: return 0;
   155747    case 7:
   155748       if (devinfo->is_haswell) {
   155749          return 0;
   155750       } else {
   155751          return 0;
   155752       }
   155753    case 6: return 0;
   155754    case 5: return 0;
   155755    case 4:
   155756       if (devinfo->is_g4x) {
   155757          return 0;
   155758       } else {
   155759          return 0;
   155760       }
   155761    default:
   155762       unreachable("Invalid hardware generation");
   155763    }
   155764 }
   155765 
   155766 
   155767 
   155768 /* MI_DISPLAY_FLIP::Display Plane Select */
   155769 
   155770 
   155771 #define GEN10_MI_DISPLAY_FLIP_DisplayPlaneSelect_bits  5
   155772 #define GEN9_MI_DISPLAY_FLIP_DisplayPlaneSelect_bits  5
   155773 
   155774 static inline uint32_t ATTRIBUTE_PURE
   155775 MI_DISPLAY_FLIP_DisplayPlaneSelect_bits(const struct gen_device_info *devinfo)
   155776 {
   155777    switch (devinfo->gen) {
   155778    case 10: return 5;
   155779    case 9: return 5;
   155780    case 8: return 0;
   155781    case 7:
   155782       if (devinfo->is_haswell) {
   155783          return 0;
   155784       } else {
   155785          return 0;
   155786       }
   155787    case 6: return 0;
   155788    case 5: return 0;
   155789    case 4:
   155790       if (devinfo->is_g4x) {
   155791          return 0;
   155792       } else {
   155793          return 0;
   155794       }
   155795    default:
   155796       unreachable("Invalid hardware generation");
   155797    }
   155798 }
   155799 
   155800 
   155801 
   155802 #define GEN10_MI_DISPLAY_FLIP_DisplayPlaneSelect_start  8
   155803 #define GEN9_MI_DISPLAY_FLIP_DisplayPlaneSelect_start  8
   155804 
   155805 static inline uint32_t ATTRIBUTE_PURE
   155806 MI_DISPLAY_FLIP_DisplayPlaneSelect_start(const struct gen_device_info *devinfo)
   155807 {
   155808    switch (devinfo->gen) {
   155809    case 10: return 8;
   155810    case 9: return 8;
   155811    case 8: return 0;
   155812    case 7:
   155813       if (devinfo->is_haswell) {
   155814          return 0;
   155815       } else {
   155816          return 0;
   155817       }
   155818    case 6: return 0;
   155819    case 5: return 0;
   155820    case 4:
   155821       if (devinfo->is_g4x) {
   155822          return 0;
   155823       } else {
   155824          return 0;
   155825       }
   155826    default:
   155827       unreachable("Invalid hardware generation");
   155828    }
   155829 }
   155830 
   155831 
   155832 
   155833 /* MI_DISPLAY_FLIP::Flip Type */
   155834 
   155835 
   155836 #define GEN10_MI_DISPLAY_FLIP_FlipType_bits  2
   155837 #define GEN9_MI_DISPLAY_FLIP_FlipType_bits  2
   155838 
   155839 static inline uint32_t ATTRIBUTE_PURE
   155840 MI_DISPLAY_FLIP_FlipType_bits(const struct gen_device_info *devinfo)
   155841 {
   155842    switch (devinfo->gen) {
   155843    case 10: return 2;
   155844    case 9: return 2;
   155845    case 8: return 0;
   155846    case 7:
   155847       if (devinfo->is_haswell) {
   155848          return 0;
   155849       } else {
   155850          return 0;
   155851       }
   155852    case 6: return 0;
   155853    case 5: return 0;
   155854    case 4:
   155855       if (devinfo->is_g4x) {
   155856          return 0;
   155857       } else {
   155858          return 0;
   155859       }
   155860    default:
   155861       unreachable("Invalid hardware generation");
   155862    }
   155863 }
   155864 
   155865 
   155866 
   155867 #define GEN10_MI_DISPLAY_FLIP_FlipType_start  64
   155868 #define GEN9_MI_DISPLAY_FLIP_FlipType_start  64
   155869 
   155870 static inline uint32_t ATTRIBUTE_PURE
   155871 MI_DISPLAY_FLIP_FlipType_start(const struct gen_device_info *devinfo)
   155872 {
   155873    switch (devinfo->gen) {
   155874    case 10: return 64;
   155875    case 9: return 64;
   155876    case 8: return 0;
   155877    case 7:
   155878       if (devinfo->is_haswell) {
   155879          return 0;
   155880       } else {
   155881          return 0;
   155882       }
   155883    case 6: return 0;
   155884    case 5: return 0;
   155885    case 4:
   155886       if (devinfo->is_g4x) {
   155887          return 0;
   155888       } else {
   155889          return 0;
   155890       }
   155891    default:
   155892       unreachable("Invalid hardware generation");
   155893    }
   155894 }
   155895 
   155896 
   155897 
   155898 /* MI_DISPLAY_FLIP::Left Eye Display Buffer Base Address */
   155899 
   155900 
   155901 #define GEN10_MI_DISPLAY_FLIP_LeftEyeDisplayBufferBaseAddress_bits  20
   155902 #define GEN9_MI_DISPLAY_FLIP_LeftEyeDisplayBufferBaseAddress_bits  20
   155903 
   155904 static inline uint32_t ATTRIBUTE_PURE
   155905 MI_DISPLAY_FLIP_LeftEyeDisplayBufferBaseAddress_bits(const struct gen_device_info *devinfo)
   155906 {
   155907    switch (devinfo->gen) {
   155908    case 10: return 20;
   155909    case 9: return 20;
   155910    case 8: return 0;
   155911    case 7:
   155912       if (devinfo->is_haswell) {
   155913          return 0;
   155914       } else {
   155915          return 0;
   155916       }
   155917    case 6: return 0;
   155918    case 5: return 0;
   155919    case 4:
   155920       if (devinfo->is_g4x) {
   155921          return 0;
   155922       } else {
   155923          return 0;
   155924       }
   155925    default:
   155926       unreachable("Invalid hardware generation");
   155927    }
   155928 }
   155929 
   155930 
   155931 
   155932 #define GEN10_MI_DISPLAY_FLIP_LeftEyeDisplayBufferBaseAddress_start  108
   155933 #define GEN9_MI_DISPLAY_FLIP_LeftEyeDisplayBufferBaseAddress_start  108
   155934 
   155935 static inline uint32_t ATTRIBUTE_PURE
   155936 MI_DISPLAY_FLIP_LeftEyeDisplayBufferBaseAddress_start(const struct gen_device_info *devinfo)
   155937 {
   155938    switch (devinfo->gen) {
   155939    case 10: return 108;
   155940    case 9: return 108;
   155941    case 8: return 0;
   155942    case 7:
   155943       if (devinfo->is_haswell) {
   155944          return 0;
   155945       } else {
   155946          return 0;
   155947       }
   155948    case 6: return 0;
   155949    case 5: return 0;
   155950    case 4:
   155951       if (devinfo->is_g4x) {
   155952          return 0;
   155953       } else {
   155954          return 0;
   155955       }
   155956    default:
   155957       unreachable("Invalid hardware generation");
   155958    }
   155959 }
   155960 
   155961 
   155962 
   155963 /* MI_DISPLAY_FLIP::MI Command Opcode */
   155964 
   155965 
   155966 #define GEN10_MI_DISPLAY_FLIP_MICommandOpcode_bits  6
   155967 #define GEN9_MI_DISPLAY_FLIP_MICommandOpcode_bits  6
   155968 
   155969 static inline uint32_t ATTRIBUTE_PURE
   155970 MI_DISPLAY_FLIP_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   155971 {
   155972    switch (devinfo->gen) {
   155973    case 10: return 6;
   155974    case 9: return 6;
   155975    case 8: return 0;
   155976    case 7:
   155977       if (devinfo->is_haswell) {
   155978          return 0;
   155979       } else {
   155980          return 0;
   155981       }
   155982    case 6: return 0;
   155983    case 5: return 0;
   155984    case 4:
   155985       if (devinfo->is_g4x) {
   155986          return 0;
   155987       } else {
   155988          return 0;
   155989       }
   155990    default:
   155991       unreachable("Invalid hardware generation");
   155992    }
   155993 }
   155994 
   155995 
   155996 
   155997 #define GEN10_MI_DISPLAY_FLIP_MICommandOpcode_start  23
   155998 #define GEN9_MI_DISPLAY_FLIP_MICommandOpcode_start  23
   155999 
   156000 static inline uint32_t ATTRIBUTE_PURE
   156001 MI_DISPLAY_FLIP_MICommandOpcode_start(const struct gen_device_info *devinfo)
   156002 {
   156003    switch (devinfo->gen) {
   156004    case 10: return 23;
   156005    case 9: return 23;
   156006    case 8: return 0;
   156007    case 7:
   156008       if (devinfo->is_haswell) {
   156009          return 0;
   156010       } else {
   156011          return 0;
   156012       }
   156013    case 6: return 0;
   156014    case 5: return 0;
   156015    case 4:
   156016       if (devinfo->is_g4x) {
   156017          return 0;
   156018       } else {
   156019          return 0;
   156020       }
   156021    default:
   156022       unreachable("Invalid hardware generation");
   156023    }
   156024 }
   156025 
   156026 
   156027 
   156028 /* MI_DISPLAY_FLIP::Stereoscopic 3D Mode */
   156029 
   156030 
   156031 #define GEN10_MI_DISPLAY_FLIP_Stereoscopic3DMode_bits  1
   156032 #define GEN9_MI_DISPLAY_FLIP_Stereoscopic3DMode_bits  1
   156033 
   156034 static inline uint32_t ATTRIBUTE_PURE
   156035 MI_DISPLAY_FLIP_Stereoscopic3DMode_bits(const struct gen_device_info *devinfo)
   156036 {
   156037    switch (devinfo->gen) {
   156038    case 10: return 1;
   156039    case 9: return 1;
   156040    case 8: return 0;
   156041    case 7:
   156042       if (devinfo->is_haswell) {
   156043          return 0;
   156044       } else {
   156045          return 0;
   156046       }
   156047    case 6: return 0;
   156048    case 5: return 0;
   156049    case 4:
   156050       if (devinfo->is_g4x) {
   156051          return 0;
   156052       } else {
   156053          return 0;
   156054       }
   156055    default:
   156056       unreachable("Invalid hardware generation");
   156057    }
   156058 }
   156059 
   156060 
   156061 
   156062 #define GEN10_MI_DISPLAY_FLIP_Stereoscopic3DMode_start  63
   156063 #define GEN9_MI_DISPLAY_FLIP_Stereoscopic3DMode_start  63
   156064 
   156065 static inline uint32_t ATTRIBUTE_PURE
   156066 MI_DISPLAY_FLIP_Stereoscopic3DMode_start(const struct gen_device_info *devinfo)
   156067 {
   156068    switch (devinfo->gen) {
   156069    case 10: return 63;
   156070    case 9: return 63;
   156071    case 8: return 0;
   156072    case 7:
   156073       if (devinfo->is_haswell) {
   156074          return 0;
   156075       } else {
   156076          return 0;
   156077       }
   156078    case 6: return 0;
   156079    case 5: return 0;
   156080    case 4:
   156081       if (devinfo->is_g4x) {
   156082          return 0;
   156083       } else {
   156084          return 0;
   156085       }
   156086    default:
   156087       unreachable("Invalid hardware generation");
   156088    }
   156089 }
   156090 
   156091 
   156092 
   156093 /* MI_DISPLAY_FLIP::Tile Parameter */
   156094 
   156095 
   156096 #define GEN10_MI_DISPLAY_FLIP_TileParameter_bits  3
   156097 #define GEN9_MI_DISPLAY_FLIP_TileParameter_bits  3
   156098 
   156099 static inline uint32_t ATTRIBUTE_PURE
   156100 MI_DISPLAY_FLIP_TileParameter_bits(const struct gen_device_info *devinfo)
   156101 {
   156102    switch (devinfo->gen) {
   156103    case 10: return 3;
   156104    case 9: return 3;
   156105    case 8: return 0;
   156106    case 7:
   156107       if (devinfo->is_haswell) {
   156108          return 0;
   156109       } else {
   156110          return 0;
   156111       }
   156112    case 6: return 0;
   156113    case 5: return 0;
   156114    case 4:
   156115       if (devinfo->is_g4x) {
   156116          return 0;
   156117       } else {
   156118          return 0;
   156119       }
   156120    default:
   156121       unreachable("Invalid hardware generation");
   156122    }
   156123 }
   156124 
   156125 
   156126 
   156127 #define GEN10_MI_DISPLAY_FLIP_TileParameter_start  32
   156128 #define GEN9_MI_DISPLAY_FLIP_TileParameter_start  32
   156129 
   156130 static inline uint32_t ATTRIBUTE_PURE
   156131 MI_DISPLAY_FLIP_TileParameter_start(const struct gen_device_info *devinfo)
   156132 {
   156133    switch (devinfo->gen) {
   156134    case 10: return 32;
   156135    case 9: return 32;
   156136    case 8: return 0;
   156137    case 7:
   156138       if (devinfo->is_haswell) {
   156139          return 0;
   156140       } else {
   156141          return 0;
   156142       }
   156143    case 6: return 0;
   156144    case 5: return 0;
   156145    case 4:
   156146       if (devinfo->is_g4x) {
   156147          return 0;
   156148       } else {
   156149          return 0;
   156150       }
   156151    default:
   156152       unreachable("Invalid hardware generation");
   156153    }
   156154 }
   156155 
   156156 
   156157 
   156158 /* MI_DISPLAY_FLIP::VRR Master Flip */
   156159 
   156160 
   156161 #define GEN10_MI_DISPLAY_FLIP_VRRMasterFlip_bits  1
   156162 
   156163 static inline uint32_t ATTRIBUTE_PURE
   156164 MI_DISPLAY_FLIP_VRRMasterFlip_bits(const struct gen_device_info *devinfo)
   156165 {
   156166    switch (devinfo->gen) {
   156167    case 10: return 1;
   156168    case 9: return 0;
   156169    case 8: return 0;
   156170    case 7:
   156171       if (devinfo->is_haswell) {
   156172          return 0;
   156173       } else {
   156174          return 0;
   156175       }
   156176    case 6: return 0;
   156177    case 5: return 0;
   156178    case 4:
   156179       if (devinfo->is_g4x) {
   156180          return 0;
   156181       } else {
   156182          return 0;
   156183       }
   156184    default:
   156185       unreachable("Invalid hardware generation");
   156186    }
   156187 }
   156188 
   156189 
   156190 
   156191 #define GEN10_MI_DISPLAY_FLIP_VRRMasterFlip_start  75
   156192 
   156193 static inline uint32_t ATTRIBUTE_PURE
   156194 MI_DISPLAY_FLIP_VRRMasterFlip_start(const struct gen_device_info *devinfo)
   156195 {
   156196    switch (devinfo->gen) {
   156197    case 10: return 75;
   156198    case 9: return 0;
   156199    case 8: return 0;
   156200    case 7:
   156201       if (devinfo->is_haswell) {
   156202          return 0;
   156203       } else {
   156204          return 0;
   156205       }
   156206    case 6: return 0;
   156207    case 5: return 0;
   156208    case 4:
   156209       if (devinfo->is_g4x) {
   156210          return 0;
   156211       } else {
   156212          return 0;
   156213       }
   156214    default:
   156215       unreachable("Invalid hardware generation");
   156216    }
   156217 }
   156218 
   156219 
   156220 
   156221 /* MI_FLUSH */
   156222 
   156223 
   156224 #define GEN75_MI_FLUSH_length  1
   156225 #define GEN7_MI_FLUSH_length  1
   156226 #define GEN6_MI_FLUSH_length  1
   156227 #define GEN5_MI_FLUSH_length  1
   156228 #define GEN45_MI_FLUSH_length  1
   156229 #define GEN4_MI_FLUSH_length  1
   156230 
   156231 static inline uint32_t ATTRIBUTE_PURE
   156232 MI_FLUSH_length(const struct gen_device_info *devinfo)
   156233 {
   156234    switch (devinfo->gen) {
   156235    case 10: return 0;
   156236    case 9: return 0;
   156237    case 8: return 0;
   156238    case 7:
   156239       if (devinfo->is_haswell) {
   156240          return 1;
   156241       } else {
   156242          return 1;
   156243       }
   156244    case 6: return 1;
   156245    case 5: return 1;
   156246    case 4:
   156247       if (devinfo->is_g4x) {
   156248          return 1;
   156249       } else {
   156250          return 1;
   156251       }
   156252    default:
   156253       unreachable("Invalid hardware generation");
   156254    }
   156255 }
   156256 
   156257 
   156258 
   156259 /* MI_FLUSH::Command Type */
   156260 
   156261 
   156262 #define GEN75_MI_FLUSH_CommandType_bits  3
   156263 #define GEN7_MI_FLUSH_CommandType_bits  3
   156264 #define GEN6_MI_FLUSH_CommandType_bits  3
   156265 #define GEN5_MI_FLUSH_CommandType_bits  3
   156266 #define GEN45_MI_FLUSH_CommandType_bits  3
   156267 #define GEN4_MI_FLUSH_CommandType_bits  3
   156268 
   156269 static inline uint32_t ATTRIBUTE_PURE
   156270 MI_FLUSH_CommandType_bits(const struct gen_device_info *devinfo)
   156271 {
   156272    switch (devinfo->gen) {
   156273    case 10: return 0;
   156274    case 9: return 0;
   156275    case 8: return 0;
   156276    case 7:
   156277       if (devinfo->is_haswell) {
   156278          return 3;
   156279       } else {
   156280          return 3;
   156281       }
   156282    case 6: return 3;
   156283    case 5: return 3;
   156284    case 4:
   156285       if (devinfo->is_g4x) {
   156286          return 3;
   156287       } else {
   156288          return 3;
   156289       }
   156290    default:
   156291       unreachable("Invalid hardware generation");
   156292    }
   156293 }
   156294 
   156295 
   156296 
   156297 #define GEN75_MI_FLUSH_CommandType_start  29
   156298 #define GEN7_MI_FLUSH_CommandType_start  29
   156299 #define GEN6_MI_FLUSH_CommandType_start  29
   156300 #define GEN5_MI_FLUSH_CommandType_start  29
   156301 #define GEN45_MI_FLUSH_CommandType_start  29
   156302 #define GEN4_MI_FLUSH_CommandType_start  29
   156303 
   156304 static inline uint32_t ATTRIBUTE_PURE
   156305 MI_FLUSH_CommandType_start(const struct gen_device_info *devinfo)
   156306 {
   156307    switch (devinfo->gen) {
   156308    case 10: return 0;
   156309    case 9: return 0;
   156310    case 8: return 0;
   156311    case 7:
   156312       if (devinfo->is_haswell) {
   156313          return 29;
   156314       } else {
   156315          return 29;
   156316       }
   156317    case 6: return 29;
   156318    case 5: return 29;
   156319    case 4:
   156320       if (devinfo->is_g4x) {
   156321          return 29;
   156322       } else {
   156323          return 29;
   156324       }
   156325    default:
   156326       unreachable("Invalid hardware generation");
   156327    }
   156328 }
   156329 
   156330 
   156331 
   156332 /* MI_FLUSH::Generic Media State Clear */
   156333 
   156334 
   156335 #define GEN75_MI_FLUSH_GenericMediaStateClear_bits  1
   156336 #define GEN7_MI_FLUSH_GenericMediaStateClear_bits  1
   156337 #define GEN6_MI_FLUSH_GenericMediaStateClear_bits  1
   156338 #define GEN5_MI_FLUSH_GenericMediaStateClear_bits  1
   156339 
   156340 static inline uint32_t ATTRIBUTE_PURE
   156341 MI_FLUSH_GenericMediaStateClear_bits(const struct gen_device_info *devinfo)
   156342 {
   156343    switch (devinfo->gen) {
   156344    case 10: return 0;
   156345    case 9: return 0;
   156346    case 8: return 0;
   156347    case 7:
   156348       if (devinfo->is_haswell) {
   156349          return 1;
   156350       } else {
   156351          return 1;
   156352       }
   156353    case 6: return 1;
   156354    case 5: return 1;
   156355    case 4:
   156356       if (devinfo->is_g4x) {
   156357          return 0;
   156358       } else {
   156359          return 0;
   156360       }
   156361    default:
   156362       unreachable("Invalid hardware generation");
   156363    }
   156364 }
   156365 
   156366 
   156367 
   156368 #define GEN75_MI_FLUSH_GenericMediaStateClear_start  4
   156369 #define GEN7_MI_FLUSH_GenericMediaStateClear_start  4
   156370 #define GEN6_MI_FLUSH_GenericMediaStateClear_start  4
   156371 #define GEN5_MI_FLUSH_GenericMediaStateClear_start  4
   156372 
   156373 static inline uint32_t ATTRIBUTE_PURE
   156374 MI_FLUSH_GenericMediaStateClear_start(const struct gen_device_info *devinfo)
   156375 {
   156376    switch (devinfo->gen) {
   156377    case 10: return 0;
   156378    case 9: return 0;
   156379    case 8: return 0;
   156380    case 7:
   156381       if (devinfo->is_haswell) {
   156382          return 4;
   156383       } else {
   156384          return 4;
   156385       }
   156386    case 6: return 4;
   156387    case 5: return 4;
   156388    case 4:
   156389       if (devinfo->is_g4x) {
   156390          return 0;
   156391       } else {
   156392          return 0;
   156393       }
   156394    default:
   156395       unreachable("Invalid hardware generation");
   156396    }
   156397 }
   156398 
   156399 
   156400 
   156401 /* MI_FLUSH::Global Snapshot Count Reset */
   156402 
   156403 
   156404 #define GEN75_MI_FLUSH_GlobalSnapshotCountReset_bits  1
   156405 #define GEN7_MI_FLUSH_GlobalSnapshotCountReset_bits  1
   156406 #define GEN6_MI_FLUSH_GlobalSnapshotCountReset_bits  1
   156407 #define GEN5_MI_FLUSH_GlobalSnapshotCountReset_bits  1
   156408 #define GEN45_MI_FLUSH_GlobalSnapshotCountReset_bits  1
   156409 #define GEN4_MI_FLUSH_GlobalSnapshotCountReset_bits  1
   156410 
   156411 static inline uint32_t ATTRIBUTE_PURE
   156412 MI_FLUSH_GlobalSnapshotCountReset_bits(const struct gen_device_info *devinfo)
   156413 {
   156414    switch (devinfo->gen) {
   156415    case 10: return 0;
   156416    case 9: return 0;
   156417    case 8: return 0;
   156418    case 7:
   156419       if (devinfo->is_haswell) {
   156420          return 1;
   156421       } else {
   156422          return 1;
   156423       }
   156424    case 6: return 1;
   156425    case 5: return 1;
   156426    case 4:
   156427       if (devinfo->is_g4x) {
   156428          return 1;
   156429       } else {
   156430          return 1;
   156431       }
   156432    default:
   156433       unreachable("Invalid hardware generation");
   156434    }
   156435 }
   156436 
   156437 
   156438 
   156439 #define GEN75_MI_FLUSH_GlobalSnapshotCountReset_start  3
   156440 #define GEN7_MI_FLUSH_GlobalSnapshotCountReset_start  3
   156441 #define GEN6_MI_FLUSH_GlobalSnapshotCountReset_start  3
   156442 #define GEN5_MI_FLUSH_GlobalSnapshotCountReset_start  3
   156443 #define GEN45_MI_FLUSH_GlobalSnapshotCountReset_start  3
   156444 #define GEN4_MI_FLUSH_GlobalSnapshotCountReset_start  3
   156445 
   156446 static inline uint32_t ATTRIBUTE_PURE
   156447 MI_FLUSH_GlobalSnapshotCountReset_start(const struct gen_device_info *devinfo)
   156448 {
   156449    switch (devinfo->gen) {
   156450    case 10: return 0;
   156451    case 9: return 0;
   156452    case 8: return 0;
   156453    case 7:
   156454       if (devinfo->is_haswell) {
   156455          return 3;
   156456       } else {
   156457          return 3;
   156458       }
   156459    case 6: return 3;
   156460    case 5: return 3;
   156461    case 4:
   156462       if (devinfo->is_g4x) {
   156463          return 3;
   156464       } else {
   156465          return 3;
   156466       }
   156467    default:
   156468       unreachable("Invalid hardware generation");
   156469    }
   156470 }
   156471 
   156472 
   156473 
   156474 /* MI_FLUSH::Indirect State Pointers Disable */
   156475 
   156476 
   156477 #define GEN75_MI_FLUSH_IndirectStatePointersDisable_bits  1
   156478 #define GEN7_MI_FLUSH_IndirectStatePointersDisable_bits  1
   156479 #define GEN6_MI_FLUSH_IndirectStatePointersDisable_bits  1
   156480 #define GEN5_MI_FLUSH_IndirectStatePointersDisable_bits  1
   156481 
   156482 static inline uint32_t ATTRIBUTE_PURE
   156483 MI_FLUSH_IndirectStatePointersDisable_bits(const struct gen_device_info *devinfo)
   156484 {
   156485    switch (devinfo->gen) {
   156486    case 10: return 0;
   156487    case 9: return 0;
   156488    case 8: return 0;
   156489    case 7:
   156490       if (devinfo->is_haswell) {
   156491          return 1;
   156492       } else {
   156493          return 1;
   156494       }
   156495    case 6: return 1;
   156496    case 5: return 1;
   156497    case 4:
   156498       if (devinfo->is_g4x) {
   156499          return 0;
   156500       } else {
   156501          return 0;
   156502       }
   156503    default:
   156504       unreachable("Invalid hardware generation");
   156505    }
   156506 }
   156507 
   156508 
   156509 
   156510 #define GEN75_MI_FLUSH_IndirectStatePointersDisable_start  5
   156511 #define GEN7_MI_FLUSH_IndirectStatePointersDisable_start  5
   156512 #define GEN6_MI_FLUSH_IndirectStatePointersDisable_start  5
   156513 #define GEN5_MI_FLUSH_IndirectStatePointersDisable_start  5
   156514 
   156515 static inline uint32_t ATTRIBUTE_PURE
   156516 MI_FLUSH_IndirectStatePointersDisable_start(const struct gen_device_info *devinfo)
   156517 {
   156518    switch (devinfo->gen) {
   156519    case 10: return 0;
   156520    case 9: return 0;
   156521    case 8: return 0;
   156522    case 7:
   156523       if (devinfo->is_haswell) {
   156524          return 5;
   156525       } else {
   156526          return 5;
   156527       }
   156528    case 6: return 5;
   156529    case 5: return 5;
   156530    case 4:
   156531       if (devinfo->is_g4x) {
   156532          return 0;
   156533       } else {
   156534          return 0;
   156535       }
   156536    default:
   156537       unreachable("Invalid hardware generation");
   156538    }
   156539 }
   156540 
   156541 
   156542 
   156543 /* MI_FLUSH::MI Command Opcode */
   156544 
   156545 
   156546 #define GEN75_MI_FLUSH_MICommandOpcode_bits  6
   156547 #define GEN7_MI_FLUSH_MICommandOpcode_bits  6
   156548 #define GEN6_MI_FLUSH_MICommandOpcode_bits  6
   156549 #define GEN5_MI_FLUSH_MICommandOpcode_bits  6
   156550 #define GEN45_MI_FLUSH_MICommandOpcode_bits  6
   156551 #define GEN4_MI_FLUSH_MICommandOpcode_bits  6
   156552 
   156553 static inline uint32_t ATTRIBUTE_PURE
   156554 MI_FLUSH_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   156555 {
   156556    switch (devinfo->gen) {
   156557    case 10: return 0;
   156558    case 9: return 0;
   156559    case 8: return 0;
   156560    case 7:
   156561       if (devinfo->is_haswell) {
   156562          return 6;
   156563       } else {
   156564          return 6;
   156565       }
   156566    case 6: return 6;
   156567    case 5: return 6;
   156568    case 4:
   156569       if (devinfo->is_g4x) {
   156570          return 6;
   156571       } else {
   156572          return 6;
   156573       }
   156574    default:
   156575       unreachable("Invalid hardware generation");
   156576    }
   156577 }
   156578 
   156579 
   156580 
   156581 #define GEN75_MI_FLUSH_MICommandOpcode_start  23
   156582 #define GEN7_MI_FLUSH_MICommandOpcode_start  23
   156583 #define GEN6_MI_FLUSH_MICommandOpcode_start  23
   156584 #define GEN5_MI_FLUSH_MICommandOpcode_start  23
   156585 #define GEN45_MI_FLUSH_MICommandOpcode_start  23
   156586 #define GEN4_MI_FLUSH_MICommandOpcode_start  23
   156587 
   156588 static inline uint32_t ATTRIBUTE_PURE
   156589 MI_FLUSH_MICommandOpcode_start(const struct gen_device_info *devinfo)
   156590 {
   156591    switch (devinfo->gen) {
   156592    case 10: return 0;
   156593    case 9: return 0;
   156594    case 8: return 0;
   156595    case 7:
   156596       if (devinfo->is_haswell) {
   156597          return 23;
   156598       } else {
   156599          return 23;
   156600       }
   156601    case 6: return 23;
   156602    case 5: return 23;
   156603    case 4:
   156604       if (devinfo->is_g4x) {
   156605          return 23;
   156606       } else {
   156607          return 23;
   156608       }
   156609    default:
   156610       unreachable("Invalid hardware generation");
   156611    }
   156612 }
   156613 
   156614 
   156615 
   156616 /* MI_FLUSH::Protected Memory Enable */
   156617 
   156618 
   156619 #define GEN5_MI_FLUSH_ProtectedMemoryEnable_bits  1
   156620 
   156621 static inline uint32_t ATTRIBUTE_PURE
   156622 MI_FLUSH_ProtectedMemoryEnable_bits(const struct gen_device_info *devinfo)
   156623 {
   156624    switch (devinfo->gen) {
   156625    case 10: return 0;
   156626    case 9: return 0;
   156627    case 8: return 0;
   156628    case 7:
   156629       if (devinfo->is_haswell) {
   156630          return 0;
   156631       } else {
   156632          return 0;
   156633       }
   156634    case 6: return 0;
   156635    case 5: return 1;
   156636    case 4:
   156637       if (devinfo->is_g4x) {
   156638          return 0;
   156639       } else {
   156640          return 0;
   156641       }
   156642    default:
   156643       unreachable("Invalid hardware generation");
   156644    }
   156645 }
   156646 
   156647 
   156648 
   156649 #define GEN5_MI_FLUSH_ProtectedMemoryEnable_start  6
   156650 
   156651 static inline uint32_t ATTRIBUTE_PURE
   156652 MI_FLUSH_ProtectedMemoryEnable_start(const struct gen_device_info *devinfo)
   156653 {
   156654    switch (devinfo->gen) {
   156655    case 10: return 0;
   156656    case 9: return 0;
   156657    case 8: return 0;
   156658    case 7:
   156659       if (devinfo->is_haswell) {
   156660          return 0;
   156661       } else {
   156662          return 0;
   156663       }
   156664    case 6: return 0;
   156665    case 5: return 6;
   156666    case 4:
   156667       if (devinfo->is_g4x) {
   156668          return 0;
   156669       } else {
   156670          return 0;
   156671       }
   156672    default:
   156673       unreachable("Invalid hardware generation");
   156674    }
   156675 }
   156676 
   156677 
   156678 
   156679 /* MI_FLUSH::Render Cache Flush Inhibit */
   156680 
   156681 
   156682 #define GEN75_MI_FLUSH_RenderCacheFlushInhibit_bits  1
   156683 #define GEN7_MI_FLUSH_RenderCacheFlushInhibit_bits  1
   156684 #define GEN6_MI_FLUSH_RenderCacheFlushInhibit_bits  1
   156685 #define GEN5_MI_FLUSH_RenderCacheFlushInhibit_bits  1
   156686 #define GEN45_MI_FLUSH_RenderCacheFlushInhibit_bits  1
   156687 #define GEN4_MI_FLUSH_RenderCacheFlushInhibit_bits  1
   156688 
   156689 static inline uint32_t ATTRIBUTE_PURE
   156690 MI_FLUSH_RenderCacheFlushInhibit_bits(const struct gen_device_info *devinfo)
   156691 {
   156692    switch (devinfo->gen) {
   156693    case 10: return 0;
   156694    case 9: return 0;
   156695    case 8: return 0;
   156696    case 7:
   156697       if (devinfo->is_haswell) {
   156698          return 1;
   156699       } else {
   156700          return 1;
   156701       }
   156702    case 6: return 1;
   156703    case 5: return 1;
   156704    case 4:
   156705       if (devinfo->is_g4x) {
   156706          return 1;
   156707       } else {
   156708          return 1;
   156709       }
   156710    default:
   156711       unreachable("Invalid hardware generation");
   156712    }
   156713 }
   156714 
   156715 
   156716 
   156717 #define GEN75_MI_FLUSH_RenderCacheFlushInhibit_start  2
   156718 #define GEN7_MI_FLUSH_RenderCacheFlushInhibit_start  2
   156719 #define GEN6_MI_FLUSH_RenderCacheFlushInhibit_start  2
   156720 #define GEN5_MI_FLUSH_RenderCacheFlushInhibit_start  2
   156721 #define GEN45_MI_FLUSH_RenderCacheFlushInhibit_start  2
   156722 #define GEN4_MI_FLUSH_RenderCacheFlushInhibit_start  2
   156723 
   156724 static inline uint32_t ATTRIBUTE_PURE
   156725 MI_FLUSH_RenderCacheFlushInhibit_start(const struct gen_device_info *devinfo)
   156726 {
   156727    switch (devinfo->gen) {
   156728    case 10: return 0;
   156729    case 9: return 0;
   156730    case 8: return 0;
   156731    case 7:
   156732       if (devinfo->is_haswell) {
   156733          return 2;
   156734       } else {
   156735          return 2;
   156736       }
   156737    case 6: return 2;
   156738    case 5: return 2;
   156739    case 4:
   156740       if (devinfo->is_g4x) {
   156741          return 2;
   156742       } else {
   156743          return 2;
   156744       }
   156745    default:
   156746       unreachable("Invalid hardware generation");
   156747    }
   156748 }
   156749 
   156750 
   156751 
   156752 /* MI_FLUSH::State/Instruction Cache Invalidate */
   156753 
   156754 
   156755 #define GEN75_MI_FLUSH_StateInstructionCacheInvalidate_bits  1
   156756 #define GEN7_MI_FLUSH_StateInstructionCacheInvalidate_bits  1
   156757 #define GEN6_MI_FLUSH_StateInstructionCacheInvalidate_bits  1
   156758 #define GEN5_MI_FLUSH_StateInstructionCacheInvalidate_bits  1
   156759 #define GEN45_MI_FLUSH_StateInstructionCacheInvalidate_bits  1
   156760 #define GEN4_MI_FLUSH_StateInstructionCacheInvalidate_bits  1
   156761 
   156762 static inline uint32_t ATTRIBUTE_PURE
   156763 MI_FLUSH_StateInstructionCacheInvalidate_bits(const struct gen_device_info *devinfo)
   156764 {
   156765    switch (devinfo->gen) {
   156766    case 10: return 0;
   156767    case 9: return 0;
   156768    case 8: return 0;
   156769    case 7:
   156770       if (devinfo->is_haswell) {
   156771          return 1;
   156772       } else {
   156773          return 1;
   156774       }
   156775    case 6: return 1;
   156776    case 5: return 1;
   156777    case 4:
   156778       if (devinfo->is_g4x) {
   156779          return 1;
   156780       } else {
   156781          return 1;
   156782       }
   156783    default:
   156784       unreachable("Invalid hardware generation");
   156785    }
   156786 }
   156787 
   156788 
   156789 
   156790 #define GEN75_MI_FLUSH_StateInstructionCacheInvalidate_start  1
   156791 #define GEN7_MI_FLUSH_StateInstructionCacheInvalidate_start  1
   156792 #define GEN6_MI_FLUSH_StateInstructionCacheInvalidate_start  1
   156793 #define GEN5_MI_FLUSH_StateInstructionCacheInvalidate_start  1
   156794 #define GEN45_MI_FLUSH_StateInstructionCacheInvalidate_start  1
   156795 #define GEN4_MI_FLUSH_StateInstructionCacheInvalidate_start  1
   156796 
   156797 static inline uint32_t ATTRIBUTE_PURE
   156798 MI_FLUSH_StateInstructionCacheInvalidate_start(const struct gen_device_info *devinfo)
   156799 {
   156800    switch (devinfo->gen) {
   156801    case 10: return 0;
   156802    case 9: return 0;
   156803    case 8: return 0;
   156804    case 7:
   156805       if (devinfo->is_haswell) {
   156806          return 1;
   156807       } else {
   156808          return 1;
   156809       }
   156810    case 6: return 1;
   156811    case 5: return 1;
   156812    case 4:
   156813       if (devinfo->is_g4x) {
   156814          return 1;
   156815       } else {
   156816          return 1;
   156817       }
   156818    default:
   156819       unreachable("Invalid hardware generation");
   156820    }
   156821 }
   156822 
   156823 
   156824 
   156825 /* MI_FORCE_WAKEUP */
   156826 
   156827 
   156828 #define GEN10_MI_FORCE_WAKEUP_length  2
   156829 #define GEN9_MI_FORCE_WAKEUP_length  2
   156830 
   156831 static inline uint32_t ATTRIBUTE_PURE
   156832 MI_FORCE_WAKEUP_length(const struct gen_device_info *devinfo)
   156833 {
   156834    switch (devinfo->gen) {
   156835    case 10: return 2;
   156836    case 9: return 2;
   156837    case 8: return 0;
   156838    case 7:
   156839       if (devinfo->is_haswell) {
   156840          return 0;
   156841       } else {
   156842          return 0;
   156843       }
   156844    case 6: return 0;
   156845    case 5: return 0;
   156846    case 4:
   156847       if (devinfo->is_g4x) {
   156848          return 0;
   156849       } else {
   156850          return 0;
   156851       }
   156852    default:
   156853       unreachable("Invalid hardware generation");
   156854    }
   156855 }
   156856 
   156857 
   156858 
   156859 /* MI_FORCE_WAKEUP::Command Type */
   156860 
   156861 
   156862 #define GEN10_MI_FORCE_WAKEUP_CommandType_bits  3
   156863 #define GEN9_MI_FORCE_WAKEUP_CommandType_bits  3
   156864 
   156865 static inline uint32_t ATTRIBUTE_PURE
   156866 MI_FORCE_WAKEUP_CommandType_bits(const struct gen_device_info *devinfo)
   156867 {
   156868    switch (devinfo->gen) {
   156869    case 10: return 3;
   156870    case 9: return 3;
   156871    case 8: return 0;
   156872    case 7:
   156873       if (devinfo->is_haswell) {
   156874          return 0;
   156875       } else {
   156876          return 0;
   156877       }
   156878    case 6: return 0;
   156879    case 5: return 0;
   156880    case 4:
   156881       if (devinfo->is_g4x) {
   156882          return 0;
   156883       } else {
   156884          return 0;
   156885       }
   156886    default:
   156887       unreachable("Invalid hardware generation");
   156888    }
   156889 }
   156890 
   156891 
   156892 
   156893 #define GEN10_MI_FORCE_WAKEUP_CommandType_start  29
   156894 #define GEN9_MI_FORCE_WAKEUP_CommandType_start  29
   156895 
   156896 static inline uint32_t ATTRIBUTE_PURE
   156897 MI_FORCE_WAKEUP_CommandType_start(const struct gen_device_info *devinfo)
   156898 {
   156899    switch (devinfo->gen) {
   156900    case 10: return 29;
   156901    case 9: return 29;
   156902    case 8: return 0;
   156903    case 7:
   156904       if (devinfo->is_haswell) {
   156905          return 0;
   156906       } else {
   156907          return 0;
   156908       }
   156909    case 6: return 0;
   156910    case 5: return 0;
   156911    case 4:
   156912       if (devinfo->is_g4x) {
   156913          return 0;
   156914       } else {
   156915          return 0;
   156916       }
   156917    default:
   156918       unreachable("Invalid hardware generation");
   156919    }
   156920 }
   156921 
   156922 
   156923 
   156924 /* MI_FORCE_WAKEUP::DWord Length */
   156925 
   156926 
   156927 #define GEN10_MI_FORCE_WAKEUP_DWordLength_bits  8
   156928 #define GEN9_MI_FORCE_WAKEUP_DWordLength_bits  8
   156929 
   156930 static inline uint32_t ATTRIBUTE_PURE
   156931 MI_FORCE_WAKEUP_DWordLength_bits(const struct gen_device_info *devinfo)
   156932 {
   156933    switch (devinfo->gen) {
   156934    case 10: return 8;
   156935    case 9: return 8;
   156936    case 8: return 0;
   156937    case 7:
   156938       if (devinfo->is_haswell) {
   156939          return 0;
   156940       } else {
   156941          return 0;
   156942       }
   156943    case 6: return 0;
   156944    case 5: return 0;
   156945    case 4:
   156946       if (devinfo->is_g4x) {
   156947          return 0;
   156948       } else {
   156949          return 0;
   156950       }
   156951    default:
   156952       unreachable("Invalid hardware generation");
   156953    }
   156954 }
   156955 
   156956 
   156957 
   156958 #define GEN10_MI_FORCE_WAKEUP_DWordLength_start  0
   156959 #define GEN9_MI_FORCE_WAKEUP_DWordLength_start  0
   156960 
   156961 static inline uint32_t ATTRIBUTE_PURE
   156962 MI_FORCE_WAKEUP_DWordLength_start(const struct gen_device_info *devinfo)
   156963 {
   156964    switch (devinfo->gen) {
   156965    case 10: return 0;
   156966    case 9: return 0;
   156967    case 8: return 0;
   156968    case 7:
   156969       if (devinfo->is_haswell) {
   156970          return 0;
   156971       } else {
   156972          return 0;
   156973       }
   156974    case 6: return 0;
   156975    case 5: return 0;
   156976    case 4:
   156977       if (devinfo->is_g4x) {
   156978          return 0;
   156979       } else {
   156980          return 0;
   156981       }
   156982    default:
   156983       unreachable("Invalid hardware generation");
   156984    }
   156985 }
   156986 
   156987 
   156988 
   156989 /* MI_FORCE_WAKEUP::Force Media Awake */
   156990 
   156991 
   156992 #define GEN10_MI_FORCE_WAKEUP_ForceMediaAwake_bits  1
   156993 #define GEN9_MI_FORCE_WAKEUP_ForceMediaAwake_bits  1
   156994 
   156995 static inline uint32_t ATTRIBUTE_PURE
   156996 MI_FORCE_WAKEUP_ForceMediaAwake_bits(const struct gen_device_info *devinfo)
   156997 {
   156998    switch (devinfo->gen) {
   156999    case 10: return 1;
   157000    case 9: return 1;
   157001    case 8: return 0;
   157002    case 7:
   157003       if (devinfo->is_haswell) {
   157004          return 0;
   157005       } else {
   157006          return 0;
   157007       }
   157008    case 6: return 0;
   157009    case 5: return 0;
   157010    case 4:
   157011       if (devinfo->is_g4x) {
   157012          return 0;
   157013       } else {
   157014          return 0;
   157015       }
   157016    default:
   157017       unreachable("Invalid hardware generation");
   157018    }
   157019 }
   157020 
   157021 
   157022 
   157023 #define GEN10_MI_FORCE_WAKEUP_ForceMediaAwake_start  32
   157024 #define GEN9_MI_FORCE_WAKEUP_ForceMediaAwake_start  32
   157025 
   157026 static inline uint32_t ATTRIBUTE_PURE
   157027 MI_FORCE_WAKEUP_ForceMediaAwake_start(const struct gen_device_info *devinfo)
   157028 {
   157029    switch (devinfo->gen) {
   157030    case 10: return 32;
   157031    case 9: return 32;
   157032    case 8: return 0;
   157033    case 7:
   157034       if (devinfo->is_haswell) {
   157035          return 0;
   157036       } else {
   157037          return 0;
   157038       }
   157039    case 6: return 0;
   157040    case 5: return 0;
   157041    case 4:
   157042       if (devinfo->is_g4x) {
   157043          return 0;
   157044       } else {
   157045          return 0;
   157046       }
   157047    default:
   157048       unreachable("Invalid hardware generation");
   157049    }
   157050 }
   157051 
   157052 
   157053 
   157054 /* MI_FORCE_WAKEUP::Force Render Awake */
   157055 
   157056 
   157057 #define GEN10_MI_FORCE_WAKEUP_ForceRenderAwake_bits  1
   157058 #define GEN9_MI_FORCE_WAKEUP_ForceRenderAwake_bits  1
   157059 
   157060 static inline uint32_t ATTRIBUTE_PURE
   157061 MI_FORCE_WAKEUP_ForceRenderAwake_bits(const struct gen_device_info *devinfo)
   157062 {
   157063    switch (devinfo->gen) {
   157064    case 10: return 1;
   157065    case 9: return 1;
   157066    case 8: return 0;
   157067    case 7:
   157068       if (devinfo->is_haswell) {
   157069          return 0;
   157070       } else {
   157071          return 0;
   157072       }
   157073    case 6: return 0;
   157074    case 5: return 0;
   157075    case 4:
   157076       if (devinfo->is_g4x) {
   157077          return 0;
   157078       } else {
   157079          return 0;
   157080       }
   157081    default:
   157082       unreachable("Invalid hardware generation");
   157083    }
   157084 }
   157085 
   157086 
   157087 
   157088 #define GEN10_MI_FORCE_WAKEUP_ForceRenderAwake_start  33
   157089 #define GEN9_MI_FORCE_WAKEUP_ForceRenderAwake_start  33
   157090 
   157091 static inline uint32_t ATTRIBUTE_PURE
   157092 MI_FORCE_WAKEUP_ForceRenderAwake_start(const struct gen_device_info *devinfo)
   157093 {
   157094    switch (devinfo->gen) {
   157095    case 10: return 33;
   157096    case 9: return 33;
   157097    case 8: return 0;
   157098    case 7:
   157099       if (devinfo->is_haswell) {
   157100          return 0;
   157101       } else {
   157102          return 0;
   157103       }
   157104    case 6: return 0;
   157105    case 5: return 0;
   157106    case 4:
   157107       if (devinfo->is_g4x) {
   157108          return 0;
   157109       } else {
   157110          return 0;
   157111       }
   157112    default:
   157113       unreachable("Invalid hardware generation");
   157114    }
   157115 }
   157116 
   157117 
   157118 
   157119 /* MI_FORCE_WAKEUP::MI Command Opcode */
   157120 
   157121 
   157122 #define GEN10_MI_FORCE_WAKEUP_MICommandOpcode_bits  6
   157123 #define GEN9_MI_FORCE_WAKEUP_MICommandOpcode_bits  6
   157124 
   157125 static inline uint32_t ATTRIBUTE_PURE
   157126 MI_FORCE_WAKEUP_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   157127 {
   157128    switch (devinfo->gen) {
   157129    case 10: return 6;
   157130    case 9: return 6;
   157131    case 8: return 0;
   157132    case 7:
   157133       if (devinfo->is_haswell) {
   157134          return 0;
   157135       } else {
   157136          return 0;
   157137       }
   157138    case 6: return 0;
   157139    case 5: return 0;
   157140    case 4:
   157141       if (devinfo->is_g4x) {
   157142          return 0;
   157143       } else {
   157144          return 0;
   157145       }
   157146    default:
   157147       unreachable("Invalid hardware generation");
   157148    }
   157149 }
   157150 
   157151 
   157152 
   157153 #define GEN10_MI_FORCE_WAKEUP_MICommandOpcode_start  23
   157154 #define GEN9_MI_FORCE_WAKEUP_MICommandOpcode_start  23
   157155 
   157156 static inline uint32_t ATTRIBUTE_PURE
   157157 MI_FORCE_WAKEUP_MICommandOpcode_start(const struct gen_device_info *devinfo)
   157158 {
   157159    switch (devinfo->gen) {
   157160    case 10: return 23;
   157161    case 9: return 23;
   157162    case 8: return 0;
   157163    case 7:
   157164       if (devinfo->is_haswell) {
   157165          return 0;
   157166       } else {
   157167          return 0;
   157168       }
   157169    case 6: return 0;
   157170    case 5: return 0;
   157171    case 4:
   157172       if (devinfo->is_g4x) {
   157173          return 0;
   157174       } else {
   157175          return 0;
   157176       }
   157177    default:
   157178       unreachable("Invalid hardware generation");
   157179    }
   157180 }
   157181 
   157182 
   157183 
   157184 /* MI_FORCE_WAKEUP::Mask Bits */
   157185 
   157186 
   157187 #define GEN10_MI_FORCE_WAKEUP_MaskBits_bits  16
   157188 #define GEN9_MI_FORCE_WAKEUP_MaskBits_bits  16
   157189 
   157190 static inline uint32_t ATTRIBUTE_PURE
   157191 MI_FORCE_WAKEUP_MaskBits_bits(const struct gen_device_info *devinfo)
   157192 {
   157193    switch (devinfo->gen) {
   157194    case 10: return 16;
   157195    case 9: return 16;
   157196    case 8: return 0;
   157197    case 7:
   157198       if (devinfo->is_haswell) {
   157199          return 0;
   157200       } else {
   157201          return 0;
   157202       }
   157203    case 6: return 0;
   157204    case 5: return 0;
   157205    case 4:
   157206       if (devinfo->is_g4x) {
   157207          return 0;
   157208       } else {
   157209          return 0;
   157210       }
   157211    default:
   157212       unreachable("Invalid hardware generation");
   157213    }
   157214 }
   157215 
   157216 
   157217 
   157218 #define GEN10_MI_FORCE_WAKEUP_MaskBits_start  48
   157219 #define GEN9_MI_FORCE_WAKEUP_MaskBits_start  48
   157220 
   157221 static inline uint32_t ATTRIBUTE_PURE
   157222 MI_FORCE_WAKEUP_MaskBits_start(const struct gen_device_info *devinfo)
   157223 {
   157224    switch (devinfo->gen) {
   157225    case 10: return 48;
   157226    case 9: return 48;
   157227    case 8: return 0;
   157228    case 7:
   157229       if (devinfo->is_haswell) {
   157230          return 0;
   157231       } else {
   157232          return 0;
   157233       }
   157234    case 6: return 0;
   157235    case 5: return 0;
   157236    case 4:
   157237       if (devinfo->is_g4x) {
   157238          return 0;
   157239       } else {
   157240          return 0;
   157241       }
   157242    default:
   157243       unreachable("Invalid hardware generation");
   157244    }
   157245 }
   157246 
   157247 
   157248 
   157249 /* MI_LOAD_REGISTER_IMM */
   157250 
   157251 
   157252 #define GEN10_MI_LOAD_REGISTER_IMM_length  3
   157253 #define GEN9_MI_LOAD_REGISTER_IMM_length  3
   157254 #define GEN8_MI_LOAD_REGISTER_IMM_length  3
   157255 #define GEN75_MI_LOAD_REGISTER_IMM_length  3
   157256 #define GEN7_MI_LOAD_REGISTER_IMM_length  3
   157257 #define GEN6_MI_LOAD_REGISTER_IMM_length  3
   157258 #define GEN5_MI_LOAD_REGISTER_IMM_length  3
   157259 #define GEN45_MI_LOAD_REGISTER_IMM_length  3
   157260 #define GEN4_MI_LOAD_REGISTER_IMM_length  3
   157261 
   157262 static inline uint32_t ATTRIBUTE_PURE
   157263 MI_LOAD_REGISTER_IMM_length(const struct gen_device_info *devinfo)
   157264 {
   157265    switch (devinfo->gen) {
   157266    case 10: return 3;
   157267    case 9: return 3;
   157268    case 8: return 3;
   157269    case 7:
   157270       if (devinfo->is_haswell) {
   157271          return 3;
   157272       } else {
   157273          return 3;
   157274       }
   157275    case 6: return 3;
   157276    case 5: return 3;
   157277    case 4:
   157278       if (devinfo->is_g4x) {
   157279          return 3;
   157280       } else {
   157281          return 3;
   157282       }
   157283    default:
   157284       unreachable("Invalid hardware generation");
   157285    }
   157286 }
   157287 
   157288 
   157289 
   157290 /* MI_LOAD_REGISTER_IMM::Byte Write Disables */
   157291 
   157292 
   157293 #define GEN10_MI_LOAD_REGISTER_IMM_ByteWriteDisables_bits  4
   157294 #define GEN9_MI_LOAD_REGISTER_IMM_ByteWriteDisables_bits  4
   157295 #define GEN8_MI_LOAD_REGISTER_IMM_ByteWriteDisables_bits  4
   157296 #define GEN75_MI_LOAD_REGISTER_IMM_ByteWriteDisables_bits  4
   157297 #define GEN7_MI_LOAD_REGISTER_IMM_ByteWriteDisables_bits  4
   157298 #define GEN6_MI_LOAD_REGISTER_IMM_ByteWriteDisables_bits  4
   157299 #define GEN5_MI_LOAD_REGISTER_IMM_ByteWriteDisables_bits  4
   157300 #define GEN45_MI_LOAD_REGISTER_IMM_ByteWriteDisables_bits  4
   157301 #define GEN4_MI_LOAD_REGISTER_IMM_ByteWriteDisables_bits  4
   157302 
   157303 static inline uint32_t ATTRIBUTE_PURE
   157304 MI_LOAD_REGISTER_IMM_ByteWriteDisables_bits(const struct gen_device_info *devinfo)
   157305 {
   157306    switch (devinfo->gen) {
   157307    case 10: return 4;
   157308    case 9: return 4;
   157309    case 8: return 4;
   157310    case 7:
   157311       if (devinfo->is_haswell) {
   157312          return 4;
   157313       } else {
   157314          return 4;
   157315       }
   157316    case 6: return 4;
   157317    case 5: return 4;
   157318    case 4:
   157319       if (devinfo->is_g4x) {
   157320          return 4;
   157321       } else {
   157322          return 4;
   157323       }
   157324    default:
   157325       unreachable("Invalid hardware generation");
   157326    }
   157327 }
   157328 
   157329 
   157330 
   157331 #define GEN10_MI_LOAD_REGISTER_IMM_ByteWriteDisables_start  8
   157332 #define GEN9_MI_LOAD_REGISTER_IMM_ByteWriteDisables_start  8
   157333 #define GEN8_MI_LOAD_REGISTER_IMM_ByteWriteDisables_start  8
   157334 #define GEN75_MI_LOAD_REGISTER_IMM_ByteWriteDisables_start  8
   157335 #define GEN7_MI_LOAD_REGISTER_IMM_ByteWriteDisables_start  8
   157336 #define GEN6_MI_LOAD_REGISTER_IMM_ByteWriteDisables_start  8
   157337 #define GEN5_MI_LOAD_REGISTER_IMM_ByteWriteDisables_start  8
   157338 #define GEN45_MI_LOAD_REGISTER_IMM_ByteWriteDisables_start  8
   157339 #define GEN4_MI_LOAD_REGISTER_IMM_ByteWriteDisables_start  8
   157340 
   157341 static inline uint32_t ATTRIBUTE_PURE
   157342 MI_LOAD_REGISTER_IMM_ByteWriteDisables_start(const struct gen_device_info *devinfo)
   157343 {
   157344    switch (devinfo->gen) {
   157345    case 10: return 8;
   157346    case 9: return 8;
   157347    case 8: return 8;
   157348    case 7:
   157349       if (devinfo->is_haswell) {
   157350          return 8;
   157351       } else {
   157352          return 8;
   157353       }
   157354    case 6: return 8;
   157355    case 5: return 8;
   157356    case 4:
   157357       if (devinfo->is_g4x) {
   157358          return 8;
   157359       } else {
   157360          return 8;
   157361       }
   157362    default:
   157363       unreachable("Invalid hardware generation");
   157364    }
   157365 }
   157366 
   157367 
   157368 
   157369 /* MI_LOAD_REGISTER_IMM::Command Type */
   157370 
   157371 
   157372 #define GEN10_MI_LOAD_REGISTER_IMM_CommandType_bits  3
   157373 #define GEN9_MI_LOAD_REGISTER_IMM_CommandType_bits  3
   157374 #define GEN8_MI_LOAD_REGISTER_IMM_CommandType_bits  3
   157375 #define GEN75_MI_LOAD_REGISTER_IMM_CommandType_bits  3
   157376 #define GEN7_MI_LOAD_REGISTER_IMM_CommandType_bits  3
   157377 #define GEN6_MI_LOAD_REGISTER_IMM_CommandType_bits  3
   157378 #define GEN5_MI_LOAD_REGISTER_IMM_CommandType_bits  3
   157379 #define GEN45_MI_LOAD_REGISTER_IMM_CommandType_bits  3
   157380 #define GEN4_MI_LOAD_REGISTER_IMM_CommandType_bits  3
   157381 
   157382 static inline uint32_t ATTRIBUTE_PURE
   157383 MI_LOAD_REGISTER_IMM_CommandType_bits(const struct gen_device_info *devinfo)
   157384 {
   157385    switch (devinfo->gen) {
   157386    case 10: return 3;
   157387    case 9: return 3;
   157388    case 8: return 3;
   157389    case 7:
   157390       if (devinfo->is_haswell) {
   157391          return 3;
   157392       } else {
   157393          return 3;
   157394       }
   157395    case 6: return 3;
   157396    case 5: return 3;
   157397    case 4:
   157398       if (devinfo->is_g4x) {
   157399          return 3;
   157400       } else {
   157401          return 3;
   157402       }
   157403    default:
   157404       unreachable("Invalid hardware generation");
   157405    }
   157406 }
   157407 
   157408 
   157409 
   157410 #define GEN10_MI_LOAD_REGISTER_IMM_CommandType_start  29
   157411 #define GEN9_MI_LOAD_REGISTER_IMM_CommandType_start  29
   157412 #define GEN8_MI_LOAD_REGISTER_IMM_CommandType_start  29
   157413 #define GEN75_MI_LOAD_REGISTER_IMM_CommandType_start  29
   157414 #define GEN7_MI_LOAD_REGISTER_IMM_CommandType_start  29
   157415 #define GEN6_MI_LOAD_REGISTER_IMM_CommandType_start  29
   157416 #define GEN5_MI_LOAD_REGISTER_IMM_CommandType_start  29
   157417 #define GEN45_MI_LOAD_REGISTER_IMM_CommandType_start  29
   157418 #define GEN4_MI_LOAD_REGISTER_IMM_CommandType_start  29
   157419 
   157420 static inline uint32_t ATTRIBUTE_PURE
   157421 MI_LOAD_REGISTER_IMM_CommandType_start(const struct gen_device_info *devinfo)
   157422 {
   157423    switch (devinfo->gen) {
   157424    case 10: return 29;
   157425    case 9: return 29;
   157426    case 8: return 29;
   157427    case 7:
   157428       if (devinfo->is_haswell) {
   157429          return 29;
   157430       } else {
   157431          return 29;
   157432       }
   157433    case 6: return 29;
   157434    case 5: return 29;
   157435    case 4:
   157436       if (devinfo->is_g4x) {
   157437          return 29;
   157438       } else {
   157439          return 29;
   157440       }
   157441    default:
   157442       unreachable("Invalid hardware generation");
   157443    }
   157444 }
   157445 
   157446 
   157447 
   157448 /* MI_LOAD_REGISTER_IMM::DWord Length */
   157449 
   157450 
   157451 #define GEN10_MI_LOAD_REGISTER_IMM_DWordLength_bits  8
   157452 #define GEN9_MI_LOAD_REGISTER_IMM_DWordLength_bits  8
   157453 #define GEN8_MI_LOAD_REGISTER_IMM_DWordLength_bits  8
   157454 #define GEN75_MI_LOAD_REGISTER_IMM_DWordLength_bits  8
   157455 #define GEN7_MI_LOAD_REGISTER_IMM_DWordLength_bits  8
   157456 #define GEN6_MI_LOAD_REGISTER_IMM_DWordLength_bits  8
   157457 #define GEN5_MI_LOAD_REGISTER_IMM_DWordLength_bits  6
   157458 #define GEN45_MI_LOAD_REGISTER_IMM_DWordLength_bits  6
   157459 #define GEN4_MI_LOAD_REGISTER_IMM_DWordLength_bits  6
   157460 
   157461 static inline uint32_t ATTRIBUTE_PURE
   157462 MI_LOAD_REGISTER_IMM_DWordLength_bits(const struct gen_device_info *devinfo)
   157463 {
   157464    switch (devinfo->gen) {
   157465    case 10: return 8;
   157466    case 9: return 8;
   157467    case 8: return 8;
   157468    case 7:
   157469       if (devinfo->is_haswell) {
   157470          return 8;
   157471       } else {
   157472          return 8;
   157473       }
   157474    case 6: return 8;
   157475    case 5: return 6;
   157476    case 4:
   157477       if (devinfo->is_g4x) {
   157478          return 6;
   157479       } else {
   157480          return 6;
   157481       }
   157482    default:
   157483       unreachable("Invalid hardware generation");
   157484    }
   157485 }
   157486 
   157487 
   157488 
   157489 #define GEN10_MI_LOAD_REGISTER_IMM_DWordLength_start  0
   157490 #define GEN9_MI_LOAD_REGISTER_IMM_DWordLength_start  0
   157491 #define GEN8_MI_LOAD_REGISTER_IMM_DWordLength_start  0
   157492 #define GEN75_MI_LOAD_REGISTER_IMM_DWordLength_start  0
   157493 #define GEN7_MI_LOAD_REGISTER_IMM_DWordLength_start  0
   157494 #define GEN6_MI_LOAD_REGISTER_IMM_DWordLength_start  0
   157495 #define GEN5_MI_LOAD_REGISTER_IMM_DWordLength_start  0
   157496 #define GEN45_MI_LOAD_REGISTER_IMM_DWordLength_start  0
   157497 #define GEN4_MI_LOAD_REGISTER_IMM_DWordLength_start  0
   157498 
   157499 static inline uint32_t ATTRIBUTE_PURE
   157500 MI_LOAD_REGISTER_IMM_DWordLength_start(const struct gen_device_info *devinfo)
   157501 {
   157502    switch (devinfo->gen) {
   157503    case 10: return 0;
   157504    case 9: return 0;
   157505    case 8: return 0;
   157506    case 7:
   157507       if (devinfo->is_haswell) {
   157508          return 0;
   157509       } else {
   157510          return 0;
   157511       }
   157512    case 6: return 0;
   157513    case 5: return 0;
   157514    case 4:
   157515       if (devinfo->is_g4x) {
   157516          return 0;
   157517       } else {
   157518          return 0;
   157519       }
   157520    default:
   157521       unreachable("Invalid hardware generation");
   157522    }
   157523 }
   157524 
   157525 
   157526 
   157527 /* MI_LOAD_REGISTER_IMM::Data DWord */
   157528 
   157529 
   157530 #define GEN10_MI_LOAD_REGISTER_IMM_DataDWord_bits  32
   157531 #define GEN9_MI_LOAD_REGISTER_IMM_DataDWord_bits  32
   157532 #define GEN8_MI_LOAD_REGISTER_IMM_DataDWord_bits  32
   157533 #define GEN75_MI_LOAD_REGISTER_IMM_DataDWord_bits  32
   157534 #define GEN7_MI_LOAD_REGISTER_IMM_DataDWord_bits  32
   157535 #define GEN6_MI_LOAD_REGISTER_IMM_DataDWord_bits  32
   157536 #define GEN5_MI_LOAD_REGISTER_IMM_DataDWord_bits  32
   157537 #define GEN45_MI_LOAD_REGISTER_IMM_DataDWord_bits  32
   157538 #define GEN4_MI_LOAD_REGISTER_IMM_DataDWord_bits  32
   157539 
   157540 static inline uint32_t ATTRIBUTE_PURE
   157541 MI_LOAD_REGISTER_IMM_DataDWord_bits(const struct gen_device_info *devinfo)
   157542 {
   157543    switch (devinfo->gen) {
   157544    case 10: return 32;
   157545    case 9: return 32;
   157546    case 8: return 32;
   157547    case 7:
   157548       if (devinfo->is_haswell) {
   157549          return 32;
   157550       } else {
   157551          return 32;
   157552       }
   157553    case 6: return 32;
   157554    case 5: return 32;
   157555    case 4:
   157556       if (devinfo->is_g4x) {
   157557          return 32;
   157558       } else {
   157559          return 32;
   157560       }
   157561    default:
   157562       unreachable("Invalid hardware generation");
   157563    }
   157564 }
   157565 
   157566 
   157567 
   157568 #define GEN10_MI_LOAD_REGISTER_IMM_DataDWord_start  64
   157569 #define GEN9_MI_LOAD_REGISTER_IMM_DataDWord_start  64
   157570 #define GEN8_MI_LOAD_REGISTER_IMM_DataDWord_start  64
   157571 #define GEN75_MI_LOAD_REGISTER_IMM_DataDWord_start  64
   157572 #define GEN7_MI_LOAD_REGISTER_IMM_DataDWord_start  64
   157573 #define GEN6_MI_LOAD_REGISTER_IMM_DataDWord_start  64
   157574 #define GEN5_MI_LOAD_REGISTER_IMM_DataDWord_start  64
   157575 #define GEN45_MI_LOAD_REGISTER_IMM_DataDWord_start  64
   157576 #define GEN4_MI_LOAD_REGISTER_IMM_DataDWord_start  64
   157577 
   157578 static inline uint32_t ATTRIBUTE_PURE
   157579 MI_LOAD_REGISTER_IMM_DataDWord_start(const struct gen_device_info *devinfo)
   157580 {
   157581    switch (devinfo->gen) {
   157582    case 10: return 64;
   157583    case 9: return 64;
   157584    case 8: return 64;
   157585    case 7:
   157586       if (devinfo->is_haswell) {
   157587          return 64;
   157588       } else {
   157589          return 64;
   157590       }
   157591    case 6: return 64;
   157592    case 5: return 64;
   157593    case 4:
   157594       if (devinfo->is_g4x) {
   157595          return 64;
   157596       } else {
   157597          return 64;
   157598       }
   157599    default:
   157600       unreachable("Invalid hardware generation");
   157601    }
   157602 }
   157603 
   157604 
   157605 
   157606 /* MI_LOAD_REGISTER_IMM::MI Command Opcode */
   157607 
   157608 
   157609 #define GEN10_MI_LOAD_REGISTER_IMM_MICommandOpcode_bits  6
   157610 #define GEN9_MI_LOAD_REGISTER_IMM_MICommandOpcode_bits  6
   157611 #define GEN8_MI_LOAD_REGISTER_IMM_MICommandOpcode_bits  6
   157612 #define GEN75_MI_LOAD_REGISTER_IMM_MICommandOpcode_bits  6
   157613 #define GEN7_MI_LOAD_REGISTER_IMM_MICommandOpcode_bits  6
   157614 #define GEN6_MI_LOAD_REGISTER_IMM_MICommandOpcode_bits  6
   157615 #define GEN5_MI_LOAD_REGISTER_IMM_MICommandOpcode_bits  6
   157616 #define GEN45_MI_LOAD_REGISTER_IMM_MICommandOpcode_bits  6
   157617 #define GEN4_MI_LOAD_REGISTER_IMM_MICommandOpcode_bits  6
   157618 
   157619 static inline uint32_t ATTRIBUTE_PURE
   157620 MI_LOAD_REGISTER_IMM_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   157621 {
   157622    switch (devinfo->gen) {
   157623    case 10: return 6;
   157624    case 9: return 6;
   157625    case 8: return 6;
   157626    case 7:
   157627       if (devinfo->is_haswell) {
   157628          return 6;
   157629       } else {
   157630          return 6;
   157631       }
   157632    case 6: return 6;
   157633    case 5: return 6;
   157634    case 4:
   157635       if (devinfo->is_g4x) {
   157636          return 6;
   157637       } else {
   157638          return 6;
   157639       }
   157640    default:
   157641       unreachable("Invalid hardware generation");
   157642    }
   157643 }
   157644 
   157645 
   157646 
   157647 #define GEN10_MI_LOAD_REGISTER_IMM_MICommandOpcode_start  23
   157648 #define GEN9_MI_LOAD_REGISTER_IMM_MICommandOpcode_start  23
   157649 #define GEN8_MI_LOAD_REGISTER_IMM_MICommandOpcode_start  23
   157650 #define GEN75_MI_LOAD_REGISTER_IMM_MICommandOpcode_start  23
   157651 #define GEN7_MI_LOAD_REGISTER_IMM_MICommandOpcode_start  23
   157652 #define GEN6_MI_LOAD_REGISTER_IMM_MICommandOpcode_start  23
   157653 #define GEN5_MI_LOAD_REGISTER_IMM_MICommandOpcode_start  23
   157654 #define GEN45_MI_LOAD_REGISTER_IMM_MICommandOpcode_start  23
   157655 #define GEN4_MI_LOAD_REGISTER_IMM_MICommandOpcode_start  23
   157656 
   157657 static inline uint32_t ATTRIBUTE_PURE
   157658 MI_LOAD_REGISTER_IMM_MICommandOpcode_start(const struct gen_device_info *devinfo)
   157659 {
   157660    switch (devinfo->gen) {
   157661    case 10: return 23;
   157662    case 9: return 23;
   157663    case 8: return 23;
   157664    case 7:
   157665       if (devinfo->is_haswell) {
   157666          return 23;
   157667       } else {
   157668          return 23;
   157669       }
   157670    case 6: return 23;
   157671    case 5: return 23;
   157672    case 4:
   157673       if (devinfo->is_g4x) {
   157674          return 23;
   157675       } else {
   157676          return 23;
   157677       }
   157678    default:
   157679       unreachable("Invalid hardware generation");
   157680    }
   157681 }
   157682 
   157683 
   157684 
   157685 /* MI_LOAD_REGISTER_IMM::Register Offset */
   157686 
   157687 
   157688 #define GEN10_MI_LOAD_REGISTER_IMM_RegisterOffset_bits  21
   157689 #define GEN9_MI_LOAD_REGISTER_IMM_RegisterOffset_bits  21
   157690 #define GEN8_MI_LOAD_REGISTER_IMM_RegisterOffset_bits  21
   157691 #define GEN75_MI_LOAD_REGISTER_IMM_RegisterOffset_bits  21
   157692 #define GEN7_MI_LOAD_REGISTER_IMM_RegisterOffset_bits  21
   157693 #define GEN6_MI_LOAD_REGISTER_IMM_RegisterOffset_bits  21
   157694 #define GEN5_MI_LOAD_REGISTER_IMM_RegisterOffset_bits  30
   157695 #define GEN45_MI_LOAD_REGISTER_IMM_RegisterOffset_bits  30
   157696 #define GEN4_MI_LOAD_REGISTER_IMM_RegisterOffset_bits  30
   157697 
   157698 static inline uint32_t ATTRIBUTE_PURE
   157699 MI_LOAD_REGISTER_IMM_RegisterOffset_bits(const struct gen_device_info *devinfo)
   157700 {
   157701    switch (devinfo->gen) {
   157702    case 10: return 21;
   157703    case 9: return 21;
   157704    case 8: return 21;
   157705    case 7:
   157706       if (devinfo->is_haswell) {
   157707          return 21;
   157708       } else {
   157709          return 21;
   157710       }
   157711    case 6: return 21;
   157712    case 5: return 30;
   157713    case 4:
   157714       if (devinfo->is_g4x) {
   157715          return 30;
   157716       } else {
   157717          return 30;
   157718       }
   157719    default:
   157720       unreachable("Invalid hardware generation");
   157721    }
   157722 }
   157723 
   157724 
   157725 
   157726 #define GEN10_MI_LOAD_REGISTER_IMM_RegisterOffset_start  34
   157727 #define GEN9_MI_LOAD_REGISTER_IMM_RegisterOffset_start  34
   157728 #define GEN8_MI_LOAD_REGISTER_IMM_RegisterOffset_start  34
   157729 #define GEN75_MI_LOAD_REGISTER_IMM_RegisterOffset_start  34
   157730 #define GEN7_MI_LOAD_REGISTER_IMM_RegisterOffset_start  34
   157731 #define GEN6_MI_LOAD_REGISTER_IMM_RegisterOffset_start  34
   157732 #define GEN5_MI_LOAD_REGISTER_IMM_RegisterOffset_start  34
   157733 #define GEN45_MI_LOAD_REGISTER_IMM_RegisterOffset_start  34
   157734 #define GEN4_MI_LOAD_REGISTER_IMM_RegisterOffset_start  34
   157735 
   157736 static inline uint32_t ATTRIBUTE_PURE
   157737 MI_LOAD_REGISTER_IMM_RegisterOffset_start(const struct gen_device_info *devinfo)
   157738 {
   157739    switch (devinfo->gen) {
   157740    case 10: return 34;
   157741    case 9: return 34;
   157742    case 8: return 34;
   157743    case 7:
   157744       if (devinfo->is_haswell) {
   157745          return 34;
   157746       } else {
   157747          return 34;
   157748       }
   157749    case 6: return 34;
   157750    case 5: return 34;
   157751    case 4:
   157752       if (devinfo->is_g4x) {
   157753          return 34;
   157754       } else {
   157755          return 34;
   157756       }
   157757    default:
   157758       unreachable("Invalid hardware generation");
   157759    }
   157760 }
   157761 
   157762 
   157763 
   157764 /* MI_LOAD_REGISTER_MEM */
   157765 
   157766 
   157767 #define GEN10_MI_LOAD_REGISTER_MEM_length  4
   157768 #define GEN9_MI_LOAD_REGISTER_MEM_length  4
   157769 #define GEN8_MI_LOAD_REGISTER_MEM_length  4
   157770 #define GEN75_MI_LOAD_REGISTER_MEM_length  3
   157771 #define GEN7_MI_LOAD_REGISTER_MEM_length  3
   157772 
   157773 static inline uint32_t ATTRIBUTE_PURE
   157774 MI_LOAD_REGISTER_MEM_length(const struct gen_device_info *devinfo)
   157775 {
   157776    switch (devinfo->gen) {
   157777    case 10: return 4;
   157778    case 9: return 4;
   157779    case 8: return 4;
   157780    case 7:
   157781       if (devinfo->is_haswell) {
   157782          return 3;
   157783       } else {
   157784          return 3;
   157785       }
   157786    case 6: return 0;
   157787    case 5: return 0;
   157788    case 4:
   157789       if (devinfo->is_g4x) {
   157790          return 0;
   157791       } else {
   157792          return 0;
   157793       }
   157794    default:
   157795       unreachable("Invalid hardware generation");
   157796    }
   157797 }
   157798 
   157799 
   157800 
   157801 /* MI_LOAD_REGISTER_MEM::Async Mode Enable */
   157802 
   157803 
   157804 #define GEN10_MI_LOAD_REGISTER_MEM_AsyncModeEnable_bits  1
   157805 #define GEN9_MI_LOAD_REGISTER_MEM_AsyncModeEnable_bits  1
   157806 #define GEN8_MI_LOAD_REGISTER_MEM_AsyncModeEnable_bits  1
   157807 #define GEN75_MI_LOAD_REGISTER_MEM_AsyncModeEnable_bits  1
   157808 #define GEN7_MI_LOAD_REGISTER_MEM_AsyncModeEnable_bits  1
   157809 
   157810 static inline uint32_t ATTRIBUTE_PURE
   157811 MI_LOAD_REGISTER_MEM_AsyncModeEnable_bits(const struct gen_device_info *devinfo)
   157812 {
   157813    switch (devinfo->gen) {
   157814    case 10: return 1;
   157815    case 9: return 1;
   157816    case 8: return 1;
   157817    case 7:
   157818       if (devinfo->is_haswell) {
   157819          return 1;
   157820       } else {
   157821          return 1;
   157822       }
   157823    case 6: return 0;
   157824    case 5: return 0;
   157825    case 4:
   157826       if (devinfo->is_g4x) {
   157827          return 0;
   157828       } else {
   157829          return 0;
   157830       }
   157831    default:
   157832       unreachable("Invalid hardware generation");
   157833    }
   157834 }
   157835 
   157836 
   157837 
   157838 #define GEN10_MI_LOAD_REGISTER_MEM_AsyncModeEnable_start  21
   157839 #define GEN9_MI_LOAD_REGISTER_MEM_AsyncModeEnable_start  21
   157840 #define GEN8_MI_LOAD_REGISTER_MEM_AsyncModeEnable_start  21
   157841 #define GEN75_MI_LOAD_REGISTER_MEM_AsyncModeEnable_start  21
   157842 #define GEN7_MI_LOAD_REGISTER_MEM_AsyncModeEnable_start  21
   157843 
   157844 static inline uint32_t ATTRIBUTE_PURE
   157845 MI_LOAD_REGISTER_MEM_AsyncModeEnable_start(const struct gen_device_info *devinfo)
   157846 {
   157847    switch (devinfo->gen) {
   157848    case 10: return 21;
   157849    case 9: return 21;
   157850    case 8: return 21;
   157851    case 7:
   157852       if (devinfo->is_haswell) {
   157853          return 21;
   157854       } else {
   157855          return 21;
   157856       }
   157857    case 6: return 0;
   157858    case 5: return 0;
   157859    case 4:
   157860       if (devinfo->is_g4x) {
   157861          return 0;
   157862       } else {
   157863          return 0;
   157864       }
   157865    default:
   157866       unreachable("Invalid hardware generation");
   157867    }
   157868 }
   157869 
   157870 
   157871 
   157872 /* MI_LOAD_REGISTER_MEM::Command Type */
   157873 
   157874 
   157875 #define GEN10_MI_LOAD_REGISTER_MEM_CommandType_bits  3
   157876 #define GEN9_MI_LOAD_REGISTER_MEM_CommandType_bits  3
   157877 #define GEN8_MI_LOAD_REGISTER_MEM_CommandType_bits  3
   157878 #define GEN75_MI_LOAD_REGISTER_MEM_CommandType_bits  3
   157879 #define GEN7_MI_LOAD_REGISTER_MEM_CommandType_bits  3
   157880 
   157881 static inline uint32_t ATTRIBUTE_PURE
   157882 MI_LOAD_REGISTER_MEM_CommandType_bits(const struct gen_device_info *devinfo)
   157883 {
   157884    switch (devinfo->gen) {
   157885    case 10: return 3;
   157886    case 9: return 3;
   157887    case 8: return 3;
   157888    case 7:
   157889       if (devinfo->is_haswell) {
   157890          return 3;
   157891       } else {
   157892          return 3;
   157893       }
   157894    case 6: return 0;
   157895    case 5: return 0;
   157896    case 4:
   157897       if (devinfo->is_g4x) {
   157898          return 0;
   157899       } else {
   157900          return 0;
   157901       }
   157902    default:
   157903       unreachable("Invalid hardware generation");
   157904    }
   157905 }
   157906 
   157907 
   157908 
   157909 #define GEN10_MI_LOAD_REGISTER_MEM_CommandType_start  29
   157910 #define GEN9_MI_LOAD_REGISTER_MEM_CommandType_start  29
   157911 #define GEN8_MI_LOAD_REGISTER_MEM_CommandType_start  29
   157912 #define GEN75_MI_LOAD_REGISTER_MEM_CommandType_start  29
   157913 #define GEN7_MI_LOAD_REGISTER_MEM_CommandType_start  29
   157914 
   157915 static inline uint32_t ATTRIBUTE_PURE
   157916 MI_LOAD_REGISTER_MEM_CommandType_start(const struct gen_device_info *devinfo)
   157917 {
   157918    switch (devinfo->gen) {
   157919    case 10: return 29;
   157920    case 9: return 29;
   157921    case 8: return 29;
   157922    case 7:
   157923       if (devinfo->is_haswell) {
   157924          return 29;
   157925       } else {
   157926          return 29;
   157927       }
   157928    case 6: return 0;
   157929    case 5: return 0;
   157930    case 4:
   157931       if (devinfo->is_g4x) {
   157932          return 0;
   157933       } else {
   157934          return 0;
   157935       }
   157936    default:
   157937       unreachable("Invalid hardware generation");
   157938    }
   157939 }
   157940 
   157941 
   157942 
   157943 /* MI_LOAD_REGISTER_MEM::DWord Length */
   157944 
   157945 
   157946 #define GEN10_MI_LOAD_REGISTER_MEM_DWordLength_bits  8
   157947 #define GEN9_MI_LOAD_REGISTER_MEM_DWordLength_bits  8
   157948 #define GEN8_MI_LOAD_REGISTER_MEM_DWordLength_bits  8
   157949 #define GEN75_MI_LOAD_REGISTER_MEM_DWordLength_bits  8
   157950 #define GEN7_MI_LOAD_REGISTER_MEM_DWordLength_bits  8
   157951 
   157952 static inline uint32_t ATTRIBUTE_PURE
   157953 MI_LOAD_REGISTER_MEM_DWordLength_bits(const struct gen_device_info *devinfo)
   157954 {
   157955    switch (devinfo->gen) {
   157956    case 10: return 8;
   157957    case 9: return 8;
   157958    case 8: return 8;
   157959    case 7:
   157960       if (devinfo->is_haswell) {
   157961          return 8;
   157962       } else {
   157963          return 8;
   157964       }
   157965    case 6: return 0;
   157966    case 5: return 0;
   157967    case 4:
   157968       if (devinfo->is_g4x) {
   157969          return 0;
   157970       } else {
   157971          return 0;
   157972       }
   157973    default:
   157974       unreachable("Invalid hardware generation");
   157975    }
   157976 }
   157977 
   157978 
   157979 
   157980 #define GEN10_MI_LOAD_REGISTER_MEM_DWordLength_start  0
   157981 #define GEN9_MI_LOAD_REGISTER_MEM_DWordLength_start  0
   157982 #define GEN8_MI_LOAD_REGISTER_MEM_DWordLength_start  0
   157983 #define GEN75_MI_LOAD_REGISTER_MEM_DWordLength_start  0
   157984 #define GEN7_MI_LOAD_REGISTER_MEM_DWordLength_start  0
   157985 
   157986 static inline uint32_t ATTRIBUTE_PURE
   157987 MI_LOAD_REGISTER_MEM_DWordLength_start(const struct gen_device_info *devinfo)
   157988 {
   157989    switch (devinfo->gen) {
   157990    case 10: return 0;
   157991    case 9: return 0;
   157992    case 8: return 0;
   157993    case 7:
   157994       if (devinfo->is_haswell) {
   157995          return 0;
   157996       } else {
   157997          return 0;
   157998       }
   157999    case 6: return 0;
   158000    case 5: return 0;
   158001    case 4:
   158002       if (devinfo->is_g4x) {
   158003          return 0;
   158004       } else {
   158005          return 0;
   158006       }
   158007    default:
   158008       unreachable("Invalid hardware generation");
   158009    }
   158010 }
   158011 
   158012 
   158013 
   158014 /* MI_LOAD_REGISTER_MEM::MI Command Opcode */
   158015 
   158016 
   158017 #define GEN10_MI_LOAD_REGISTER_MEM_MICommandOpcode_bits  6
   158018 #define GEN9_MI_LOAD_REGISTER_MEM_MICommandOpcode_bits  6
   158019 #define GEN8_MI_LOAD_REGISTER_MEM_MICommandOpcode_bits  6
   158020 #define GEN75_MI_LOAD_REGISTER_MEM_MICommandOpcode_bits  6
   158021 #define GEN7_MI_LOAD_REGISTER_MEM_MICommandOpcode_bits  6
   158022 
   158023 static inline uint32_t ATTRIBUTE_PURE
   158024 MI_LOAD_REGISTER_MEM_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   158025 {
   158026    switch (devinfo->gen) {
   158027    case 10: return 6;
   158028    case 9: return 6;
   158029    case 8: return 6;
   158030    case 7:
   158031       if (devinfo->is_haswell) {
   158032          return 6;
   158033       } else {
   158034          return 6;
   158035       }
   158036    case 6: return 0;
   158037    case 5: return 0;
   158038    case 4:
   158039       if (devinfo->is_g4x) {
   158040          return 0;
   158041       } else {
   158042          return 0;
   158043       }
   158044    default:
   158045       unreachable("Invalid hardware generation");
   158046    }
   158047 }
   158048 
   158049 
   158050 
   158051 #define GEN10_MI_LOAD_REGISTER_MEM_MICommandOpcode_start  23
   158052 #define GEN9_MI_LOAD_REGISTER_MEM_MICommandOpcode_start  23
   158053 #define GEN8_MI_LOAD_REGISTER_MEM_MICommandOpcode_start  23
   158054 #define GEN75_MI_LOAD_REGISTER_MEM_MICommandOpcode_start  23
   158055 #define GEN7_MI_LOAD_REGISTER_MEM_MICommandOpcode_start  23
   158056 
   158057 static inline uint32_t ATTRIBUTE_PURE
   158058 MI_LOAD_REGISTER_MEM_MICommandOpcode_start(const struct gen_device_info *devinfo)
   158059 {
   158060    switch (devinfo->gen) {
   158061    case 10: return 23;
   158062    case 9: return 23;
   158063    case 8: return 23;
   158064    case 7:
   158065       if (devinfo->is_haswell) {
   158066          return 23;
   158067       } else {
   158068          return 23;
   158069       }
   158070    case 6: return 0;
   158071    case 5: return 0;
   158072    case 4:
   158073       if (devinfo->is_g4x) {
   158074          return 0;
   158075       } else {
   158076          return 0;
   158077       }
   158078    default:
   158079       unreachable("Invalid hardware generation");
   158080    }
   158081 }
   158082 
   158083 
   158084 
   158085 /* MI_LOAD_REGISTER_MEM::Memory Address */
   158086 
   158087 
   158088 #define GEN10_MI_LOAD_REGISTER_MEM_MemoryAddress_bits  62
   158089 #define GEN9_MI_LOAD_REGISTER_MEM_MemoryAddress_bits  62
   158090 #define GEN8_MI_LOAD_REGISTER_MEM_MemoryAddress_bits  62
   158091 #define GEN75_MI_LOAD_REGISTER_MEM_MemoryAddress_bits  30
   158092 #define GEN7_MI_LOAD_REGISTER_MEM_MemoryAddress_bits  30
   158093 
   158094 static inline uint32_t ATTRIBUTE_PURE
   158095 MI_LOAD_REGISTER_MEM_MemoryAddress_bits(const struct gen_device_info *devinfo)
   158096 {
   158097    switch (devinfo->gen) {
   158098    case 10: return 62;
   158099    case 9: return 62;
   158100    case 8: return 62;
   158101    case 7:
   158102       if (devinfo->is_haswell) {
   158103          return 30;
   158104       } else {
   158105          return 30;
   158106       }
   158107    case 6: return 0;
   158108    case 5: return 0;
   158109    case 4:
   158110       if (devinfo->is_g4x) {
   158111          return 0;
   158112       } else {
   158113          return 0;
   158114       }
   158115    default:
   158116       unreachable("Invalid hardware generation");
   158117    }
   158118 }
   158119 
   158120 
   158121 
   158122 #define GEN10_MI_LOAD_REGISTER_MEM_MemoryAddress_start  66
   158123 #define GEN9_MI_LOAD_REGISTER_MEM_MemoryAddress_start  66
   158124 #define GEN8_MI_LOAD_REGISTER_MEM_MemoryAddress_start  66
   158125 #define GEN75_MI_LOAD_REGISTER_MEM_MemoryAddress_start  66
   158126 #define GEN7_MI_LOAD_REGISTER_MEM_MemoryAddress_start  66
   158127 
   158128 static inline uint32_t ATTRIBUTE_PURE
   158129 MI_LOAD_REGISTER_MEM_MemoryAddress_start(const struct gen_device_info *devinfo)
   158130 {
   158131    switch (devinfo->gen) {
   158132    case 10: return 66;
   158133    case 9: return 66;
   158134    case 8: return 66;
   158135    case 7:
   158136       if (devinfo->is_haswell) {
   158137          return 66;
   158138       } else {
   158139          return 66;
   158140       }
   158141    case 6: return 0;
   158142    case 5: return 0;
   158143    case 4:
   158144       if (devinfo->is_g4x) {
   158145          return 0;
   158146       } else {
   158147          return 0;
   158148       }
   158149    default:
   158150       unreachable("Invalid hardware generation");
   158151    }
   158152 }
   158153 
   158154 
   158155 
   158156 /* MI_LOAD_REGISTER_MEM::Register Address */
   158157 
   158158 
   158159 #define GEN10_MI_LOAD_REGISTER_MEM_RegisterAddress_bits  21
   158160 #define GEN9_MI_LOAD_REGISTER_MEM_RegisterAddress_bits  21
   158161 #define GEN8_MI_LOAD_REGISTER_MEM_RegisterAddress_bits  21
   158162 #define GEN75_MI_LOAD_REGISTER_MEM_RegisterAddress_bits  21
   158163 #define GEN7_MI_LOAD_REGISTER_MEM_RegisterAddress_bits  21
   158164 
   158165 static inline uint32_t ATTRIBUTE_PURE
   158166 MI_LOAD_REGISTER_MEM_RegisterAddress_bits(const struct gen_device_info *devinfo)
   158167 {
   158168    switch (devinfo->gen) {
   158169    case 10: return 21;
   158170    case 9: return 21;
   158171    case 8: return 21;
   158172    case 7:
   158173       if (devinfo->is_haswell) {
   158174          return 21;
   158175       } else {
   158176          return 21;
   158177       }
   158178    case 6: return 0;
   158179    case 5: return 0;
   158180    case 4:
   158181       if (devinfo->is_g4x) {
   158182          return 0;
   158183       } else {
   158184          return 0;
   158185       }
   158186    default:
   158187       unreachable("Invalid hardware generation");
   158188    }
   158189 }
   158190 
   158191 
   158192 
   158193 #define GEN10_MI_LOAD_REGISTER_MEM_RegisterAddress_start  34
   158194 #define GEN9_MI_LOAD_REGISTER_MEM_RegisterAddress_start  34
   158195 #define GEN8_MI_LOAD_REGISTER_MEM_RegisterAddress_start  34
   158196 #define GEN75_MI_LOAD_REGISTER_MEM_RegisterAddress_start  34
   158197 #define GEN7_MI_LOAD_REGISTER_MEM_RegisterAddress_start  34
   158198 
   158199 static inline uint32_t ATTRIBUTE_PURE
   158200 MI_LOAD_REGISTER_MEM_RegisterAddress_start(const struct gen_device_info *devinfo)
   158201 {
   158202    switch (devinfo->gen) {
   158203    case 10: return 34;
   158204    case 9: return 34;
   158205    case 8: return 34;
   158206    case 7:
   158207       if (devinfo->is_haswell) {
   158208          return 34;
   158209       } else {
   158210          return 34;
   158211       }
   158212    case 6: return 0;
   158213    case 5: return 0;
   158214    case 4:
   158215       if (devinfo->is_g4x) {
   158216          return 0;
   158217       } else {
   158218          return 0;
   158219       }
   158220    default:
   158221       unreachable("Invalid hardware generation");
   158222    }
   158223 }
   158224 
   158225 
   158226 
   158227 /* MI_LOAD_REGISTER_MEM::Use Global GTT */
   158228 
   158229 
   158230 #define GEN10_MI_LOAD_REGISTER_MEM_UseGlobalGTT_bits  1
   158231 #define GEN9_MI_LOAD_REGISTER_MEM_UseGlobalGTT_bits  1
   158232 #define GEN8_MI_LOAD_REGISTER_MEM_UseGlobalGTT_bits  1
   158233 #define GEN75_MI_LOAD_REGISTER_MEM_UseGlobalGTT_bits  1
   158234 #define GEN7_MI_LOAD_REGISTER_MEM_UseGlobalGTT_bits  1
   158235 
   158236 static inline uint32_t ATTRIBUTE_PURE
   158237 MI_LOAD_REGISTER_MEM_UseGlobalGTT_bits(const struct gen_device_info *devinfo)
   158238 {
   158239    switch (devinfo->gen) {
   158240    case 10: return 1;
   158241    case 9: return 1;
   158242    case 8: return 1;
   158243    case 7:
   158244       if (devinfo->is_haswell) {
   158245          return 1;
   158246       } else {
   158247          return 1;
   158248       }
   158249    case 6: return 0;
   158250    case 5: return 0;
   158251    case 4:
   158252       if (devinfo->is_g4x) {
   158253          return 0;
   158254       } else {
   158255          return 0;
   158256       }
   158257    default:
   158258       unreachable("Invalid hardware generation");
   158259    }
   158260 }
   158261 
   158262 
   158263 
   158264 #define GEN10_MI_LOAD_REGISTER_MEM_UseGlobalGTT_start  22
   158265 #define GEN9_MI_LOAD_REGISTER_MEM_UseGlobalGTT_start  22
   158266 #define GEN8_MI_LOAD_REGISTER_MEM_UseGlobalGTT_start  22
   158267 #define GEN75_MI_LOAD_REGISTER_MEM_UseGlobalGTT_start  22
   158268 #define GEN7_MI_LOAD_REGISTER_MEM_UseGlobalGTT_start  22
   158269 
   158270 static inline uint32_t ATTRIBUTE_PURE
   158271 MI_LOAD_REGISTER_MEM_UseGlobalGTT_start(const struct gen_device_info *devinfo)
   158272 {
   158273    switch (devinfo->gen) {
   158274    case 10: return 22;
   158275    case 9: return 22;
   158276    case 8: return 22;
   158277    case 7:
   158278       if (devinfo->is_haswell) {
   158279          return 22;
   158280       } else {
   158281          return 22;
   158282       }
   158283    case 6: return 0;
   158284    case 5: return 0;
   158285    case 4:
   158286       if (devinfo->is_g4x) {
   158287          return 0;
   158288       } else {
   158289          return 0;
   158290       }
   158291    default:
   158292       unreachable("Invalid hardware generation");
   158293    }
   158294 }
   158295 
   158296 
   158297 
   158298 /* MI_LOAD_REGISTER_REG */
   158299 
   158300 
   158301 #define GEN10_MI_LOAD_REGISTER_REG_length  3
   158302 #define GEN9_MI_LOAD_REGISTER_REG_length  3
   158303 #define GEN8_MI_LOAD_REGISTER_REG_length  3
   158304 #define GEN75_MI_LOAD_REGISTER_REG_length  3
   158305 
   158306 static inline uint32_t ATTRIBUTE_PURE
   158307 MI_LOAD_REGISTER_REG_length(const struct gen_device_info *devinfo)
   158308 {
   158309    switch (devinfo->gen) {
   158310    case 10: return 3;
   158311    case 9: return 3;
   158312    case 8: return 3;
   158313    case 7:
   158314       if (devinfo->is_haswell) {
   158315          return 3;
   158316       } else {
   158317          return 0;
   158318       }
   158319    case 6: return 0;
   158320    case 5: return 0;
   158321    case 4:
   158322       if (devinfo->is_g4x) {
   158323          return 0;
   158324       } else {
   158325          return 0;
   158326       }
   158327    default:
   158328       unreachable("Invalid hardware generation");
   158329    }
   158330 }
   158331 
   158332 
   158333 
   158334 /* MI_LOAD_REGISTER_REG::Command Type */
   158335 
   158336 
   158337 #define GEN10_MI_LOAD_REGISTER_REG_CommandType_bits  3
   158338 #define GEN9_MI_LOAD_REGISTER_REG_CommandType_bits  3
   158339 #define GEN8_MI_LOAD_REGISTER_REG_CommandType_bits  3
   158340 #define GEN75_MI_LOAD_REGISTER_REG_CommandType_bits  3
   158341 
   158342 static inline uint32_t ATTRIBUTE_PURE
   158343 MI_LOAD_REGISTER_REG_CommandType_bits(const struct gen_device_info *devinfo)
   158344 {
   158345    switch (devinfo->gen) {
   158346    case 10: return 3;
   158347    case 9: return 3;
   158348    case 8: return 3;
   158349    case 7:
   158350       if (devinfo->is_haswell) {
   158351          return 3;
   158352       } else {
   158353          return 0;
   158354       }
   158355    case 6: return 0;
   158356    case 5: return 0;
   158357    case 4:
   158358       if (devinfo->is_g4x) {
   158359          return 0;
   158360       } else {
   158361          return 0;
   158362       }
   158363    default:
   158364       unreachable("Invalid hardware generation");
   158365    }
   158366 }
   158367 
   158368 
   158369 
   158370 #define GEN10_MI_LOAD_REGISTER_REG_CommandType_start  29
   158371 #define GEN9_MI_LOAD_REGISTER_REG_CommandType_start  29
   158372 #define GEN8_MI_LOAD_REGISTER_REG_CommandType_start  29
   158373 #define GEN75_MI_LOAD_REGISTER_REG_CommandType_start  29
   158374 
   158375 static inline uint32_t ATTRIBUTE_PURE
   158376 MI_LOAD_REGISTER_REG_CommandType_start(const struct gen_device_info *devinfo)
   158377 {
   158378    switch (devinfo->gen) {
   158379    case 10: return 29;
   158380    case 9: return 29;
   158381    case 8: return 29;
   158382    case 7:
   158383       if (devinfo->is_haswell) {
   158384          return 29;
   158385       } else {
   158386          return 0;
   158387       }
   158388    case 6: return 0;
   158389    case 5: return 0;
   158390    case 4:
   158391       if (devinfo->is_g4x) {
   158392          return 0;
   158393       } else {
   158394          return 0;
   158395       }
   158396    default:
   158397       unreachable("Invalid hardware generation");
   158398    }
   158399 }
   158400 
   158401 
   158402 
   158403 /* MI_LOAD_REGISTER_REG::DWord Length */
   158404 
   158405 
   158406 #define GEN10_MI_LOAD_REGISTER_REG_DWordLength_bits  8
   158407 #define GEN9_MI_LOAD_REGISTER_REG_DWordLength_bits  8
   158408 #define GEN8_MI_LOAD_REGISTER_REG_DWordLength_bits  8
   158409 #define GEN75_MI_LOAD_REGISTER_REG_DWordLength_bits  8
   158410 
   158411 static inline uint32_t ATTRIBUTE_PURE
   158412 MI_LOAD_REGISTER_REG_DWordLength_bits(const struct gen_device_info *devinfo)
   158413 {
   158414    switch (devinfo->gen) {
   158415    case 10: return 8;
   158416    case 9: return 8;
   158417    case 8: return 8;
   158418    case 7:
   158419       if (devinfo->is_haswell) {
   158420          return 8;
   158421       } else {
   158422          return 0;
   158423       }
   158424    case 6: return 0;
   158425    case 5: return 0;
   158426    case 4:
   158427       if (devinfo->is_g4x) {
   158428          return 0;
   158429       } else {
   158430          return 0;
   158431       }
   158432    default:
   158433       unreachable("Invalid hardware generation");
   158434    }
   158435 }
   158436 
   158437 
   158438 
   158439 #define GEN10_MI_LOAD_REGISTER_REG_DWordLength_start  0
   158440 #define GEN9_MI_LOAD_REGISTER_REG_DWordLength_start  0
   158441 #define GEN8_MI_LOAD_REGISTER_REG_DWordLength_start  0
   158442 #define GEN75_MI_LOAD_REGISTER_REG_DWordLength_start  0
   158443 
   158444 static inline uint32_t ATTRIBUTE_PURE
   158445 MI_LOAD_REGISTER_REG_DWordLength_start(const struct gen_device_info *devinfo)
   158446 {
   158447    switch (devinfo->gen) {
   158448    case 10: return 0;
   158449    case 9: return 0;
   158450    case 8: return 0;
   158451    case 7:
   158452       if (devinfo->is_haswell) {
   158453          return 0;
   158454       } else {
   158455          return 0;
   158456       }
   158457    case 6: return 0;
   158458    case 5: return 0;
   158459    case 4:
   158460       if (devinfo->is_g4x) {
   158461          return 0;
   158462       } else {
   158463          return 0;
   158464       }
   158465    default:
   158466       unreachable("Invalid hardware generation");
   158467    }
   158468 }
   158469 
   158470 
   158471 
   158472 /* MI_LOAD_REGISTER_REG::Destination Register Address */
   158473 
   158474 
   158475 #define GEN10_MI_LOAD_REGISTER_REG_DestinationRegisterAddress_bits  21
   158476 #define GEN9_MI_LOAD_REGISTER_REG_DestinationRegisterAddress_bits  21
   158477 #define GEN8_MI_LOAD_REGISTER_REG_DestinationRegisterAddress_bits  21
   158478 #define GEN75_MI_LOAD_REGISTER_REG_DestinationRegisterAddress_bits  21
   158479 
   158480 static inline uint32_t ATTRIBUTE_PURE
   158481 MI_LOAD_REGISTER_REG_DestinationRegisterAddress_bits(const struct gen_device_info *devinfo)
   158482 {
   158483    switch (devinfo->gen) {
   158484    case 10: return 21;
   158485    case 9: return 21;
   158486    case 8: return 21;
   158487    case 7:
   158488       if (devinfo->is_haswell) {
   158489          return 21;
   158490       } else {
   158491          return 0;
   158492       }
   158493    case 6: return 0;
   158494    case 5: return 0;
   158495    case 4:
   158496       if (devinfo->is_g4x) {
   158497          return 0;
   158498       } else {
   158499          return 0;
   158500       }
   158501    default:
   158502       unreachable("Invalid hardware generation");
   158503    }
   158504 }
   158505 
   158506 
   158507 
   158508 #define GEN10_MI_LOAD_REGISTER_REG_DestinationRegisterAddress_start  66
   158509 #define GEN9_MI_LOAD_REGISTER_REG_DestinationRegisterAddress_start  66
   158510 #define GEN8_MI_LOAD_REGISTER_REG_DestinationRegisterAddress_start  66
   158511 #define GEN75_MI_LOAD_REGISTER_REG_DestinationRegisterAddress_start  66
   158512 
   158513 static inline uint32_t ATTRIBUTE_PURE
   158514 MI_LOAD_REGISTER_REG_DestinationRegisterAddress_start(const struct gen_device_info *devinfo)
   158515 {
   158516    switch (devinfo->gen) {
   158517    case 10: return 66;
   158518    case 9: return 66;
   158519    case 8: return 66;
   158520    case 7:
   158521       if (devinfo->is_haswell) {
   158522          return 66;
   158523       } else {
   158524          return 0;
   158525       }
   158526    case 6: return 0;
   158527    case 5: return 0;
   158528    case 4:
   158529       if (devinfo->is_g4x) {
   158530          return 0;
   158531       } else {
   158532          return 0;
   158533       }
   158534    default:
   158535       unreachable("Invalid hardware generation");
   158536    }
   158537 }
   158538 
   158539 
   158540 
   158541 /* MI_LOAD_REGISTER_REG::MI Command Opcode */
   158542 
   158543 
   158544 #define GEN10_MI_LOAD_REGISTER_REG_MICommandOpcode_bits  6
   158545 #define GEN9_MI_LOAD_REGISTER_REG_MICommandOpcode_bits  6
   158546 #define GEN8_MI_LOAD_REGISTER_REG_MICommandOpcode_bits  6
   158547 #define GEN75_MI_LOAD_REGISTER_REG_MICommandOpcode_bits  6
   158548 
   158549 static inline uint32_t ATTRIBUTE_PURE
   158550 MI_LOAD_REGISTER_REG_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   158551 {
   158552    switch (devinfo->gen) {
   158553    case 10: return 6;
   158554    case 9: return 6;
   158555    case 8: return 6;
   158556    case 7:
   158557       if (devinfo->is_haswell) {
   158558          return 6;
   158559       } else {
   158560          return 0;
   158561       }
   158562    case 6: return 0;
   158563    case 5: return 0;
   158564    case 4:
   158565       if (devinfo->is_g4x) {
   158566          return 0;
   158567       } else {
   158568          return 0;
   158569       }
   158570    default:
   158571       unreachable("Invalid hardware generation");
   158572    }
   158573 }
   158574 
   158575 
   158576 
   158577 #define GEN10_MI_LOAD_REGISTER_REG_MICommandOpcode_start  23
   158578 #define GEN9_MI_LOAD_REGISTER_REG_MICommandOpcode_start  23
   158579 #define GEN8_MI_LOAD_REGISTER_REG_MICommandOpcode_start  23
   158580 #define GEN75_MI_LOAD_REGISTER_REG_MICommandOpcode_start  23
   158581 
   158582 static inline uint32_t ATTRIBUTE_PURE
   158583 MI_LOAD_REGISTER_REG_MICommandOpcode_start(const struct gen_device_info *devinfo)
   158584 {
   158585    switch (devinfo->gen) {
   158586    case 10: return 23;
   158587    case 9: return 23;
   158588    case 8: return 23;
   158589    case 7:
   158590       if (devinfo->is_haswell) {
   158591          return 23;
   158592       } else {
   158593          return 0;
   158594       }
   158595    case 6: return 0;
   158596    case 5: return 0;
   158597    case 4:
   158598       if (devinfo->is_g4x) {
   158599          return 0;
   158600       } else {
   158601          return 0;
   158602       }
   158603    default:
   158604       unreachable("Invalid hardware generation");
   158605    }
   158606 }
   158607 
   158608 
   158609 
   158610 /* MI_LOAD_REGISTER_REG::Source Register Address */
   158611 
   158612 
   158613 #define GEN10_MI_LOAD_REGISTER_REG_SourceRegisterAddress_bits  21
   158614 #define GEN9_MI_LOAD_REGISTER_REG_SourceRegisterAddress_bits  21
   158615 #define GEN8_MI_LOAD_REGISTER_REG_SourceRegisterAddress_bits  21
   158616 #define GEN75_MI_LOAD_REGISTER_REG_SourceRegisterAddress_bits  21
   158617 
   158618 static inline uint32_t ATTRIBUTE_PURE
   158619 MI_LOAD_REGISTER_REG_SourceRegisterAddress_bits(const struct gen_device_info *devinfo)
   158620 {
   158621    switch (devinfo->gen) {
   158622    case 10: return 21;
   158623    case 9: return 21;
   158624    case 8: return 21;
   158625    case 7:
   158626       if (devinfo->is_haswell) {
   158627          return 21;
   158628       } else {
   158629          return 0;
   158630       }
   158631    case 6: return 0;
   158632    case 5: return 0;
   158633    case 4:
   158634       if (devinfo->is_g4x) {
   158635          return 0;
   158636       } else {
   158637          return 0;
   158638       }
   158639    default:
   158640       unreachable("Invalid hardware generation");
   158641    }
   158642 }
   158643 
   158644 
   158645 
   158646 #define GEN10_MI_LOAD_REGISTER_REG_SourceRegisterAddress_start  34
   158647 #define GEN9_MI_LOAD_REGISTER_REG_SourceRegisterAddress_start  34
   158648 #define GEN8_MI_LOAD_REGISTER_REG_SourceRegisterAddress_start  34
   158649 #define GEN75_MI_LOAD_REGISTER_REG_SourceRegisterAddress_start  34
   158650 
   158651 static inline uint32_t ATTRIBUTE_PURE
   158652 MI_LOAD_REGISTER_REG_SourceRegisterAddress_start(const struct gen_device_info *devinfo)
   158653 {
   158654    switch (devinfo->gen) {
   158655    case 10: return 34;
   158656    case 9: return 34;
   158657    case 8: return 34;
   158658    case 7:
   158659       if (devinfo->is_haswell) {
   158660          return 34;
   158661       } else {
   158662          return 0;
   158663       }
   158664    case 6: return 0;
   158665    case 5: return 0;
   158666    case 4:
   158667       if (devinfo->is_g4x) {
   158668          return 0;
   158669       } else {
   158670          return 0;
   158671       }
   158672    default:
   158673       unreachable("Invalid hardware generation");
   158674    }
   158675 }
   158676 
   158677 
   158678 
   158679 /* MI_LOAD_SCAN_LINES_EXCL */
   158680 
   158681 
   158682 #define GEN10_MI_LOAD_SCAN_LINES_EXCL_length  2
   158683 #define GEN9_MI_LOAD_SCAN_LINES_EXCL_length  2
   158684 #define GEN8_MI_LOAD_SCAN_LINES_EXCL_length  2
   158685 #define GEN75_MI_LOAD_SCAN_LINES_EXCL_length  2
   158686 #define GEN6_MI_LOAD_SCAN_LINES_EXCL_length  2
   158687 
   158688 static inline uint32_t ATTRIBUTE_PURE
   158689 MI_LOAD_SCAN_LINES_EXCL_length(const struct gen_device_info *devinfo)
   158690 {
   158691    switch (devinfo->gen) {
   158692    case 10: return 2;
   158693    case 9: return 2;
   158694    case 8: return 2;
   158695    case 7:
   158696       if (devinfo->is_haswell) {
   158697          return 2;
   158698       } else {
   158699          return 0;
   158700       }
   158701    case 6: return 2;
   158702    case 5: return 0;
   158703    case 4:
   158704       if (devinfo->is_g4x) {
   158705          return 0;
   158706       } else {
   158707          return 0;
   158708       }
   158709    default:
   158710       unreachable("Invalid hardware generation");
   158711    }
   158712 }
   158713 
   158714 
   158715 
   158716 /* MI_LOAD_SCAN_LINES_EXCL::Command Type */
   158717 
   158718 
   158719 #define GEN10_MI_LOAD_SCAN_LINES_EXCL_CommandType_bits  3
   158720 #define GEN9_MI_LOAD_SCAN_LINES_EXCL_CommandType_bits  3
   158721 #define GEN8_MI_LOAD_SCAN_LINES_EXCL_CommandType_bits  3
   158722 #define GEN75_MI_LOAD_SCAN_LINES_EXCL_CommandType_bits  3
   158723 #define GEN6_MI_LOAD_SCAN_LINES_EXCL_CommandType_bits  3
   158724 
   158725 static inline uint32_t ATTRIBUTE_PURE
   158726 MI_LOAD_SCAN_LINES_EXCL_CommandType_bits(const struct gen_device_info *devinfo)
   158727 {
   158728    switch (devinfo->gen) {
   158729    case 10: return 3;
   158730    case 9: return 3;
   158731    case 8: return 3;
   158732    case 7:
   158733       if (devinfo->is_haswell) {
   158734          return 3;
   158735       } else {
   158736          return 0;
   158737       }
   158738    case 6: return 3;
   158739    case 5: return 0;
   158740    case 4:
   158741       if (devinfo->is_g4x) {
   158742          return 0;
   158743       } else {
   158744          return 0;
   158745       }
   158746    default:
   158747       unreachable("Invalid hardware generation");
   158748    }
   158749 }
   158750 
   158751 
   158752 
   158753 #define GEN10_MI_LOAD_SCAN_LINES_EXCL_CommandType_start  29
   158754 #define GEN9_MI_LOAD_SCAN_LINES_EXCL_CommandType_start  29
   158755 #define GEN8_MI_LOAD_SCAN_LINES_EXCL_CommandType_start  29
   158756 #define GEN75_MI_LOAD_SCAN_LINES_EXCL_CommandType_start  29
   158757 #define GEN6_MI_LOAD_SCAN_LINES_EXCL_CommandType_start  29
   158758 
   158759 static inline uint32_t ATTRIBUTE_PURE
   158760 MI_LOAD_SCAN_LINES_EXCL_CommandType_start(const struct gen_device_info *devinfo)
   158761 {
   158762    switch (devinfo->gen) {
   158763    case 10: return 29;
   158764    case 9: return 29;
   158765    case 8: return 29;
   158766    case 7:
   158767       if (devinfo->is_haswell) {
   158768          return 29;
   158769       } else {
   158770          return 0;
   158771       }
   158772    case 6: return 29;
   158773    case 5: return 0;
   158774    case 4:
   158775       if (devinfo->is_g4x) {
   158776          return 0;
   158777       } else {
   158778          return 0;
   158779       }
   158780    default:
   158781       unreachable("Invalid hardware generation");
   158782    }
   158783 }
   158784 
   158785 
   158786 
   158787 /* MI_LOAD_SCAN_LINES_EXCL::DWord Length */
   158788 
   158789 
   158790 #define GEN10_MI_LOAD_SCAN_LINES_EXCL_DWordLength_bits  6
   158791 #define GEN9_MI_LOAD_SCAN_LINES_EXCL_DWordLength_bits  6
   158792 #define GEN8_MI_LOAD_SCAN_LINES_EXCL_DWordLength_bits  6
   158793 #define GEN75_MI_LOAD_SCAN_LINES_EXCL_DWordLength_bits  6
   158794 #define GEN6_MI_LOAD_SCAN_LINES_EXCL_DWordLength_bits  6
   158795 
   158796 static inline uint32_t ATTRIBUTE_PURE
   158797 MI_LOAD_SCAN_LINES_EXCL_DWordLength_bits(const struct gen_device_info *devinfo)
   158798 {
   158799    switch (devinfo->gen) {
   158800    case 10: return 6;
   158801    case 9: return 6;
   158802    case 8: return 6;
   158803    case 7:
   158804       if (devinfo->is_haswell) {
   158805          return 6;
   158806       } else {
   158807          return 0;
   158808       }
   158809    case 6: return 6;
   158810    case 5: return 0;
   158811    case 4:
   158812       if (devinfo->is_g4x) {
   158813          return 0;
   158814       } else {
   158815          return 0;
   158816       }
   158817    default:
   158818       unreachable("Invalid hardware generation");
   158819    }
   158820 }
   158821 
   158822 
   158823 
   158824 #define GEN10_MI_LOAD_SCAN_LINES_EXCL_DWordLength_start  0
   158825 #define GEN9_MI_LOAD_SCAN_LINES_EXCL_DWordLength_start  0
   158826 #define GEN8_MI_LOAD_SCAN_LINES_EXCL_DWordLength_start  0
   158827 #define GEN75_MI_LOAD_SCAN_LINES_EXCL_DWordLength_start  0
   158828 #define GEN6_MI_LOAD_SCAN_LINES_EXCL_DWordLength_start  0
   158829 
   158830 static inline uint32_t ATTRIBUTE_PURE
   158831 MI_LOAD_SCAN_LINES_EXCL_DWordLength_start(const struct gen_device_info *devinfo)
   158832 {
   158833    switch (devinfo->gen) {
   158834    case 10: return 0;
   158835    case 9: return 0;
   158836    case 8: return 0;
   158837    case 7:
   158838       if (devinfo->is_haswell) {
   158839          return 0;
   158840       } else {
   158841          return 0;
   158842       }
   158843    case 6: return 0;
   158844    case 5: return 0;
   158845    case 4:
   158846       if (devinfo->is_g4x) {
   158847          return 0;
   158848       } else {
   158849          return 0;
   158850       }
   158851    default:
   158852       unreachable("Invalid hardware generation");
   158853    }
   158854 }
   158855 
   158856 
   158857 
   158858 /* MI_LOAD_SCAN_LINES_EXCL::Display (Plane) Select */
   158859 
   158860 
   158861 #define GEN10_MI_LOAD_SCAN_LINES_EXCL_DisplayPlaneSelect_bits  3
   158862 #define GEN9_MI_LOAD_SCAN_LINES_EXCL_DisplayPlaneSelect_bits  3
   158863 #define GEN8_MI_LOAD_SCAN_LINES_EXCL_DisplayPlaneSelect_bits  3
   158864 #define GEN75_MI_LOAD_SCAN_LINES_EXCL_DisplayPlaneSelect_bits  3
   158865 #define GEN6_MI_LOAD_SCAN_LINES_EXCL_DisplayPlaneSelect_bits  3
   158866 
   158867 static inline uint32_t ATTRIBUTE_PURE
   158868 MI_LOAD_SCAN_LINES_EXCL_DisplayPlaneSelect_bits(const struct gen_device_info *devinfo)
   158869 {
   158870    switch (devinfo->gen) {
   158871    case 10: return 3;
   158872    case 9: return 3;
   158873    case 8: return 3;
   158874    case 7:
   158875       if (devinfo->is_haswell) {
   158876          return 3;
   158877       } else {
   158878          return 0;
   158879       }
   158880    case 6: return 3;
   158881    case 5: return 0;
   158882    case 4:
   158883       if (devinfo->is_g4x) {
   158884          return 0;
   158885       } else {
   158886          return 0;
   158887       }
   158888    default:
   158889       unreachable("Invalid hardware generation");
   158890    }
   158891 }
   158892 
   158893 
   158894 
   158895 #define GEN10_MI_LOAD_SCAN_LINES_EXCL_DisplayPlaneSelect_start  19
   158896 #define GEN9_MI_LOAD_SCAN_LINES_EXCL_DisplayPlaneSelect_start  19
   158897 #define GEN8_MI_LOAD_SCAN_LINES_EXCL_DisplayPlaneSelect_start  19
   158898 #define GEN75_MI_LOAD_SCAN_LINES_EXCL_DisplayPlaneSelect_start  19
   158899 #define GEN6_MI_LOAD_SCAN_LINES_EXCL_DisplayPlaneSelect_start  19
   158900 
   158901 static inline uint32_t ATTRIBUTE_PURE
   158902 MI_LOAD_SCAN_LINES_EXCL_DisplayPlaneSelect_start(const struct gen_device_info *devinfo)
   158903 {
   158904    switch (devinfo->gen) {
   158905    case 10: return 19;
   158906    case 9: return 19;
   158907    case 8: return 19;
   158908    case 7:
   158909       if (devinfo->is_haswell) {
   158910          return 19;
   158911       } else {
   158912          return 0;
   158913       }
   158914    case 6: return 19;
   158915    case 5: return 0;
   158916    case 4:
   158917       if (devinfo->is_g4x) {
   158918          return 0;
   158919       } else {
   158920          return 0;
   158921       }
   158922    default:
   158923       unreachable("Invalid hardware generation");
   158924    }
   158925 }
   158926 
   158927 
   158928 
   158929 /* MI_LOAD_SCAN_LINES_EXCL::End Scan Line Number */
   158930 
   158931 
   158932 #define GEN10_MI_LOAD_SCAN_LINES_EXCL_EndScanLineNumber_bits  13
   158933 #define GEN9_MI_LOAD_SCAN_LINES_EXCL_EndScanLineNumber_bits  13
   158934 #define GEN8_MI_LOAD_SCAN_LINES_EXCL_EndScanLineNumber_bits  13
   158935 #define GEN75_MI_LOAD_SCAN_LINES_EXCL_EndScanLineNumber_bits  13
   158936 #define GEN6_MI_LOAD_SCAN_LINES_EXCL_EndScanLineNumber_bits  13
   158937 
   158938 static inline uint32_t ATTRIBUTE_PURE
   158939 MI_LOAD_SCAN_LINES_EXCL_EndScanLineNumber_bits(const struct gen_device_info *devinfo)
   158940 {
   158941    switch (devinfo->gen) {
   158942    case 10: return 13;
   158943    case 9: return 13;
   158944    case 8: return 13;
   158945    case 7:
   158946       if (devinfo->is_haswell) {
   158947          return 13;
   158948       } else {
   158949          return 0;
   158950       }
   158951    case 6: return 13;
   158952    case 5: return 0;
   158953    case 4:
   158954       if (devinfo->is_g4x) {
   158955          return 0;
   158956       } else {
   158957          return 0;
   158958       }
   158959    default:
   158960       unreachable("Invalid hardware generation");
   158961    }
   158962 }
   158963 
   158964 
   158965 
   158966 #define GEN10_MI_LOAD_SCAN_LINES_EXCL_EndScanLineNumber_start  32
   158967 #define GEN9_MI_LOAD_SCAN_LINES_EXCL_EndScanLineNumber_start  32
   158968 #define GEN8_MI_LOAD_SCAN_LINES_EXCL_EndScanLineNumber_start  32
   158969 #define GEN75_MI_LOAD_SCAN_LINES_EXCL_EndScanLineNumber_start  32
   158970 #define GEN6_MI_LOAD_SCAN_LINES_EXCL_EndScanLineNumber_start  32
   158971 
   158972 static inline uint32_t ATTRIBUTE_PURE
   158973 MI_LOAD_SCAN_LINES_EXCL_EndScanLineNumber_start(const struct gen_device_info *devinfo)
   158974 {
   158975    switch (devinfo->gen) {
   158976    case 10: return 32;
   158977    case 9: return 32;
   158978    case 8: return 32;
   158979    case 7:
   158980       if (devinfo->is_haswell) {
   158981          return 32;
   158982       } else {
   158983          return 0;
   158984       }
   158985    case 6: return 32;
   158986    case 5: return 0;
   158987    case 4:
   158988       if (devinfo->is_g4x) {
   158989          return 0;
   158990       } else {
   158991          return 0;
   158992       }
   158993    default:
   158994       unreachable("Invalid hardware generation");
   158995    }
   158996 }
   158997 
   158998 
   158999 
   159000 /* MI_LOAD_SCAN_LINES_EXCL::MI Command Opcode */
   159001 
   159002 
   159003 #define GEN10_MI_LOAD_SCAN_LINES_EXCL_MICommandOpcode_bits  6
   159004 #define GEN9_MI_LOAD_SCAN_LINES_EXCL_MICommandOpcode_bits  6
   159005 #define GEN8_MI_LOAD_SCAN_LINES_EXCL_MICommandOpcode_bits  6
   159006 #define GEN75_MI_LOAD_SCAN_LINES_EXCL_MICommandOpcode_bits  6
   159007 #define GEN6_MI_LOAD_SCAN_LINES_EXCL_MICommandOpcode_bits  6
   159008 
   159009 static inline uint32_t ATTRIBUTE_PURE
   159010 MI_LOAD_SCAN_LINES_EXCL_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   159011 {
   159012    switch (devinfo->gen) {
   159013    case 10: return 6;
   159014    case 9: return 6;
   159015    case 8: return 6;
   159016    case 7:
   159017       if (devinfo->is_haswell) {
   159018          return 6;
   159019       } else {
   159020          return 0;
   159021       }
   159022    case 6: return 6;
   159023    case 5: return 0;
   159024    case 4:
   159025       if (devinfo->is_g4x) {
   159026          return 0;
   159027       } else {
   159028          return 0;
   159029       }
   159030    default:
   159031       unreachable("Invalid hardware generation");
   159032    }
   159033 }
   159034 
   159035 
   159036 
   159037 #define GEN10_MI_LOAD_SCAN_LINES_EXCL_MICommandOpcode_start  23
   159038 #define GEN9_MI_LOAD_SCAN_LINES_EXCL_MICommandOpcode_start  23
   159039 #define GEN8_MI_LOAD_SCAN_LINES_EXCL_MICommandOpcode_start  23
   159040 #define GEN75_MI_LOAD_SCAN_LINES_EXCL_MICommandOpcode_start  23
   159041 #define GEN6_MI_LOAD_SCAN_LINES_EXCL_MICommandOpcode_start  23
   159042 
   159043 static inline uint32_t ATTRIBUTE_PURE
   159044 MI_LOAD_SCAN_LINES_EXCL_MICommandOpcode_start(const struct gen_device_info *devinfo)
   159045 {
   159046    switch (devinfo->gen) {
   159047    case 10: return 23;
   159048    case 9: return 23;
   159049    case 8: return 23;
   159050    case 7:
   159051       if (devinfo->is_haswell) {
   159052          return 23;
   159053       } else {
   159054          return 0;
   159055       }
   159056    case 6: return 23;
   159057    case 5: return 0;
   159058    case 4:
   159059       if (devinfo->is_g4x) {
   159060          return 0;
   159061       } else {
   159062          return 0;
   159063       }
   159064    default:
   159065       unreachable("Invalid hardware generation");
   159066    }
   159067 }
   159068 
   159069 
   159070 
   159071 /* MI_LOAD_SCAN_LINES_EXCL::Start Scan Line Number */
   159072 
   159073 
   159074 #define GEN10_MI_LOAD_SCAN_LINES_EXCL_StartScanLineNumber_bits  13
   159075 #define GEN9_MI_LOAD_SCAN_LINES_EXCL_StartScanLineNumber_bits  13
   159076 #define GEN8_MI_LOAD_SCAN_LINES_EXCL_StartScanLineNumber_bits  13
   159077 #define GEN75_MI_LOAD_SCAN_LINES_EXCL_StartScanLineNumber_bits  13
   159078 #define GEN6_MI_LOAD_SCAN_LINES_EXCL_StartScanLineNumber_bits  13
   159079 
   159080 static inline uint32_t ATTRIBUTE_PURE
   159081 MI_LOAD_SCAN_LINES_EXCL_StartScanLineNumber_bits(const struct gen_device_info *devinfo)
   159082 {
   159083    switch (devinfo->gen) {
   159084    case 10: return 13;
   159085    case 9: return 13;
   159086    case 8: return 13;
   159087    case 7:
   159088       if (devinfo->is_haswell) {
   159089          return 13;
   159090       } else {
   159091          return 0;
   159092       }
   159093    case 6: return 13;
   159094    case 5: return 0;
   159095    case 4:
   159096       if (devinfo->is_g4x) {
   159097          return 0;
   159098       } else {
   159099          return 0;
   159100       }
   159101    default:
   159102       unreachable("Invalid hardware generation");
   159103    }
   159104 }
   159105 
   159106 
   159107 
   159108 #define GEN10_MI_LOAD_SCAN_LINES_EXCL_StartScanLineNumber_start  48
   159109 #define GEN9_MI_LOAD_SCAN_LINES_EXCL_StartScanLineNumber_start  48
   159110 #define GEN8_MI_LOAD_SCAN_LINES_EXCL_StartScanLineNumber_start  48
   159111 #define GEN75_MI_LOAD_SCAN_LINES_EXCL_StartScanLineNumber_start  48
   159112 #define GEN6_MI_LOAD_SCAN_LINES_EXCL_StartScanLineNumber_start  48
   159113 
   159114 static inline uint32_t ATTRIBUTE_PURE
   159115 MI_LOAD_SCAN_LINES_EXCL_StartScanLineNumber_start(const struct gen_device_info *devinfo)
   159116 {
   159117    switch (devinfo->gen) {
   159118    case 10: return 48;
   159119    case 9: return 48;
   159120    case 8: return 48;
   159121    case 7:
   159122       if (devinfo->is_haswell) {
   159123          return 48;
   159124       } else {
   159125          return 0;
   159126       }
   159127    case 6: return 48;
   159128    case 5: return 0;
   159129    case 4:
   159130       if (devinfo->is_g4x) {
   159131          return 0;
   159132       } else {
   159133          return 0;
   159134       }
   159135    default:
   159136       unreachable("Invalid hardware generation");
   159137    }
   159138 }
   159139 
   159140 
   159141 
   159142 /* MI_LOAD_SCAN_LINES_INCL */
   159143 
   159144 
   159145 #define GEN10_MI_LOAD_SCAN_LINES_INCL_length  2
   159146 #define GEN9_MI_LOAD_SCAN_LINES_INCL_length  2
   159147 #define GEN8_MI_LOAD_SCAN_LINES_INCL_length  2
   159148 #define GEN75_MI_LOAD_SCAN_LINES_INCL_length  2
   159149 
   159150 static inline uint32_t ATTRIBUTE_PURE
   159151 MI_LOAD_SCAN_LINES_INCL_length(const struct gen_device_info *devinfo)
   159152 {
   159153    switch (devinfo->gen) {
   159154    case 10: return 2;
   159155    case 9: return 2;
   159156    case 8: return 2;
   159157    case 7:
   159158       if (devinfo->is_haswell) {
   159159          return 2;
   159160       } else {
   159161          return 0;
   159162       }
   159163    case 6: return 0;
   159164    case 5: return 0;
   159165    case 4:
   159166       if (devinfo->is_g4x) {
   159167          return 0;
   159168       } else {
   159169          return 0;
   159170       }
   159171    default:
   159172       unreachable("Invalid hardware generation");
   159173    }
   159174 }
   159175 
   159176 
   159177 
   159178 /* MI_LOAD_SCAN_LINES_INCL::Command Type */
   159179 
   159180 
   159181 #define GEN10_MI_LOAD_SCAN_LINES_INCL_CommandType_bits  3
   159182 #define GEN9_MI_LOAD_SCAN_LINES_INCL_CommandType_bits  3
   159183 #define GEN8_MI_LOAD_SCAN_LINES_INCL_CommandType_bits  3
   159184 #define GEN75_MI_LOAD_SCAN_LINES_INCL_CommandType_bits  3
   159185 
   159186 static inline uint32_t ATTRIBUTE_PURE
   159187 MI_LOAD_SCAN_LINES_INCL_CommandType_bits(const struct gen_device_info *devinfo)
   159188 {
   159189    switch (devinfo->gen) {
   159190    case 10: return 3;
   159191    case 9: return 3;
   159192    case 8: return 3;
   159193    case 7:
   159194       if (devinfo->is_haswell) {
   159195          return 3;
   159196       } else {
   159197          return 0;
   159198       }
   159199    case 6: return 0;
   159200    case 5: return 0;
   159201    case 4:
   159202       if (devinfo->is_g4x) {
   159203          return 0;
   159204       } else {
   159205          return 0;
   159206       }
   159207    default:
   159208       unreachable("Invalid hardware generation");
   159209    }
   159210 }
   159211 
   159212 
   159213 
   159214 #define GEN10_MI_LOAD_SCAN_LINES_INCL_CommandType_start  29
   159215 #define GEN9_MI_LOAD_SCAN_LINES_INCL_CommandType_start  29
   159216 #define GEN8_MI_LOAD_SCAN_LINES_INCL_CommandType_start  29
   159217 #define GEN75_MI_LOAD_SCAN_LINES_INCL_CommandType_start  29
   159218 
   159219 static inline uint32_t ATTRIBUTE_PURE
   159220 MI_LOAD_SCAN_LINES_INCL_CommandType_start(const struct gen_device_info *devinfo)
   159221 {
   159222    switch (devinfo->gen) {
   159223    case 10: return 29;
   159224    case 9: return 29;
   159225    case 8: return 29;
   159226    case 7:
   159227       if (devinfo->is_haswell) {
   159228          return 29;
   159229       } else {
   159230          return 0;
   159231       }
   159232    case 6: return 0;
   159233    case 5: return 0;
   159234    case 4:
   159235       if (devinfo->is_g4x) {
   159236          return 0;
   159237       } else {
   159238          return 0;
   159239       }
   159240    default:
   159241       unreachable("Invalid hardware generation");
   159242    }
   159243 }
   159244 
   159245 
   159246 
   159247 /* MI_LOAD_SCAN_LINES_INCL::DWord Length */
   159248 
   159249 
   159250 #define GEN10_MI_LOAD_SCAN_LINES_INCL_DWordLength_bits  6
   159251 #define GEN9_MI_LOAD_SCAN_LINES_INCL_DWordLength_bits  6
   159252 #define GEN8_MI_LOAD_SCAN_LINES_INCL_DWordLength_bits  6
   159253 #define GEN75_MI_LOAD_SCAN_LINES_INCL_DWordLength_bits  6
   159254 
   159255 static inline uint32_t ATTRIBUTE_PURE
   159256 MI_LOAD_SCAN_LINES_INCL_DWordLength_bits(const struct gen_device_info *devinfo)
   159257 {
   159258    switch (devinfo->gen) {
   159259    case 10: return 6;
   159260    case 9: return 6;
   159261    case 8: return 6;
   159262    case 7:
   159263       if (devinfo->is_haswell) {
   159264          return 6;
   159265       } else {
   159266          return 0;
   159267       }
   159268    case 6: return 0;
   159269    case 5: return 0;
   159270    case 4:
   159271       if (devinfo->is_g4x) {
   159272          return 0;
   159273       } else {
   159274          return 0;
   159275       }
   159276    default:
   159277       unreachable("Invalid hardware generation");
   159278    }
   159279 }
   159280 
   159281 
   159282 
   159283 #define GEN10_MI_LOAD_SCAN_LINES_INCL_DWordLength_start  0
   159284 #define GEN9_MI_LOAD_SCAN_LINES_INCL_DWordLength_start  0
   159285 #define GEN8_MI_LOAD_SCAN_LINES_INCL_DWordLength_start  0
   159286 #define GEN75_MI_LOAD_SCAN_LINES_INCL_DWordLength_start  0
   159287 
   159288 static inline uint32_t ATTRIBUTE_PURE
   159289 MI_LOAD_SCAN_LINES_INCL_DWordLength_start(const struct gen_device_info *devinfo)
   159290 {
   159291    switch (devinfo->gen) {
   159292    case 10: return 0;
   159293    case 9: return 0;
   159294    case 8: return 0;
   159295    case 7:
   159296       if (devinfo->is_haswell) {
   159297          return 0;
   159298       } else {
   159299          return 0;
   159300       }
   159301    case 6: return 0;
   159302    case 5: return 0;
   159303    case 4:
   159304       if (devinfo->is_g4x) {
   159305          return 0;
   159306       } else {
   159307          return 0;
   159308       }
   159309    default:
   159310       unreachable("Invalid hardware generation");
   159311    }
   159312 }
   159313 
   159314 
   159315 
   159316 /* MI_LOAD_SCAN_LINES_INCL::Display (Plane) Select */
   159317 
   159318 
   159319 #define GEN10_MI_LOAD_SCAN_LINES_INCL_DisplayPlaneSelect_bits  3
   159320 #define GEN9_MI_LOAD_SCAN_LINES_INCL_DisplayPlaneSelect_bits  3
   159321 #define GEN8_MI_LOAD_SCAN_LINES_INCL_DisplayPlaneSelect_bits  3
   159322 #define GEN75_MI_LOAD_SCAN_LINES_INCL_DisplayPlaneSelect_bits  3
   159323 
   159324 static inline uint32_t ATTRIBUTE_PURE
   159325 MI_LOAD_SCAN_LINES_INCL_DisplayPlaneSelect_bits(const struct gen_device_info *devinfo)
   159326 {
   159327    switch (devinfo->gen) {
   159328    case 10: return 3;
   159329    case 9: return 3;
   159330    case 8: return 3;
   159331    case 7:
   159332       if (devinfo->is_haswell) {
   159333          return 3;
   159334       } else {
   159335          return 0;
   159336       }
   159337    case 6: return 0;
   159338    case 5: return 0;
   159339    case 4:
   159340       if (devinfo->is_g4x) {
   159341          return 0;
   159342       } else {
   159343          return 0;
   159344       }
   159345    default:
   159346       unreachable("Invalid hardware generation");
   159347    }
   159348 }
   159349 
   159350 
   159351 
   159352 #define GEN10_MI_LOAD_SCAN_LINES_INCL_DisplayPlaneSelect_start  19
   159353 #define GEN9_MI_LOAD_SCAN_LINES_INCL_DisplayPlaneSelect_start  19
   159354 #define GEN8_MI_LOAD_SCAN_LINES_INCL_DisplayPlaneSelect_start  19
   159355 #define GEN75_MI_LOAD_SCAN_LINES_INCL_DisplayPlaneSelect_start  19
   159356 
   159357 static inline uint32_t ATTRIBUTE_PURE
   159358 MI_LOAD_SCAN_LINES_INCL_DisplayPlaneSelect_start(const struct gen_device_info *devinfo)
   159359 {
   159360    switch (devinfo->gen) {
   159361    case 10: return 19;
   159362    case 9: return 19;
   159363    case 8: return 19;
   159364    case 7:
   159365       if (devinfo->is_haswell) {
   159366          return 19;
   159367       } else {
   159368          return 0;
   159369       }
   159370    case 6: return 0;
   159371    case 5: return 0;
   159372    case 4:
   159373       if (devinfo->is_g4x) {
   159374          return 0;
   159375       } else {
   159376          return 0;
   159377       }
   159378    default:
   159379       unreachable("Invalid hardware generation");
   159380    }
   159381 }
   159382 
   159383 
   159384 
   159385 /* MI_LOAD_SCAN_LINES_INCL::End Scan Line Number */
   159386 
   159387 
   159388 #define GEN10_MI_LOAD_SCAN_LINES_INCL_EndScanLineNumber_bits  13
   159389 #define GEN9_MI_LOAD_SCAN_LINES_INCL_EndScanLineNumber_bits  13
   159390 #define GEN8_MI_LOAD_SCAN_LINES_INCL_EndScanLineNumber_bits  13
   159391 #define GEN75_MI_LOAD_SCAN_LINES_INCL_EndScanLineNumber_bits  13
   159392 
   159393 static inline uint32_t ATTRIBUTE_PURE
   159394 MI_LOAD_SCAN_LINES_INCL_EndScanLineNumber_bits(const struct gen_device_info *devinfo)
   159395 {
   159396    switch (devinfo->gen) {
   159397    case 10: return 13;
   159398    case 9: return 13;
   159399    case 8: return 13;
   159400    case 7:
   159401       if (devinfo->is_haswell) {
   159402          return 13;
   159403       } else {
   159404          return 0;
   159405       }
   159406    case 6: return 0;
   159407    case 5: return 0;
   159408    case 4:
   159409       if (devinfo->is_g4x) {
   159410          return 0;
   159411       } else {
   159412          return 0;
   159413       }
   159414    default:
   159415       unreachable("Invalid hardware generation");
   159416    }
   159417 }
   159418 
   159419 
   159420 
   159421 #define GEN10_MI_LOAD_SCAN_LINES_INCL_EndScanLineNumber_start  32
   159422 #define GEN9_MI_LOAD_SCAN_LINES_INCL_EndScanLineNumber_start  32
   159423 #define GEN8_MI_LOAD_SCAN_LINES_INCL_EndScanLineNumber_start  32
   159424 #define GEN75_MI_LOAD_SCAN_LINES_INCL_EndScanLineNumber_start  32
   159425 
   159426 static inline uint32_t ATTRIBUTE_PURE
   159427 MI_LOAD_SCAN_LINES_INCL_EndScanLineNumber_start(const struct gen_device_info *devinfo)
   159428 {
   159429    switch (devinfo->gen) {
   159430    case 10: return 32;
   159431    case 9: return 32;
   159432    case 8: return 32;
   159433    case 7:
   159434       if (devinfo->is_haswell) {
   159435          return 32;
   159436       } else {
   159437          return 0;
   159438       }
   159439    case 6: return 0;
   159440    case 5: return 0;
   159441    case 4:
   159442       if (devinfo->is_g4x) {
   159443          return 0;
   159444       } else {
   159445          return 0;
   159446       }
   159447    default:
   159448       unreachable("Invalid hardware generation");
   159449    }
   159450 }
   159451 
   159452 
   159453 
   159454 /* MI_LOAD_SCAN_LINES_INCL::MI Command Opcode */
   159455 
   159456 
   159457 #define GEN10_MI_LOAD_SCAN_LINES_INCL_MICommandOpcode_bits  6
   159458 #define GEN9_MI_LOAD_SCAN_LINES_INCL_MICommandOpcode_bits  6
   159459 #define GEN8_MI_LOAD_SCAN_LINES_INCL_MICommandOpcode_bits  6
   159460 #define GEN75_MI_LOAD_SCAN_LINES_INCL_MICommandOpcode_bits  6
   159461 
   159462 static inline uint32_t ATTRIBUTE_PURE
   159463 MI_LOAD_SCAN_LINES_INCL_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   159464 {
   159465    switch (devinfo->gen) {
   159466    case 10: return 6;
   159467    case 9: return 6;
   159468    case 8: return 6;
   159469    case 7:
   159470       if (devinfo->is_haswell) {
   159471          return 6;
   159472       } else {
   159473          return 0;
   159474       }
   159475    case 6: return 0;
   159476    case 5: return 0;
   159477    case 4:
   159478       if (devinfo->is_g4x) {
   159479          return 0;
   159480       } else {
   159481          return 0;
   159482       }
   159483    default:
   159484       unreachable("Invalid hardware generation");
   159485    }
   159486 }
   159487 
   159488 
   159489 
   159490 #define GEN10_MI_LOAD_SCAN_LINES_INCL_MICommandOpcode_start  23
   159491 #define GEN9_MI_LOAD_SCAN_LINES_INCL_MICommandOpcode_start  23
   159492 #define GEN8_MI_LOAD_SCAN_LINES_INCL_MICommandOpcode_start  23
   159493 #define GEN75_MI_LOAD_SCAN_LINES_INCL_MICommandOpcode_start  23
   159494 
   159495 static inline uint32_t ATTRIBUTE_PURE
   159496 MI_LOAD_SCAN_LINES_INCL_MICommandOpcode_start(const struct gen_device_info *devinfo)
   159497 {
   159498    switch (devinfo->gen) {
   159499    case 10: return 23;
   159500    case 9: return 23;
   159501    case 8: return 23;
   159502    case 7:
   159503       if (devinfo->is_haswell) {
   159504          return 23;
   159505       } else {
   159506          return 0;
   159507       }
   159508    case 6: return 0;
   159509    case 5: return 0;
   159510    case 4:
   159511       if (devinfo->is_g4x) {
   159512          return 0;
   159513       } else {
   159514          return 0;
   159515       }
   159516    default:
   159517       unreachable("Invalid hardware generation");
   159518    }
   159519 }
   159520 
   159521 
   159522 
   159523 /* MI_LOAD_SCAN_LINES_INCL::Scan Line Event Done Forward */
   159524 
   159525 
   159526 #define GEN10_MI_LOAD_SCAN_LINES_INCL_ScanLineEventDoneForward_bits  2
   159527 #define GEN9_MI_LOAD_SCAN_LINES_INCL_ScanLineEventDoneForward_bits  2
   159528 #define GEN8_MI_LOAD_SCAN_LINES_INCL_ScanLineEventDoneForward_bits  2
   159529 
   159530 static inline uint32_t ATTRIBUTE_PURE
   159531 MI_LOAD_SCAN_LINES_INCL_ScanLineEventDoneForward_bits(const struct gen_device_info *devinfo)
   159532 {
   159533    switch (devinfo->gen) {
   159534    case 10: return 2;
   159535    case 9: return 2;
   159536    case 8: return 2;
   159537    case 7:
   159538       if (devinfo->is_haswell) {
   159539          return 0;
   159540       } else {
   159541          return 0;
   159542       }
   159543    case 6: return 0;
   159544    case 5: return 0;
   159545    case 4:
   159546       if (devinfo->is_g4x) {
   159547          return 0;
   159548       } else {
   159549          return 0;
   159550       }
   159551    default:
   159552       unreachable("Invalid hardware generation");
   159553    }
   159554 }
   159555 
   159556 
   159557 
   159558 #define GEN10_MI_LOAD_SCAN_LINES_INCL_ScanLineEventDoneForward_start  17
   159559 #define GEN9_MI_LOAD_SCAN_LINES_INCL_ScanLineEventDoneForward_start  17
   159560 #define GEN8_MI_LOAD_SCAN_LINES_INCL_ScanLineEventDoneForward_start  17
   159561 
   159562 static inline uint32_t ATTRIBUTE_PURE
   159563 MI_LOAD_SCAN_LINES_INCL_ScanLineEventDoneForward_start(const struct gen_device_info *devinfo)
   159564 {
   159565    switch (devinfo->gen) {
   159566    case 10: return 17;
   159567    case 9: return 17;
   159568    case 8: return 17;
   159569    case 7:
   159570       if (devinfo->is_haswell) {
   159571          return 0;
   159572       } else {
   159573          return 0;
   159574       }
   159575    case 6: return 0;
   159576    case 5: return 0;
   159577    case 4:
   159578       if (devinfo->is_g4x) {
   159579          return 0;
   159580       } else {
   159581          return 0;
   159582       }
   159583    default:
   159584       unreachable("Invalid hardware generation");
   159585    }
   159586 }
   159587 
   159588 
   159589 
   159590 /* MI_LOAD_SCAN_LINES_INCL::Start Scan Line Number */
   159591 
   159592 
   159593 #define GEN10_MI_LOAD_SCAN_LINES_INCL_StartScanLineNumber_bits  13
   159594 #define GEN9_MI_LOAD_SCAN_LINES_INCL_StartScanLineNumber_bits  13
   159595 #define GEN8_MI_LOAD_SCAN_LINES_INCL_StartScanLineNumber_bits  13
   159596 #define GEN75_MI_LOAD_SCAN_LINES_INCL_StartScanLineNumber_bits  13
   159597 
   159598 static inline uint32_t ATTRIBUTE_PURE
   159599 MI_LOAD_SCAN_LINES_INCL_StartScanLineNumber_bits(const struct gen_device_info *devinfo)
   159600 {
   159601    switch (devinfo->gen) {
   159602    case 10: return 13;
   159603    case 9: return 13;
   159604    case 8: return 13;
   159605    case 7:
   159606       if (devinfo->is_haswell) {
   159607          return 13;
   159608       } else {
   159609          return 0;
   159610       }
   159611    case 6: return 0;
   159612    case 5: return 0;
   159613    case 4:
   159614       if (devinfo->is_g4x) {
   159615          return 0;
   159616       } else {
   159617          return 0;
   159618       }
   159619    default:
   159620       unreachable("Invalid hardware generation");
   159621    }
   159622 }
   159623 
   159624 
   159625 
   159626 #define GEN10_MI_LOAD_SCAN_LINES_INCL_StartScanLineNumber_start  48
   159627 #define GEN9_MI_LOAD_SCAN_LINES_INCL_StartScanLineNumber_start  48
   159628 #define GEN8_MI_LOAD_SCAN_LINES_INCL_StartScanLineNumber_start  48
   159629 #define GEN75_MI_LOAD_SCAN_LINES_INCL_StartScanLineNumber_start  48
   159630 
   159631 static inline uint32_t ATTRIBUTE_PURE
   159632 MI_LOAD_SCAN_LINES_INCL_StartScanLineNumber_start(const struct gen_device_info *devinfo)
   159633 {
   159634    switch (devinfo->gen) {
   159635    case 10: return 48;
   159636    case 9: return 48;
   159637    case 8: return 48;
   159638    case 7:
   159639       if (devinfo->is_haswell) {
   159640          return 48;
   159641       } else {
   159642          return 0;
   159643       }
   159644    case 6: return 0;
   159645    case 5: return 0;
   159646    case 4:
   159647       if (devinfo->is_g4x) {
   159648          return 0;
   159649       } else {
   159650          return 0;
   159651       }
   159652    default:
   159653       unreachable("Invalid hardware generation");
   159654    }
   159655 }
   159656 
   159657 
   159658 
   159659 /* MI_LOAD_URB_MEM */
   159660 
   159661 
   159662 #define GEN9_MI_LOAD_URB_MEM_length  4
   159663 #define GEN8_MI_LOAD_URB_MEM_length  4
   159664 #define GEN75_MI_LOAD_URB_MEM_length  3
   159665 
   159666 static inline uint32_t ATTRIBUTE_PURE
   159667 MI_LOAD_URB_MEM_length(const struct gen_device_info *devinfo)
   159668 {
   159669    switch (devinfo->gen) {
   159670    case 10: return 0;
   159671    case 9: return 4;
   159672    case 8: return 4;
   159673    case 7:
   159674       if (devinfo->is_haswell) {
   159675          return 3;
   159676       } else {
   159677          return 0;
   159678       }
   159679    case 6: return 0;
   159680    case 5: return 0;
   159681    case 4:
   159682       if (devinfo->is_g4x) {
   159683          return 0;
   159684       } else {
   159685          return 0;
   159686       }
   159687    default:
   159688       unreachable("Invalid hardware generation");
   159689    }
   159690 }
   159691 
   159692 
   159693 
   159694 /* MI_LOAD_URB_MEM::Command Type */
   159695 
   159696 
   159697 #define GEN9_MI_LOAD_URB_MEM_CommandType_bits  3
   159698 #define GEN8_MI_LOAD_URB_MEM_CommandType_bits  3
   159699 #define GEN75_MI_LOAD_URB_MEM_CommandType_bits  3
   159700 
   159701 static inline uint32_t ATTRIBUTE_PURE
   159702 MI_LOAD_URB_MEM_CommandType_bits(const struct gen_device_info *devinfo)
   159703 {
   159704    switch (devinfo->gen) {
   159705    case 10: return 0;
   159706    case 9: return 3;
   159707    case 8: return 3;
   159708    case 7:
   159709       if (devinfo->is_haswell) {
   159710          return 3;
   159711       } else {
   159712          return 0;
   159713       }
   159714    case 6: return 0;
   159715    case 5: return 0;
   159716    case 4:
   159717       if (devinfo->is_g4x) {
   159718          return 0;
   159719       } else {
   159720          return 0;
   159721       }
   159722    default:
   159723       unreachable("Invalid hardware generation");
   159724    }
   159725 }
   159726 
   159727 
   159728 
   159729 #define GEN9_MI_LOAD_URB_MEM_CommandType_start  29
   159730 #define GEN8_MI_LOAD_URB_MEM_CommandType_start  29
   159731 #define GEN75_MI_LOAD_URB_MEM_CommandType_start  29
   159732 
   159733 static inline uint32_t ATTRIBUTE_PURE
   159734 MI_LOAD_URB_MEM_CommandType_start(const struct gen_device_info *devinfo)
   159735 {
   159736    switch (devinfo->gen) {
   159737    case 10: return 0;
   159738    case 9: return 29;
   159739    case 8: return 29;
   159740    case 7:
   159741       if (devinfo->is_haswell) {
   159742          return 29;
   159743       } else {
   159744          return 0;
   159745       }
   159746    case 6: return 0;
   159747    case 5: return 0;
   159748    case 4:
   159749       if (devinfo->is_g4x) {
   159750          return 0;
   159751       } else {
   159752          return 0;
   159753       }
   159754    default:
   159755       unreachable("Invalid hardware generation");
   159756    }
   159757 }
   159758 
   159759 
   159760 
   159761 /* MI_LOAD_URB_MEM::DWord Length */
   159762 
   159763 
   159764 #define GEN9_MI_LOAD_URB_MEM_DWordLength_bits  8
   159765 #define GEN8_MI_LOAD_URB_MEM_DWordLength_bits  8
   159766 #define GEN75_MI_LOAD_URB_MEM_DWordLength_bits  8
   159767 
   159768 static inline uint32_t ATTRIBUTE_PURE
   159769 MI_LOAD_URB_MEM_DWordLength_bits(const struct gen_device_info *devinfo)
   159770 {
   159771    switch (devinfo->gen) {
   159772    case 10: return 0;
   159773    case 9: return 8;
   159774    case 8: return 8;
   159775    case 7:
   159776       if (devinfo->is_haswell) {
   159777          return 8;
   159778       } else {
   159779          return 0;
   159780       }
   159781    case 6: return 0;
   159782    case 5: return 0;
   159783    case 4:
   159784       if (devinfo->is_g4x) {
   159785          return 0;
   159786       } else {
   159787          return 0;
   159788       }
   159789    default:
   159790       unreachable("Invalid hardware generation");
   159791    }
   159792 }
   159793 
   159794 
   159795 
   159796 #define GEN9_MI_LOAD_URB_MEM_DWordLength_start  0
   159797 #define GEN8_MI_LOAD_URB_MEM_DWordLength_start  0
   159798 #define GEN75_MI_LOAD_URB_MEM_DWordLength_start  0
   159799 
   159800 static inline uint32_t ATTRIBUTE_PURE
   159801 MI_LOAD_URB_MEM_DWordLength_start(const struct gen_device_info *devinfo)
   159802 {
   159803    switch (devinfo->gen) {
   159804    case 10: return 0;
   159805    case 9: return 0;
   159806    case 8: return 0;
   159807    case 7:
   159808       if (devinfo->is_haswell) {
   159809          return 0;
   159810       } else {
   159811          return 0;
   159812       }
   159813    case 6: return 0;
   159814    case 5: return 0;
   159815    case 4:
   159816       if (devinfo->is_g4x) {
   159817          return 0;
   159818       } else {
   159819          return 0;
   159820       }
   159821    default:
   159822       unreachable("Invalid hardware generation");
   159823    }
   159824 }
   159825 
   159826 
   159827 
   159828 /* MI_LOAD_URB_MEM::MI Command Opcode */
   159829 
   159830 
   159831 #define GEN9_MI_LOAD_URB_MEM_MICommandOpcode_bits  6
   159832 #define GEN8_MI_LOAD_URB_MEM_MICommandOpcode_bits  6
   159833 #define GEN75_MI_LOAD_URB_MEM_MICommandOpcode_bits  6
   159834 
   159835 static inline uint32_t ATTRIBUTE_PURE
   159836 MI_LOAD_URB_MEM_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   159837 {
   159838    switch (devinfo->gen) {
   159839    case 10: return 0;
   159840    case 9: return 6;
   159841    case 8: return 6;
   159842    case 7:
   159843       if (devinfo->is_haswell) {
   159844          return 6;
   159845       } else {
   159846          return 0;
   159847       }
   159848    case 6: return 0;
   159849    case 5: return 0;
   159850    case 4:
   159851       if (devinfo->is_g4x) {
   159852          return 0;
   159853       } else {
   159854          return 0;
   159855       }
   159856    default:
   159857       unreachable("Invalid hardware generation");
   159858    }
   159859 }
   159860 
   159861 
   159862 
   159863 #define GEN9_MI_LOAD_URB_MEM_MICommandOpcode_start  23
   159864 #define GEN8_MI_LOAD_URB_MEM_MICommandOpcode_start  23
   159865 #define GEN75_MI_LOAD_URB_MEM_MICommandOpcode_start  23
   159866 
   159867 static inline uint32_t ATTRIBUTE_PURE
   159868 MI_LOAD_URB_MEM_MICommandOpcode_start(const struct gen_device_info *devinfo)
   159869 {
   159870    switch (devinfo->gen) {
   159871    case 10: return 0;
   159872    case 9: return 23;
   159873    case 8: return 23;
   159874    case 7:
   159875       if (devinfo->is_haswell) {
   159876          return 23;
   159877       } else {
   159878          return 0;
   159879       }
   159880    case 6: return 0;
   159881    case 5: return 0;
   159882    case 4:
   159883       if (devinfo->is_g4x) {
   159884          return 0;
   159885       } else {
   159886          return 0;
   159887       }
   159888    default:
   159889       unreachable("Invalid hardware generation");
   159890    }
   159891 }
   159892 
   159893 
   159894 
   159895 /* MI_LOAD_URB_MEM::Memory Address */
   159896 
   159897 
   159898 #define GEN9_MI_LOAD_URB_MEM_MemoryAddress_bits  58
   159899 #define GEN8_MI_LOAD_URB_MEM_MemoryAddress_bits  58
   159900 #define GEN75_MI_LOAD_URB_MEM_MemoryAddress_bits  26
   159901 
   159902 static inline uint32_t ATTRIBUTE_PURE
   159903 MI_LOAD_URB_MEM_MemoryAddress_bits(const struct gen_device_info *devinfo)
   159904 {
   159905    switch (devinfo->gen) {
   159906    case 10: return 0;
   159907    case 9: return 58;
   159908    case 8: return 58;
   159909    case 7:
   159910       if (devinfo->is_haswell) {
   159911          return 26;
   159912       } else {
   159913          return 0;
   159914       }
   159915    case 6: return 0;
   159916    case 5: return 0;
   159917    case 4:
   159918       if (devinfo->is_g4x) {
   159919          return 0;
   159920       } else {
   159921          return 0;
   159922       }
   159923    default:
   159924       unreachable("Invalid hardware generation");
   159925    }
   159926 }
   159927 
   159928 
   159929 
   159930 #define GEN9_MI_LOAD_URB_MEM_MemoryAddress_start  70
   159931 #define GEN8_MI_LOAD_URB_MEM_MemoryAddress_start  70
   159932 #define GEN75_MI_LOAD_URB_MEM_MemoryAddress_start  70
   159933 
   159934 static inline uint32_t ATTRIBUTE_PURE
   159935 MI_LOAD_URB_MEM_MemoryAddress_start(const struct gen_device_info *devinfo)
   159936 {
   159937    switch (devinfo->gen) {
   159938    case 10: return 0;
   159939    case 9: return 70;
   159940    case 8: return 70;
   159941    case 7:
   159942       if (devinfo->is_haswell) {
   159943          return 70;
   159944       } else {
   159945          return 0;
   159946       }
   159947    case 6: return 0;
   159948    case 5: return 0;
   159949    case 4:
   159950       if (devinfo->is_g4x) {
   159951          return 0;
   159952       } else {
   159953          return 0;
   159954       }
   159955    default:
   159956       unreachable("Invalid hardware generation");
   159957    }
   159958 }
   159959 
   159960 
   159961 
   159962 /* MI_LOAD_URB_MEM::URB Address */
   159963 
   159964 
   159965 #define GEN9_MI_LOAD_URB_MEM_URBAddress_bits  13
   159966 #define GEN8_MI_LOAD_URB_MEM_URBAddress_bits  13
   159967 #define GEN75_MI_LOAD_URB_MEM_URBAddress_bits  13
   159968 
   159969 static inline uint32_t ATTRIBUTE_PURE
   159970 MI_LOAD_URB_MEM_URBAddress_bits(const struct gen_device_info *devinfo)
   159971 {
   159972    switch (devinfo->gen) {
   159973    case 10: return 0;
   159974    case 9: return 13;
   159975    case 8: return 13;
   159976    case 7:
   159977       if (devinfo->is_haswell) {
   159978          return 13;
   159979       } else {
   159980          return 0;
   159981       }
   159982    case 6: return 0;
   159983    case 5: return 0;
   159984    case 4:
   159985       if (devinfo->is_g4x) {
   159986          return 0;
   159987       } else {
   159988          return 0;
   159989       }
   159990    default:
   159991       unreachable("Invalid hardware generation");
   159992    }
   159993 }
   159994 
   159995 
   159996 
   159997 #define GEN9_MI_LOAD_URB_MEM_URBAddress_start  34
   159998 #define GEN8_MI_LOAD_URB_MEM_URBAddress_start  34
   159999 #define GEN75_MI_LOAD_URB_MEM_URBAddress_start  34
   160000 
   160001 static inline uint32_t ATTRIBUTE_PURE
   160002 MI_LOAD_URB_MEM_URBAddress_start(const struct gen_device_info *devinfo)
   160003 {
   160004    switch (devinfo->gen) {
   160005    case 10: return 0;
   160006    case 9: return 34;
   160007    case 8: return 34;
   160008    case 7:
   160009       if (devinfo->is_haswell) {
   160010          return 34;
   160011       } else {
   160012          return 0;
   160013       }
   160014    case 6: return 0;
   160015    case 5: return 0;
   160016    case 4:
   160017       if (devinfo->is_g4x) {
   160018          return 0;
   160019       } else {
   160020          return 0;
   160021       }
   160022    default:
   160023       unreachable("Invalid hardware generation");
   160024    }
   160025 }
   160026 
   160027 
   160028 
   160029 /* MI_MATH */
   160030 
   160031 
   160032 
   160033 
   160034 
   160035 /* MI_MATH::Command Type */
   160036 
   160037 
   160038 #define GEN10_MI_MATH_CommandType_bits  3
   160039 #define GEN9_MI_MATH_CommandType_bits  3
   160040 #define GEN8_MI_MATH_CommandType_bits  3
   160041 #define GEN75_MI_MATH_CommandType_bits  3
   160042 
   160043 static inline uint32_t ATTRIBUTE_PURE
   160044 MI_MATH_CommandType_bits(const struct gen_device_info *devinfo)
   160045 {
   160046    switch (devinfo->gen) {
   160047    case 10: return 3;
   160048    case 9: return 3;
   160049    case 8: return 3;
   160050    case 7:
   160051       if (devinfo->is_haswell) {
   160052          return 3;
   160053       } else {
   160054          return 0;
   160055       }
   160056    case 6: return 0;
   160057    case 5: return 0;
   160058    case 4:
   160059       if (devinfo->is_g4x) {
   160060          return 0;
   160061       } else {
   160062          return 0;
   160063       }
   160064    default:
   160065       unreachable("Invalid hardware generation");
   160066    }
   160067 }
   160068 
   160069 
   160070 
   160071 #define GEN10_MI_MATH_CommandType_start  29
   160072 #define GEN9_MI_MATH_CommandType_start  29
   160073 #define GEN8_MI_MATH_CommandType_start  29
   160074 #define GEN75_MI_MATH_CommandType_start  29
   160075 
   160076 static inline uint32_t ATTRIBUTE_PURE
   160077 MI_MATH_CommandType_start(const struct gen_device_info *devinfo)
   160078 {
   160079    switch (devinfo->gen) {
   160080    case 10: return 29;
   160081    case 9: return 29;
   160082    case 8: return 29;
   160083    case 7:
   160084       if (devinfo->is_haswell) {
   160085          return 29;
   160086       } else {
   160087          return 0;
   160088       }
   160089    case 6: return 0;
   160090    case 5: return 0;
   160091    case 4:
   160092       if (devinfo->is_g4x) {
   160093          return 0;
   160094       } else {
   160095          return 0;
   160096       }
   160097    default:
   160098       unreachable("Invalid hardware generation");
   160099    }
   160100 }
   160101 
   160102 
   160103 
   160104 /* MI_MATH::DWord Length */
   160105 
   160106 
   160107 #define GEN10_MI_MATH_DWordLength_bits  8
   160108 #define GEN9_MI_MATH_DWordLength_bits  8
   160109 #define GEN8_MI_MATH_DWordLength_bits  6
   160110 #define GEN75_MI_MATH_DWordLength_bits  6
   160111 
   160112 static inline uint32_t ATTRIBUTE_PURE
   160113 MI_MATH_DWordLength_bits(const struct gen_device_info *devinfo)
   160114 {
   160115    switch (devinfo->gen) {
   160116    case 10: return 8;
   160117    case 9: return 8;
   160118    case 8: return 6;
   160119    case 7:
   160120       if (devinfo->is_haswell) {
   160121          return 6;
   160122       } else {
   160123          return 0;
   160124       }
   160125    case 6: return 0;
   160126    case 5: return 0;
   160127    case 4:
   160128       if (devinfo->is_g4x) {
   160129          return 0;
   160130       } else {
   160131          return 0;
   160132       }
   160133    default:
   160134       unreachable("Invalid hardware generation");
   160135    }
   160136 }
   160137 
   160138 
   160139 
   160140 #define GEN10_MI_MATH_DWordLength_start  0
   160141 #define GEN9_MI_MATH_DWordLength_start  0
   160142 #define GEN8_MI_MATH_DWordLength_start  0
   160143 #define GEN75_MI_MATH_DWordLength_start  0
   160144 
   160145 static inline uint32_t ATTRIBUTE_PURE
   160146 MI_MATH_DWordLength_start(const struct gen_device_info *devinfo)
   160147 {
   160148    switch (devinfo->gen) {
   160149    case 10: return 0;
   160150    case 9: return 0;
   160151    case 8: return 0;
   160152    case 7:
   160153       if (devinfo->is_haswell) {
   160154          return 0;
   160155       } else {
   160156          return 0;
   160157       }
   160158    case 6: return 0;
   160159    case 5: return 0;
   160160    case 4:
   160161       if (devinfo->is_g4x) {
   160162          return 0;
   160163       } else {
   160164          return 0;
   160165       }
   160166    default:
   160167       unreachable("Invalid hardware generation");
   160168    }
   160169 }
   160170 
   160171 
   160172 
   160173 /* MI_MATH::Instruction */
   160174 
   160175 
   160176 #define GEN10_MI_MATH_Instruction_bits  32
   160177 #define GEN9_MI_MATH_Instruction_bits  32
   160178 #define GEN8_MI_MATH_Instruction_bits  32
   160179 #define GEN75_MI_MATH_Instruction_bits  32
   160180 
   160181 static inline uint32_t ATTRIBUTE_PURE
   160182 MI_MATH_Instruction_bits(const struct gen_device_info *devinfo)
   160183 {
   160184    switch (devinfo->gen) {
   160185    case 10: return 32;
   160186    case 9: return 32;
   160187    case 8: return 32;
   160188    case 7:
   160189       if (devinfo->is_haswell) {
   160190          return 32;
   160191       } else {
   160192          return 0;
   160193       }
   160194    case 6: return 0;
   160195    case 5: return 0;
   160196    case 4:
   160197       if (devinfo->is_g4x) {
   160198          return 0;
   160199       } else {
   160200          return 0;
   160201       }
   160202    default:
   160203       unreachable("Invalid hardware generation");
   160204    }
   160205 }
   160206 
   160207 
   160208 
   160209 #define GEN10_MI_MATH_Instruction_start  0
   160210 #define GEN9_MI_MATH_Instruction_start  0
   160211 #define GEN8_MI_MATH_Instruction_start  0
   160212 #define GEN75_MI_MATH_Instruction_start  0
   160213 
   160214 static inline uint32_t ATTRIBUTE_PURE
   160215 MI_MATH_Instruction_start(const struct gen_device_info *devinfo)
   160216 {
   160217    switch (devinfo->gen) {
   160218    case 10: return 0;
   160219    case 9: return 0;
   160220    case 8: return 0;
   160221    case 7:
   160222       if (devinfo->is_haswell) {
   160223          return 0;
   160224       } else {
   160225          return 0;
   160226       }
   160227    case 6: return 0;
   160228    case 5: return 0;
   160229    case 4:
   160230       if (devinfo->is_g4x) {
   160231          return 0;
   160232       } else {
   160233          return 0;
   160234       }
   160235    default:
   160236       unreachable("Invalid hardware generation");
   160237    }
   160238 }
   160239 
   160240 
   160241 
   160242 /* MI_MATH::MI Command Opcode */
   160243 
   160244 
   160245 #define GEN10_MI_MATH_MICommandOpcode_bits  6
   160246 #define GEN9_MI_MATH_MICommandOpcode_bits  6
   160247 #define GEN8_MI_MATH_MICommandOpcode_bits  6
   160248 #define GEN75_MI_MATH_MICommandOpcode_bits  6
   160249 
   160250 static inline uint32_t ATTRIBUTE_PURE
   160251 MI_MATH_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   160252 {
   160253    switch (devinfo->gen) {
   160254    case 10: return 6;
   160255    case 9: return 6;
   160256    case 8: return 6;
   160257    case 7:
   160258       if (devinfo->is_haswell) {
   160259          return 6;
   160260       } else {
   160261          return 0;
   160262       }
   160263    case 6: return 0;
   160264    case 5: return 0;
   160265    case 4:
   160266       if (devinfo->is_g4x) {
   160267          return 0;
   160268       } else {
   160269          return 0;
   160270       }
   160271    default:
   160272       unreachable("Invalid hardware generation");
   160273    }
   160274 }
   160275 
   160276 
   160277 
   160278 #define GEN10_MI_MATH_MICommandOpcode_start  23
   160279 #define GEN9_MI_MATH_MICommandOpcode_start  23
   160280 #define GEN8_MI_MATH_MICommandOpcode_start  23
   160281 #define GEN75_MI_MATH_MICommandOpcode_start  23
   160282 
   160283 static inline uint32_t ATTRIBUTE_PURE
   160284 MI_MATH_MICommandOpcode_start(const struct gen_device_info *devinfo)
   160285 {
   160286    switch (devinfo->gen) {
   160287    case 10: return 23;
   160288    case 9: return 23;
   160289    case 8: return 23;
   160290    case 7:
   160291       if (devinfo->is_haswell) {
   160292          return 23;
   160293       } else {
   160294          return 0;
   160295       }
   160296    case 6: return 0;
   160297    case 5: return 0;
   160298    case 4:
   160299       if (devinfo->is_g4x) {
   160300          return 0;
   160301       } else {
   160302          return 0;
   160303       }
   160304    default:
   160305       unreachable("Invalid hardware generation");
   160306    }
   160307 }
   160308 
   160309 
   160310 
   160311 /* MI_MATH_ALU_INSTRUCTION */
   160312 
   160313 
   160314 #define GEN10_MI_MATH_ALU_INSTRUCTION_length  1
   160315 #define GEN9_MI_MATH_ALU_INSTRUCTION_length  1
   160316 #define GEN8_MI_MATH_ALU_INSTRUCTION_length  1
   160317 #define GEN75_MI_MATH_ALU_INSTRUCTION_length  1
   160318 
   160319 static inline uint32_t ATTRIBUTE_PURE
   160320 MI_MATH_ALU_INSTRUCTION_length(const struct gen_device_info *devinfo)
   160321 {
   160322    switch (devinfo->gen) {
   160323    case 10: return 1;
   160324    case 9: return 1;
   160325    case 8: return 1;
   160326    case 7:
   160327       if (devinfo->is_haswell) {
   160328          return 1;
   160329       } else {
   160330          return 0;
   160331       }
   160332    case 6: return 0;
   160333    case 5: return 0;
   160334    case 4:
   160335       if (devinfo->is_g4x) {
   160336          return 0;
   160337       } else {
   160338          return 0;
   160339       }
   160340    default:
   160341       unreachable("Invalid hardware generation");
   160342    }
   160343 }
   160344 
   160345 
   160346 
   160347 /* MI_MATH_ALU_INSTRUCTION::ALU Opcode */
   160348 
   160349 
   160350 #define GEN10_MI_MATH_ALU_INSTRUCTION_ALUOpcode_bits  12
   160351 #define GEN9_MI_MATH_ALU_INSTRUCTION_ALUOpcode_bits  12
   160352 #define GEN8_MI_MATH_ALU_INSTRUCTION_ALUOpcode_bits  12
   160353 #define GEN75_MI_MATH_ALU_INSTRUCTION_ALUOpcode_bits  12
   160354 
   160355 static inline uint32_t ATTRIBUTE_PURE
   160356 MI_MATH_ALU_INSTRUCTION_ALUOpcode_bits(const struct gen_device_info *devinfo)
   160357 {
   160358    switch (devinfo->gen) {
   160359    case 10: return 12;
   160360    case 9: return 12;
   160361    case 8: return 12;
   160362    case 7:
   160363       if (devinfo->is_haswell) {
   160364          return 12;
   160365       } else {
   160366          return 0;
   160367       }
   160368    case 6: return 0;
   160369    case 5: return 0;
   160370    case 4:
   160371       if (devinfo->is_g4x) {
   160372          return 0;
   160373       } else {
   160374          return 0;
   160375       }
   160376    default:
   160377       unreachable("Invalid hardware generation");
   160378    }
   160379 }
   160380 
   160381 
   160382 
   160383 #define GEN10_MI_MATH_ALU_INSTRUCTION_ALUOpcode_start  20
   160384 #define GEN9_MI_MATH_ALU_INSTRUCTION_ALUOpcode_start  20
   160385 #define GEN8_MI_MATH_ALU_INSTRUCTION_ALUOpcode_start  20
   160386 #define GEN75_MI_MATH_ALU_INSTRUCTION_ALUOpcode_start  20
   160387 
   160388 static inline uint32_t ATTRIBUTE_PURE
   160389 MI_MATH_ALU_INSTRUCTION_ALUOpcode_start(const struct gen_device_info *devinfo)
   160390 {
   160391    switch (devinfo->gen) {
   160392    case 10: return 20;
   160393    case 9: return 20;
   160394    case 8: return 20;
   160395    case 7:
   160396       if (devinfo->is_haswell) {
   160397          return 20;
   160398       } else {
   160399          return 0;
   160400       }
   160401    case 6: return 0;
   160402    case 5: return 0;
   160403    case 4:
   160404       if (devinfo->is_g4x) {
   160405          return 0;
   160406       } else {
   160407          return 0;
   160408       }
   160409    default:
   160410       unreachable("Invalid hardware generation");
   160411    }
   160412 }
   160413 
   160414 
   160415 
   160416 /* MI_MATH_ALU_INSTRUCTION::Operand 1 */
   160417 
   160418 
   160419 #define GEN10_MI_MATH_ALU_INSTRUCTION_Operand1_bits  10
   160420 #define GEN9_MI_MATH_ALU_INSTRUCTION_Operand1_bits  10
   160421 #define GEN8_MI_MATH_ALU_INSTRUCTION_Operand1_bits  10
   160422 #define GEN75_MI_MATH_ALU_INSTRUCTION_Operand1_bits  10
   160423 
   160424 static inline uint32_t ATTRIBUTE_PURE
   160425 MI_MATH_ALU_INSTRUCTION_Operand1_bits(const struct gen_device_info *devinfo)
   160426 {
   160427    switch (devinfo->gen) {
   160428    case 10: return 10;
   160429    case 9: return 10;
   160430    case 8: return 10;
   160431    case 7:
   160432       if (devinfo->is_haswell) {
   160433          return 10;
   160434       } else {
   160435          return 0;
   160436       }
   160437    case 6: return 0;
   160438    case 5: return 0;
   160439    case 4:
   160440       if (devinfo->is_g4x) {
   160441          return 0;
   160442       } else {
   160443          return 0;
   160444       }
   160445    default:
   160446       unreachable("Invalid hardware generation");
   160447    }
   160448 }
   160449 
   160450 
   160451 
   160452 #define GEN10_MI_MATH_ALU_INSTRUCTION_Operand1_start  10
   160453 #define GEN9_MI_MATH_ALU_INSTRUCTION_Operand1_start  10
   160454 #define GEN8_MI_MATH_ALU_INSTRUCTION_Operand1_start  10
   160455 #define GEN75_MI_MATH_ALU_INSTRUCTION_Operand1_start  10
   160456 
   160457 static inline uint32_t ATTRIBUTE_PURE
   160458 MI_MATH_ALU_INSTRUCTION_Operand1_start(const struct gen_device_info *devinfo)
   160459 {
   160460    switch (devinfo->gen) {
   160461    case 10: return 10;
   160462    case 9: return 10;
   160463    case 8: return 10;
   160464    case 7:
   160465       if (devinfo->is_haswell) {
   160466          return 10;
   160467       } else {
   160468          return 0;
   160469       }
   160470    case 6: return 0;
   160471    case 5: return 0;
   160472    case 4:
   160473       if (devinfo->is_g4x) {
   160474          return 0;
   160475       } else {
   160476          return 0;
   160477       }
   160478    default:
   160479       unreachable("Invalid hardware generation");
   160480    }
   160481 }
   160482 
   160483 
   160484 
   160485 /* MI_MATH_ALU_INSTRUCTION::Operand 2 */
   160486 
   160487 
   160488 #define GEN10_MI_MATH_ALU_INSTRUCTION_Operand2_bits  10
   160489 #define GEN9_MI_MATH_ALU_INSTRUCTION_Operand2_bits  10
   160490 #define GEN8_MI_MATH_ALU_INSTRUCTION_Operand2_bits  10
   160491 #define GEN75_MI_MATH_ALU_INSTRUCTION_Operand2_bits  10
   160492 
   160493 static inline uint32_t ATTRIBUTE_PURE
   160494 MI_MATH_ALU_INSTRUCTION_Operand2_bits(const struct gen_device_info *devinfo)
   160495 {
   160496    switch (devinfo->gen) {
   160497    case 10: return 10;
   160498    case 9: return 10;
   160499    case 8: return 10;
   160500    case 7:
   160501       if (devinfo->is_haswell) {
   160502          return 10;
   160503       } else {
   160504          return 0;
   160505       }
   160506    case 6: return 0;
   160507    case 5: return 0;
   160508    case 4:
   160509       if (devinfo->is_g4x) {
   160510          return 0;
   160511       } else {
   160512          return 0;
   160513       }
   160514    default:
   160515       unreachable("Invalid hardware generation");
   160516    }
   160517 }
   160518 
   160519 
   160520 
   160521 #define GEN10_MI_MATH_ALU_INSTRUCTION_Operand2_start  0
   160522 #define GEN9_MI_MATH_ALU_INSTRUCTION_Operand2_start  0
   160523 #define GEN8_MI_MATH_ALU_INSTRUCTION_Operand2_start  0
   160524 #define GEN75_MI_MATH_ALU_INSTRUCTION_Operand2_start  0
   160525 
   160526 static inline uint32_t ATTRIBUTE_PURE
   160527 MI_MATH_ALU_INSTRUCTION_Operand2_start(const struct gen_device_info *devinfo)
   160528 {
   160529    switch (devinfo->gen) {
   160530    case 10: return 0;
   160531    case 9: return 0;
   160532    case 8: return 0;
   160533    case 7:
   160534       if (devinfo->is_haswell) {
   160535          return 0;
   160536       } else {
   160537          return 0;
   160538       }
   160539    case 6: return 0;
   160540    case 5: return 0;
   160541    case 4:
   160542       if (devinfo->is_g4x) {
   160543          return 0;
   160544       } else {
   160545          return 0;
   160546       }
   160547    default:
   160548       unreachable("Invalid hardware generation");
   160549    }
   160550 }
   160551 
   160552 
   160553 
   160554 /* MI_NOOP */
   160555 
   160556 
   160557 #define GEN10_MI_NOOP_length  1
   160558 #define GEN9_MI_NOOP_length  1
   160559 #define GEN8_MI_NOOP_length  1
   160560 #define GEN75_MI_NOOP_length  1
   160561 #define GEN7_MI_NOOP_length  1
   160562 #define GEN6_MI_NOOP_length  1
   160563 
   160564 static inline uint32_t ATTRIBUTE_PURE
   160565 MI_NOOP_length(const struct gen_device_info *devinfo)
   160566 {
   160567    switch (devinfo->gen) {
   160568    case 10: return 1;
   160569    case 9: return 1;
   160570    case 8: return 1;
   160571    case 7:
   160572       if (devinfo->is_haswell) {
   160573          return 1;
   160574       } else {
   160575          return 1;
   160576       }
   160577    case 6: return 1;
   160578    case 5: return 0;
   160579    case 4:
   160580       if (devinfo->is_g4x) {
   160581          return 0;
   160582       } else {
   160583          return 0;
   160584       }
   160585    default:
   160586       unreachable("Invalid hardware generation");
   160587    }
   160588 }
   160589 
   160590 
   160591 
   160592 /* MI_NOOP::Command Type */
   160593 
   160594 
   160595 #define GEN10_MI_NOOP_CommandType_bits  3
   160596 #define GEN9_MI_NOOP_CommandType_bits  3
   160597 #define GEN8_MI_NOOP_CommandType_bits  3
   160598 #define GEN75_MI_NOOP_CommandType_bits  3
   160599 #define GEN7_MI_NOOP_CommandType_bits  3
   160600 #define GEN6_MI_NOOP_CommandType_bits  3
   160601 
   160602 static inline uint32_t ATTRIBUTE_PURE
   160603 MI_NOOP_CommandType_bits(const struct gen_device_info *devinfo)
   160604 {
   160605    switch (devinfo->gen) {
   160606    case 10: return 3;
   160607    case 9: return 3;
   160608    case 8: return 3;
   160609    case 7:
   160610       if (devinfo->is_haswell) {
   160611          return 3;
   160612       } else {
   160613          return 3;
   160614       }
   160615    case 6: return 3;
   160616    case 5: return 0;
   160617    case 4:
   160618       if (devinfo->is_g4x) {
   160619          return 0;
   160620       } else {
   160621          return 0;
   160622       }
   160623    default:
   160624       unreachable("Invalid hardware generation");
   160625    }
   160626 }
   160627 
   160628 
   160629 
   160630 #define GEN10_MI_NOOP_CommandType_start  29
   160631 #define GEN9_MI_NOOP_CommandType_start  29
   160632 #define GEN8_MI_NOOP_CommandType_start  29
   160633 #define GEN75_MI_NOOP_CommandType_start  29
   160634 #define GEN7_MI_NOOP_CommandType_start  29
   160635 #define GEN6_MI_NOOP_CommandType_start  29
   160636 
   160637 static inline uint32_t ATTRIBUTE_PURE
   160638 MI_NOOP_CommandType_start(const struct gen_device_info *devinfo)
   160639 {
   160640    switch (devinfo->gen) {
   160641    case 10: return 29;
   160642    case 9: return 29;
   160643    case 8: return 29;
   160644    case 7:
   160645       if (devinfo->is_haswell) {
   160646          return 29;
   160647       } else {
   160648          return 29;
   160649       }
   160650    case 6: return 29;
   160651    case 5: return 0;
   160652    case 4:
   160653       if (devinfo->is_g4x) {
   160654          return 0;
   160655       } else {
   160656          return 0;
   160657       }
   160658    default:
   160659       unreachable("Invalid hardware generation");
   160660    }
   160661 }
   160662 
   160663 
   160664 
   160665 /* MI_NOOP::Identification Number */
   160666 
   160667 
   160668 #define GEN10_MI_NOOP_IdentificationNumber_bits  22
   160669 #define GEN9_MI_NOOP_IdentificationNumber_bits  22
   160670 #define GEN8_MI_NOOP_IdentificationNumber_bits  22
   160671 #define GEN75_MI_NOOP_IdentificationNumber_bits  22
   160672 #define GEN7_MI_NOOP_IdentificationNumber_bits  22
   160673 #define GEN6_MI_NOOP_IdentificationNumber_bits  22
   160674 
   160675 static inline uint32_t ATTRIBUTE_PURE
   160676 MI_NOOP_IdentificationNumber_bits(const struct gen_device_info *devinfo)
   160677 {
   160678    switch (devinfo->gen) {
   160679    case 10: return 22;
   160680    case 9: return 22;
   160681    case 8: return 22;
   160682    case 7:
   160683       if (devinfo->is_haswell) {
   160684          return 22;
   160685       } else {
   160686          return 22;
   160687       }
   160688    case 6: return 22;
   160689    case 5: return 0;
   160690    case 4:
   160691       if (devinfo->is_g4x) {
   160692          return 0;
   160693       } else {
   160694          return 0;
   160695       }
   160696    default:
   160697       unreachable("Invalid hardware generation");
   160698    }
   160699 }
   160700 
   160701 
   160702 
   160703 #define GEN10_MI_NOOP_IdentificationNumber_start  0
   160704 #define GEN9_MI_NOOP_IdentificationNumber_start  0
   160705 #define GEN8_MI_NOOP_IdentificationNumber_start  0
   160706 #define GEN75_MI_NOOP_IdentificationNumber_start  0
   160707 #define GEN7_MI_NOOP_IdentificationNumber_start  0
   160708 #define GEN6_MI_NOOP_IdentificationNumber_start  0
   160709 
   160710 static inline uint32_t ATTRIBUTE_PURE
   160711 MI_NOOP_IdentificationNumber_start(const struct gen_device_info *devinfo)
   160712 {
   160713    switch (devinfo->gen) {
   160714    case 10: return 0;
   160715    case 9: return 0;
   160716    case 8: return 0;
   160717    case 7:
   160718       if (devinfo->is_haswell) {
   160719          return 0;
   160720       } else {
   160721          return 0;
   160722       }
   160723    case 6: return 0;
   160724    case 5: return 0;
   160725    case 4:
   160726       if (devinfo->is_g4x) {
   160727          return 0;
   160728       } else {
   160729          return 0;
   160730       }
   160731    default:
   160732       unreachable("Invalid hardware generation");
   160733    }
   160734 }
   160735 
   160736 
   160737 
   160738 /* MI_NOOP::Identification Number Register Write Enable */
   160739 
   160740 
   160741 #define GEN10_MI_NOOP_IdentificationNumberRegisterWriteEnable_bits  1
   160742 #define GEN9_MI_NOOP_IdentificationNumberRegisterWriteEnable_bits  1
   160743 #define GEN8_MI_NOOP_IdentificationNumberRegisterWriteEnable_bits  1
   160744 #define GEN75_MI_NOOP_IdentificationNumberRegisterWriteEnable_bits  1
   160745 #define GEN7_MI_NOOP_IdentificationNumberRegisterWriteEnable_bits  1
   160746 #define GEN6_MI_NOOP_IdentificationNumberRegisterWriteEnable_bits  1
   160747 
   160748 static inline uint32_t ATTRIBUTE_PURE
   160749 MI_NOOP_IdentificationNumberRegisterWriteEnable_bits(const struct gen_device_info *devinfo)
   160750 {
   160751    switch (devinfo->gen) {
   160752    case 10: return 1;
   160753    case 9: return 1;
   160754    case 8: return 1;
   160755    case 7:
   160756       if (devinfo->is_haswell) {
   160757          return 1;
   160758       } else {
   160759          return 1;
   160760       }
   160761    case 6: return 1;
   160762    case 5: return 0;
   160763    case 4:
   160764       if (devinfo->is_g4x) {
   160765          return 0;
   160766       } else {
   160767          return 0;
   160768       }
   160769    default:
   160770       unreachable("Invalid hardware generation");
   160771    }
   160772 }
   160773 
   160774 
   160775 
   160776 #define GEN10_MI_NOOP_IdentificationNumberRegisterWriteEnable_start  22
   160777 #define GEN9_MI_NOOP_IdentificationNumberRegisterWriteEnable_start  22
   160778 #define GEN8_MI_NOOP_IdentificationNumberRegisterWriteEnable_start  22
   160779 #define GEN75_MI_NOOP_IdentificationNumberRegisterWriteEnable_start  22
   160780 #define GEN7_MI_NOOP_IdentificationNumberRegisterWriteEnable_start  22
   160781 #define GEN6_MI_NOOP_IdentificationNumberRegisterWriteEnable_start  22
   160782 
   160783 static inline uint32_t ATTRIBUTE_PURE
   160784 MI_NOOP_IdentificationNumberRegisterWriteEnable_start(const struct gen_device_info *devinfo)
   160785 {
   160786    switch (devinfo->gen) {
   160787    case 10: return 22;
   160788    case 9: return 22;
   160789    case 8: return 22;
   160790    case 7:
   160791       if (devinfo->is_haswell) {
   160792          return 22;
   160793       } else {
   160794          return 22;
   160795       }
   160796    case 6: return 22;
   160797    case 5: return 0;
   160798    case 4:
   160799       if (devinfo->is_g4x) {
   160800          return 0;
   160801       } else {
   160802          return 0;
   160803       }
   160804    default:
   160805       unreachable("Invalid hardware generation");
   160806    }
   160807 }
   160808 
   160809 
   160810 
   160811 /* MI_NOOP::MI Command Opcode */
   160812 
   160813 
   160814 #define GEN10_MI_NOOP_MICommandOpcode_bits  6
   160815 #define GEN9_MI_NOOP_MICommandOpcode_bits  6
   160816 #define GEN8_MI_NOOP_MICommandOpcode_bits  6
   160817 #define GEN75_MI_NOOP_MICommandOpcode_bits  6
   160818 #define GEN7_MI_NOOP_MICommandOpcode_bits  6
   160819 #define GEN6_MI_NOOP_MICommandOpcode_bits  6
   160820 
   160821 static inline uint32_t ATTRIBUTE_PURE
   160822 MI_NOOP_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   160823 {
   160824    switch (devinfo->gen) {
   160825    case 10: return 6;
   160826    case 9: return 6;
   160827    case 8: return 6;
   160828    case 7:
   160829       if (devinfo->is_haswell) {
   160830          return 6;
   160831       } else {
   160832          return 6;
   160833       }
   160834    case 6: return 6;
   160835    case 5: return 0;
   160836    case 4:
   160837       if (devinfo->is_g4x) {
   160838          return 0;
   160839       } else {
   160840          return 0;
   160841       }
   160842    default:
   160843       unreachable("Invalid hardware generation");
   160844    }
   160845 }
   160846 
   160847 
   160848 
   160849 #define GEN10_MI_NOOP_MICommandOpcode_start  23
   160850 #define GEN9_MI_NOOP_MICommandOpcode_start  23
   160851 #define GEN8_MI_NOOP_MICommandOpcode_start  23
   160852 #define GEN75_MI_NOOP_MICommandOpcode_start  23
   160853 #define GEN7_MI_NOOP_MICommandOpcode_start  23
   160854 #define GEN6_MI_NOOP_MICommandOpcode_start  23
   160855 
   160856 static inline uint32_t ATTRIBUTE_PURE
   160857 MI_NOOP_MICommandOpcode_start(const struct gen_device_info *devinfo)
   160858 {
   160859    switch (devinfo->gen) {
   160860    case 10: return 23;
   160861    case 9: return 23;
   160862    case 8: return 23;
   160863    case 7:
   160864       if (devinfo->is_haswell) {
   160865          return 23;
   160866       } else {
   160867          return 23;
   160868       }
   160869    case 6: return 23;
   160870    case 5: return 0;
   160871    case 4:
   160872       if (devinfo->is_g4x) {
   160873          return 0;
   160874       } else {
   160875          return 0;
   160876       }
   160877    default:
   160878       unreachable("Invalid hardware generation");
   160879    }
   160880 }
   160881 
   160882 
   160883 
   160884 /* MI_PREDICATE */
   160885 
   160886 
   160887 #define GEN10_MI_PREDICATE_length  1
   160888 #define GEN9_MI_PREDICATE_length  1
   160889 #define GEN8_MI_PREDICATE_length  1
   160890 #define GEN75_MI_PREDICATE_length  1
   160891 #define GEN7_MI_PREDICATE_length  1
   160892 
   160893 static inline uint32_t ATTRIBUTE_PURE
   160894 MI_PREDICATE_length(const struct gen_device_info *devinfo)
   160895 {
   160896    switch (devinfo->gen) {
   160897    case 10: return 1;
   160898    case 9: return 1;
   160899    case 8: return 1;
   160900    case 7:
   160901       if (devinfo->is_haswell) {
   160902          return 1;
   160903       } else {
   160904          return 1;
   160905       }
   160906    case 6: return 0;
   160907    case 5: return 0;
   160908    case 4:
   160909       if (devinfo->is_g4x) {
   160910          return 0;
   160911       } else {
   160912          return 0;
   160913       }
   160914    default:
   160915       unreachable("Invalid hardware generation");
   160916    }
   160917 }
   160918 
   160919 
   160920 
   160921 /* MI_PREDICATE::Combine Operation */
   160922 
   160923 
   160924 #define GEN10_MI_PREDICATE_CombineOperation_bits  2
   160925 #define GEN9_MI_PREDICATE_CombineOperation_bits  2
   160926 #define GEN8_MI_PREDICATE_CombineOperation_bits  2
   160927 #define GEN75_MI_PREDICATE_CombineOperation_bits  2
   160928 #define GEN7_MI_PREDICATE_CombineOperation_bits  2
   160929 
   160930 static inline uint32_t ATTRIBUTE_PURE
   160931 MI_PREDICATE_CombineOperation_bits(const struct gen_device_info *devinfo)
   160932 {
   160933    switch (devinfo->gen) {
   160934    case 10: return 2;
   160935    case 9: return 2;
   160936    case 8: return 2;
   160937    case 7:
   160938       if (devinfo->is_haswell) {
   160939          return 2;
   160940       } else {
   160941          return 2;
   160942       }
   160943    case 6: return 0;
   160944    case 5: return 0;
   160945    case 4:
   160946       if (devinfo->is_g4x) {
   160947          return 0;
   160948       } else {
   160949          return 0;
   160950       }
   160951    default:
   160952       unreachable("Invalid hardware generation");
   160953    }
   160954 }
   160955 
   160956 
   160957 
   160958 #define GEN10_MI_PREDICATE_CombineOperation_start  3
   160959 #define GEN9_MI_PREDICATE_CombineOperation_start  3
   160960 #define GEN8_MI_PREDICATE_CombineOperation_start  3
   160961 #define GEN75_MI_PREDICATE_CombineOperation_start  3
   160962 #define GEN7_MI_PREDICATE_CombineOperation_start  3
   160963 
   160964 static inline uint32_t ATTRIBUTE_PURE
   160965 MI_PREDICATE_CombineOperation_start(const struct gen_device_info *devinfo)
   160966 {
   160967    switch (devinfo->gen) {
   160968    case 10: return 3;
   160969    case 9: return 3;
   160970    case 8: return 3;
   160971    case 7:
   160972       if (devinfo->is_haswell) {
   160973          return 3;
   160974       } else {
   160975          return 3;
   160976       }
   160977    case 6: return 0;
   160978    case 5: return 0;
   160979    case 4:
   160980       if (devinfo->is_g4x) {
   160981          return 0;
   160982       } else {
   160983          return 0;
   160984       }
   160985    default:
   160986       unreachable("Invalid hardware generation");
   160987    }
   160988 }
   160989 
   160990 
   160991 
   160992 /* MI_PREDICATE::Command Type */
   160993 
   160994 
   160995 #define GEN10_MI_PREDICATE_CommandType_bits  3
   160996 #define GEN9_MI_PREDICATE_CommandType_bits  3
   160997 #define GEN8_MI_PREDICATE_CommandType_bits  3
   160998 #define GEN75_MI_PREDICATE_CommandType_bits  3
   160999 #define GEN7_MI_PREDICATE_CommandType_bits  3
   161000 
   161001 static inline uint32_t ATTRIBUTE_PURE
   161002 MI_PREDICATE_CommandType_bits(const struct gen_device_info *devinfo)
   161003 {
   161004    switch (devinfo->gen) {
   161005    case 10: return 3;
   161006    case 9: return 3;
   161007    case 8: return 3;
   161008    case 7:
   161009       if (devinfo->is_haswell) {
   161010          return 3;
   161011       } else {
   161012          return 3;
   161013       }
   161014    case 6: return 0;
   161015    case 5: return 0;
   161016    case 4:
   161017       if (devinfo->is_g4x) {
   161018          return 0;
   161019       } else {
   161020          return 0;
   161021       }
   161022    default:
   161023       unreachable("Invalid hardware generation");
   161024    }
   161025 }
   161026 
   161027 
   161028 
   161029 #define GEN10_MI_PREDICATE_CommandType_start  29
   161030 #define GEN9_MI_PREDICATE_CommandType_start  29
   161031 #define GEN8_MI_PREDICATE_CommandType_start  29
   161032 #define GEN75_MI_PREDICATE_CommandType_start  29
   161033 #define GEN7_MI_PREDICATE_CommandType_start  29
   161034 
   161035 static inline uint32_t ATTRIBUTE_PURE
   161036 MI_PREDICATE_CommandType_start(const struct gen_device_info *devinfo)
   161037 {
   161038    switch (devinfo->gen) {
   161039    case 10: return 29;
   161040    case 9: return 29;
   161041    case 8: return 29;
   161042    case 7:
   161043       if (devinfo->is_haswell) {
   161044          return 29;
   161045       } else {
   161046          return 29;
   161047       }
   161048    case 6: return 0;
   161049    case 5: return 0;
   161050    case 4:
   161051       if (devinfo->is_g4x) {
   161052          return 0;
   161053       } else {
   161054          return 0;
   161055       }
   161056    default:
   161057       unreachable("Invalid hardware generation");
   161058    }
   161059 }
   161060 
   161061 
   161062 
   161063 /* MI_PREDICATE::Compare Operation */
   161064 
   161065 
   161066 #define GEN10_MI_PREDICATE_CompareOperation_bits  2
   161067 #define GEN9_MI_PREDICATE_CompareOperation_bits  2
   161068 #define GEN8_MI_PREDICATE_CompareOperation_bits  2
   161069 #define GEN75_MI_PREDICATE_CompareOperation_bits  2
   161070 #define GEN7_MI_PREDICATE_CompareOperation_bits  2
   161071 
   161072 static inline uint32_t ATTRIBUTE_PURE
   161073 MI_PREDICATE_CompareOperation_bits(const struct gen_device_info *devinfo)
   161074 {
   161075    switch (devinfo->gen) {
   161076    case 10: return 2;
   161077    case 9: return 2;
   161078    case 8: return 2;
   161079    case 7:
   161080       if (devinfo->is_haswell) {
   161081          return 2;
   161082       } else {
   161083          return 2;
   161084       }
   161085    case 6: return 0;
   161086    case 5: return 0;
   161087    case 4:
   161088       if (devinfo->is_g4x) {
   161089          return 0;
   161090       } else {
   161091          return 0;
   161092       }
   161093    default:
   161094       unreachable("Invalid hardware generation");
   161095    }
   161096 }
   161097 
   161098 
   161099 
   161100 #define GEN10_MI_PREDICATE_CompareOperation_start  0
   161101 #define GEN9_MI_PREDICATE_CompareOperation_start  0
   161102 #define GEN8_MI_PREDICATE_CompareOperation_start  0
   161103 #define GEN75_MI_PREDICATE_CompareOperation_start  0
   161104 #define GEN7_MI_PREDICATE_CompareOperation_start  0
   161105 
   161106 static inline uint32_t ATTRIBUTE_PURE
   161107 MI_PREDICATE_CompareOperation_start(const struct gen_device_info *devinfo)
   161108 {
   161109    switch (devinfo->gen) {
   161110    case 10: return 0;
   161111    case 9: return 0;
   161112    case 8: return 0;
   161113    case 7:
   161114       if (devinfo->is_haswell) {
   161115          return 0;
   161116       } else {
   161117          return 0;
   161118       }
   161119    case 6: return 0;
   161120    case 5: return 0;
   161121    case 4:
   161122       if (devinfo->is_g4x) {
   161123          return 0;
   161124       } else {
   161125          return 0;
   161126       }
   161127    default:
   161128       unreachable("Invalid hardware generation");
   161129    }
   161130 }
   161131 
   161132 
   161133 
   161134 /* MI_PREDICATE::Load Operation */
   161135 
   161136 
   161137 #define GEN10_MI_PREDICATE_LoadOperation_bits  2
   161138 #define GEN9_MI_PREDICATE_LoadOperation_bits  2
   161139 #define GEN8_MI_PREDICATE_LoadOperation_bits  2
   161140 #define GEN75_MI_PREDICATE_LoadOperation_bits  2
   161141 #define GEN7_MI_PREDICATE_LoadOperation_bits  2
   161142 
   161143 static inline uint32_t ATTRIBUTE_PURE
   161144 MI_PREDICATE_LoadOperation_bits(const struct gen_device_info *devinfo)
   161145 {
   161146    switch (devinfo->gen) {
   161147    case 10: return 2;
   161148    case 9: return 2;
   161149    case 8: return 2;
   161150    case 7:
   161151       if (devinfo->is_haswell) {
   161152          return 2;
   161153       } else {
   161154          return 2;
   161155       }
   161156    case 6: return 0;
   161157    case 5: return 0;
   161158    case 4:
   161159       if (devinfo->is_g4x) {
   161160          return 0;
   161161       } else {
   161162          return 0;
   161163       }
   161164    default:
   161165       unreachable("Invalid hardware generation");
   161166    }
   161167 }
   161168 
   161169 
   161170 
   161171 #define GEN10_MI_PREDICATE_LoadOperation_start  6
   161172 #define GEN9_MI_PREDICATE_LoadOperation_start  6
   161173 #define GEN8_MI_PREDICATE_LoadOperation_start  6
   161174 #define GEN75_MI_PREDICATE_LoadOperation_start  6
   161175 #define GEN7_MI_PREDICATE_LoadOperation_start  6
   161176 
   161177 static inline uint32_t ATTRIBUTE_PURE
   161178 MI_PREDICATE_LoadOperation_start(const struct gen_device_info *devinfo)
   161179 {
   161180    switch (devinfo->gen) {
   161181    case 10: return 6;
   161182    case 9: return 6;
   161183    case 8: return 6;
   161184    case 7:
   161185       if (devinfo->is_haswell) {
   161186          return 6;
   161187       } else {
   161188          return 6;
   161189       }
   161190    case 6: return 0;
   161191    case 5: return 0;
   161192    case 4:
   161193       if (devinfo->is_g4x) {
   161194          return 0;
   161195       } else {
   161196          return 0;
   161197       }
   161198    default:
   161199       unreachable("Invalid hardware generation");
   161200    }
   161201 }
   161202 
   161203 
   161204 
   161205 /* MI_PREDICATE::MI Command Opcode */
   161206 
   161207 
   161208 #define GEN10_MI_PREDICATE_MICommandOpcode_bits  6
   161209 #define GEN9_MI_PREDICATE_MICommandOpcode_bits  6
   161210 #define GEN8_MI_PREDICATE_MICommandOpcode_bits  6
   161211 #define GEN75_MI_PREDICATE_MICommandOpcode_bits  6
   161212 #define GEN7_MI_PREDICATE_MICommandOpcode_bits  6
   161213 
   161214 static inline uint32_t ATTRIBUTE_PURE
   161215 MI_PREDICATE_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   161216 {
   161217    switch (devinfo->gen) {
   161218    case 10: return 6;
   161219    case 9: return 6;
   161220    case 8: return 6;
   161221    case 7:
   161222       if (devinfo->is_haswell) {
   161223          return 6;
   161224       } else {
   161225          return 6;
   161226       }
   161227    case 6: return 0;
   161228    case 5: return 0;
   161229    case 4:
   161230       if (devinfo->is_g4x) {
   161231          return 0;
   161232       } else {
   161233          return 0;
   161234       }
   161235    default:
   161236       unreachable("Invalid hardware generation");
   161237    }
   161238 }
   161239 
   161240 
   161241 
   161242 #define GEN10_MI_PREDICATE_MICommandOpcode_start  23
   161243 #define GEN9_MI_PREDICATE_MICommandOpcode_start  23
   161244 #define GEN8_MI_PREDICATE_MICommandOpcode_start  23
   161245 #define GEN75_MI_PREDICATE_MICommandOpcode_start  23
   161246 #define GEN7_MI_PREDICATE_MICommandOpcode_start  23
   161247 
   161248 static inline uint32_t ATTRIBUTE_PURE
   161249 MI_PREDICATE_MICommandOpcode_start(const struct gen_device_info *devinfo)
   161250 {
   161251    switch (devinfo->gen) {
   161252    case 10: return 23;
   161253    case 9: return 23;
   161254    case 8: return 23;
   161255    case 7:
   161256       if (devinfo->is_haswell) {
   161257          return 23;
   161258       } else {
   161259          return 23;
   161260       }
   161261    case 6: return 0;
   161262    case 5: return 0;
   161263    case 4:
   161264       if (devinfo->is_g4x) {
   161265          return 0;
   161266       } else {
   161267          return 0;
   161268       }
   161269    default:
   161270       unreachable("Invalid hardware generation");
   161271    }
   161272 }
   161273 
   161274 
   161275 
   161276 /* MI_REPORT_HEAD */
   161277 
   161278 
   161279 #define GEN10_MI_REPORT_HEAD_length  1
   161280 #define GEN9_MI_REPORT_HEAD_length  1
   161281 #define GEN8_MI_REPORT_HEAD_length  1
   161282 #define GEN75_MI_REPORT_HEAD_length  1
   161283 #define GEN7_MI_REPORT_HEAD_length  1
   161284 #define GEN6_MI_REPORT_HEAD_length  1
   161285 
   161286 static inline uint32_t ATTRIBUTE_PURE
   161287 MI_REPORT_HEAD_length(const struct gen_device_info *devinfo)
   161288 {
   161289    switch (devinfo->gen) {
   161290    case 10: return 1;
   161291    case 9: return 1;
   161292    case 8: return 1;
   161293    case 7:
   161294       if (devinfo->is_haswell) {
   161295          return 1;
   161296       } else {
   161297          return 1;
   161298       }
   161299    case 6: return 1;
   161300    case 5: return 0;
   161301    case 4:
   161302       if (devinfo->is_g4x) {
   161303          return 0;
   161304       } else {
   161305          return 0;
   161306       }
   161307    default:
   161308       unreachable("Invalid hardware generation");
   161309    }
   161310 }
   161311 
   161312 
   161313 
   161314 /* MI_REPORT_HEAD::Command Type */
   161315 
   161316 
   161317 #define GEN10_MI_REPORT_HEAD_CommandType_bits  3
   161318 #define GEN9_MI_REPORT_HEAD_CommandType_bits  3
   161319 #define GEN8_MI_REPORT_HEAD_CommandType_bits  3
   161320 #define GEN75_MI_REPORT_HEAD_CommandType_bits  3
   161321 #define GEN7_MI_REPORT_HEAD_CommandType_bits  3
   161322 #define GEN6_MI_REPORT_HEAD_CommandType_bits  3
   161323 
   161324 static inline uint32_t ATTRIBUTE_PURE
   161325 MI_REPORT_HEAD_CommandType_bits(const struct gen_device_info *devinfo)
   161326 {
   161327    switch (devinfo->gen) {
   161328    case 10: return 3;
   161329    case 9: return 3;
   161330    case 8: return 3;
   161331    case 7:
   161332       if (devinfo->is_haswell) {
   161333          return 3;
   161334       } else {
   161335          return 3;
   161336       }
   161337    case 6: return 3;
   161338    case 5: return 0;
   161339    case 4:
   161340       if (devinfo->is_g4x) {
   161341          return 0;
   161342       } else {
   161343          return 0;
   161344       }
   161345    default:
   161346       unreachable("Invalid hardware generation");
   161347    }
   161348 }
   161349 
   161350 
   161351 
   161352 #define GEN10_MI_REPORT_HEAD_CommandType_start  29
   161353 #define GEN9_MI_REPORT_HEAD_CommandType_start  29
   161354 #define GEN8_MI_REPORT_HEAD_CommandType_start  29
   161355 #define GEN75_MI_REPORT_HEAD_CommandType_start  29
   161356 #define GEN7_MI_REPORT_HEAD_CommandType_start  29
   161357 #define GEN6_MI_REPORT_HEAD_CommandType_start  29
   161358 
   161359 static inline uint32_t ATTRIBUTE_PURE
   161360 MI_REPORT_HEAD_CommandType_start(const struct gen_device_info *devinfo)
   161361 {
   161362    switch (devinfo->gen) {
   161363    case 10: return 29;
   161364    case 9: return 29;
   161365    case 8: return 29;
   161366    case 7:
   161367       if (devinfo->is_haswell) {
   161368          return 29;
   161369       } else {
   161370          return 29;
   161371       }
   161372    case 6: return 29;
   161373    case 5: return 0;
   161374    case 4:
   161375       if (devinfo->is_g4x) {
   161376          return 0;
   161377       } else {
   161378          return 0;
   161379       }
   161380    default:
   161381       unreachable("Invalid hardware generation");
   161382    }
   161383 }
   161384 
   161385 
   161386 
   161387 /* MI_REPORT_HEAD::MI Command Opcode */
   161388 
   161389 
   161390 #define GEN10_MI_REPORT_HEAD_MICommandOpcode_bits  6
   161391 #define GEN9_MI_REPORT_HEAD_MICommandOpcode_bits  6
   161392 #define GEN8_MI_REPORT_HEAD_MICommandOpcode_bits  6
   161393 #define GEN75_MI_REPORT_HEAD_MICommandOpcode_bits  6
   161394 #define GEN7_MI_REPORT_HEAD_MICommandOpcode_bits  6
   161395 #define GEN6_MI_REPORT_HEAD_MICommandOpcode_bits  6
   161396 
   161397 static inline uint32_t ATTRIBUTE_PURE
   161398 MI_REPORT_HEAD_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   161399 {
   161400    switch (devinfo->gen) {
   161401    case 10: return 6;
   161402    case 9: return 6;
   161403    case 8: return 6;
   161404    case 7:
   161405       if (devinfo->is_haswell) {
   161406          return 6;
   161407       } else {
   161408          return 6;
   161409       }
   161410    case 6: return 6;
   161411    case 5: return 0;
   161412    case 4:
   161413       if (devinfo->is_g4x) {
   161414          return 0;
   161415       } else {
   161416          return 0;
   161417       }
   161418    default:
   161419       unreachable("Invalid hardware generation");
   161420    }
   161421 }
   161422 
   161423 
   161424 
   161425 #define GEN10_MI_REPORT_HEAD_MICommandOpcode_start  23
   161426 #define GEN9_MI_REPORT_HEAD_MICommandOpcode_start  23
   161427 #define GEN8_MI_REPORT_HEAD_MICommandOpcode_start  23
   161428 #define GEN75_MI_REPORT_HEAD_MICommandOpcode_start  23
   161429 #define GEN7_MI_REPORT_HEAD_MICommandOpcode_start  23
   161430 #define GEN6_MI_REPORT_HEAD_MICommandOpcode_start  23
   161431 
   161432 static inline uint32_t ATTRIBUTE_PURE
   161433 MI_REPORT_HEAD_MICommandOpcode_start(const struct gen_device_info *devinfo)
   161434 {
   161435    switch (devinfo->gen) {
   161436    case 10: return 23;
   161437    case 9: return 23;
   161438    case 8: return 23;
   161439    case 7:
   161440       if (devinfo->is_haswell) {
   161441          return 23;
   161442       } else {
   161443          return 23;
   161444       }
   161445    case 6: return 23;
   161446    case 5: return 0;
   161447    case 4:
   161448       if (devinfo->is_g4x) {
   161449          return 0;
   161450       } else {
   161451          return 0;
   161452       }
   161453    default:
   161454       unreachable("Invalid hardware generation");
   161455    }
   161456 }
   161457 
   161458 
   161459 
   161460 /* MI_REPORT_PERF_COUNT */
   161461 
   161462 
   161463 #define GEN10_MI_REPORT_PERF_COUNT_length  4
   161464 #define GEN9_MI_REPORT_PERF_COUNT_length  4
   161465 #define GEN8_MI_REPORT_PERF_COUNT_length  4
   161466 #define GEN75_MI_REPORT_PERF_COUNT_length  3
   161467 #define GEN7_MI_REPORT_PERF_COUNT_length  3
   161468 
   161469 static inline uint32_t ATTRIBUTE_PURE
   161470 MI_REPORT_PERF_COUNT_length(const struct gen_device_info *devinfo)
   161471 {
   161472    switch (devinfo->gen) {
   161473    case 10: return 4;
   161474    case 9: return 4;
   161475    case 8: return 4;
   161476    case 7:
   161477       if (devinfo->is_haswell) {
   161478          return 3;
   161479       } else {
   161480          return 3;
   161481       }
   161482    case 6: return 0;
   161483    case 5: return 0;
   161484    case 4:
   161485       if (devinfo->is_g4x) {
   161486          return 0;
   161487       } else {
   161488          return 0;
   161489       }
   161490    default:
   161491       unreachable("Invalid hardware generation");
   161492    }
   161493 }
   161494 
   161495 
   161496 
   161497 /* MI_REPORT_PERF_COUNT::Command Type */
   161498 
   161499 
   161500 #define GEN10_MI_REPORT_PERF_COUNT_CommandType_bits  3
   161501 #define GEN9_MI_REPORT_PERF_COUNT_CommandType_bits  3
   161502 #define GEN8_MI_REPORT_PERF_COUNT_CommandType_bits  3
   161503 #define GEN75_MI_REPORT_PERF_COUNT_CommandType_bits  3
   161504 #define GEN7_MI_REPORT_PERF_COUNT_CommandType_bits  3
   161505 
   161506 static inline uint32_t ATTRIBUTE_PURE
   161507 MI_REPORT_PERF_COUNT_CommandType_bits(const struct gen_device_info *devinfo)
   161508 {
   161509    switch (devinfo->gen) {
   161510    case 10: return 3;
   161511    case 9: return 3;
   161512    case 8: return 3;
   161513    case 7:
   161514       if (devinfo->is_haswell) {
   161515          return 3;
   161516       } else {
   161517          return 3;
   161518       }
   161519    case 6: return 0;
   161520    case 5: return 0;
   161521    case 4:
   161522       if (devinfo->is_g4x) {
   161523          return 0;
   161524       } else {
   161525          return 0;
   161526       }
   161527    default:
   161528       unreachable("Invalid hardware generation");
   161529    }
   161530 }
   161531 
   161532 
   161533 
   161534 #define GEN10_MI_REPORT_PERF_COUNT_CommandType_start  29
   161535 #define GEN9_MI_REPORT_PERF_COUNT_CommandType_start  29
   161536 #define GEN8_MI_REPORT_PERF_COUNT_CommandType_start  29
   161537 #define GEN75_MI_REPORT_PERF_COUNT_CommandType_start  29
   161538 #define GEN7_MI_REPORT_PERF_COUNT_CommandType_start  29
   161539 
   161540 static inline uint32_t ATTRIBUTE_PURE
   161541 MI_REPORT_PERF_COUNT_CommandType_start(const struct gen_device_info *devinfo)
   161542 {
   161543    switch (devinfo->gen) {
   161544    case 10: return 29;
   161545    case 9: return 29;
   161546    case 8: return 29;
   161547    case 7:
   161548       if (devinfo->is_haswell) {
   161549          return 29;
   161550       } else {
   161551          return 29;
   161552       }
   161553    case 6: return 0;
   161554    case 5: return 0;
   161555    case 4:
   161556       if (devinfo->is_g4x) {
   161557          return 0;
   161558       } else {
   161559          return 0;
   161560       }
   161561    default:
   161562       unreachable("Invalid hardware generation");
   161563    }
   161564 }
   161565 
   161566 
   161567 
   161568 /* MI_REPORT_PERF_COUNT::Core Mode Enable */
   161569 
   161570 
   161571 #define GEN10_MI_REPORT_PERF_COUNT_CoreModeEnable_bits  1
   161572 #define GEN9_MI_REPORT_PERF_COUNT_CoreModeEnable_bits  1
   161573 #define GEN8_MI_REPORT_PERF_COUNT_CoreModeEnable_bits  1
   161574 #define GEN75_MI_REPORT_PERF_COUNT_CoreModeEnable_bits  1
   161575 
   161576 static inline uint32_t ATTRIBUTE_PURE
   161577 MI_REPORT_PERF_COUNT_CoreModeEnable_bits(const struct gen_device_info *devinfo)
   161578 {
   161579    switch (devinfo->gen) {
   161580    case 10: return 1;
   161581    case 9: return 1;
   161582    case 8: return 1;
   161583    case 7:
   161584       if (devinfo->is_haswell) {
   161585          return 1;
   161586       } else {
   161587          return 0;
   161588       }
   161589    case 6: return 0;
   161590    case 5: return 0;
   161591    case 4:
   161592       if (devinfo->is_g4x) {
   161593          return 0;
   161594       } else {
   161595          return 0;
   161596       }
   161597    default:
   161598       unreachable("Invalid hardware generation");
   161599    }
   161600 }
   161601 
   161602 
   161603 
   161604 #define GEN10_MI_REPORT_PERF_COUNT_CoreModeEnable_start  36
   161605 #define GEN9_MI_REPORT_PERF_COUNT_CoreModeEnable_start  36
   161606 #define GEN8_MI_REPORT_PERF_COUNT_CoreModeEnable_start  36
   161607 #define GEN75_MI_REPORT_PERF_COUNT_CoreModeEnable_start  36
   161608 
   161609 static inline uint32_t ATTRIBUTE_PURE
   161610 MI_REPORT_PERF_COUNT_CoreModeEnable_start(const struct gen_device_info *devinfo)
   161611 {
   161612    switch (devinfo->gen) {
   161613    case 10: return 36;
   161614    case 9: return 36;
   161615    case 8: return 36;
   161616    case 7:
   161617       if (devinfo->is_haswell) {
   161618          return 36;
   161619       } else {
   161620          return 0;
   161621       }
   161622    case 6: return 0;
   161623    case 5: return 0;
   161624    case 4:
   161625       if (devinfo->is_g4x) {
   161626          return 0;
   161627       } else {
   161628          return 0;
   161629       }
   161630    default:
   161631       unreachable("Invalid hardware generation");
   161632    }
   161633 }
   161634 
   161635 
   161636 
   161637 /* MI_REPORT_PERF_COUNT::DWord Length */
   161638 
   161639 
   161640 #define GEN10_MI_REPORT_PERF_COUNT_DWordLength_bits  6
   161641 #define GEN9_MI_REPORT_PERF_COUNT_DWordLength_bits  6
   161642 #define GEN8_MI_REPORT_PERF_COUNT_DWordLength_bits  6
   161643 #define GEN75_MI_REPORT_PERF_COUNT_DWordLength_bits  6
   161644 #define GEN7_MI_REPORT_PERF_COUNT_DWordLength_bits  6
   161645 
   161646 static inline uint32_t ATTRIBUTE_PURE
   161647 MI_REPORT_PERF_COUNT_DWordLength_bits(const struct gen_device_info *devinfo)
   161648 {
   161649    switch (devinfo->gen) {
   161650    case 10: return 6;
   161651    case 9: return 6;
   161652    case 8: return 6;
   161653    case 7:
   161654       if (devinfo->is_haswell) {
   161655          return 6;
   161656       } else {
   161657          return 6;
   161658       }
   161659    case 6: return 0;
   161660    case 5: return 0;
   161661    case 4:
   161662       if (devinfo->is_g4x) {
   161663          return 0;
   161664       } else {
   161665          return 0;
   161666       }
   161667    default:
   161668       unreachable("Invalid hardware generation");
   161669    }
   161670 }
   161671 
   161672 
   161673 
   161674 #define GEN10_MI_REPORT_PERF_COUNT_DWordLength_start  0
   161675 #define GEN9_MI_REPORT_PERF_COUNT_DWordLength_start  0
   161676 #define GEN8_MI_REPORT_PERF_COUNT_DWordLength_start  0
   161677 #define GEN75_MI_REPORT_PERF_COUNT_DWordLength_start  0
   161678 #define GEN7_MI_REPORT_PERF_COUNT_DWordLength_start  0
   161679 
   161680 static inline uint32_t ATTRIBUTE_PURE
   161681 MI_REPORT_PERF_COUNT_DWordLength_start(const struct gen_device_info *devinfo)
   161682 {
   161683    switch (devinfo->gen) {
   161684    case 10: return 0;
   161685    case 9: return 0;
   161686    case 8: return 0;
   161687    case 7:
   161688       if (devinfo->is_haswell) {
   161689          return 0;
   161690       } else {
   161691          return 0;
   161692       }
   161693    case 6: return 0;
   161694    case 5: return 0;
   161695    case 4:
   161696       if (devinfo->is_g4x) {
   161697          return 0;
   161698       } else {
   161699          return 0;
   161700       }
   161701    default:
   161702       unreachable("Invalid hardware generation");
   161703    }
   161704 }
   161705 
   161706 
   161707 
   161708 /* MI_REPORT_PERF_COUNT::MI Command Opcode */
   161709 
   161710 
   161711 #define GEN10_MI_REPORT_PERF_COUNT_MICommandOpcode_bits  6
   161712 #define GEN9_MI_REPORT_PERF_COUNT_MICommandOpcode_bits  6
   161713 #define GEN8_MI_REPORT_PERF_COUNT_MICommandOpcode_bits  6
   161714 #define GEN75_MI_REPORT_PERF_COUNT_MICommandOpcode_bits  6
   161715 #define GEN7_MI_REPORT_PERF_COUNT_MICommandOpcode_bits  6
   161716 
   161717 static inline uint32_t ATTRIBUTE_PURE
   161718 MI_REPORT_PERF_COUNT_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   161719 {
   161720    switch (devinfo->gen) {
   161721    case 10: return 6;
   161722    case 9: return 6;
   161723    case 8: return 6;
   161724    case 7:
   161725       if (devinfo->is_haswell) {
   161726          return 6;
   161727       } else {
   161728          return 6;
   161729       }
   161730    case 6: return 0;
   161731    case 5: return 0;
   161732    case 4:
   161733       if (devinfo->is_g4x) {
   161734          return 0;
   161735       } else {
   161736          return 0;
   161737       }
   161738    default:
   161739       unreachable("Invalid hardware generation");
   161740    }
   161741 }
   161742 
   161743 
   161744 
   161745 #define GEN10_MI_REPORT_PERF_COUNT_MICommandOpcode_start  23
   161746 #define GEN9_MI_REPORT_PERF_COUNT_MICommandOpcode_start  23
   161747 #define GEN8_MI_REPORT_PERF_COUNT_MICommandOpcode_start  23
   161748 #define GEN75_MI_REPORT_PERF_COUNT_MICommandOpcode_start  23
   161749 #define GEN7_MI_REPORT_PERF_COUNT_MICommandOpcode_start  23
   161750 
   161751 static inline uint32_t ATTRIBUTE_PURE
   161752 MI_REPORT_PERF_COUNT_MICommandOpcode_start(const struct gen_device_info *devinfo)
   161753 {
   161754    switch (devinfo->gen) {
   161755    case 10: return 23;
   161756    case 9: return 23;
   161757    case 8: return 23;
   161758    case 7:
   161759       if (devinfo->is_haswell) {
   161760          return 23;
   161761       } else {
   161762          return 23;
   161763       }
   161764    case 6: return 0;
   161765    case 5: return 0;
   161766    case 4:
   161767       if (devinfo->is_g4x) {
   161768          return 0;
   161769       } else {
   161770          return 0;
   161771       }
   161772    default:
   161773       unreachable("Invalid hardware generation");
   161774    }
   161775 }
   161776 
   161777 
   161778 
   161779 /* MI_REPORT_PERF_COUNT::Memory Address */
   161780 
   161781 
   161782 #define GEN10_MI_REPORT_PERF_COUNT_MemoryAddress_bits  58
   161783 #define GEN9_MI_REPORT_PERF_COUNT_MemoryAddress_bits  58
   161784 #define GEN8_MI_REPORT_PERF_COUNT_MemoryAddress_bits  58
   161785 #define GEN75_MI_REPORT_PERF_COUNT_MemoryAddress_bits  26
   161786 #define GEN7_MI_REPORT_PERF_COUNT_MemoryAddress_bits  26
   161787 
   161788 static inline uint32_t ATTRIBUTE_PURE
   161789 MI_REPORT_PERF_COUNT_MemoryAddress_bits(const struct gen_device_info *devinfo)
   161790 {
   161791    switch (devinfo->gen) {
   161792    case 10: return 58;
   161793    case 9: return 58;
   161794    case 8: return 58;
   161795    case 7:
   161796       if (devinfo->is_haswell) {
   161797          return 26;
   161798       } else {
   161799          return 26;
   161800       }
   161801    case 6: return 0;
   161802    case 5: return 0;
   161803    case 4:
   161804       if (devinfo->is_g4x) {
   161805          return 0;
   161806       } else {
   161807          return 0;
   161808       }
   161809    default:
   161810       unreachable("Invalid hardware generation");
   161811    }
   161812 }
   161813 
   161814 
   161815 
   161816 #define GEN10_MI_REPORT_PERF_COUNT_MemoryAddress_start  38
   161817 #define GEN9_MI_REPORT_PERF_COUNT_MemoryAddress_start  38
   161818 #define GEN8_MI_REPORT_PERF_COUNT_MemoryAddress_start  38
   161819 #define GEN75_MI_REPORT_PERF_COUNT_MemoryAddress_start  38
   161820 #define GEN7_MI_REPORT_PERF_COUNT_MemoryAddress_start  38
   161821 
   161822 static inline uint32_t ATTRIBUTE_PURE
   161823 MI_REPORT_PERF_COUNT_MemoryAddress_start(const struct gen_device_info *devinfo)
   161824 {
   161825    switch (devinfo->gen) {
   161826    case 10: return 38;
   161827    case 9: return 38;
   161828    case 8: return 38;
   161829    case 7:
   161830       if (devinfo->is_haswell) {
   161831          return 38;
   161832       } else {
   161833          return 38;
   161834       }
   161835    case 6: return 0;
   161836    case 5: return 0;
   161837    case 4:
   161838       if (devinfo->is_g4x) {
   161839          return 0;
   161840       } else {
   161841          return 0;
   161842       }
   161843    default:
   161844       unreachable("Invalid hardware generation");
   161845    }
   161846 }
   161847 
   161848 
   161849 
   161850 /* MI_REPORT_PERF_COUNT::Report ID */
   161851 
   161852 
   161853 #define GEN10_MI_REPORT_PERF_COUNT_ReportID_bits  32
   161854 #define GEN9_MI_REPORT_PERF_COUNT_ReportID_bits  32
   161855 #define GEN8_MI_REPORT_PERF_COUNT_ReportID_bits  32
   161856 #define GEN75_MI_REPORT_PERF_COUNT_ReportID_bits  32
   161857 #define GEN7_MI_REPORT_PERF_COUNT_ReportID_bits  32
   161858 
   161859 static inline uint32_t ATTRIBUTE_PURE
   161860 MI_REPORT_PERF_COUNT_ReportID_bits(const struct gen_device_info *devinfo)
   161861 {
   161862    switch (devinfo->gen) {
   161863    case 10: return 32;
   161864    case 9: return 32;
   161865    case 8: return 32;
   161866    case 7:
   161867       if (devinfo->is_haswell) {
   161868          return 32;
   161869       } else {
   161870          return 32;
   161871       }
   161872    case 6: return 0;
   161873    case 5: return 0;
   161874    case 4:
   161875       if (devinfo->is_g4x) {
   161876          return 0;
   161877       } else {
   161878          return 0;
   161879       }
   161880    default:
   161881       unreachable("Invalid hardware generation");
   161882    }
   161883 }
   161884 
   161885 
   161886 
   161887 #define GEN10_MI_REPORT_PERF_COUNT_ReportID_start  96
   161888 #define GEN9_MI_REPORT_PERF_COUNT_ReportID_start  96
   161889 #define GEN8_MI_REPORT_PERF_COUNT_ReportID_start  96
   161890 #define GEN75_MI_REPORT_PERF_COUNT_ReportID_start  64
   161891 #define GEN7_MI_REPORT_PERF_COUNT_ReportID_start  64
   161892 
   161893 static inline uint32_t ATTRIBUTE_PURE
   161894 MI_REPORT_PERF_COUNT_ReportID_start(const struct gen_device_info *devinfo)
   161895 {
   161896    switch (devinfo->gen) {
   161897    case 10: return 96;
   161898    case 9: return 96;
   161899    case 8: return 96;
   161900    case 7:
   161901       if (devinfo->is_haswell) {
   161902          return 64;
   161903       } else {
   161904          return 64;
   161905       }
   161906    case 6: return 0;
   161907    case 5: return 0;
   161908    case 4:
   161909       if (devinfo->is_g4x) {
   161910          return 0;
   161911       } else {
   161912          return 0;
   161913       }
   161914    default:
   161915       unreachable("Invalid hardware generation");
   161916    }
   161917 }
   161918 
   161919 
   161920 
   161921 /* MI_REPORT_PERF_COUNT::Use Global GTT */
   161922 
   161923 
   161924 #define GEN10_MI_REPORT_PERF_COUNT_UseGlobalGTT_bits  1
   161925 #define GEN9_MI_REPORT_PERF_COUNT_UseGlobalGTT_bits  1
   161926 #define GEN8_MI_REPORT_PERF_COUNT_UseGlobalGTT_bits  1
   161927 #define GEN75_MI_REPORT_PERF_COUNT_UseGlobalGTT_bits  1
   161928 #define GEN7_MI_REPORT_PERF_COUNT_UseGlobalGTT_bits  1
   161929 
   161930 static inline uint32_t ATTRIBUTE_PURE
   161931 MI_REPORT_PERF_COUNT_UseGlobalGTT_bits(const struct gen_device_info *devinfo)
   161932 {
   161933    switch (devinfo->gen) {
   161934    case 10: return 1;
   161935    case 9: return 1;
   161936    case 8: return 1;
   161937    case 7:
   161938       if (devinfo->is_haswell) {
   161939          return 1;
   161940       } else {
   161941          return 1;
   161942       }
   161943    case 6: return 0;
   161944    case 5: return 0;
   161945    case 4:
   161946       if (devinfo->is_g4x) {
   161947          return 0;
   161948       } else {
   161949          return 0;
   161950       }
   161951    default:
   161952       unreachable("Invalid hardware generation");
   161953    }
   161954 }
   161955 
   161956 
   161957 
   161958 #define GEN10_MI_REPORT_PERF_COUNT_UseGlobalGTT_start  32
   161959 #define GEN9_MI_REPORT_PERF_COUNT_UseGlobalGTT_start  32
   161960 #define GEN8_MI_REPORT_PERF_COUNT_UseGlobalGTT_start  32
   161961 #define GEN75_MI_REPORT_PERF_COUNT_UseGlobalGTT_start  32
   161962 #define GEN7_MI_REPORT_PERF_COUNT_UseGlobalGTT_start  32
   161963 
   161964 static inline uint32_t ATTRIBUTE_PURE
   161965 MI_REPORT_PERF_COUNT_UseGlobalGTT_start(const struct gen_device_info *devinfo)
   161966 {
   161967    switch (devinfo->gen) {
   161968    case 10: return 32;
   161969    case 9: return 32;
   161970    case 8: return 32;
   161971    case 7:
   161972       if (devinfo->is_haswell) {
   161973          return 32;
   161974       } else {
   161975          return 32;
   161976       }
   161977    case 6: return 0;
   161978    case 5: return 0;
   161979    case 4:
   161980       if (devinfo->is_g4x) {
   161981          return 0;
   161982       } else {
   161983          return 0;
   161984       }
   161985    default:
   161986       unreachable("Invalid hardware generation");
   161987    }
   161988 }
   161989 
   161990 
   161991 
   161992 /* MI_RS_CONTEXT */
   161993 
   161994 
   161995 #define GEN10_MI_RS_CONTEXT_length  1
   161996 #define GEN9_MI_RS_CONTEXT_length  1
   161997 #define GEN8_MI_RS_CONTEXT_length  1
   161998 #define GEN75_MI_RS_CONTEXT_length  1
   161999 
   162000 static inline uint32_t ATTRIBUTE_PURE
   162001 MI_RS_CONTEXT_length(const struct gen_device_info *devinfo)
   162002 {
   162003    switch (devinfo->gen) {
   162004    case 10: return 1;
   162005    case 9: return 1;
   162006    case 8: return 1;
   162007    case 7:
   162008       if (devinfo->is_haswell) {
   162009          return 1;
   162010       } else {
   162011          return 0;
   162012       }
   162013    case 6: return 0;
   162014    case 5: return 0;
   162015    case 4:
   162016       if (devinfo->is_g4x) {
   162017          return 0;
   162018       } else {
   162019          return 0;
   162020       }
   162021    default:
   162022       unreachable("Invalid hardware generation");
   162023    }
   162024 }
   162025 
   162026 
   162027 
   162028 /* MI_RS_CONTEXT::Command Type */
   162029 
   162030 
   162031 #define GEN10_MI_RS_CONTEXT_CommandType_bits  3
   162032 #define GEN9_MI_RS_CONTEXT_CommandType_bits  3
   162033 #define GEN8_MI_RS_CONTEXT_CommandType_bits  3
   162034 #define GEN75_MI_RS_CONTEXT_CommandType_bits  3
   162035 
   162036 static inline uint32_t ATTRIBUTE_PURE
   162037 MI_RS_CONTEXT_CommandType_bits(const struct gen_device_info *devinfo)
   162038 {
   162039    switch (devinfo->gen) {
   162040    case 10: return 3;
   162041    case 9: return 3;
   162042    case 8: return 3;
   162043    case 7:
   162044       if (devinfo->is_haswell) {
   162045          return 3;
   162046       } else {
   162047          return 0;
   162048       }
   162049    case 6: return 0;
   162050    case 5: return 0;
   162051    case 4:
   162052       if (devinfo->is_g4x) {
   162053          return 0;
   162054       } else {
   162055          return 0;
   162056       }
   162057    default:
   162058       unreachable("Invalid hardware generation");
   162059    }
   162060 }
   162061 
   162062 
   162063 
   162064 #define GEN10_MI_RS_CONTEXT_CommandType_start  29
   162065 #define GEN9_MI_RS_CONTEXT_CommandType_start  29
   162066 #define GEN8_MI_RS_CONTEXT_CommandType_start  29
   162067 #define GEN75_MI_RS_CONTEXT_CommandType_start  29
   162068 
   162069 static inline uint32_t ATTRIBUTE_PURE
   162070 MI_RS_CONTEXT_CommandType_start(const struct gen_device_info *devinfo)
   162071 {
   162072    switch (devinfo->gen) {
   162073    case 10: return 29;
   162074    case 9: return 29;
   162075    case 8: return 29;
   162076    case 7:
   162077       if (devinfo->is_haswell) {
   162078          return 29;
   162079       } else {
   162080          return 0;
   162081       }
   162082    case 6: return 0;
   162083    case 5: return 0;
   162084    case 4:
   162085       if (devinfo->is_g4x) {
   162086          return 0;
   162087       } else {
   162088          return 0;
   162089       }
   162090    default:
   162091       unreachable("Invalid hardware generation");
   162092    }
   162093 }
   162094 
   162095 
   162096 
   162097 /* MI_RS_CONTEXT::MI Command Opcode */
   162098 
   162099 
   162100 #define GEN10_MI_RS_CONTEXT_MICommandOpcode_bits  6
   162101 #define GEN9_MI_RS_CONTEXT_MICommandOpcode_bits  6
   162102 #define GEN8_MI_RS_CONTEXT_MICommandOpcode_bits  6
   162103 #define GEN75_MI_RS_CONTEXT_MICommandOpcode_bits  6
   162104 
   162105 static inline uint32_t ATTRIBUTE_PURE
   162106 MI_RS_CONTEXT_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   162107 {
   162108    switch (devinfo->gen) {
   162109    case 10: return 6;
   162110    case 9: return 6;
   162111    case 8: return 6;
   162112    case 7:
   162113       if (devinfo->is_haswell) {
   162114          return 6;
   162115       } else {
   162116          return 0;
   162117       }
   162118    case 6: return 0;
   162119    case 5: return 0;
   162120    case 4:
   162121       if (devinfo->is_g4x) {
   162122          return 0;
   162123       } else {
   162124          return 0;
   162125       }
   162126    default:
   162127       unreachable("Invalid hardware generation");
   162128    }
   162129 }
   162130 
   162131 
   162132 
   162133 #define GEN10_MI_RS_CONTEXT_MICommandOpcode_start  23
   162134 #define GEN9_MI_RS_CONTEXT_MICommandOpcode_start  23
   162135 #define GEN8_MI_RS_CONTEXT_MICommandOpcode_start  23
   162136 #define GEN75_MI_RS_CONTEXT_MICommandOpcode_start  23
   162137 
   162138 static inline uint32_t ATTRIBUTE_PURE
   162139 MI_RS_CONTEXT_MICommandOpcode_start(const struct gen_device_info *devinfo)
   162140 {
   162141    switch (devinfo->gen) {
   162142    case 10: return 23;
   162143    case 9: return 23;
   162144    case 8: return 23;
   162145    case 7:
   162146       if (devinfo->is_haswell) {
   162147          return 23;
   162148       } else {
   162149          return 0;
   162150       }
   162151    case 6: return 0;
   162152    case 5: return 0;
   162153    case 4:
   162154       if (devinfo->is_g4x) {
   162155          return 0;
   162156       } else {
   162157          return 0;
   162158       }
   162159    default:
   162160       unreachable("Invalid hardware generation");
   162161    }
   162162 }
   162163 
   162164 
   162165 
   162166 /* MI_RS_CONTEXT::Resource Streamer Save */
   162167 
   162168 
   162169 #define GEN10_MI_RS_CONTEXT_ResourceStreamerSave_bits  1
   162170 #define GEN9_MI_RS_CONTEXT_ResourceStreamerSave_bits  1
   162171 #define GEN8_MI_RS_CONTEXT_ResourceStreamerSave_bits  1
   162172 #define GEN75_MI_RS_CONTEXT_ResourceStreamerSave_bits  1
   162173 
   162174 static inline uint32_t ATTRIBUTE_PURE
   162175 MI_RS_CONTEXT_ResourceStreamerSave_bits(const struct gen_device_info *devinfo)
   162176 {
   162177    switch (devinfo->gen) {
   162178    case 10: return 1;
   162179    case 9: return 1;
   162180    case 8: return 1;
   162181    case 7:
   162182       if (devinfo->is_haswell) {
   162183          return 1;
   162184       } else {
   162185          return 0;
   162186       }
   162187    case 6: return 0;
   162188    case 5: return 0;
   162189    case 4:
   162190       if (devinfo->is_g4x) {
   162191          return 0;
   162192       } else {
   162193          return 0;
   162194       }
   162195    default:
   162196       unreachable("Invalid hardware generation");
   162197    }
   162198 }
   162199 
   162200 
   162201 
   162202 #define GEN10_MI_RS_CONTEXT_ResourceStreamerSave_start  0
   162203 #define GEN9_MI_RS_CONTEXT_ResourceStreamerSave_start  0
   162204 #define GEN8_MI_RS_CONTEXT_ResourceStreamerSave_start  0
   162205 #define GEN75_MI_RS_CONTEXT_ResourceStreamerSave_start  0
   162206 
   162207 static inline uint32_t ATTRIBUTE_PURE
   162208 MI_RS_CONTEXT_ResourceStreamerSave_start(const struct gen_device_info *devinfo)
   162209 {
   162210    switch (devinfo->gen) {
   162211    case 10: return 0;
   162212    case 9: return 0;
   162213    case 8: return 0;
   162214    case 7:
   162215       if (devinfo->is_haswell) {
   162216          return 0;
   162217       } else {
   162218          return 0;
   162219       }
   162220    case 6: return 0;
   162221    case 5: return 0;
   162222    case 4:
   162223       if (devinfo->is_g4x) {
   162224          return 0;
   162225       } else {
   162226          return 0;
   162227       }
   162228    default:
   162229       unreachable("Invalid hardware generation");
   162230    }
   162231 }
   162232 
   162233 
   162234 
   162235 /* MI_RS_CONTROL */
   162236 
   162237 
   162238 #define GEN10_MI_RS_CONTROL_length  1
   162239 #define GEN9_MI_RS_CONTROL_length  1
   162240 #define GEN8_MI_RS_CONTROL_length  1
   162241 #define GEN75_MI_RS_CONTROL_length  1
   162242 
   162243 static inline uint32_t ATTRIBUTE_PURE
   162244 MI_RS_CONTROL_length(const struct gen_device_info *devinfo)
   162245 {
   162246    switch (devinfo->gen) {
   162247    case 10: return 1;
   162248    case 9: return 1;
   162249    case 8: return 1;
   162250    case 7:
   162251       if (devinfo->is_haswell) {
   162252          return 1;
   162253       } else {
   162254          return 0;
   162255       }
   162256    case 6: return 0;
   162257    case 5: return 0;
   162258    case 4:
   162259       if (devinfo->is_g4x) {
   162260          return 0;
   162261       } else {
   162262          return 0;
   162263       }
   162264    default:
   162265       unreachable("Invalid hardware generation");
   162266    }
   162267 }
   162268 
   162269 
   162270 
   162271 /* MI_RS_CONTROL::Command Type */
   162272 
   162273 
   162274 #define GEN10_MI_RS_CONTROL_CommandType_bits  3
   162275 #define GEN9_MI_RS_CONTROL_CommandType_bits  3
   162276 #define GEN8_MI_RS_CONTROL_CommandType_bits  3
   162277 #define GEN75_MI_RS_CONTROL_CommandType_bits  3
   162278 
   162279 static inline uint32_t ATTRIBUTE_PURE
   162280 MI_RS_CONTROL_CommandType_bits(const struct gen_device_info *devinfo)
   162281 {
   162282    switch (devinfo->gen) {
   162283    case 10: return 3;
   162284    case 9: return 3;
   162285    case 8: return 3;
   162286    case 7:
   162287       if (devinfo->is_haswell) {
   162288          return 3;
   162289       } else {
   162290          return 0;
   162291       }
   162292    case 6: return 0;
   162293    case 5: return 0;
   162294    case 4:
   162295       if (devinfo->is_g4x) {
   162296          return 0;
   162297       } else {
   162298          return 0;
   162299       }
   162300    default:
   162301       unreachable("Invalid hardware generation");
   162302    }
   162303 }
   162304 
   162305 
   162306 
   162307 #define GEN10_MI_RS_CONTROL_CommandType_start  29
   162308 #define GEN9_MI_RS_CONTROL_CommandType_start  29
   162309 #define GEN8_MI_RS_CONTROL_CommandType_start  29
   162310 #define GEN75_MI_RS_CONTROL_CommandType_start  29
   162311 
   162312 static inline uint32_t ATTRIBUTE_PURE
   162313 MI_RS_CONTROL_CommandType_start(const struct gen_device_info *devinfo)
   162314 {
   162315    switch (devinfo->gen) {
   162316    case 10: return 29;
   162317    case 9: return 29;
   162318    case 8: return 29;
   162319    case 7:
   162320       if (devinfo->is_haswell) {
   162321          return 29;
   162322       } else {
   162323          return 0;
   162324       }
   162325    case 6: return 0;
   162326    case 5: return 0;
   162327    case 4:
   162328       if (devinfo->is_g4x) {
   162329          return 0;
   162330       } else {
   162331          return 0;
   162332       }
   162333    default:
   162334       unreachable("Invalid hardware generation");
   162335    }
   162336 }
   162337 
   162338 
   162339 
   162340 /* MI_RS_CONTROL::MI Command Opcode */
   162341 
   162342 
   162343 #define GEN10_MI_RS_CONTROL_MICommandOpcode_bits  6
   162344 #define GEN9_MI_RS_CONTROL_MICommandOpcode_bits  6
   162345 #define GEN8_MI_RS_CONTROL_MICommandOpcode_bits  6
   162346 #define GEN75_MI_RS_CONTROL_MICommandOpcode_bits  6
   162347 
   162348 static inline uint32_t ATTRIBUTE_PURE
   162349 MI_RS_CONTROL_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   162350 {
   162351    switch (devinfo->gen) {
   162352    case 10: return 6;
   162353    case 9: return 6;
   162354    case 8: return 6;
   162355    case 7:
   162356       if (devinfo->is_haswell) {
   162357          return 6;
   162358       } else {
   162359          return 0;
   162360       }
   162361    case 6: return 0;
   162362    case 5: return 0;
   162363    case 4:
   162364       if (devinfo->is_g4x) {
   162365          return 0;
   162366       } else {
   162367          return 0;
   162368       }
   162369    default:
   162370       unreachable("Invalid hardware generation");
   162371    }
   162372 }
   162373 
   162374 
   162375 
   162376 #define GEN10_MI_RS_CONTROL_MICommandOpcode_start  23
   162377 #define GEN9_MI_RS_CONTROL_MICommandOpcode_start  23
   162378 #define GEN8_MI_RS_CONTROL_MICommandOpcode_start  23
   162379 #define GEN75_MI_RS_CONTROL_MICommandOpcode_start  23
   162380 
   162381 static inline uint32_t ATTRIBUTE_PURE
   162382 MI_RS_CONTROL_MICommandOpcode_start(const struct gen_device_info *devinfo)
   162383 {
   162384    switch (devinfo->gen) {
   162385    case 10: return 23;
   162386    case 9: return 23;
   162387    case 8: return 23;
   162388    case 7:
   162389       if (devinfo->is_haswell) {
   162390          return 23;
   162391       } else {
   162392          return 0;
   162393       }
   162394    case 6: return 0;
   162395    case 5: return 0;
   162396    case 4:
   162397       if (devinfo->is_g4x) {
   162398          return 0;
   162399       } else {
   162400          return 0;
   162401       }
   162402    default:
   162403       unreachable("Invalid hardware generation");
   162404    }
   162405 }
   162406 
   162407 
   162408 
   162409 /* MI_RS_CONTROL::Resource Streamer Control */
   162410 
   162411 
   162412 #define GEN10_MI_RS_CONTROL_ResourceStreamerControl_bits  1
   162413 #define GEN9_MI_RS_CONTROL_ResourceStreamerControl_bits  1
   162414 #define GEN8_MI_RS_CONTROL_ResourceStreamerControl_bits  1
   162415 #define GEN75_MI_RS_CONTROL_ResourceStreamerControl_bits  1
   162416 
   162417 static inline uint32_t ATTRIBUTE_PURE
   162418 MI_RS_CONTROL_ResourceStreamerControl_bits(const struct gen_device_info *devinfo)
   162419 {
   162420    switch (devinfo->gen) {
   162421    case 10: return 1;
   162422    case 9: return 1;
   162423    case 8: return 1;
   162424    case 7:
   162425       if (devinfo->is_haswell) {
   162426          return 1;
   162427       } else {
   162428          return 0;
   162429       }
   162430    case 6: return 0;
   162431    case 5: return 0;
   162432    case 4:
   162433       if (devinfo->is_g4x) {
   162434          return 0;
   162435       } else {
   162436          return 0;
   162437       }
   162438    default:
   162439       unreachable("Invalid hardware generation");
   162440    }
   162441 }
   162442 
   162443 
   162444 
   162445 #define GEN10_MI_RS_CONTROL_ResourceStreamerControl_start  0
   162446 #define GEN9_MI_RS_CONTROL_ResourceStreamerControl_start  0
   162447 #define GEN8_MI_RS_CONTROL_ResourceStreamerControl_start  0
   162448 #define GEN75_MI_RS_CONTROL_ResourceStreamerControl_start  0
   162449 
   162450 static inline uint32_t ATTRIBUTE_PURE
   162451 MI_RS_CONTROL_ResourceStreamerControl_start(const struct gen_device_info *devinfo)
   162452 {
   162453    switch (devinfo->gen) {
   162454    case 10: return 0;
   162455    case 9: return 0;
   162456    case 8: return 0;
   162457    case 7:
   162458       if (devinfo->is_haswell) {
   162459          return 0;
   162460       } else {
   162461          return 0;
   162462       }
   162463    case 6: return 0;
   162464    case 5: return 0;
   162465    case 4:
   162466       if (devinfo->is_g4x) {
   162467          return 0;
   162468       } else {
   162469          return 0;
   162470       }
   162471    default:
   162472       unreachable("Invalid hardware generation");
   162473    }
   162474 }
   162475 
   162476 
   162477 
   162478 /* MI_RS_STORE_DATA_IMM */
   162479 
   162480 
   162481 #define GEN10_MI_RS_STORE_DATA_IMM_length  4
   162482 #define GEN9_MI_RS_STORE_DATA_IMM_length  4
   162483 #define GEN8_MI_RS_STORE_DATA_IMM_length  4
   162484 #define GEN75_MI_RS_STORE_DATA_IMM_length  4
   162485 
   162486 static inline uint32_t ATTRIBUTE_PURE
   162487 MI_RS_STORE_DATA_IMM_length(const struct gen_device_info *devinfo)
   162488 {
   162489    switch (devinfo->gen) {
   162490    case 10: return 4;
   162491    case 9: return 4;
   162492    case 8: return 4;
   162493    case 7:
   162494       if (devinfo->is_haswell) {
   162495          return 4;
   162496       } else {
   162497          return 0;
   162498       }
   162499    case 6: return 0;
   162500    case 5: return 0;
   162501    case 4:
   162502       if (devinfo->is_g4x) {
   162503          return 0;
   162504       } else {
   162505          return 0;
   162506       }
   162507    default:
   162508       unreachable("Invalid hardware generation");
   162509    }
   162510 }
   162511 
   162512 
   162513 
   162514 /* MI_RS_STORE_DATA_IMM::Command Type */
   162515 
   162516 
   162517 #define GEN10_MI_RS_STORE_DATA_IMM_CommandType_bits  3
   162518 #define GEN9_MI_RS_STORE_DATA_IMM_CommandType_bits  3
   162519 #define GEN8_MI_RS_STORE_DATA_IMM_CommandType_bits  3
   162520 #define GEN75_MI_RS_STORE_DATA_IMM_CommandType_bits  3
   162521 
   162522 static inline uint32_t ATTRIBUTE_PURE
   162523 MI_RS_STORE_DATA_IMM_CommandType_bits(const struct gen_device_info *devinfo)
   162524 {
   162525    switch (devinfo->gen) {
   162526    case 10: return 3;
   162527    case 9: return 3;
   162528    case 8: return 3;
   162529    case 7:
   162530       if (devinfo->is_haswell) {
   162531          return 3;
   162532       } else {
   162533          return 0;
   162534       }
   162535    case 6: return 0;
   162536    case 5: return 0;
   162537    case 4:
   162538       if (devinfo->is_g4x) {
   162539          return 0;
   162540       } else {
   162541          return 0;
   162542       }
   162543    default:
   162544       unreachable("Invalid hardware generation");
   162545    }
   162546 }
   162547 
   162548 
   162549 
   162550 #define GEN10_MI_RS_STORE_DATA_IMM_CommandType_start  29
   162551 #define GEN9_MI_RS_STORE_DATA_IMM_CommandType_start  29
   162552 #define GEN8_MI_RS_STORE_DATA_IMM_CommandType_start  29
   162553 #define GEN75_MI_RS_STORE_DATA_IMM_CommandType_start  29
   162554 
   162555 static inline uint32_t ATTRIBUTE_PURE
   162556 MI_RS_STORE_DATA_IMM_CommandType_start(const struct gen_device_info *devinfo)
   162557 {
   162558    switch (devinfo->gen) {
   162559    case 10: return 29;
   162560    case 9: return 29;
   162561    case 8: return 29;
   162562    case 7:
   162563       if (devinfo->is_haswell) {
   162564          return 29;
   162565       } else {
   162566          return 0;
   162567       }
   162568    case 6: return 0;
   162569    case 5: return 0;
   162570    case 4:
   162571       if (devinfo->is_g4x) {
   162572          return 0;
   162573       } else {
   162574          return 0;
   162575       }
   162576    default:
   162577       unreachable("Invalid hardware generation");
   162578    }
   162579 }
   162580 
   162581 
   162582 
   162583 /* MI_RS_STORE_DATA_IMM::Core Mode Enable */
   162584 
   162585 
   162586 #define GEN10_MI_RS_STORE_DATA_IMM_CoreModeEnable_bits  1
   162587 #define GEN9_MI_RS_STORE_DATA_IMM_CoreModeEnable_bits  1
   162588 #define GEN8_MI_RS_STORE_DATA_IMM_CoreModeEnable_bits  1
   162589 #define GEN75_MI_RS_STORE_DATA_IMM_CoreModeEnable_bits  1
   162590 
   162591 static inline uint32_t ATTRIBUTE_PURE
   162592 MI_RS_STORE_DATA_IMM_CoreModeEnable_bits(const struct gen_device_info *devinfo)
   162593 {
   162594    switch (devinfo->gen) {
   162595    case 10: return 1;
   162596    case 9: return 1;
   162597    case 8: return 1;
   162598    case 7:
   162599       if (devinfo->is_haswell) {
   162600          return 1;
   162601       } else {
   162602          return 0;
   162603       }
   162604    case 6: return 0;
   162605    case 5: return 0;
   162606    case 4:
   162607       if (devinfo->is_g4x) {
   162608          return 0;
   162609       } else {
   162610          return 0;
   162611       }
   162612    default:
   162613       unreachable("Invalid hardware generation");
   162614    }
   162615 }
   162616 
   162617 
   162618 
   162619 #define GEN10_MI_RS_STORE_DATA_IMM_CoreModeEnable_start  32
   162620 #define GEN9_MI_RS_STORE_DATA_IMM_CoreModeEnable_start  32
   162621 #define GEN8_MI_RS_STORE_DATA_IMM_CoreModeEnable_start  32
   162622 #define GEN75_MI_RS_STORE_DATA_IMM_CoreModeEnable_start  64
   162623 
   162624 static inline uint32_t ATTRIBUTE_PURE
   162625 MI_RS_STORE_DATA_IMM_CoreModeEnable_start(const struct gen_device_info *devinfo)
   162626 {
   162627    switch (devinfo->gen) {
   162628    case 10: return 32;
   162629    case 9: return 32;
   162630    case 8: return 32;
   162631    case 7:
   162632       if (devinfo->is_haswell) {
   162633          return 64;
   162634       } else {
   162635          return 0;
   162636       }
   162637    case 6: return 0;
   162638    case 5: return 0;
   162639    case 4:
   162640       if (devinfo->is_g4x) {
   162641          return 0;
   162642       } else {
   162643          return 0;
   162644       }
   162645    default:
   162646       unreachable("Invalid hardware generation");
   162647    }
   162648 }
   162649 
   162650 
   162651 
   162652 /* MI_RS_STORE_DATA_IMM::DWord Length */
   162653 
   162654 
   162655 #define GEN10_MI_RS_STORE_DATA_IMM_DWordLength_bits  8
   162656 #define GEN9_MI_RS_STORE_DATA_IMM_DWordLength_bits  8
   162657 #define GEN8_MI_RS_STORE_DATA_IMM_DWordLength_bits  8
   162658 #define GEN75_MI_RS_STORE_DATA_IMM_DWordLength_bits  8
   162659 
   162660 static inline uint32_t ATTRIBUTE_PURE
   162661 MI_RS_STORE_DATA_IMM_DWordLength_bits(const struct gen_device_info *devinfo)
   162662 {
   162663    switch (devinfo->gen) {
   162664    case 10: return 8;
   162665    case 9: return 8;
   162666    case 8: return 8;
   162667    case 7:
   162668       if (devinfo->is_haswell) {
   162669          return 8;
   162670       } else {
   162671          return 0;
   162672       }
   162673    case 6: return 0;
   162674    case 5: return 0;
   162675    case 4:
   162676       if (devinfo->is_g4x) {
   162677          return 0;
   162678       } else {
   162679          return 0;
   162680       }
   162681    default:
   162682       unreachable("Invalid hardware generation");
   162683    }
   162684 }
   162685 
   162686 
   162687 
   162688 #define GEN10_MI_RS_STORE_DATA_IMM_DWordLength_start  0
   162689 #define GEN9_MI_RS_STORE_DATA_IMM_DWordLength_start  0
   162690 #define GEN8_MI_RS_STORE_DATA_IMM_DWordLength_start  0
   162691 #define GEN75_MI_RS_STORE_DATA_IMM_DWordLength_start  0
   162692 
   162693 static inline uint32_t ATTRIBUTE_PURE
   162694 MI_RS_STORE_DATA_IMM_DWordLength_start(const struct gen_device_info *devinfo)
   162695 {
   162696    switch (devinfo->gen) {
   162697    case 10: return 0;
   162698    case 9: return 0;
   162699    case 8: return 0;
   162700    case 7:
   162701       if (devinfo->is_haswell) {
   162702          return 0;
   162703       } else {
   162704          return 0;
   162705       }
   162706    case 6: return 0;
   162707    case 5: return 0;
   162708    case 4:
   162709       if (devinfo->is_g4x) {
   162710          return 0;
   162711       } else {
   162712          return 0;
   162713       }
   162714    default:
   162715       unreachable("Invalid hardware generation");
   162716    }
   162717 }
   162718 
   162719 
   162720 
   162721 /* MI_RS_STORE_DATA_IMM::Data DWord 0 */
   162722 
   162723 
   162724 #define GEN10_MI_RS_STORE_DATA_IMM_DataDWord0_bits  32
   162725 #define GEN9_MI_RS_STORE_DATA_IMM_DataDWord0_bits  32
   162726 #define GEN8_MI_RS_STORE_DATA_IMM_DataDWord0_bits  32
   162727 #define GEN75_MI_RS_STORE_DATA_IMM_DataDWord0_bits  32
   162728 
   162729 static inline uint32_t ATTRIBUTE_PURE
   162730 MI_RS_STORE_DATA_IMM_DataDWord0_bits(const struct gen_device_info *devinfo)
   162731 {
   162732    switch (devinfo->gen) {
   162733    case 10: return 32;
   162734    case 9: return 32;
   162735    case 8: return 32;
   162736    case 7:
   162737       if (devinfo->is_haswell) {
   162738          return 32;
   162739       } else {
   162740          return 0;
   162741       }
   162742    case 6: return 0;
   162743    case 5: return 0;
   162744    case 4:
   162745       if (devinfo->is_g4x) {
   162746          return 0;
   162747       } else {
   162748          return 0;
   162749       }
   162750    default:
   162751       unreachable("Invalid hardware generation");
   162752    }
   162753 }
   162754 
   162755 
   162756 
   162757 #define GEN10_MI_RS_STORE_DATA_IMM_DataDWord0_start  96
   162758 #define GEN9_MI_RS_STORE_DATA_IMM_DataDWord0_start  96
   162759 #define GEN8_MI_RS_STORE_DATA_IMM_DataDWord0_start  96
   162760 #define GEN75_MI_RS_STORE_DATA_IMM_DataDWord0_start  96
   162761 
   162762 static inline uint32_t ATTRIBUTE_PURE
   162763 MI_RS_STORE_DATA_IMM_DataDWord0_start(const struct gen_device_info *devinfo)
   162764 {
   162765    switch (devinfo->gen) {
   162766    case 10: return 96;
   162767    case 9: return 96;
   162768    case 8: return 96;
   162769    case 7:
   162770       if (devinfo->is_haswell) {
   162771          return 96;
   162772       } else {
   162773          return 0;
   162774       }
   162775    case 6: return 0;
   162776    case 5: return 0;
   162777    case 4:
   162778       if (devinfo->is_g4x) {
   162779          return 0;
   162780       } else {
   162781          return 0;
   162782       }
   162783    default:
   162784       unreachable("Invalid hardware generation");
   162785    }
   162786 }
   162787 
   162788 
   162789 
   162790 /* MI_RS_STORE_DATA_IMM::Destination Address */
   162791 
   162792 
   162793 #define GEN10_MI_RS_STORE_DATA_IMM_DestinationAddress_bits  62
   162794 #define GEN9_MI_RS_STORE_DATA_IMM_DestinationAddress_bits  62
   162795 #define GEN8_MI_RS_STORE_DATA_IMM_DestinationAddress_bits  62
   162796 #define GEN75_MI_RS_STORE_DATA_IMM_DestinationAddress_bits  30
   162797 
   162798 static inline uint32_t ATTRIBUTE_PURE
   162799 MI_RS_STORE_DATA_IMM_DestinationAddress_bits(const struct gen_device_info *devinfo)
   162800 {
   162801    switch (devinfo->gen) {
   162802    case 10: return 62;
   162803    case 9: return 62;
   162804    case 8: return 62;
   162805    case 7:
   162806       if (devinfo->is_haswell) {
   162807          return 30;
   162808       } else {
   162809          return 0;
   162810       }
   162811    case 6: return 0;
   162812    case 5: return 0;
   162813    case 4:
   162814       if (devinfo->is_g4x) {
   162815          return 0;
   162816       } else {
   162817          return 0;
   162818       }
   162819    default:
   162820       unreachable("Invalid hardware generation");
   162821    }
   162822 }
   162823 
   162824 
   162825 
   162826 #define GEN10_MI_RS_STORE_DATA_IMM_DestinationAddress_start  34
   162827 #define GEN9_MI_RS_STORE_DATA_IMM_DestinationAddress_start  34
   162828 #define GEN8_MI_RS_STORE_DATA_IMM_DestinationAddress_start  34
   162829 #define GEN75_MI_RS_STORE_DATA_IMM_DestinationAddress_start  66
   162830 
   162831 static inline uint32_t ATTRIBUTE_PURE
   162832 MI_RS_STORE_DATA_IMM_DestinationAddress_start(const struct gen_device_info *devinfo)
   162833 {
   162834    switch (devinfo->gen) {
   162835    case 10: return 34;
   162836    case 9: return 34;
   162837    case 8: return 34;
   162838    case 7:
   162839       if (devinfo->is_haswell) {
   162840          return 66;
   162841       } else {
   162842          return 0;
   162843       }
   162844    case 6: return 0;
   162845    case 5: return 0;
   162846    case 4:
   162847       if (devinfo->is_g4x) {
   162848          return 0;
   162849       } else {
   162850          return 0;
   162851       }
   162852    default:
   162853       unreachable("Invalid hardware generation");
   162854    }
   162855 }
   162856 
   162857 
   162858 
   162859 /* MI_RS_STORE_DATA_IMM::MI Command Opcode */
   162860 
   162861 
   162862 #define GEN10_MI_RS_STORE_DATA_IMM_MICommandOpcode_bits  6
   162863 #define GEN9_MI_RS_STORE_DATA_IMM_MICommandOpcode_bits  6
   162864 #define GEN8_MI_RS_STORE_DATA_IMM_MICommandOpcode_bits  6
   162865 #define GEN75_MI_RS_STORE_DATA_IMM_MICommandOpcode_bits  6
   162866 
   162867 static inline uint32_t ATTRIBUTE_PURE
   162868 MI_RS_STORE_DATA_IMM_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   162869 {
   162870    switch (devinfo->gen) {
   162871    case 10: return 6;
   162872    case 9: return 6;
   162873    case 8: return 6;
   162874    case 7:
   162875       if (devinfo->is_haswell) {
   162876          return 6;
   162877       } else {
   162878          return 0;
   162879       }
   162880    case 6: return 0;
   162881    case 5: return 0;
   162882    case 4:
   162883       if (devinfo->is_g4x) {
   162884          return 0;
   162885       } else {
   162886          return 0;
   162887       }
   162888    default:
   162889       unreachable("Invalid hardware generation");
   162890    }
   162891 }
   162892 
   162893 
   162894 
   162895 #define GEN10_MI_RS_STORE_DATA_IMM_MICommandOpcode_start  23
   162896 #define GEN9_MI_RS_STORE_DATA_IMM_MICommandOpcode_start  23
   162897 #define GEN8_MI_RS_STORE_DATA_IMM_MICommandOpcode_start  23
   162898 #define GEN75_MI_RS_STORE_DATA_IMM_MICommandOpcode_start  23
   162899 
   162900 static inline uint32_t ATTRIBUTE_PURE
   162901 MI_RS_STORE_DATA_IMM_MICommandOpcode_start(const struct gen_device_info *devinfo)
   162902 {
   162903    switch (devinfo->gen) {
   162904    case 10: return 23;
   162905    case 9: return 23;
   162906    case 8: return 23;
   162907    case 7:
   162908       if (devinfo->is_haswell) {
   162909          return 23;
   162910       } else {
   162911          return 0;
   162912       }
   162913    case 6: return 0;
   162914    case 5: return 0;
   162915    case 4:
   162916       if (devinfo->is_g4x) {
   162917          return 0;
   162918       } else {
   162919          return 0;
   162920       }
   162921    default:
   162922       unreachable("Invalid hardware generation");
   162923    }
   162924 }
   162925 
   162926 
   162927 
   162928 /* MI_SEMAPHORE_MBOX */
   162929 
   162930 
   162931 #define GEN75_MI_SEMAPHORE_MBOX_length  3
   162932 #define GEN7_MI_SEMAPHORE_MBOX_length  3
   162933 #define GEN6_MI_SEMAPHORE_MBOX_length  3
   162934 
   162935 static inline uint32_t ATTRIBUTE_PURE
   162936 MI_SEMAPHORE_MBOX_length(const struct gen_device_info *devinfo)
   162937 {
   162938    switch (devinfo->gen) {
   162939    case 10: return 0;
   162940    case 9: return 0;
   162941    case 8: return 0;
   162942    case 7:
   162943       if (devinfo->is_haswell) {
   162944          return 3;
   162945       } else {
   162946          return 3;
   162947       }
   162948    case 6: return 3;
   162949    case 5: return 0;
   162950    case 4:
   162951       if (devinfo->is_g4x) {
   162952          return 0;
   162953       } else {
   162954          return 0;
   162955       }
   162956    default:
   162957       unreachable("Invalid hardware generation");
   162958    }
   162959 }
   162960 
   162961 
   162962 
   162963 /* MI_SEMAPHORE_MBOX::Command Type */
   162964 
   162965 
   162966 #define GEN75_MI_SEMAPHORE_MBOX_CommandType_bits  3
   162967 #define GEN7_MI_SEMAPHORE_MBOX_CommandType_bits  3
   162968 #define GEN6_MI_SEMAPHORE_MBOX_CommandType_bits  3
   162969 
   162970 static inline uint32_t ATTRIBUTE_PURE
   162971 MI_SEMAPHORE_MBOX_CommandType_bits(const struct gen_device_info *devinfo)
   162972 {
   162973    switch (devinfo->gen) {
   162974    case 10: return 0;
   162975    case 9: return 0;
   162976    case 8: return 0;
   162977    case 7:
   162978       if (devinfo->is_haswell) {
   162979          return 3;
   162980       } else {
   162981          return 3;
   162982       }
   162983    case 6: return 3;
   162984    case 5: return 0;
   162985    case 4:
   162986       if (devinfo->is_g4x) {
   162987          return 0;
   162988       } else {
   162989          return 0;
   162990       }
   162991    default:
   162992       unreachable("Invalid hardware generation");
   162993    }
   162994 }
   162995 
   162996 
   162997 
   162998 #define GEN75_MI_SEMAPHORE_MBOX_CommandType_start  29
   162999 #define GEN7_MI_SEMAPHORE_MBOX_CommandType_start  29
   163000 #define GEN6_MI_SEMAPHORE_MBOX_CommandType_start  29
   163001 
   163002 static inline uint32_t ATTRIBUTE_PURE
   163003 MI_SEMAPHORE_MBOX_CommandType_start(const struct gen_device_info *devinfo)
   163004 {
   163005    switch (devinfo->gen) {
   163006    case 10: return 0;
   163007    case 9: return 0;
   163008    case 8: return 0;
   163009    case 7:
   163010       if (devinfo->is_haswell) {
   163011          return 29;
   163012       } else {
   163013          return 29;
   163014       }
   163015    case 6: return 29;
   163016    case 5: return 0;
   163017    case 4:
   163018       if (devinfo->is_g4x) {
   163019          return 0;
   163020       } else {
   163021          return 0;
   163022       }
   163023    default:
   163024       unreachable("Invalid hardware generation");
   163025    }
   163026 }
   163027 
   163028 
   163029 
   163030 /* MI_SEMAPHORE_MBOX::DWord Length */
   163031 
   163032 
   163033 #define GEN75_MI_SEMAPHORE_MBOX_DWordLength_bits  8
   163034 #define GEN7_MI_SEMAPHORE_MBOX_DWordLength_bits  8
   163035 #define GEN6_MI_SEMAPHORE_MBOX_DWordLength_bits  8
   163036 
   163037 static inline uint32_t ATTRIBUTE_PURE
   163038 MI_SEMAPHORE_MBOX_DWordLength_bits(const struct gen_device_info *devinfo)
   163039 {
   163040    switch (devinfo->gen) {
   163041    case 10: return 0;
   163042    case 9: return 0;
   163043    case 8: return 0;
   163044    case 7:
   163045       if (devinfo->is_haswell) {
   163046          return 8;
   163047       } else {
   163048          return 8;
   163049       }
   163050    case 6: return 8;
   163051    case 5: return 0;
   163052    case 4:
   163053       if (devinfo->is_g4x) {
   163054          return 0;
   163055       } else {
   163056          return 0;
   163057       }
   163058    default:
   163059       unreachable("Invalid hardware generation");
   163060    }
   163061 }
   163062 
   163063 
   163064 
   163065 #define GEN75_MI_SEMAPHORE_MBOX_DWordLength_start  0
   163066 #define GEN7_MI_SEMAPHORE_MBOX_DWordLength_start  0
   163067 #define GEN6_MI_SEMAPHORE_MBOX_DWordLength_start  0
   163068 
   163069 static inline uint32_t ATTRIBUTE_PURE
   163070 MI_SEMAPHORE_MBOX_DWordLength_start(const struct gen_device_info *devinfo)
   163071 {
   163072    switch (devinfo->gen) {
   163073    case 10: return 0;
   163074    case 9: return 0;
   163075    case 8: return 0;
   163076    case 7:
   163077       if (devinfo->is_haswell) {
   163078          return 0;
   163079       } else {
   163080          return 0;
   163081       }
   163082    case 6: return 0;
   163083    case 5: return 0;
   163084    case 4:
   163085       if (devinfo->is_g4x) {
   163086          return 0;
   163087       } else {
   163088          return 0;
   163089       }
   163090    default:
   163091       unreachable("Invalid hardware generation");
   163092    }
   163093 }
   163094 
   163095 
   163096 
   163097 /* MI_SEMAPHORE_MBOX::General Register Select */
   163098 
   163099 
   163100 #define GEN75_MI_SEMAPHORE_MBOX_GeneralRegisterSelect_bits  6
   163101 
   163102 static inline uint32_t ATTRIBUTE_PURE
   163103 MI_SEMAPHORE_MBOX_GeneralRegisterSelect_bits(const struct gen_device_info *devinfo)
   163104 {
   163105    switch (devinfo->gen) {
   163106    case 10: return 0;
   163107    case 9: return 0;
   163108    case 8: return 0;
   163109    case 7:
   163110       if (devinfo->is_haswell) {
   163111          return 6;
   163112       } else {
   163113          return 0;
   163114       }
   163115    case 6: return 0;
   163116    case 5: return 0;
   163117    case 4:
   163118       if (devinfo->is_g4x) {
   163119          return 0;
   163120       } else {
   163121          return 0;
   163122       }
   163123    default:
   163124       unreachable("Invalid hardware generation");
   163125    }
   163126 }
   163127 
   163128 
   163129 
   163130 #define GEN75_MI_SEMAPHORE_MBOX_GeneralRegisterSelect_start  8
   163131 
   163132 static inline uint32_t ATTRIBUTE_PURE
   163133 MI_SEMAPHORE_MBOX_GeneralRegisterSelect_start(const struct gen_device_info *devinfo)
   163134 {
   163135    switch (devinfo->gen) {
   163136    case 10: return 0;
   163137    case 9: return 0;
   163138    case 8: return 0;
   163139    case 7:
   163140       if (devinfo->is_haswell) {
   163141          return 8;
   163142       } else {
   163143          return 0;
   163144       }
   163145    case 6: return 0;
   163146    case 5: return 0;
   163147    case 4:
   163148       if (devinfo->is_g4x) {
   163149          return 0;
   163150       } else {
   163151          return 0;
   163152       }
   163153    default:
   163154       unreachable("Invalid hardware generation");
   163155    }
   163156 }
   163157 
   163158 
   163159 
   163160 /* MI_SEMAPHORE_MBOX::MI Command Opcode */
   163161 
   163162 
   163163 #define GEN75_MI_SEMAPHORE_MBOX_MICommandOpcode_bits  6
   163164 #define GEN7_MI_SEMAPHORE_MBOX_MICommandOpcode_bits  6
   163165 #define GEN6_MI_SEMAPHORE_MBOX_MICommandOpcode_bits  6
   163166 
   163167 static inline uint32_t ATTRIBUTE_PURE
   163168 MI_SEMAPHORE_MBOX_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   163169 {
   163170    switch (devinfo->gen) {
   163171    case 10: return 0;
   163172    case 9: return 0;
   163173    case 8: return 0;
   163174    case 7:
   163175       if (devinfo->is_haswell) {
   163176          return 6;
   163177       } else {
   163178          return 6;
   163179       }
   163180    case 6: return 6;
   163181    case 5: return 0;
   163182    case 4:
   163183       if (devinfo->is_g4x) {
   163184          return 0;
   163185       } else {
   163186          return 0;
   163187       }
   163188    default:
   163189       unreachable("Invalid hardware generation");
   163190    }
   163191 }
   163192 
   163193 
   163194 
   163195 #define GEN75_MI_SEMAPHORE_MBOX_MICommandOpcode_start  23
   163196 #define GEN7_MI_SEMAPHORE_MBOX_MICommandOpcode_start  23
   163197 #define GEN6_MI_SEMAPHORE_MBOX_MICommandOpcode_start  23
   163198 
   163199 static inline uint32_t ATTRIBUTE_PURE
   163200 MI_SEMAPHORE_MBOX_MICommandOpcode_start(const struct gen_device_info *devinfo)
   163201 {
   163202    switch (devinfo->gen) {
   163203    case 10: return 0;
   163204    case 9: return 0;
   163205    case 8: return 0;
   163206    case 7:
   163207       if (devinfo->is_haswell) {
   163208          return 23;
   163209       } else {
   163210          return 23;
   163211       }
   163212    case 6: return 23;
   163213    case 5: return 0;
   163214    case 4:
   163215       if (devinfo->is_g4x) {
   163216          return 0;
   163217       } else {
   163218          return 0;
   163219       }
   163220    default:
   163221       unreachable("Invalid hardware generation");
   163222    }
   163223 }
   163224 
   163225 
   163226 
   163227 /* MI_SEMAPHORE_MBOX::Register Select */
   163228 
   163229 
   163230 #define GEN75_MI_SEMAPHORE_MBOX_RegisterSelect_bits  2
   163231 #define GEN7_MI_SEMAPHORE_MBOX_RegisterSelect_bits  2
   163232 #define GEN6_MI_SEMAPHORE_MBOX_RegisterSelect_bits  2
   163233 
   163234 static inline uint32_t ATTRIBUTE_PURE
   163235 MI_SEMAPHORE_MBOX_RegisterSelect_bits(const struct gen_device_info *devinfo)
   163236 {
   163237    switch (devinfo->gen) {
   163238    case 10: return 0;
   163239    case 9: return 0;
   163240    case 8: return 0;
   163241    case 7:
   163242       if (devinfo->is_haswell) {
   163243          return 2;
   163244       } else {
   163245          return 2;
   163246       }
   163247    case 6: return 2;
   163248    case 5: return 0;
   163249    case 4:
   163250       if (devinfo->is_g4x) {
   163251          return 0;
   163252       } else {
   163253          return 0;
   163254       }
   163255    default:
   163256       unreachable("Invalid hardware generation");
   163257    }
   163258 }
   163259 
   163260 
   163261 
   163262 #define GEN75_MI_SEMAPHORE_MBOX_RegisterSelect_start  16
   163263 #define GEN7_MI_SEMAPHORE_MBOX_RegisterSelect_start  16
   163264 #define GEN6_MI_SEMAPHORE_MBOX_RegisterSelect_start  16
   163265 
   163266 static inline uint32_t ATTRIBUTE_PURE
   163267 MI_SEMAPHORE_MBOX_RegisterSelect_start(const struct gen_device_info *devinfo)
   163268 {
   163269    switch (devinfo->gen) {
   163270    case 10: return 0;
   163271    case 9: return 0;
   163272    case 8: return 0;
   163273    case 7:
   163274       if (devinfo->is_haswell) {
   163275          return 16;
   163276       } else {
   163277          return 16;
   163278       }
   163279    case 6: return 16;
   163280    case 5: return 0;
   163281    case 4:
   163282       if (devinfo->is_g4x) {
   163283          return 0;
   163284       } else {
   163285          return 0;
   163286       }
   163287    default:
   163288       unreachable("Invalid hardware generation");
   163289    }
   163290 }
   163291 
   163292 
   163293 
   163294 /* MI_SEMAPHORE_MBOX::Semaphore Data Dword */
   163295 
   163296 
   163297 #define GEN75_MI_SEMAPHORE_MBOX_SemaphoreDataDword_bits  32
   163298 #define GEN7_MI_SEMAPHORE_MBOX_SemaphoreDataDword_bits  32
   163299 #define GEN6_MI_SEMAPHORE_MBOX_SemaphoreDataDword_bits  32
   163300 
   163301 static inline uint32_t ATTRIBUTE_PURE
   163302 MI_SEMAPHORE_MBOX_SemaphoreDataDword_bits(const struct gen_device_info *devinfo)
   163303 {
   163304    switch (devinfo->gen) {
   163305    case 10: return 0;
   163306    case 9: return 0;
   163307    case 8: return 0;
   163308    case 7:
   163309       if (devinfo->is_haswell) {
   163310          return 32;
   163311       } else {
   163312          return 32;
   163313       }
   163314    case 6: return 32;
   163315    case 5: return 0;
   163316    case 4:
   163317       if (devinfo->is_g4x) {
   163318          return 0;
   163319       } else {
   163320          return 0;
   163321       }
   163322    default:
   163323       unreachable("Invalid hardware generation");
   163324    }
   163325 }
   163326 
   163327 
   163328 
   163329 #define GEN75_MI_SEMAPHORE_MBOX_SemaphoreDataDword_start  32
   163330 #define GEN7_MI_SEMAPHORE_MBOX_SemaphoreDataDword_start  32
   163331 #define GEN6_MI_SEMAPHORE_MBOX_SemaphoreDataDword_start  32
   163332 
   163333 static inline uint32_t ATTRIBUTE_PURE
   163334 MI_SEMAPHORE_MBOX_SemaphoreDataDword_start(const struct gen_device_info *devinfo)
   163335 {
   163336    switch (devinfo->gen) {
   163337    case 10: return 0;
   163338    case 9: return 0;
   163339    case 8: return 0;
   163340    case 7:
   163341       if (devinfo->is_haswell) {
   163342          return 32;
   163343       } else {
   163344          return 32;
   163345       }
   163346    case 6: return 32;
   163347    case 5: return 0;
   163348    case 4:
   163349       if (devinfo->is_g4x) {
   163350          return 0;
   163351       } else {
   163352          return 0;
   163353       }
   163354    default:
   163355       unreachable("Invalid hardware generation");
   163356    }
   163357 }
   163358 
   163359 
   163360 
   163361 /* MI_SEMAPHORE_SIGNAL */
   163362 
   163363 
   163364 #define GEN10_MI_SEMAPHORE_SIGNAL_length  2
   163365 #define GEN9_MI_SEMAPHORE_SIGNAL_length  2
   163366 #define GEN8_MI_SEMAPHORE_SIGNAL_length  2
   163367 
   163368 static inline uint32_t ATTRIBUTE_PURE
   163369 MI_SEMAPHORE_SIGNAL_length(const struct gen_device_info *devinfo)
   163370 {
   163371    switch (devinfo->gen) {
   163372    case 10: return 2;
   163373    case 9: return 2;
   163374    case 8: return 2;
   163375    case 7:
   163376       if (devinfo->is_haswell) {
   163377          return 0;
   163378       } else {
   163379          return 0;
   163380       }
   163381    case 6: return 0;
   163382    case 5: return 0;
   163383    case 4:
   163384       if (devinfo->is_g4x) {
   163385          return 0;
   163386       } else {
   163387          return 0;
   163388       }
   163389    default:
   163390       unreachable("Invalid hardware generation");
   163391    }
   163392 }
   163393 
   163394 
   163395 
   163396 /* MI_SEMAPHORE_SIGNAL::Command Type */
   163397 
   163398 
   163399 #define GEN10_MI_SEMAPHORE_SIGNAL_CommandType_bits  3
   163400 #define GEN9_MI_SEMAPHORE_SIGNAL_CommandType_bits  3
   163401 #define GEN8_MI_SEMAPHORE_SIGNAL_CommandType_bits  3
   163402 
   163403 static inline uint32_t ATTRIBUTE_PURE
   163404 MI_SEMAPHORE_SIGNAL_CommandType_bits(const struct gen_device_info *devinfo)
   163405 {
   163406    switch (devinfo->gen) {
   163407    case 10: return 3;
   163408    case 9: return 3;
   163409    case 8: return 3;
   163410    case 7:
   163411       if (devinfo->is_haswell) {
   163412          return 0;
   163413       } else {
   163414          return 0;
   163415       }
   163416    case 6: return 0;
   163417    case 5: return 0;
   163418    case 4:
   163419       if (devinfo->is_g4x) {
   163420          return 0;
   163421       } else {
   163422          return 0;
   163423       }
   163424    default:
   163425       unreachable("Invalid hardware generation");
   163426    }
   163427 }
   163428 
   163429 
   163430 
   163431 #define GEN10_MI_SEMAPHORE_SIGNAL_CommandType_start  29
   163432 #define GEN9_MI_SEMAPHORE_SIGNAL_CommandType_start  29
   163433 #define GEN8_MI_SEMAPHORE_SIGNAL_CommandType_start  29
   163434 
   163435 static inline uint32_t ATTRIBUTE_PURE
   163436 MI_SEMAPHORE_SIGNAL_CommandType_start(const struct gen_device_info *devinfo)
   163437 {
   163438    switch (devinfo->gen) {
   163439    case 10: return 29;
   163440    case 9: return 29;
   163441    case 8: return 29;
   163442    case 7:
   163443       if (devinfo->is_haswell) {
   163444          return 0;
   163445       } else {
   163446          return 0;
   163447       }
   163448    case 6: return 0;
   163449    case 5: return 0;
   163450    case 4:
   163451       if (devinfo->is_g4x) {
   163452          return 0;
   163453       } else {
   163454          return 0;
   163455       }
   163456    default:
   163457       unreachable("Invalid hardware generation");
   163458    }
   163459 }
   163460 
   163461 
   163462 
   163463 /* MI_SEMAPHORE_SIGNAL::DWord Length */
   163464 
   163465 
   163466 #define GEN10_MI_SEMAPHORE_SIGNAL_DWordLength_bits  8
   163467 #define GEN9_MI_SEMAPHORE_SIGNAL_DWordLength_bits  8
   163468 #define GEN8_MI_SEMAPHORE_SIGNAL_DWordLength_bits  8
   163469 
   163470 static inline uint32_t ATTRIBUTE_PURE
   163471 MI_SEMAPHORE_SIGNAL_DWordLength_bits(const struct gen_device_info *devinfo)
   163472 {
   163473    switch (devinfo->gen) {
   163474    case 10: return 8;
   163475    case 9: return 8;
   163476    case 8: return 8;
   163477    case 7:
   163478       if (devinfo->is_haswell) {
   163479          return 0;
   163480       } else {
   163481          return 0;
   163482       }
   163483    case 6: return 0;
   163484    case 5: return 0;
   163485    case 4:
   163486       if (devinfo->is_g4x) {
   163487          return 0;
   163488       } else {
   163489          return 0;
   163490       }
   163491    default:
   163492       unreachable("Invalid hardware generation");
   163493    }
   163494 }
   163495 
   163496 
   163497 
   163498 #define GEN10_MI_SEMAPHORE_SIGNAL_DWordLength_start  0
   163499 #define GEN9_MI_SEMAPHORE_SIGNAL_DWordLength_start  0
   163500 #define GEN8_MI_SEMAPHORE_SIGNAL_DWordLength_start  0
   163501 
   163502 static inline uint32_t ATTRIBUTE_PURE
   163503 MI_SEMAPHORE_SIGNAL_DWordLength_start(const struct gen_device_info *devinfo)
   163504 {
   163505    switch (devinfo->gen) {
   163506    case 10: return 0;
   163507    case 9: return 0;
   163508    case 8: return 0;
   163509    case 7:
   163510       if (devinfo->is_haswell) {
   163511          return 0;
   163512       } else {
   163513          return 0;
   163514       }
   163515    case 6: return 0;
   163516    case 5: return 0;
   163517    case 4:
   163518       if (devinfo->is_g4x) {
   163519          return 0;
   163520       } else {
   163521          return 0;
   163522       }
   163523    default:
   163524       unreachable("Invalid hardware generation");
   163525    }
   163526 }
   163527 
   163528 
   163529 
   163530 /* MI_SEMAPHORE_SIGNAL::MI Command Opcode */
   163531 
   163532 
   163533 #define GEN10_MI_SEMAPHORE_SIGNAL_MICommandOpcode_bits  6
   163534 #define GEN9_MI_SEMAPHORE_SIGNAL_MICommandOpcode_bits  6
   163535 #define GEN8_MI_SEMAPHORE_SIGNAL_MICommandOpcode_bits  6
   163536 
   163537 static inline uint32_t ATTRIBUTE_PURE
   163538 MI_SEMAPHORE_SIGNAL_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   163539 {
   163540    switch (devinfo->gen) {
   163541    case 10: return 6;
   163542    case 9: return 6;
   163543    case 8: return 6;
   163544    case 7:
   163545       if (devinfo->is_haswell) {
   163546          return 0;
   163547       } else {
   163548          return 0;
   163549       }
   163550    case 6: return 0;
   163551    case 5: return 0;
   163552    case 4:
   163553       if (devinfo->is_g4x) {
   163554          return 0;
   163555       } else {
   163556          return 0;
   163557       }
   163558    default:
   163559       unreachable("Invalid hardware generation");
   163560    }
   163561 }
   163562 
   163563 
   163564 
   163565 #define GEN10_MI_SEMAPHORE_SIGNAL_MICommandOpcode_start  23
   163566 #define GEN9_MI_SEMAPHORE_SIGNAL_MICommandOpcode_start  23
   163567 #define GEN8_MI_SEMAPHORE_SIGNAL_MICommandOpcode_start  23
   163568 
   163569 static inline uint32_t ATTRIBUTE_PURE
   163570 MI_SEMAPHORE_SIGNAL_MICommandOpcode_start(const struct gen_device_info *devinfo)
   163571 {
   163572    switch (devinfo->gen) {
   163573    case 10: return 23;
   163574    case 9: return 23;
   163575    case 8: return 23;
   163576    case 7:
   163577       if (devinfo->is_haswell) {
   163578          return 0;
   163579       } else {
   163580          return 0;
   163581       }
   163582    case 6: return 0;
   163583    case 5: return 0;
   163584    case 4:
   163585       if (devinfo->is_g4x) {
   163586          return 0;
   163587       } else {
   163588          return 0;
   163589       }
   163590    default:
   163591       unreachable("Invalid hardware generation");
   163592    }
   163593 }
   163594 
   163595 
   163596 
   163597 /* MI_SEMAPHORE_SIGNAL::Post-Sync Operation */
   163598 
   163599 
   163600 #define GEN10_MI_SEMAPHORE_SIGNAL_PostSyncOperation_bits  1
   163601 #define GEN9_MI_SEMAPHORE_SIGNAL_PostSyncOperation_bits  1
   163602 #define GEN8_MI_SEMAPHORE_SIGNAL_PostSyncOperation_bits  1
   163603 
   163604 static inline uint32_t ATTRIBUTE_PURE
   163605 MI_SEMAPHORE_SIGNAL_PostSyncOperation_bits(const struct gen_device_info *devinfo)
   163606 {
   163607    switch (devinfo->gen) {
   163608    case 10: return 1;
   163609    case 9: return 1;
   163610    case 8: return 1;
   163611    case 7:
   163612       if (devinfo->is_haswell) {
   163613          return 0;
   163614       } else {
   163615          return 0;
   163616       }
   163617    case 6: return 0;
   163618    case 5: return 0;
   163619    case 4:
   163620       if (devinfo->is_g4x) {
   163621          return 0;
   163622       } else {
   163623          return 0;
   163624       }
   163625    default:
   163626       unreachable("Invalid hardware generation");
   163627    }
   163628 }
   163629 
   163630 
   163631 
   163632 #define GEN10_MI_SEMAPHORE_SIGNAL_PostSyncOperation_start  21
   163633 #define GEN9_MI_SEMAPHORE_SIGNAL_PostSyncOperation_start  21
   163634 #define GEN8_MI_SEMAPHORE_SIGNAL_PostSyncOperation_start  21
   163635 
   163636 static inline uint32_t ATTRIBUTE_PURE
   163637 MI_SEMAPHORE_SIGNAL_PostSyncOperation_start(const struct gen_device_info *devinfo)
   163638 {
   163639    switch (devinfo->gen) {
   163640    case 10: return 21;
   163641    case 9: return 21;
   163642    case 8: return 21;
   163643    case 7:
   163644       if (devinfo->is_haswell) {
   163645          return 0;
   163646       } else {
   163647          return 0;
   163648       }
   163649    case 6: return 0;
   163650    case 5: return 0;
   163651    case 4:
   163652       if (devinfo->is_g4x) {
   163653          return 0;
   163654       } else {
   163655          return 0;
   163656       }
   163657    default:
   163658       unreachable("Invalid hardware generation");
   163659    }
   163660 }
   163661 
   163662 
   163663 
   163664 /* MI_SEMAPHORE_SIGNAL::Target Context ID */
   163665 
   163666 
   163667 #define GEN10_MI_SEMAPHORE_SIGNAL_TargetContextID_bits  32
   163668 #define GEN9_MI_SEMAPHORE_SIGNAL_TargetContextID_bits  32
   163669 #define GEN8_MI_SEMAPHORE_SIGNAL_TargetContextID_bits  32
   163670 
   163671 static inline uint32_t ATTRIBUTE_PURE
   163672 MI_SEMAPHORE_SIGNAL_TargetContextID_bits(const struct gen_device_info *devinfo)
   163673 {
   163674    switch (devinfo->gen) {
   163675    case 10: return 32;
   163676    case 9: return 32;
   163677    case 8: return 32;
   163678    case 7:
   163679       if (devinfo->is_haswell) {
   163680          return 0;
   163681       } else {
   163682          return 0;
   163683       }
   163684    case 6: return 0;
   163685    case 5: return 0;
   163686    case 4:
   163687       if (devinfo->is_g4x) {
   163688          return 0;
   163689       } else {
   163690          return 0;
   163691       }
   163692    default:
   163693       unreachable("Invalid hardware generation");
   163694    }
   163695 }
   163696 
   163697 
   163698 
   163699 #define GEN10_MI_SEMAPHORE_SIGNAL_TargetContextID_start  32
   163700 #define GEN9_MI_SEMAPHORE_SIGNAL_TargetContextID_start  32
   163701 #define GEN8_MI_SEMAPHORE_SIGNAL_TargetContextID_start  32
   163702 
   163703 static inline uint32_t ATTRIBUTE_PURE
   163704 MI_SEMAPHORE_SIGNAL_TargetContextID_start(const struct gen_device_info *devinfo)
   163705 {
   163706    switch (devinfo->gen) {
   163707    case 10: return 32;
   163708    case 9: return 32;
   163709    case 8: return 32;
   163710    case 7:
   163711       if (devinfo->is_haswell) {
   163712          return 0;
   163713       } else {
   163714          return 0;
   163715       }
   163716    case 6: return 0;
   163717    case 5: return 0;
   163718    case 4:
   163719       if (devinfo->is_g4x) {
   163720          return 0;
   163721       } else {
   163722          return 0;
   163723       }
   163724    default:
   163725       unreachable("Invalid hardware generation");
   163726    }
   163727 }
   163728 
   163729 
   163730 
   163731 /* MI_SEMAPHORE_SIGNAL::Target Engine Select */
   163732 
   163733 
   163734 #define GEN10_MI_SEMAPHORE_SIGNAL_TargetEngineSelect_bits  3
   163735 #define GEN9_MI_SEMAPHORE_SIGNAL_TargetEngineSelect_bits  3
   163736 #define GEN8_MI_SEMAPHORE_SIGNAL_TargetEngineSelect_bits  3
   163737 
   163738 static inline uint32_t ATTRIBUTE_PURE
   163739 MI_SEMAPHORE_SIGNAL_TargetEngineSelect_bits(const struct gen_device_info *devinfo)
   163740 {
   163741    switch (devinfo->gen) {
   163742    case 10: return 3;
   163743    case 9: return 3;
   163744    case 8: return 3;
   163745    case 7:
   163746       if (devinfo->is_haswell) {
   163747          return 0;
   163748       } else {
   163749          return 0;
   163750       }
   163751    case 6: return 0;
   163752    case 5: return 0;
   163753    case 4:
   163754       if (devinfo->is_g4x) {
   163755          return 0;
   163756       } else {
   163757          return 0;
   163758       }
   163759    default:
   163760       unreachable("Invalid hardware generation");
   163761    }
   163762 }
   163763 
   163764 
   163765 
   163766 #define GEN10_MI_SEMAPHORE_SIGNAL_TargetEngineSelect_start  15
   163767 #define GEN9_MI_SEMAPHORE_SIGNAL_TargetEngineSelect_start  15
   163768 #define GEN8_MI_SEMAPHORE_SIGNAL_TargetEngineSelect_start  15
   163769 
   163770 static inline uint32_t ATTRIBUTE_PURE
   163771 MI_SEMAPHORE_SIGNAL_TargetEngineSelect_start(const struct gen_device_info *devinfo)
   163772 {
   163773    switch (devinfo->gen) {
   163774    case 10: return 15;
   163775    case 9: return 15;
   163776    case 8: return 15;
   163777    case 7:
   163778       if (devinfo->is_haswell) {
   163779          return 0;
   163780       } else {
   163781          return 0;
   163782       }
   163783    case 6: return 0;
   163784    case 5: return 0;
   163785    case 4:
   163786       if (devinfo->is_g4x) {
   163787          return 0;
   163788       } else {
   163789          return 0;
   163790       }
   163791    default:
   163792       unreachable("Invalid hardware generation");
   163793    }
   163794 }
   163795 
   163796 
   163797 
   163798 /* MI_SEMAPHORE_WAIT */
   163799 
   163800 
   163801 #define GEN10_MI_SEMAPHORE_WAIT_length  4
   163802 #define GEN9_MI_SEMAPHORE_WAIT_length  4
   163803 #define GEN8_MI_SEMAPHORE_WAIT_length  4
   163804 
   163805 static inline uint32_t ATTRIBUTE_PURE
   163806 MI_SEMAPHORE_WAIT_length(const struct gen_device_info *devinfo)
   163807 {
   163808    switch (devinfo->gen) {
   163809    case 10: return 4;
   163810    case 9: return 4;
   163811    case 8: return 4;
   163812    case 7:
   163813       if (devinfo->is_haswell) {
   163814          return 0;
   163815       } else {
   163816          return 0;
   163817       }
   163818    case 6: return 0;
   163819    case 5: return 0;
   163820    case 4:
   163821       if (devinfo->is_g4x) {
   163822          return 0;
   163823       } else {
   163824          return 0;
   163825       }
   163826    default:
   163827       unreachable("Invalid hardware generation");
   163828    }
   163829 }
   163830 
   163831 
   163832 
   163833 /* MI_SEMAPHORE_WAIT::Command Type */
   163834 
   163835 
   163836 #define GEN10_MI_SEMAPHORE_WAIT_CommandType_bits  3
   163837 #define GEN9_MI_SEMAPHORE_WAIT_CommandType_bits  3
   163838 #define GEN8_MI_SEMAPHORE_WAIT_CommandType_bits  3
   163839 
   163840 static inline uint32_t ATTRIBUTE_PURE
   163841 MI_SEMAPHORE_WAIT_CommandType_bits(const struct gen_device_info *devinfo)
   163842 {
   163843    switch (devinfo->gen) {
   163844    case 10: return 3;
   163845    case 9: return 3;
   163846    case 8: return 3;
   163847    case 7:
   163848       if (devinfo->is_haswell) {
   163849          return 0;
   163850       } else {
   163851          return 0;
   163852       }
   163853    case 6: return 0;
   163854    case 5: return 0;
   163855    case 4:
   163856       if (devinfo->is_g4x) {
   163857          return 0;
   163858       } else {
   163859          return 0;
   163860       }
   163861    default:
   163862       unreachable("Invalid hardware generation");
   163863    }
   163864 }
   163865 
   163866 
   163867 
   163868 #define GEN10_MI_SEMAPHORE_WAIT_CommandType_start  29
   163869 #define GEN9_MI_SEMAPHORE_WAIT_CommandType_start  29
   163870 #define GEN8_MI_SEMAPHORE_WAIT_CommandType_start  29
   163871 
   163872 static inline uint32_t ATTRIBUTE_PURE
   163873 MI_SEMAPHORE_WAIT_CommandType_start(const struct gen_device_info *devinfo)
   163874 {
   163875    switch (devinfo->gen) {
   163876    case 10: return 29;
   163877    case 9: return 29;
   163878    case 8: return 29;
   163879    case 7:
   163880       if (devinfo->is_haswell) {
   163881          return 0;
   163882       } else {
   163883          return 0;
   163884       }
   163885    case 6: return 0;
   163886    case 5: return 0;
   163887    case 4:
   163888       if (devinfo->is_g4x) {
   163889          return 0;
   163890       } else {
   163891          return 0;
   163892       }
   163893    default:
   163894       unreachable("Invalid hardware generation");
   163895    }
   163896 }
   163897 
   163898 
   163899 
   163900 /* MI_SEMAPHORE_WAIT::Compare Operation */
   163901 
   163902 
   163903 #define GEN10_MI_SEMAPHORE_WAIT_CompareOperation_bits  3
   163904 #define GEN9_MI_SEMAPHORE_WAIT_CompareOperation_bits  3
   163905 #define GEN8_MI_SEMAPHORE_WAIT_CompareOperation_bits  3
   163906 
   163907 static inline uint32_t ATTRIBUTE_PURE
   163908 MI_SEMAPHORE_WAIT_CompareOperation_bits(const struct gen_device_info *devinfo)
   163909 {
   163910    switch (devinfo->gen) {
   163911    case 10: return 3;
   163912    case 9: return 3;
   163913    case 8: return 3;
   163914    case 7:
   163915       if (devinfo->is_haswell) {
   163916          return 0;
   163917       } else {
   163918          return 0;
   163919       }
   163920    case 6: return 0;
   163921    case 5: return 0;
   163922    case 4:
   163923       if (devinfo->is_g4x) {
   163924          return 0;
   163925       } else {
   163926          return 0;
   163927       }
   163928    default:
   163929       unreachable("Invalid hardware generation");
   163930    }
   163931 }
   163932 
   163933 
   163934 
   163935 #define GEN10_MI_SEMAPHORE_WAIT_CompareOperation_start  12
   163936 #define GEN9_MI_SEMAPHORE_WAIT_CompareOperation_start  12
   163937 #define GEN8_MI_SEMAPHORE_WAIT_CompareOperation_start  12
   163938 
   163939 static inline uint32_t ATTRIBUTE_PURE
   163940 MI_SEMAPHORE_WAIT_CompareOperation_start(const struct gen_device_info *devinfo)
   163941 {
   163942    switch (devinfo->gen) {
   163943    case 10: return 12;
   163944    case 9: return 12;
   163945    case 8: return 12;
   163946    case 7:
   163947       if (devinfo->is_haswell) {
   163948          return 0;
   163949       } else {
   163950          return 0;
   163951       }
   163952    case 6: return 0;
   163953    case 5: return 0;
   163954    case 4:
   163955       if (devinfo->is_g4x) {
   163956          return 0;
   163957       } else {
   163958          return 0;
   163959       }
   163960    default:
   163961       unreachable("Invalid hardware generation");
   163962    }
   163963 }
   163964 
   163965 
   163966 
   163967 /* MI_SEMAPHORE_WAIT::DWord Length */
   163968 
   163969 
   163970 #define GEN10_MI_SEMAPHORE_WAIT_DWordLength_bits  8
   163971 #define GEN9_MI_SEMAPHORE_WAIT_DWordLength_bits  8
   163972 #define GEN8_MI_SEMAPHORE_WAIT_DWordLength_bits  8
   163973 
   163974 static inline uint32_t ATTRIBUTE_PURE
   163975 MI_SEMAPHORE_WAIT_DWordLength_bits(const struct gen_device_info *devinfo)
   163976 {
   163977    switch (devinfo->gen) {
   163978    case 10: return 8;
   163979    case 9: return 8;
   163980    case 8: return 8;
   163981    case 7:
   163982       if (devinfo->is_haswell) {
   163983          return 0;
   163984       } else {
   163985          return 0;
   163986       }
   163987    case 6: return 0;
   163988    case 5: return 0;
   163989    case 4:
   163990       if (devinfo->is_g4x) {
   163991          return 0;
   163992       } else {
   163993          return 0;
   163994       }
   163995    default:
   163996       unreachable("Invalid hardware generation");
   163997    }
   163998 }
   163999 
   164000 
   164001 
   164002 #define GEN10_MI_SEMAPHORE_WAIT_DWordLength_start  0
   164003 #define GEN9_MI_SEMAPHORE_WAIT_DWordLength_start  0
   164004 #define GEN8_MI_SEMAPHORE_WAIT_DWordLength_start  0
   164005 
   164006 static inline uint32_t ATTRIBUTE_PURE
   164007 MI_SEMAPHORE_WAIT_DWordLength_start(const struct gen_device_info *devinfo)
   164008 {
   164009    switch (devinfo->gen) {
   164010    case 10: return 0;
   164011    case 9: return 0;
   164012    case 8: return 0;
   164013    case 7:
   164014       if (devinfo->is_haswell) {
   164015          return 0;
   164016       } else {
   164017          return 0;
   164018       }
   164019    case 6: return 0;
   164020    case 5: return 0;
   164021    case 4:
   164022       if (devinfo->is_g4x) {
   164023          return 0;
   164024       } else {
   164025          return 0;
   164026       }
   164027    default:
   164028       unreachable("Invalid hardware generation");
   164029    }
   164030 }
   164031 
   164032 
   164033 
   164034 /* MI_SEMAPHORE_WAIT::MI Command Opcode */
   164035 
   164036 
   164037 #define GEN10_MI_SEMAPHORE_WAIT_MICommandOpcode_bits  6
   164038 #define GEN9_MI_SEMAPHORE_WAIT_MICommandOpcode_bits  6
   164039 #define GEN8_MI_SEMAPHORE_WAIT_MICommandOpcode_bits  6
   164040 
   164041 static inline uint32_t ATTRIBUTE_PURE
   164042 MI_SEMAPHORE_WAIT_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   164043 {
   164044    switch (devinfo->gen) {
   164045    case 10: return 6;
   164046    case 9: return 6;
   164047    case 8: return 6;
   164048    case 7:
   164049       if (devinfo->is_haswell) {
   164050          return 0;
   164051       } else {
   164052          return 0;
   164053       }
   164054    case 6: return 0;
   164055    case 5: return 0;
   164056    case 4:
   164057       if (devinfo->is_g4x) {
   164058          return 0;
   164059       } else {
   164060          return 0;
   164061       }
   164062    default:
   164063       unreachable("Invalid hardware generation");
   164064    }
   164065 }
   164066 
   164067 
   164068 
   164069 #define GEN10_MI_SEMAPHORE_WAIT_MICommandOpcode_start  23
   164070 #define GEN9_MI_SEMAPHORE_WAIT_MICommandOpcode_start  23
   164071 #define GEN8_MI_SEMAPHORE_WAIT_MICommandOpcode_start  23
   164072 
   164073 static inline uint32_t ATTRIBUTE_PURE
   164074 MI_SEMAPHORE_WAIT_MICommandOpcode_start(const struct gen_device_info *devinfo)
   164075 {
   164076    switch (devinfo->gen) {
   164077    case 10: return 23;
   164078    case 9: return 23;
   164079    case 8: return 23;
   164080    case 7:
   164081       if (devinfo->is_haswell) {
   164082          return 0;
   164083       } else {
   164084          return 0;
   164085       }
   164086    case 6: return 0;
   164087    case 5: return 0;
   164088    case 4:
   164089       if (devinfo->is_g4x) {
   164090          return 0;
   164091       } else {
   164092          return 0;
   164093       }
   164094    default:
   164095       unreachable("Invalid hardware generation");
   164096    }
   164097 }
   164098 
   164099 
   164100 
   164101 /* MI_SEMAPHORE_WAIT::Memory Type */
   164102 
   164103 
   164104 #define GEN10_MI_SEMAPHORE_WAIT_MemoryType_bits  1
   164105 #define GEN9_MI_SEMAPHORE_WAIT_MemoryType_bits  1
   164106 #define GEN8_MI_SEMAPHORE_WAIT_MemoryType_bits  1
   164107 
   164108 static inline uint32_t ATTRIBUTE_PURE
   164109 MI_SEMAPHORE_WAIT_MemoryType_bits(const struct gen_device_info *devinfo)
   164110 {
   164111    switch (devinfo->gen) {
   164112    case 10: return 1;
   164113    case 9: return 1;
   164114    case 8: return 1;
   164115    case 7:
   164116       if (devinfo->is_haswell) {
   164117          return 0;
   164118       } else {
   164119          return 0;
   164120       }
   164121    case 6: return 0;
   164122    case 5: return 0;
   164123    case 4:
   164124       if (devinfo->is_g4x) {
   164125          return 0;
   164126       } else {
   164127          return 0;
   164128       }
   164129    default:
   164130       unreachable("Invalid hardware generation");
   164131    }
   164132 }
   164133 
   164134 
   164135 
   164136 #define GEN10_MI_SEMAPHORE_WAIT_MemoryType_start  22
   164137 #define GEN9_MI_SEMAPHORE_WAIT_MemoryType_start  22
   164138 #define GEN8_MI_SEMAPHORE_WAIT_MemoryType_start  22
   164139 
   164140 static inline uint32_t ATTRIBUTE_PURE
   164141 MI_SEMAPHORE_WAIT_MemoryType_start(const struct gen_device_info *devinfo)
   164142 {
   164143    switch (devinfo->gen) {
   164144    case 10: return 22;
   164145    case 9: return 22;
   164146    case 8: return 22;
   164147    case 7:
   164148       if (devinfo->is_haswell) {
   164149          return 0;
   164150       } else {
   164151          return 0;
   164152       }
   164153    case 6: return 0;
   164154    case 5: return 0;
   164155    case 4:
   164156       if (devinfo->is_g4x) {
   164157          return 0;
   164158       } else {
   164159          return 0;
   164160       }
   164161    default:
   164162       unreachable("Invalid hardware generation");
   164163    }
   164164 }
   164165 
   164166 
   164167 
   164168 /* MI_SEMAPHORE_WAIT::Register Poll Mode */
   164169 
   164170 
   164171 #define GEN10_MI_SEMAPHORE_WAIT_RegisterPollMode_bits  1
   164172 #define GEN9_MI_SEMAPHORE_WAIT_RegisterPollMode_bits  1
   164173 
   164174 static inline uint32_t ATTRIBUTE_PURE
   164175 MI_SEMAPHORE_WAIT_RegisterPollMode_bits(const struct gen_device_info *devinfo)
   164176 {
   164177    switch (devinfo->gen) {
   164178    case 10: return 1;
   164179    case 9: return 1;
   164180    case 8: return 0;
   164181    case 7:
   164182       if (devinfo->is_haswell) {
   164183          return 0;
   164184       } else {
   164185          return 0;
   164186       }
   164187    case 6: return 0;
   164188    case 5: return 0;
   164189    case 4:
   164190       if (devinfo->is_g4x) {
   164191          return 0;
   164192       } else {
   164193          return 0;
   164194       }
   164195    default:
   164196       unreachable("Invalid hardware generation");
   164197    }
   164198 }
   164199 
   164200 
   164201 
   164202 #define GEN10_MI_SEMAPHORE_WAIT_RegisterPollMode_start  16
   164203 #define GEN9_MI_SEMAPHORE_WAIT_RegisterPollMode_start  16
   164204 
   164205 static inline uint32_t ATTRIBUTE_PURE
   164206 MI_SEMAPHORE_WAIT_RegisterPollMode_start(const struct gen_device_info *devinfo)
   164207 {
   164208    switch (devinfo->gen) {
   164209    case 10: return 16;
   164210    case 9: return 16;
   164211    case 8: return 0;
   164212    case 7:
   164213       if (devinfo->is_haswell) {
   164214          return 0;
   164215       } else {
   164216          return 0;
   164217       }
   164218    case 6: return 0;
   164219    case 5: return 0;
   164220    case 4:
   164221       if (devinfo->is_g4x) {
   164222          return 0;
   164223       } else {
   164224          return 0;
   164225       }
   164226    default:
   164227       unreachable("Invalid hardware generation");
   164228    }
   164229 }
   164230 
   164231 
   164232 
   164233 /* MI_SEMAPHORE_WAIT::Semaphore Address */
   164234 
   164235 
   164236 #define GEN10_MI_SEMAPHORE_WAIT_SemaphoreAddress_bits  62
   164237 #define GEN9_MI_SEMAPHORE_WAIT_SemaphoreAddress_bits  62
   164238 #define GEN8_MI_SEMAPHORE_WAIT_SemaphoreAddress_bits  30
   164239 
   164240 static inline uint32_t ATTRIBUTE_PURE
   164241 MI_SEMAPHORE_WAIT_SemaphoreAddress_bits(const struct gen_device_info *devinfo)
   164242 {
   164243    switch (devinfo->gen) {
   164244    case 10: return 62;
   164245    case 9: return 62;
   164246    case 8: return 30;
   164247    case 7:
   164248       if (devinfo->is_haswell) {
   164249          return 0;
   164250       } else {
   164251          return 0;
   164252       }
   164253    case 6: return 0;
   164254    case 5: return 0;
   164255    case 4:
   164256       if (devinfo->is_g4x) {
   164257          return 0;
   164258       } else {
   164259          return 0;
   164260       }
   164261    default:
   164262       unreachable("Invalid hardware generation");
   164263    }
   164264 }
   164265 
   164266 
   164267 
   164268 #define GEN10_MI_SEMAPHORE_WAIT_SemaphoreAddress_start  66
   164269 #define GEN9_MI_SEMAPHORE_WAIT_SemaphoreAddress_start  66
   164270 #define GEN8_MI_SEMAPHORE_WAIT_SemaphoreAddress_start  66
   164271 
   164272 static inline uint32_t ATTRIBUTE_PURE
   164273 MI_SEMAPHORE_WAIT_SemaphoreAddress_start(const struct gen_device_info *devinfo)
   164274 {
   164275    switch (devinfo->gen) {
   164276    case 10: return 66;
   164277    case 9: return 66;
   164278    case 8: return 66;
   164279    case 7:
   164280       if (devinfo->is_haswell) {
   164281          return 0;
   164282       } else {
   164283          return 0;
   164284       }
   164285    case 6: return 0;
   164286    case 5: return 0;
   164287    case 4:
   164288       if (devinfo->is_g4x) {
   164289          return 0;
   164290       } else {
   164291          return 0;
   164292       }
   164293    default:
   164294       unreachable("Invalid hardware generation");
   164295    }
   164296 }
   164297 
   164298 
   164299 
   164300 /* MI_SEMAPHORE_WAIT::Semaphore Address High */
   164301 
   164302 
   164303 #define GEN8_MI_SEMAPHORE_WAIT_SemaphoreAddressHigh_bits  16
   164304 
   164305 static inline uint32_t ATTRIBUTE_PURE
   164306 MI_SEMAPHORE_WAIT_SemaphoreAddressHigh_bits(const struct gen_device_info *devinfo)
   164307 {
   164308    switch (devinfo->gen) {
   164309    case 10: return 0;
   164310    case 9: return 0;
   164311    case 8: return 16;
   164312    case 7:
   164313       if (devinfo->is_haswell) {
   164314          return 0;
   164315       } else {
   164316          return 0;
   164317       }
   164318    case 6: return 0;
   164319    case 5: return 0;
   164320    case 4:
   164321       if (devinfo->is_g4x) {
   164322          return 0;
   164323       } else {
   164324          return 0;
   164325       }
   164326    default:
   164327       unreachable("Invalid hardware generation");
   164328    }
   164329 }
   164330 
   164331 
   164332 
   164333 #define GEN8_MI_SEMAPHORE_WAIT_SemaphoreAddressHigh_start  96
   164334 
   164335 static inline uint32_t ATTRIBUTE_PURE
   164336 MI_SEMAPHORE_WAIT_SemaphoreAddressHigh_start(const struct gen_device_info *devinfo)
   164337 {
   164338    switch (devinfo->gen) {
   164339    case 10: return 0;
   164340    case 9: return 0;
   164341    case 8: return 96;
   164342    case 7:
   164343       if (devinfo->is_haswell) {
   164344          return 0;
   164345       } else {
   164346          return 0;
   164347       }
   164348    case 6: return 0;
   164349    case 5: return 0;
   164350    case 4:
   164351       if (devinfo->is_g4x) {
   164352          return 0;
   164353       } else {
   164354          return 0;
   164355       }
   164356    default:
   164357       unreachable("Invalid hardware generation");
   164358    }
   164359 }
   164360 
   164361 
   164362 
   164363 /* MI_SEMAPHORE_WAIT::Semaphore Data Dword */
   164364 
   164365 
   164366 #define GEN10_MI_SEMAPHORE_WAIT_SemaphoreDataDword_bits  32
   164367 #define GEN9_MI_SEMAPHORE_WAIT_SemaphoreDataDword_bits  32
   164368 #define GEN8_MI_SEMAPHORE_WAIT_SemaphoreDataDword_bits  32
   164369 
   164370 static inline uint32_t ATTRIBUTE_PURE
   164371 MI_SEMAPHORE_WAIT_SemaphoreDataDword_bits(const struct gen_device_info *devinfo)
   164372 {
   164373    switch (devinfo->gen) {
   164374    case 10: return 32;
   164375    case 9: return 32;
   164376    case 8: return 32;
   164377    case 7:
   164378       if (devinfo->is_haswell) {
   164379          return 0;
   164380       } else {
   164381          return 0;
   164382       }
   164383    case 6: return 0;
   164384    case 5: return 0;
   164385    case 4:
   164386       if (devinfo->is_g4x) {
   164387          return 0;
   164388       } else {
   164389          return 0;
   164390       }
   164391    default:
   164392       unreachable("Invalid hardware generation");
   164393    }
   164394 }
   164395 
   164396 
   164397 
   164398 #define GEN10_MI_SEMAPHORE_WAIT_SemaphoreDataDword_start  32
   164399 #define GEN9_MI_SEMAPHORE_WAIT_SemaphoreDataDword_start  32
   164400 #define GEN8_MI_SEMAPHORE_WAIT_SemaphoreDataDword_start  32
   164401 
   164402 static inline uint32_t ATTRIBUTE_PURE
   164403 MI_SEMAPHORE_WAIT_SemaphoreDataDword_start(const struct gen_device_info *devinfo)
   164404 {
   164405    switch (devinfo->gen) {
   164406    case 10: return 32;
   164407    case 9: return 32;
   164408    case 8: return 32;
   164409    case 7:
   164410       if (devinfo->is_haswell) {
   164411          return 0;
   164412       } else {
   164413          return 0;
   164414       }
   164415    case 6: return 0;
   164416    case 5: return 0;
   164417    case 4:
   164418       if (devinfo->is_g4x) {
   164419          return 0;
   164420       } else {
   164421          return 0;
   164422       }
   164423    default:
   164424       unreachable("Invalid hardware generation");
   164425    }
   164426 }
   164427 
   164428 
   164429 
   164430 /* MI_SEMAPHORE_WAIT::Wait Mode */
   164431 
   164432 
   164433 #define GEN10_MI_SEMAPHORE_WAIT_WaitMode_bits  1
   164434 #define GEN9_MI_SEMAPHORE_WAIT_WaitMode_bits  1
   164435 #define GEN8_MI_SEMAPHORE_WAIT_WaitMode_bits  1
   164436 
   164437 static inline uint32_t ATTRIBUTE_PURE
   164438 MI_SEMAPHORE_WAIT_WaitMode_bits(const struct gen_device_info *devinfo)
   164439 {
   164440    switch (devinfo->gen) {
   164441    case 10: return 1;
   164442    case 9: return 1;
   164443    case 8: return 1;
   164444    case 7:
   164445       if (devinfo->is_haswell) {
   164446          return 0;
   164447       } else {
   164448          return 0;
   164449       }
   164450    case 6: return 0;
   164451    case 5: return 0;
   164452    case 4:
   164453       if (devinfo->is_g4x) {
   164454          return 0;
   164455       } else {
   164456          return 0;
   164457       }
   164458    default:
   164459       unreachable("Invalid hardware generation");
   164460    }
   164461 }
   164462 
   164463 
   164464 
   164465 #define GEN10_MI_SEMAPHORE_WAIT_WaitMode_start  15
   164466 #define GEN9_MI_SEMAPHORE_WAIT_WaitMode_start  15
   164467 #define GEN8_MI_SEMAPHORE_WAIT_WaitMode_start  15
   164468 
   164469 static inline uint32_t ATTRIBUTE_PURE
   164470 MI_SEMAPHORE_WAIT_WaitMode_start(const struct gen_device_info *devinfo)
   164471 {
   164472    switch (devinfo->gen) {
   164473    case 10: return 15;
   164474    case 9: return 15;
   164475    case 8: return 15;
   164476    case 7:
   164477       if (devinfo->is_haswell) {
   164478          return 0;
   164479       } else {
   164480          return 0;
   164481       }
   164482    case 6: return 0;
   164483    case 5: return 0;
   164484    case 4:
   164485       if (devinfo->is_g4x) {
   164486          return 0;
   164487       } else {
   164488          return 0;
   164489       }
   164490    default:
   164491       unreachable("Invalid hardware generation");
   164492    }
   164493 }
   164494 
   164495 
   164496 
   164497 /* MI_SET_CONTEXT */
   164498 
   164499 
   164500 #define GEN10_MI_SET_CONTEXT_length  2
   164501 #define GEN9_MI_SET_CONTEXT_length  2
   164502 #define GEN8_MI_SET_CONTEXT_length  2
   164503 #define GEN75_MI_SET_CONTEXT_length  2
   164504 #define GEN7_MI_SET_CONTEXT_length  2
   164505 #define GEN6_MI_SET_CONTEXT_length  2
   164506 
   164507 static inline uint32_t ATTRIBUTE_PURE
   164508 MI_SET_CONTEXT_length(const struct gen_device_info *devinfo)
   164509 {
   164510    switch (devinfo->gen) {
   164511    case 10: return 2;
   164512    case 9: return 2;
   164513    case 8: return 2;
   164514    case 7:
   164515       if (devinfo->is_haswell) {
   164516          return 2;
   164517       } else {
   164518          return 2;
   164519       }
   164520    case 6: return 2;
   164521    case 5: return 0;
   164522    case 4:
   164523       if (devinfo->is_g4x) {
   164524          return 0;
   164525       } else {
   164526          return 0;
   164527       }
   164528    default:
   164529       unreachable("Invalid hardware generation");
   164530    }
   164531 }
   164532 
   164533 
   164534 
   164535 /* MI_SET_CONTEXT::Command Type */
   164536 
   164537 
   164538 #define GEN10_MI_SET_CONTEXT_CommandType_bits  3
   164539 #define GEN9_MI_SET_CONTEXT_CommandType_bits  3
   164540 #define GEN8_MI_SET_CONTEXT_CommandType_bits  3
   164541 #define GEN75_MI_SET_CONTEXT_CommandType_bits  3
   164542 #define GEN7_MI_SET_CONTEXT_CommandType_bits  3
   164543 #define GEN6_MI_SET_CONTEXT_CommandType_bits  3
   164544 
   164545 static inline uint32_t ATTRIBUTE_PURE
   164546 MI_SET_CONTEXT_CommandType_bits(const struct gen_device_info *devinfo)
   164547 {
   164548    switch (devinfo->gen) {
   164549    case 10: return 3;
   164550    case 9: return 3;
   164551    case 8: return 3;
   164552    case 7:
   164553       if (devinfo->is_haswell) {
   164554          return 3;
   164555       } else {
   164556          return 3;
   164557       }
   164558    case 6: return 3;
   164559    case 5: return 0;
   164560    case 4:
   164561       if (devinfo->is_g4x) {
   164562          return 0;
   164563       } else {
   164564          return 0;
   164565       }
   164566    default:
   164567       unreachable("Invalid hardware generation");
   164568    }
   164569 }
   164570 
   164571 
   164572 
   164573 #define GEN10_MI_SET_CONTEXT_CommandType_start  29
   164574 #define GEN9_MI_SET_CONTEXT_CommandType_start  29
   164575 #define GEN8_MI_SET_CONTEXT_CommandType_start  29
   164576 #define GEN75_MI_SET_CONTEXT_CommandType_start  29
   164577 #define GEN7_MI_SET_CONTEXT_CommandType_start  29
   164578 #define GEN6_MI_SET_CONTEXT_CommandType_start  29
   164579 
   164580 static inline uint32_t ATTRIBUTE_PURE
   164581 MI_SET_CONTEXT_CommandType_start(const struct gen_device_info *devinfo)
   164582 {
   164583    switch (devinfo->gen) {
   164584    case 10: return 29;
   164585    case 9: return 29;
   164586    case 8: return 29;
   164587    case 7:
   164588       if (devinfo->is_haswell) {
   164589          return 29;
   164590       } else {
   164591          return 29;
   164592       }
   164593    case 6: return 29;
   164594    case 5: return 0;
   164595    case 4:
   164596       if (devinfo->is_g4x) {
   164597          return 0;
   164598       } else {
   164599          return 0;
   164600       }
   164601    default:
   164602       unreachable("Invalid hardware generation");
   164603    }
   164604 }
   164605 
   164606 
   164607 
   164608 /* MI_SET_CONTEXT::Core Mode Enable */
   164609 
   164610 
   164611 #define GEN10_MI_SET_CONTEXT_CoreModeEnable_bits  1
   164612 #define GEN9_MI_SET_CONTEXT_CoreModeEnable_bits  1
   164613 #define GEN8_MI_SET_CONTEXT_CoreModeEnable_bits  1
   164614 #define GEN75_MI_SET_CONTEXT_CoreModeEnable_bits  1
   164615 
   164616 static inline uint32_t ATTRIBUTE_PURE
   164617 MI_SET_CONTEXT_CoreModeEnable_bits(const struct gen_device_info *devinfo)
   164618 {
   164619    switch (devinfo->gen) {
   164620    case 10: return 1;
   164621    case 9: return 1;
   164622    case 8: return 1;
   164623    case 7:
   164624       if (devinfo->is_haswell) {
   164625          return 1;
   164626       } else {
   164627          return 0;
   164628       }
   164629    case 6: return 0;
   164630    case 5: return 0;
   164631    case 4:
   164632       if (devinfo->is_g4x) {
   164633          return 0;
   164634       } else {
   164635          return 0;
   164636       }
   164637    default:
   164638       unreachable("Invalid hardware generation");
   164639    }
   164640 }
   164641 
   164642 
   164643 
   164644 #define GEN10_MI_SET_CONTEXT_CoreModeEnable_start  36
   164645 #define GEN9_MI_SET_CONTEXT_CoreModeEnable_start  36
   164646 #define GEN8_MI_SET_CONTEXT_CoreModeEnable_start  36
   164647 #define GEN75_MI_SET_CONTEXT_CoreModeEnable_start  36
   164648 
   164649 static inline uint32_t ATTRIBUTE_PURE
   164650 MI_SET_CONTEXT_CoreModeEnable_start(const struct gen_device_info *devinfo)
   164651 {
   164652    switch (devinfo->gen) {
   164653    case 10: return 36;
   164654    case 9: return 36;
   164655    case 8: return 36;
   164656    case 7:
   164657       if (devinfo->is_haswell) {
   164658          return 36;
   164659       } else {
   164660          return 0;
   164661       }
   164662    case 6: return 0;
   164663    case 5: return 0;
   164664    case 4:
   164665       if (devinfo->is_g4x) {
   164666          return 0;
   164667       } else {
   164668          return 0;
   164669       }
   164670    default:
   164671       unreachable("Invalid hardware generation");
   164672    }
   164673 }
   164674 
   164675 
   164676 
   164677 /* MI_SET_CONTEXT::DWord Length */
   164678 
   164679 
   164680 #define GEN10_MI_SET_CONTEXT_DWordLength_bits  8
   164681 #define GEN9_MI_SET_CONTEXT_DWordLength_bits  8
   164682 #define GEN8_MI_SET_CONTEXT_DWordLength_bits  8
   164683 #define GEN75_MI_SET_CONTEXT_DWordLength_bits  8
   164684 #define GEN7_MI_SET_CONTEXT_DWordLength_bits  8
   164685 #define GEN6_MI_SET_CONTEXT_DWordLength_bits  8
   164686 
   164687 static inline uint32_t ATTRIBUTE_PURE
   164688 MI_SET_CONTEXT_DWordLength_bits(const struct gen_device_info *devinfo)
   164689 {
   164690    switch (devinfo->gen) {
   164691    case 10: return 8;
   164692    case 9: return 8;
   164693    case 8: return 8;
   164694    case 7:
   164695       if (devinfo->is_haswell) {
   164696          return 8;
   164697       } else {
   164698          return 8;
   164699       }
   164700    case 6: return 8;
   164701    case 5: return 0;
   164702    case 4:
   164703       if (devinfo->is_g4x) {
   164704          return 0;
   164705       } else {
   164706          return 0;
   164707       }
   164708    default:
   164709       unreachable("Invalid hardware generation");
   164710    }
   164711 }
   164712 
   164713 
   164714 
   164715 #define GEN10_MI_SET_CONTEXT_DWordLength_start  0
   164716 #define GEN9_MI_SET_CONTEXT_DWordLength_start  0
   164717 #define GEN8_MI_SET_CONTEXT_DWordLength_start  0
   164718 #define GEN75_MI_SET_CONTEXT_DWordLength_start  0
   164719 #define GEN7_MI_SET_CONTEXT_DWordLength_start  0
   164720 #define GEN6_MI_SET_CONTEXT_DWordLength_start  0
   164721 
   164722 static inline uint32_t ATTRIBUTE_PURE
   164723 MI_SET_CONTEXT_DWordLength_start(const struct gen_device_info *devinfo)
   164724 {
   164725    switch (devinfo->gen) {
   164726    case 10: return 0;
   164727    case 9: return 0;
   164728    case 8: return 0;
   164729    case 7:
   164730       if (devinfo->is_haswell) {
   164731          return 0;
   164732       } else {
   164733          return 0;
   164734       }
   164735    case 6: return 0;
   164736    case 5: return 0;
   164737    case 4:
   164738       if (devinfo->is_g4x) {
   164739          return 0;
   164740       } else {
   164741          return 0;
   164742       }
   164743    default:
   164744       unreachable("Invalid hardware generation");
   164745    }
   164746 }
   164747 
   164748 
   164749 
   164750 /* MI_SET_CONTEXT::Extended State Restore Enable */
   164751 
   164752 
   164753 #define GEN7_MI_SET_CONTEXT_ExtendedStateRestoreEnable_bits  1
   164754 #define GEN6_MI_SET_CONTEXT_ExtendedStateRestoreEnable_bits  1
   164755 
   164756 static inline uint32_t ATTRIBUTE_PURE
   164757 MI_SET_CONTEXT_ExtendedStateRestoreEnable_bits(const struct gen_device_info *devinfo)
   164758 {
   164759    switch (devinfo->gen) {
   164760    case 10: return 0;
   164761    case 9: return 0;
   164762    case 8: return 0;
   164763    case 7:
   164764       if (devinfo->is_haswell) {
   164765          return 0;
   164766       } else {
   164767          return 1;
   164768       }
   164769    case 6: return 1;
   164770    case 5: return 0;
   164771    case 4:
   164772       if (devinfo->is_g4x) {
   164773          return 0;
   164774       } else {
   164775          return 0;
   164776       }
   164777    default:
   164778       unreachable("Invalid hardware generation");
   164779    }
   164780 }
   164781 
   164782 
   164783 
   164784 #define GEN7_MI_SET_CONTEXT_ExtendedStateRestoreEnable_start  34
   164785 #define GEN6_MI_SET_CONTEXT_ExtendedStateRestoreEnable_start  34
   164786 
   164787 static inline uint32_t ATTRIBUTE_PURE
   164788 MI_SET_CONTEXT_ExtendedStateRestoreEnable_start(const struct gen_device_info *devinfo)
   164789 {
   164790    switch (devinfo->gen) {
   164791    case 10: return 0;
   164792    case 9: return 0;
   164793    case 8: return 0;
   164794    case 7:
   164795       if (devinfo->is_haswell) {
   164796          return 0;
   164797       } else {
   164798          return 34;
   164799       }
   164800    case 6: return 34;
   164801    case 5: return 0;
   164802    case 4:
   164803       if (devinfo->is_g4x) {
   164804          return 0;
   164805       } else {
   164806          return 0;
   164807       }
   164808    default:
   164809       unreachable("Invalid hardware generation");
   164810    }
   164811 }
   164812 
   164813 
   164814 
   164815 /* MI_SET_CONTEXT::Extended State Save Enable */
   164816 
   164817 
   164818 #define GEN7_MI_SET_CONTEXT_ExtendedStateSaveEnable_bits  1
   164819 #define GEN6_MI_SET_CONTEXT_ExtendedStateSaveEnable_bits  1
   164820 
   164821 static inline uint32_t ATTRIBUTE_PURE
   164822 MI_SET_CONTEXT_ExtendedStateSaveEnable_bits(const struct gen_device_info *devinfo)
   164823 {
   164824    switch (devinfo->gen) {
   164825    case 10: return 0;
   164826    case 9: return 0;
   164827    case 8: return 0;
   164828    case 7:
   164829       if (devinfo->is_haswell) {
   164830          return 0;
   164831       } else {
   164832          return 1;
   164833       }
   164834    case 6: return 1;
   164835    case 5: return 0;
   164836    case 4:
   164837       if (devinfo->is_g4x) {
   164838          return 0;
   164839       } else {
   164840          return 0;
   164841       }
   164842    default:
   164843       unreachable("Invalid hardware generation");
   164844    }
   164845 }
   164846 
   164847 
   164848 
   164849 #define GEN7_MI_SET_CONTEXT_ExtendedStateSaveEnable_start  35
   164850 #define GEN6_MI_SET_CONTEXT_ExtendedStateSaveEnable_start  35
   164851 
   164852 static inline uint32_t ATTRIBUTE_PURE
   164853 MI_SET_CONTEXT_ExtendedStateSaveEnable_start(const struct gen_device_info *devinfo)
   164854 {
   164855    switch (devinfo->gen) {
   164856    case 10: return 0;
   164857    case 9: return 0;
   164858    case 8: return 0;
   164859    case 7:
   164860       if (devinfo->is_haswell) {
   164861          return 0;
   164862       } else {
   164863          return 35;
   164864       }
   164865    case 6: return 35;
   164866    case 5: return 0;
   164867    case 4:
   164868       if (devinfo->is_g4x) {
   164869          return 0;
   164870       } else {
   164871          return 0;
   164872       }
   164873    default:
   164874       unreachable("Invalid hardware generation");
   164875    }
   164876 }
   164877 
   164878 
   164879 
   164880 /* MI_SET_CONTEXT::Force Restore */
   164881 
   164882 
   164883 #define GEN10_MI_SET_CONTEXT_ForceRestore_bits  1
   164884 #define GEN9_MI_SET_CONTEXT_ForceRestore_bits  1
   164885 #define GEN8_MI_SET_CONTEXT_ForceRestore_bits  1
   164886 #define GEN75_MI_SET_CONTEXT_ForceRestore_bits  1
   164887 #define GEN7_MI_SET_CONTEXT_ForceRestore_bits  1
   164888 #define GEN6_MI_SET_CONTEXT_ForceRestore_bits  1
   164889 
   164890 static inline uint32_t ATTRIBUTE_PURE
   164891 MI_SET_CONTEXT_ForceRestore_bits(const struct gen_device_info *devinfo)
   164892 {
   164893    switch (devinfo->gen) {
   164894    case 10: return 1;
   164895    case 9: return 1;
   164896    case 8: return 1;
   164897    case 7:
   164898       if (devinfo->is_haswell) {
   164899          return 1;
   164900       } else {
   164901          return 1;
   164902       }
   164903    case 6: return 1;
   164904    case 5: return 0;
   164905    case 4:
   164906       if (devinfo->is_g4x) {
   164907          return 0;
   164908       } else {
   164909          return 0;
   164910       }
   164911    default:
   164912       unreachable("Invalid hardware generation");
   164913    }
   164914 }
   164915 
   164916 
   164917 
   164918 #define GEN10_MI_SET_CONTEXT_ForceRestore_start  33
   164919 #define GEN9_MI_SET_CONTEXT_ForceRestore_start  33
   164920 #define GEN8_MI_SET_CONTEXT_ForceRestore_start  33
   164921 #define GEN75_MI_SET_CONTEXT_ForceRestore_start  33
   164922 #define GEN7_MI_SET_CONTEXT_ForceRestore_start  33
   164923 #define GEN6_MI_SET_CONTEXT_ForceRestore_start  33
   164924 
   164925 static inline uint32_t ATTRIBUTE_PURE
   164926 MI_SET_CONTEXT_ForceRestore_start(const struct gen_device_info *devinfo)
   164927 {
   164928    switch (devinfo->gen) {
   164929    case 10: return 33;
   164930    case 9: return 33;
   164931    case 8: return 33;
   164932    case 7:
   164933       if (devinfo->is_haswell) {
   164934          return 33;
   164935       } else {
   164936          return 33;
   164937       }
   164938    case 6: return 33;
   164939    case 5: return 0;
   164940    case 4:
   164941       if (devinfo->is_g4x) {
   164942          return 0;
   164943       } else {
   164944          return 0;
   164945       }
   164946    default:
   164947       unreachable("Invalid hardware generation");
   164948    }
   164949 }
   164950 
   164951 
   164952 
   164953 /* MI_SET_CONTEXT::HD DVD Context */
   164954 
   164955 
   164956 #define GEN6_MI_SET_CONTEXT_HDDVDContext_bits  1
   164957 
   164958 static inline uint32_t ATTRIBUTE_PURE
   164959 MI_SET_CONTEXT_HDDVDContext_bits(const struct gen_device_info *devinfo)
   164960 {
   164961    switch (devinfo->gen) {
   164962    case 10: return 0;
   164963    case 9: return 0;
   164964    case 8: return 0;
   164965    case 7:
   164966       if (devinfo->is_haswell) {
   164967          return 0;
   164968       } else {
   164969          return 0;
   164970       }
   164971    case 6: return 1;
   164972    case 5: return 0;
   164973    case 4:
   164974       if (devinfo->is_g4x) {
   164975          return 0;
   164976       } else {
   164977          return 0;
   164978       }
   164979    default:
   164980       unreachable("Invalid hardware generation");
   164981    }
   164982 }
   164983 
   164984 
   164985 
   164986 #define GEN6_MI_SET_CONTEXT_HDDVDContext_start  41
   164987 
   164988 static inline uint32_t ATTRIBUTE_PURE
   164989 MI_SET_CONTEXT_HDDVDContext_start(const struct gen_device_info *devinfo)
   164990 {
   164991    switch (devinfo->gen) {
   164992    case 10: return 0;
   164993    case 9: return 0;
   164994    case 8: return 0;
   164995    case 7:
   164996       if (devinfo->is_haswell) {
   164997          return 0;
   164998       } else {
   164999          return 0;
   165000       }
   165001    case 6: return 41;
   165002    case 5: return 0;
   165003    case 4:
   165004       if (devinfo->is_g4x) {
   165005          return 0;
   165006       } else {
   165007          return 0;
   165008       }
   165009    default:
   165010       unreachable("Invalid hardware generation");
   165011    }
   165012 }
   165013 
   165014 
   165015 
   165016 /* MI_SET_CONTEXT::Logical Context Address */
   165017 
   165018 
   165019 #define GEN10_MI_SET_CONTEXT_LogicalContextAddress_bits  20
   165020 #define GEN9_MI_SET_CONTEXT_LogicalContextAddress_bits  20
   165021 #define GEN8_MI_SET_CONTEXT_LogicalContextAddress_bits  20
   165022 #define GEN75_MI_SET_CONTEXT_LogicalContextAddress_bits  20
   165023 #define GEN7_MI_SET_CONTEXT_LogicalContextAddress_bits  20
   165024 #define GEN6_MI_SET_CONTEXT_LogicalContextAddress_bits  20
   165025 
   165026 static inline uint32_t ATTRIBUTE_PURE
   165027 MI_SET_CONTEXT_LogicalContextAddress_bits(const struct gen_device_info *devinfo)
   165028 {
   165029    switch (devinfo->gen) {
   165030    case 10: return 20;
   165031    case 9: return 20;
   165032    case 8: return 20;
   165033    case 7:
   165034       if (devinfo->is_haswell) {
   165035          return 20;
   165036       } else {
   165037          return 20;
   165038       }
   165039    case 6: return 20;
   165040    case 5: return 0;
   165041    case 4:
   165042       if (devinfo->is_g4x) {
   165043          return 0;
   165044       } else {
   165045          return 0;
   165046       }
   165047    default:
   165048       unreachable("Invalid hardware generation");
   165049    }
   165050 }
   165051 
   165052 
   165053 
   165054 #define GEN10_MI_SET_CONTEXT_LogicalContextAddress_start  44
   165055 #define GEN9_MI_SET_CONTEXT_LogicalContextAddress_start  44
   165056 #define GEN8_MI_SET_CONTEXT_LogicalContextAddress_start  44
   165057 #define GEN75_MI_SET_CONTEXT_LogicalContextAddress_start  44
   165058 #define GEN7_MI_SET_CONTEXT_LogicalContextAddress_start  44
   165059 #define GEN6_MI_SET_CONTEXT_LogicalContextAddress_start  44
   165060 
   165061 static inline uint32_t ATTRIBUTE_PURE
   165062 MI_SET_CONTEXT_LogicalContextAddress_start(const struct gen_device_info *devinfo)
   165063 {
   165064    switch (devinfo->gen) {
   165065    case 10: return 44;
   165066    case 9: return 44;
   165067    case 8: return 44;
   165068    case 7:
   165069       if (devinfo->is_haswell) {
   165070          return 44;
   165071       } else {
   165072          return 44;
   165073       }
   165074    case 6: return 44;
   165075    case 5: return 0;
   165076    case 4:
   165077       if (devinfo->is_g4x) {
   165078          return 0;
   165079       } else {
   165080          return 0;
   165081       }
   165082    default:
   165083       unreachable("Invalid hardware generation");
   165084    }
   165085 }
   165086 
   165087 
   165088 
   165089 /* MI_SET_CONTEXT::MI Command Opcode */
   165090 
   165091 
   165092 #define GEN10_MI_SET_CONTEXT_MICommandOpcode_bits  6
   165093 #define GEN9_MI_SET_CONTEXT_MICommandOpcode_bits  6
   165094 #define GEN8_MI_SET_CONTEXT_MICommandOpcode_bits  6
   165095 #define GEN75_MI_SET_CONTEXT_MICommandOpcode_bits  6
   165096 #define GEN7_MI_SET_CONTEXT_MICommandOpcode_bits  6
   165097 #define GEN6_MI_SET_CONTEXT_MICommandOpcode_bits  6
   165098 
   165099 static inline uint32_t ATTRIBUTE_PURE
   165100 MI_SET_CONTEXT_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   165101 {
   165102    switch (devinfo->gen) {
   165103    case 10: return 6;
   165104    case 9: return 6;
   165105    case 8: return 6;
   165106    case 7:
   165107       if (devinfo->is_haswell) {
   165108          return 6;
   165109       } else {
   165110          return 6;
   165111       }
   165112    case 6: return 6;
   165113    case 5: return 0;
   165114    case 4:
   165115       if (devinfo->is_g4x) {
   165116          return 0;
   165117       } else {
   165118          return 0;
   165119       }
   165120    default:
   165121       unreachable("Invalid hardware generation");
   165122    }
   165123 }
   165124 
   165125 
   165126 
   165127 #define GEN10_MI_SET_CONTEXT_MICommandOpcode_start  23
   165128 #define GEN9_MI_SET_CONTEXT_MICommandOpcode_start  23
   165129 #define GEN8_MI_SET_CONTEXT_MICommandOpcode_start  23
   165130 #define GEN75_MI_SET_CONTEXT_MICommandOpcode_start  23
   165131 #define GEN7_MI_SET_CONTEXT_MICommandOpcode_start  23
   165132 #define GEN6_MI_SET_CONTEXT_MICommandOpcode_start  23
   165133 
   165134 static inline uint32_t ATTRIBUTE_PURE
   165135 MI_SET_CONTEXT_MICommandOpcode_start(const struct gen_device_info *devinfo)
   165136 {
   165137    switch (devinfo->gen) {
   165138    case 10: return 23;
   165139    case 9: return 23;
   165140    case 8: return 23;
   165141    case 7:
   165142       if (devinfo->is_haswell) {
   165143          return 23;
   165144       } else {
   165145          return 23;
   165146       }
   165147    case 6: return 23;
   165148    case 5: return 0;
   165149    case 4:
   165150       if (devinfo->is_g4x) {
   165151          return 0;
   165152       } else {
   165153          return 0;
   165154       }
   165155    default:
   165156       unreachable("Invalid hardware generation");
   165157    }
   165158 }
   165159 
   165160 
   165161 
   165162 /* MI_SET_CONTEXT::Reserved, Must be 1 */
   165163 
   165164 
   165165 #define GEN10_MI_SET_CONTEXT_ReservedMustbe1_bits  1
   165166 #define GEN9_MI_SET_CONTEXT_ReservedMustbe1_bits  1
   165167 #define GEN8_MI_SET_CONTEXT_ReservedMustbe1_bits  1
   165168 #define GEN75_MI_SET_CONTEXT_ReservedMustbe1_bits  1
   165169 #define GEN7_MI_SET_CONTEXT_ReservedMustbe1_bits  1
   165170 #define GEN6_MI_SET_CONTEXT_ReservedMustbe1_bits  1
   165171 
   165172 static inline uint32_t ATTRIBUTE_PURE
   165173 MI_SET_CONTEXT_ReservedMustbe1_bits(const struct gen_device_info *devinfo)
   165174 {
   165175    switch (devinfo->gen) {
   165176    case 10: return 1;
   165177    case 9: return 1;
   165178    case 8: return 1;
   165179    case 7:
   165180       if (devinfo->is_haswell) {
   165181          return 1;
   165182       } else {
   165183          return 1;
   165184       }
   165185    case 6: return 1;
   165186    case 5: return 0;
   165187    case 4:
   165188       if (devinfo->is_g4x) {
   165189          return 0;
   165190       } else {
   165191          return 0;
   165192       }
   165193    default:
   165194       unreachable("Invalid hardware generation");
   165195    }
   165196 }
   165197 
   165198 
   165199 
   165200 #define GEN10_MI_SET_CONTEXT_ReservedMustbe1_start  40
   165201 #define GEN9_MI_SET_CONTEXT_ReservedMustbe1_start  40
   165202 #define GEN8_MI_SET_CONTEXT_ReservedMustbe1_start  40
   165203 #define GEN75_MI_SET_CONTEXT_ReservedMustbe1_start  40
   165204 #define GEN7_MI_SET_CONTEXT_ReservedMustbe1_start  40
   165205 #define GEN6_MI_SET_CONTEXT_ReservedMustbe1_start  40
   165206 
   165207 static inline uint32_t ATTRIBUTE_PURE
   165208 MI_SET_CONTEXT_ReservedMustbe1_start(const struct gen_device_info *devinfo)
   165209 {
   165210    switch (devinfo->gen) {
   165211    case 10: return 40;
   165212    case 9: return 40;
   165213    case 8: return 40;
   165214    case 7:
   165215       if (devinfo->is_haswell) {
   165216          return 40;
   165217       } else {
   165218          return 40;
   165219       }
   165220    case 6: return 40;
   165221    case 5: return 0;
   165222    case 4:
   165223       if (devinfo->is_g4x) {
   165224          return 0;
   165225       } else {
   165226          return 0;
   165227       }
   165228    default:
   165229       unreachable("Invalid hardware generation");
   165230    }
   165231 }
   165232 
   165233 
   165234 
   165235 /* MI_SET_CONTEXT::Resource Streamer State Restore Enable */
   165236 
   165237 
   165238 #define GEN10_MI_SET_CONTEXT_ResourceStreamerStateRestoreEnable_bits  1
   165239 #define GEN9_MI_SET_CONTEXT_ResourceStreamerStateRestoreEnable_bits  1
   165240 #define GEN8_MI_SET_CONTEXT_ResourceStreamerStateRestoreEnable_bits  1
   165241 #define GEN75_MI_SET_CONTEXT_ResourceStreamerStateRestoreEnable_bits  1
   165242 
   165243 static inline uint32_t ATTRIBUTE_PURE
   165244 MI_SET_CONTEXT_ResourceStreamerStateRestoreEnable_bits(const struct gen_device_info *devinfo)
   165245 {
   165246    switch (devinfo->gen) {
   165247    case 10: return 1;
   165248    case 9: return 1;
   165249    case 8: return 1;
   165250    case 7:
   165251       if (devinfo->is_haswell) {
   165252          return 1;
   165253       } else {
   165254          return 0;
   165255       }
   165256    case 6: return 0;
   165257    case 5: return 0;
   165258    case 4:
   165259       if (devinfo->is_g4x) {
   165260          return 0;
   165261       } else {
   165262          return 0;
   165263       }
   165264    default:
   165265       unreachable("Invalid hardware generation");
   165266    }
   165267 }
   165268 
   165269 
   165270 
   165271 #define GEN10_MI_SET_CONTEXT_ResourceStreamerStateRestoreEnable_start  34
   165272 #define GEN9_MI_SET_CONTEXT_ResourceStreamerStateRestoreEnable_start  34
   165273 #define GEN8_MI_SET_CONTEXT_ResourceStreamerStateRestoreEnable_start  34
   165274 #define GEN75_MI_SET_CONTEXT_ResourceStreamerStateRestoreEnable_start  34
   165275 
   165276 static inline uint32_t ATTRIBUTE_PURE
   165277 MI_SET_CONTEXT_ResourceStreamerStateRestoreEnable_start(const struct gen_device_info *devinfo)
   165278 {
   165279    switch (devinfo->gen) {
   165280    case 10: return 34;
   165281    case 9: return 34;
   165282    case 8: return 34;
   165283    case 7:
   165284       if (devinfo->is_haswell) {
   165285          return 34;
   165286       } else {
   165287          return 0;
   165288       }
   165289    case 6: return 0;
   165290    case 5: return 0;
   165291    case 4:
   165292       if (devinfo->is_g4x) {
   165293          return 0;
   165294       } else {
   165295          return 0;
   165296       }
   165297    default:
   165298       unreachable("Invalid hardware generation");
   165299    }
   165300 }
   165301 
   165302 
   165303 
   165304 /* MI_SET_CONTEXT::Resource Streamer State Save Enable */
   165305 
   165306 
   165307 #define GEN10_MI_SET_CONTEXT_ResourceStreamerStateSaveEnable_bits  1
   165308 #define GEN9_MI_SET_CONTEXT_ResourceStreamerStateSaveEnable_bits  1
   165309 #define GEN8_MI_SET_CONTEXT_ResourceStreamerStateSaveEnable_bits  1
   165310 #define GEN75_MI_SET_CONTEXT_ResourceStreamerStateSaveEnable_bits  1
   165311 
   165312 static inline uint32_t ATTRIBUTE_PURE
   165313 MI_SET_CONTEXT_ResourceStreamerStateSaveEnable_bits(const struct gen_device_info *devinfo)
   165314 {
   165315    switch (devinfo->gen) {
   165316    case 10: return 1;
   165317    case 9: return 1;
   165318    case 8: return 1;
   165319    case 7:
   165320       if (devinfo->is_haswell) {
   165321          return 1;
   165322       } else {
   165323          return 0;
   165324       }
   165325    case 6: return 0;
   165326    case 5: return 0;
   165327    case 4:
   165328       if (devinfo->is_g4x) {
   165329          return 0;
   165330       } else {
   165331          return 0;
   165332       }
   165333    default:
   165334       unreachable("Invalid hardware generation");
   165335    }
   165336 }
   165337 
   165338 
   165339 
   165340 #define GEN10_MI_SET_CONTEXT_ResourceStreamerStateSaveEnable_start  35
   165341 #define GEN9_MI_SET_CONTEXT_ResourceStreamerStateSaveEnable_start  35
   165342 #define GEN8_MI_SET_CONTEXT_ResourceStreamerStateSaveEnable_start  35
   165343 #define GEN75_MI_SET_CONTEXT_ResourceStreamerStateSaveEnable_start  35
   165344 
   165345 static inline uint32_t ATTRIBUTE_PURE
   165346 MI_SET_CONTEXT_ResourceStreamerStateSaveEnable_start(const struct gen_device_info *devinfo)
   165347 {
   165348    switch (devinfo->gen) {
   165349    case 10: return 35;
   165350    case 9: return 35;
   165351    case 8: return 35;
   165352    case 7:
   165353       if (devinfo->is_haswell) {
   165354          return 35;
   165355       } else {
   165356          return 0;
   165357       }
   165358    case 6: return 0;
   165359    case 5: return 0;
   165360    case 4:
   165361       if (devinfo->is_g4x) {
   165362          return 0;
   165363       } else {
   165364          return 0;
   165365       }
   165366    default:
   165367       unreachable("Invalid hardware generation");
   165368    }
   165369 }
   165370 
   165371 
   165372 
   165373 /* MI_SET_CONTEXT::Restore Inhibit */
   165374 
   165375 
   165376 #define GEN10_MI_SET_CONTEXT_RestoreInhibit_bits  1
   165377 #define GEN9_MI_SET_CONTEXT_RestoreInhibit_bits  1
   165378 #define GEN8_MI_SET_CONTEXT_RestoreInhibit_bits  1
   165379 #define GEN75_MI_SET_CONTEXT_RestoreInhibit_bits  1
   165380 #define GEN7_MI_SET_CONTEXT_RestoreInhibit_bits  1
   165381 #define GEN6_MI_SET_CONTEXT_RestoreInhibit_bits  1
   165382 
   165383 static inline uint32_t ATTRIBUTE_PURE
   165384 MI_SET_CONTEXT_RestoreInhibit_bits(const struct gen_device_info *devinfo)
   165385 {
   165386    switch (devinfo->gen) {
   165387    case 10: return 1;
   165388    case 9: return 1;
   165389    case 8: return 1;
   165390    case 7:
   165391       if (devinfo->is_haswell) {
   165392          return 1;
   165393       } else {
   165394          return 1;
   165395       }
   165396    case 6: return 1;
   165397    case 5: return 0;
   165398    case 4:
   165399       if (devinfo->is_g4x) {
   165400          return 0;
   165401       } else {
   165402          return 0;
   165403       }
   165404    default:
   165405       unreachable("Invalid hardware generation");
   165406    }
   165407 }
   165408 
   165409 
   165410 
   165411 #define GEN10_MI_SET_CONTEXT_RestoreInhibit_start  32
   165412 #define GEN9_MI_SET_CONTEXT_RestoreInhibit_start  32
   165413 #define GEN8_MI_SET_CONTEXT_RestoreInhibit_start  32
   165414 #define GEN75_MI_SET_CONTEXT_RestoreInhibit_start  32
   165415 #define GEN7_MI_SET_CONTEXT_RestoreInhibit_start  32
   165416 #define GEN6_MI_SET_CONTEXT_RestoreInhibit_start  32
   165417 
   165418 static inline uint32_t ATTRIBUTE_PURE
   165419 MI_SET_CONTEXT_RestoreInhibit_start(const struct gen_device_info *devinfo)
   165420 {
   165421    switch (devinfo->gen) {
   165422    case 10: return 32;
   165423    case 9: return 32;
   165424    case 8: return 32;
   165425    case 7:
   165426       if (devinfo->is_haswell) {
   165427          return 32;
   165428       } else {
   165429          return 32;
   165430       }
   165431    case 6: return 32;
   165432    case 5: return 0;
   165433    case 4:
   165434       if (devinfo->is_g4x) {
   165435          return 0;
   165436       } else {
   165437          return 0;
   165438       }
   165439    default:
   165440       unreachable("Invalid hardware generation");
   165441    }
   165442 }
   165443 
   165444 
   165445 
   165446 /* MI_SET_PREDICATE */
   165447 
   165448 
   165449 #define GEN10_MI_SET_PREDICATE_length  1
   165450 #define GEN9_MI_SET_PREDICATE_length  1
   165451 #define GEN8_MI_SET_PREDICATE_length  1
   165452 #define GEN75_MI_SET_PREDICATE_length  1
   165453 
   165454 static inline uint32_t ATTRIBUTE_PURE
   165455 MI_SET_PREDICATE_length(const struct gen_device_info *devinfo)
   165456 {
   165457    switch (devinfo->gen) {
   165458    case 10: return 1;
   165459    case 9: return 1;
   165460    case 8: return 1;
   165461    case 7:
   165462       if (devinfo->is_haswell) {
   165463          return 1;
   165464       } else {
   165465          return 0;
   165466       }
   165467    case 6: return 0;
   165468    case 5: return 0;
   165469    case 4:
   165470       if (devinfo->is_g4x) {
   165471          return 0;
   165472       } else {
   165473          return 0;
   165474       }
   165475    default:
   165476       unreachable("Invalid hardware generation");
   165477    }
   165478 }
   165479 
   165480 
   165481 
   165482 /* MI_SET_PREDICATE::Command Type */
   165483 
   165484 
   165485 #define GEN10_MI_SET_PREDICATE_CommandType_bits  3
   165486 #define GEN9_MI_SET_PREDICATE_CommandType_bits  3
   165487 #define GEN8_MI_SET_PREDICATE_CommandType_bits  3
   165488 #define GEN75_MI_SET_PREDICATE_CommandType_bits  3
   165489 
   165490 static inline uint32_t ATTRIBUTE_PURE
   165491 MI_SET_PREDICATE_CommandType_bits(const struct gen_device_info *devinfo)
   165492 {
   165493    switch (devinfo->gen) {
   165494    case 10: return 3;
   165495    case 9: return 3;
   165496    case 8: return 3;
   165497    case 7:
   165498       if (devinfo->is_haswell) {
   165499          return 3;
   165500       } else {
   165501          return 0;
   165502       }
   165503    case 6: return 0;
   165504    case 5: return 0;
   165505    case 4:
   165506       if (devinfo->is_g4x) {
   165507          return 0;
   165508       } else {
   165509          return 0;
   165510       }
   165511    default:
   165512       unreachable("Invalid hardware generation");
   165513    }
   165514 }
   165515 
   165516 
   165517 
   165518 #define GEN10_MI_SET_PREDICATE_CommandType_start  29
   165519 #define GEN9_MI_SET_PREDICATE_CommandType_start  29
   165520 #define GEN8_MI_SET_PREDICATE_CommandType_start  29
   165521 #define GEN75_MI_SET_PREDICATE_CommandType_start  29
   165522 
   165523 static inline uint32_t ATTRIBUTE_PURE
   165524 MI_SET_PREDICATE_CommandType_start(const struct gen_device_info *devinfo)
   165525 {
   165526    switch (devinfo->gen) {
   165527    case 10: return 29;
   165528    case 9: return 29;
   165529    case 8: return 29;
   165530    case 7:
   165531       if (devinfo->is_haswell) {
   165532          return 29;
   165533       } else {
   165534          return 0;
   165535       }
   165536    case 6: return 0;
   165537    case 5: return 0;
   165538    case 4:
   165539       if (devinfo->is_g4x) {
   165540          return 0;
   165541       } else {
   165542          return 0;
   165543       }
   165544    default:
   165545       unreachable("Invalid hardware generation");
   165546    }
   165547 }
   165548 
   165549 
   165550 
   165551 /* MI_SET_PREDICATE::MI Command Opcode */
   165552 
   165553 
   165554 #define GEN10_MI_SET_PREDICATE_MICommandOpcode_bits  6
   165555 #define GEN9_MI_SET_PREDICATE_MICommandOpcode_bits  6
   165556 #define GEN8_MI_SET_PREDICATE_MICommandOpcode_bits  6
   165557 #define GEN75_MI_SET_PREDICATE_MICommandOpcode_bits  6
   165558 
   165559 static inline uint32_t ATTRIBUTE_PURE
   165560 MI_SET_PREDICATE_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   165561 {
   165562    switch (devinfo->gen) {
   165563    case 10: return 6;
   165564    case 9: return 6;
   165565    case 8: return 6;
   165566    case 7:
   165567       if (devinfo->is_haswell) {
   165568          return 6;
   165569       } else {
   165570          return 0;
   165571       }
   165572    case 6: return 0;
   165573    case 5: return 0;
   165574    case 4:
   165575       if (devinfo->is_g4x) {
   165576          return 0;
   165577       } else {
   165578          return 0;
   165579       }
   165580    default:
   165581       unreachable("Invalid hardware generation");
   165582    }
   165583 }
   165584 
   165585 
   165586 
   165587 #define GEN10_MI_SET_PREDICATE_MICommandOpcode_start  23
   165588 #define GEN9_MI_SET_PREDICATE_MICommandOpcode_start  23
   165589 #define GEN8_MI_SET_PREDICATE_MICommandOpcode_start  23
   165590 #define GEN75_MI_SET_PREDICATE_MICommandOpcode_start  23
   165591 
   165592 static inline uint32_t ATTRIBUTE_PURE
   165593 MI_SET_PREDICATE_MICommandOpcode_start(const struct gen_device_info *devinfo)
   165594 {
   165595    switch (devinfo->gen) {
   165596    case 10: return 23;
   165597    case 9: return 23;
   165598    case 8: return 23;
   165599    case 7:
   165600       if (devinfo->is_haswell) {
   165601          return 23;
   165602       } else {
   165603          return 0;
   165604       }
   165605    case 6: return 0;
   165606    case 5: return 0;
   165607    case 4:
   165608       if (devinfo->is_g4x) {
   165609          return 0;
   165610       } else {
   165611          return 0;
   165612       }
   165613    default:
   165614       unreachable("Invalid hardware generation");
   165615    }
   165616 }
   165617 
   165618 
   165619 
   165620 /* MI_SET_PREDICATE::PREDICATE ENABLE */
   165621 
   165622 
   165623 #define GEN10_MI_SET_PREDICATE_PREDICATEENABLE_bits  4
   165624 #define GEN9_MI_SET_PREDICATE_PREDICATEENABLE_bits  4
   165625 #define GEN8_MI_SET_PREDICATE_PREDICATEENABLE_bits  4
   165626 #define GEN75_MI_SET_PREDICATE_PREDICATEENABLE_bits  2
   165627 
   165628 static inline uint32_t ATTRIBUTE_PURE
   165629 MI_SET_PREDICATE_PREDICATEENABLE_bits(const struct gen_device_info *devinfo)
   165630 {
   165631    switch (devinfo->gen) {
   165632    case 10: return 4;
   165633    case 9: return 4;
   165634    case 8: return 4;
   165635    case 7:
   165636       if (devinfo->is_haswell) {
   165637          return 2;
   165638       } else {
   165639          return 0;
   165640       }
   165641    case 6: return 0;
   165642    case 5: return 0;
   165643    case 4:
   165644       if (devinfo->is_g4x) {
   165645          return 0;
   165646       } else {
   165647          return 0;
   165648       }
   165649    default:
   165650       unreachable("Invalid hardware generation");
   165651    }
   165652 }
   165653 
   165654 
   165655 
   165656 #define GEN10_MI_SET_PREDICATE_PREDICATEENABLE_start  0
   165657 #define GEN9_MI_SET_PREDICATE_PREDICATEENABLE_start  0
   165658 #define GEN8_MI_SET_PREDICATE_PREDICATEENABLE_start  0
   165659 #define GEN75_MI_SET_PREDICATE_PREDICATEENABLE_start  0
   165660 
   165661 static inline uint32_t ATTRIBUTE_PURE
   165662 MI_SET_PREDICATE_PREDICATEENABLE_start(const struct gen_device_info *devinfo)
   165663 {
   165664    switch (devinfo->gen) {
   165665    case 10: return 0;
   165666    case 9: return 0;
   165667    case 8: return 0;
   165668    case 7:
   165669       if (devinfo->is_haswell) {
   165670          return 0;
   165671       } else {
   165672          return 0;
   165673       }
   165674    case 6: return 0;
   165675    case 5: return 0;
   165676    case 4:
   165677       if (devinfo->is_g4x) {
   165678          return 0;
   165679       } else {
   165680          return 0;
   165681       }
   165682    default:
   165683       unreachable("Invalid hardware generation");
   165684    }
   165685 }
   165686 
   165687 
   165688 
   165689 /* MI_STORE_DATA_IMM */
   165690 
   165691 
   165692 #define GEN10_MI_STORE_DATA_IMM_length  4
   165693 #define GEN9_MI_STORE_DATA_IMM_length  4
   165694 #define GEN8_MI_STORE_DATA_IMM_length  4
   165695 #define GEN75_MI_STORE_DATA_IMM_length  4
   165696 #define GEN7_MI_STORE_DATA_IMM_length  4
   165697 #define GEN6_MI_STORE_DATA_IMM_length  4
   165698 #define GEN5_MI_STORE_DATA_IMM_length  5
   165699 #define GEN45_MI_STORE_DATA_IMM_length  5
   165700 #define GEN4_MI_STORE_DATA_IMM_length  5
   165701 
   165702 static inline uint32_t ATTRIBUTE_PURE
   165703 MI_STORE_DATA_IMM_length(const struct gen_device_info *devinfo)
   165704 {
   165705    switch (devinfo->gen) {
   165706    case 10: return 4;
   165707    case 9: return 4;
   165708    case 8: return 4;
   165709    case 7:
   165710       if (devinfo->is_haswell) {
   165711          return 4;
   165712       } else {
   165713          return 4;
   165714       }
   165715    case 6: return 4;
   165716    case 5: return 5;
   165717    case 4:
   165718       if (devinfo->is_g4x) {
   165719          return 5;
   165720       } else {
   165721          return 5;
   165722       }
   165723    default:
   165724       unreachable("Invalid hardware generation");
   165725    }
   165726 }
   165727 
   165728 
   165729 
   165730 /* MI_STORE_DATA_IMM::Address */
   165731 
   165732 
   165733 #define GEN10_MI_STORE_DATA_IMM_Address_bits  46
   165734 #define GEN9_MI_STORE_DATA_IMM_Address_bits  46
   165735 #define GEN8_MI_STORE_DATA_IMM_Address_bits  46
   165736 #define GEN75_MI_STORE_DATA_IMM_Address_bits  30
   165737 #define GEN7_MI_STORE_DATA_IMM_Address_bits  30
   165738 #define GEN6_MI_STORE_DATA_IMM_Address_bits  30
   165739 #define GEN5_MI_STORE_DATA_IMM_Address_bits  30
   165740 #define GEN45_MI_STORE_DATA_IMM_Address_bits  30
   165741 #define GEN4_MI_STORE_DATA_IMM_Address_bits  30
   165742 
   165743 static inline uint32_t ATTRIBUTE_PURE
   165744 MI_STORE_DATA_IMM_Address_bits(const struct gen_device_info *devinfo)
   165745 {
   165746    switch (devinfo->gen) {
   165747    case 10: return 46;
   165748    case 9: return 46;
   165749    case 8: return 46;
   165750    case 7:
   165751       if (devinfo->is_haswell) {
   165752          return 30;
   165753       } else {
   165754          return 30;
   165755       }
   165756    case 6: return 30;
   165757    case 5: return 30;
   165758    case 4:
   165759       if (devinfo->is_g4x) {
   165760          return 30;
   165761       } else {
   165762          return 30;
   165763       }
   165764    default:
   165765       unreachable("Invalid hardware generation");
   165766    }
   165767 }
   165768 
   165769 
   165770 
   165771 #define GEN10_MI_STORE_DATA_IMM_Address_start  34
   165772 #define GEN9_MI_STORE_DATA_IMM_Address_start  34
   165773 #define GEN8_MI_STORE_DATA_IMM_Address_start  34
   165774 #define GEN75_MI_STORE_DATA_IMM_Address_start  66
   165775 #define GEN7_MI_STORE_DATA_IMM_Address_start  66
   165776 #define GEN6_MI_STORE_DATA_IMM_Address_start  66
   165777 #define GEN5_MI_STORE_DATA_IMM_Address_start  66
   165778 #define GEN45_MI_STORE_DATA_IMM_Address_start  66
   165779 #define GEN4_MI_STORE_DATA_IMM_Address_start  66
   165780 
   165781 static inline uint32_t ATTRIBUTE_PURE
   165782 MI_STORE_DATA_IMM_Address_start(const struct gen_device_info *devinfo)
   165783 {
   165784    switch (devinfo->gen) {
   165785    case 10: return 34;
   165786    case 9: return 34;
   165787    case 8: return 34;
   165788    case 7:
   165789       if (devinfo->is_haswell) {
   165790          return 66;
   165791       } else {
   165792          return 66;
   165793       }
   165794    case 6: return 66;
   165795    case 5: return 66;
   165796    case 4:
   165797       if (devinfo->is_g4x) {
   165798          return 66;
   165799       } else {
   165800          return 66;
   165801       }
   165802    default:
   165803       unreachable("Invalid hardware generation");
   165804    }
   165805 }
   165806 
   165807 
   165808 
   165809 /* MI_STORE_DATA_IMM::BitFieldName */
   165810 
   165811 
   165812 #define GEN45_MI_STORE_DATA_IMM_BitFieldName_bits  1
   165813 #define GEN4_MI_STORE_DATA_IMM_BitFieldName_bits  1
   165814 
   165815 static inline uint32_t ATTRIBUTE_PURE
   165816 MI_STORE_DATA_IMM_BitFieldName_bits(const struct gen_device_info *devinfo)
   165817 {
   165818    switch (devinfo->gen) {
   165819    case 10: return 0;
   165820    case 9: return 0;
   165821    case 8: return 0;
   165822    case 7:
   165823       if (devinfo->is_haswell) {
   165824          return 0;
   165825       } else {
   165826          return 0;
   165827       }
   165828    case 6: return 0;
   165829    case 5: return 0;
   165830    case 4:
   165831       if (devinfo->is_g4x) {
   165832          return 1;
   165833       } else {
   165834          return 1;
   165835       }
   165836    default:
   165837       unreachable("Invalid hardware generation");
   165838    }
   165839 }
   165840 
   165841 
   165842 
   165843 #define GEN45_MI_STORE_DATA_IMM_BitFieldName_start  21
   165844 #define GEN4_MI_STORE_DATA_IMM_BitFieldName_start  21
   165845 
   165846 static inline uint32_t ATTRIBUTE_PURE
   165847 MI_STORE_DATA_IMM_BitFieldName_start(const struct gen_device_info *devinfo)
   165848 {
   165849    switch (devinfo->gen) {
   165850    case 10: return 0;
   165851    case 9: return 0;
   165852    case 8: return 0;
   165853    case 7:
   165854       if (devinfo->is_haswell) {
   165855          return 0;
   165856       } else {
   165857          return 0;
   165858       }
   165859    case 6: return 0;
   165860    case 5: return 0;
   165861    case 4:
   165862       if (devinfo->is_g4x) {
   165863          return 21;
   165864       } else {
   165865          return 21;
   165866       }
   165867    default:
   165868       unreachable("Invalid hardware generation");
   165869    }
   165870 }
   165871 
   165872 
   165873 
   165874 /* MI_STORE_DATA_IMM::Command Type */
   165875 
   165876 
   165877 #define GEN10_MI_STORE_DATA_IMM_CommandType_bits  3
   165878 #define GEN9_MI_STORE_DATA_IMM_CommandType_bits  3
   165879 #define GEN8_MI_STORE_DATA_IMM_CommandType_bits  3
   165880 #define GEN75_MI_STORE_DATA_IMM_CommandType_bits  3
   165881 #define GEN7_MI_STORE_DATA_IMM_CommandType_bits  3
   165882 #define GEN6_MI_STORE_DATA_IMM_CommandType_bits  3
   165883 #define GEN5_MI_STORE_DATA_IMM_CommandType_bits  3
   165884 #define GEN45_MI_STORE_DATA_IMM_CommandType_bits  3
   165885 #define GEN4_MI_STORE_DATA_IMM_CommandType_bits  3
   165886 
   165887 static inline uint32_t ATTRIBUTE_PURE
   165888 MI_STORE_DATA_IMM_CommandType_bits(const struct gen_device_info *devinfo)
   165889 {
   165890    switch (devinfo->gen) {
   165891    case 10: return 3;
   165892    case 9: return 3;
   165893    case 8: return 3;
   165894    case 7:
   165895       if (devinfo->is_haswell) {
   165896          return 3;
   165897       } else {
   165898          return 3;
   165899       }
   165900    case 6: return 3;
   165901    case 5: return 3;
   165902    case 4:
   165903       if (devinfo->is_g4x) {
   165904          return 3;
   165905       } else {
   165906          return 3;
   165907       }
   165908    default:
   165909       unreachable("Invalid hardware generation");
   165910    }
   165911 }
   165912 
   165913 
   165914 
   165915 #define GEN10_MI_STORE_DATA_IMM_CommandType_start  29
   165916 #define GEN9_MI_STORE_DATA_IMM_CommandType_start  29
   165917 #define GEN8_MI_STORE_DATA_IMM_CommandType_start  29
   165918 #define GEN75_MI_STORE_DATA_IMM_CommandType_start  29
   165919 #define GEN7_MI_STORE_DATA_IMM_CommandType_start  29
   165920 #define GEN6_MI_STORE_DATA_IMM_CommandType_start  29
   165921 #define GEN5_MI_STORE_DATA_IMM_CommandType_start  29
   165922 #define GEN45_MI_STORE_DATA_IMM_CommandType_start  29
   165923 #define GEN4_MI_STORE_DATA_IMM_CommandType_start  29
   165924 
   165925 static inline uint32_t ATTRIBUTE_PURE
   165926 MI_STORE_DATA_IMM_CommandType_start(const struct gen_device_info *devinfo)
   165927 {
   165928    switch (devinfo->gen) {
   165929    case 10: return 29;
   165930    case 9: return 29;
   165931    case 8: return 29;
   165932    case 7:
   165933       if (devinfo->is_haswell) {
   165934          return 29;
   165935       } else {
   165936          return 29;
   165937       }
   165938    case 6: return 29;
   165939    case 5: return 29;
   165940    case 4:
   165941       if (devinfo->is_g4x) {
   165942          return 29;
   165943       } else {
   165944          return 29;
   165945       }
   165946    default:
   165947       unreachable("Invalid hardware generation");
   165948    }
   165949 }
   165950 
   165951 
   165952 
   165953 /* MI_STORE_DATA_IMM::Core Mode Enable */
   165954 
   165955 
   165956 #define GEN10_MI_STORE_DATA_IMM_CoreModeEnable_bits  1
   165957 #define GEN9_MI_STORE_DATA_IMM_CoreModeEnable_bits  1
   165958 #define GEN8_MI_STORE_DATA_IMM_CoreModeEnable_bits  1
   165959 #define GEN75_MI_STORE_DATA_IMM_CoreModeEnable_bits  1
   165960 #define GEN7_MI_STORE_DATA_IMM_CoreModeEnable_bits  1
   165961 #define GEN6_MI_STORE_DATA_IMM_CoreModeEnable_bits  1
   165962 
   165963 static inline uint32_t ATTRIBUTE_PURE
   165964 MI_STORE_DATA_IMM_CoreModeEnable_bits(const struct gen_device_info *devinfo)
   165965 {
   165966    switch (devinfo->gen) {
   165967    case 10: return 1;
   165968    case 9: return 1;
   165969    case 8: return 1;
   165970    case 7:
   165971       if (devinfo->is_haswell) {
   165972          return 1;
   165973       } else {
   165974          return 1;
   165975       }
   165976    case 6: return 1;
   165977    case 5: return 0;
   165978    case 4:
   165979       if (devinfo->is_g4x) {
   165980          return 0;
   165981       } else {
   165982          return 0;
   165983       }
   165984    default:
   165985       unreachable("Invalid hardware generation");
   165986    }
   165987 }
   165988 
   165989 
   165990 
   165991 #define GEN10_MI_STORE_DATA_IMM_CoreModeEnable_start  32
   165992 #define GEN9_MI_STORE_DATA_IMM_CoreModeEnable_start  32
   165993 #define GEN8_MI_STORE_DATA_IMM_CoreModeEnable_start  32
   165994 #define GEN75_MI_STORE_DATA_IMM_CoreModeEnable_start  64
   165995 #define GEN7_MI_STORE_DATA_IMM_CoreModeEnable_start  64
   165996 #define GEN6_MI_STORE_DATA_IMM_CoreModeEnable_start  64
   165997 
   165998 static inline uint32_t ATTRIBUTE_PURE
   165999 MI_STORE_DATA_IMM_CoreModeEnable_start(const struct gen_device_info *devinfo)
   166000 {
   166001    switch (devinfo->gen) {
   166002    case 10: return 32;
   166003    case 9: return 32;
   166004    case 8: return 32;
   166005    case 7:
   166006       if (devinfo->is_haswell) {
   166007          return 64;
   166008       } else {
   166009          return 64;
   166010       }
   166011    case 6: return 64;
   166012    case 5: return 0;
   166013    case 4:
   166014       if (devinfo->is_g4x) {
   166015          return 0;
   166016       } else {
   166017          return 0;
   166018       }
   166019    default:
   166020       unreachable("Invalid hardware generation");
   166021    }
   166022 }
   166023 
   166024 
   166025 
   166026 /* MI_STORE_DATA_IMM::DWord Length */
   166027 
   166028 
   166029 #define GEN10_MI_STORE_DATA_IMM_DWordLength_bits  10
   166030 #define GEN9_MI_STORE_DATA_IMM_DWordLength_bits  10
   166031 #define GEN8_MI_STORE_DATA_IMM_DWordLength_bits  10
   166032 #define GEN75_MI_STORE_DATA_IMM_DWordLength_bits  6
   166033 #define GEN7_MI_STORE_DATA_IMM_DWordLength_bits  6
   166034 #define GEN6_MI_STORE_DATA_IMM_DWordLength_bits  6
   166035 #define GEN5_MI_STORE_DATA_IMM_DWordLength_bits  6
   166036 #define GEN45_MI_STORE_DATA_IMM_DWordLength_bits  6
   166037 #define GEN4_MI_STORE_DATA_IMM_DWordLength_bits  6
   166038 
   166039 static inline uint32_t ATTRIBUTE_PURE
   166040 MI_STORE_DATA_IMM_DWordLength_bits(const struct gen_device_info *devinfo)
   166041 {
   166042    switch (devinfo->gen) {
   166043    case 10: return 10;
   166044    case 9: return 10;
   166045    case 8: return 10;
   166046    case 7:
   166047       if (devinfo->is_haswell) {
   166048          return 6;
   166049       } else {
   166050          return 6;
   166051       }
   166052    case 6: return 6;
   166053    case 5: return 6;
   166054    case 4:
   166055       if (devinfo->is_g4x) {
   166056          return 6;
   166057       } else {
   166058          return 6;
   166059       }
   166060    default:
   166061       unreachable("Invalid hardware generation");
   166062    }
   166063 }
   166064 
   166065 
   166066 
   166067 #define GEN10_MI_STORE_DATA_IMM_DWordLength_start  0
   166068 #define GEN9_MI_STORE_DATA_IMM_DWordLength_start  0
   166069 #define GEN8_MI_STORE_DATA_IMM_DWordLength_start  0
   166070 #define GEN75_MI_STORE_DATA_IMM_DWordLength_start  0
   166071 #define GEN7_MI_STORE_DATA_IMM_DWordLength_start  0
   166072 #define GEN6_MI_STORE_DATA_IMM_DWordLength_start  0
   166073 #define GEN5_MI_STORE_DATA_IMM_DWordLength_start  0
   166074 #define GEN45_MI_STORE_DATA_IMM_DWordLength_start  0
   166075 #define GEN4_MI_STORE_DATA_IMM_DWordLength_start  0
   166076 
   166077 static inline uint32_t ATTRIBUTE_PURE
   166078 MI_STORE_DATA_IMM_DWordLength_start(const struct gen_device_info *devinfo)
   166079 {
   166080    switch (devinfo->gen) {
   166081    case 10: return 0;
   166082    case 9: return 0;
   166083    case 8: return 0;
   166084    case 7:
   166085       if (devinfo->is_haswell) {
   166086          return 0;
   166087       } else {
   166088          return 0;
   166089       }
   166090    case 6: return 0;
   166091    case 5: return 0;
   166092    case 4:
   166093       if (devinfo->is_g4x) {
   166094          return 0;
   166095       } else {
   166096          return 0;
   166097       }
   166098    default:
   166099       unreachable("Invalid hardware generation");
   166100    }
   166101 }
   166102 
   166103 
   166104 
   166105 /* MI_STORE_DATA_IMM::Data DWord 0 */
   166106 
   166107 
   166108 #define GEN5_MI_STORE_DATA_IMM_DataDWord0_bits  32
   166109 #define GEN45_MI_STORE_DATA_IMM_DataDWord0_bits  32
   166110 #define GEN4_MI_STORE_DATA_IMM_DataDWord0_bits  32
   166111 
   166112 static inline uint32_t ATTRIBUTE_PURE
   166113 MI_STORE_DATA_IMM_DataDWord0_bits(const struct gen_device_info *devinfo)
   166114 {
   166115    switch (devinfo->gen) {
   166116    case 10: return 0;
   166117    case 9: return 0;
   166118    case 8: return 0;
   166119    case 7:
   166120       if (devinfo->is_haswell) {
   166121          return 0;
   166122       } else {
   166123          return 0;
   166124       }
   166125    case 6: return 0;
   166126    case 5: return 32;
   166127    case 4:
   166128       if (devinfo->is_g4x) {
   166129          return 32;
   166130       } else {
   166131          return 32;
   166132       }
   166133    default:
   166134       unreachable("Invalid hardware generation");
   166135    }
   166136 }
   166137 
   166138 
   166139 
   166140 #define GEN5_MI_STORE_DATA_IMM_DataDWord0_start  96
   166141 #define GEN45_MI_STORE_DATA_IMM_DataDWord0_start  96
   166142 #define GEN4_MI_STORE_DATA_IMM_DataDWord0_start  96
   166143 
   166144 static inline uint32_t ATTRIBUTE_PURE
   166145 MI_STORE_DATA_IMM_DataDWord0_start(const struct gen_device_info *devinfo)
   166146 {
   166147    switch (devinfo->gen) {
   166148    case 10: return 0;
   166149    case 9: return 0;
   166150    case 8: return 0;
   166151    case 7:
   166152       if (devinfo->is_haswell) {
   166153          return 0;
   166154       } else {
   166155          return 0;
   166156       }
   166157    case 6: return 0;
   166158    case 5: return 96;
   166159    case 4:
   166160       if (devinfo->is_g4x) {
   166161          return 96;
   166162       } else {
   166163          return 96;
   166164       }
   166165    default:
   166166       unreachable("Invalid hardware generation");
   166167    }
   166168 }
   166169 
   166170 
   166171 
   166172 /* MI_STORE_DATA_IMM::Data DWord 1 */
   166173 
   166174 
   166175 #define GEN5_MI_STORE_DATA_IMM_DataDWord1_bits  32
   166176 #define GEN45_MI_STORE_DATA_IMM_DataDWord1_bits  32
   166177 #define GEN4_MI_STORE_DATA_IMM_DataDWord1_bits  32
   166178 
   166179 static inline uint32_t ATTRIBUTE_PURE
   166180 MI_STORE_DATA_IMM_DataDWord1_bits(const struct gen_device_info *devinfo)
   166181 {
   166182    switch (devinfo->gen) {
   166183    case 10: return 0;
   166184    case 9: return 0;
   166185    case 8: return 0;
   166186    case 7:
   166187       if (devinfo->is_haswell) {
   166188          return 0;
   166189       } else {
   166190          return 0;
   166191       }
   166192    case 6: return 0;
   166193    case 5: return 32;
   166194    case 4:
   166195       if (devinfo->is_g4x) {
   166196          return 32;
   166197       } else {
   166198          return 32;
   166199       }
   166200    default:
   166201       unreachable("Invalid hardware generation");
   166202    }
   166203 }
   166204 
   166205 
   166206 
   166207 #define GEN5_MI_STORE_DATA_IMM_DataDWord1_start  128
   166208 #define GEN45_MI_STORE_DATA_IMM_DataDWord1_start  128
   166209 #define GEN4_MI_STORE_DATA_IMM_DataDWord1_start  128
   166210 
   166211 static inline uint32_t ATTRIBUTE_PURE
   166212 MI_STORE_DATA_IMM_DataDWord1_start(const struct gen_device_info *devinfo)
   166213 {
   166214    switch (devinfo->gen) {
   166215    case 10: return 0;
   166216    case 9: return 0;
   166217    case 8: return 0;
   166218    case 7:
   166219       if (devinfo->is_haswell) {
   166220          return 0;
   166221       } else {
   166222          return 0;
   166223       }
   166224    case 6: return 0;
   166225    case 5: return 128;
   166226    case 4:
   166227       if (devinfo->is_g4x) {
   166228          return 128;
   166229       } else {
   166230          return 128;
   166231       }
   166232    default:
   166233       unreachable("Invalid hardware generation");
   166234    }
   166235 }
   166236 
   166237 
   166238 
   166239 /* MI_STORE_DATA_IMM::Immediate Data */
   166240 
   166241 
   166242 #define GEN10_MI_STORE_DATA_IMM_ImmediateData_bits  64
   166243 #define GEN9_MI_STORE_DATA_IMM_ImmediateData_bits  64
   166244 #define GEN8_MI_STORE_DATA_IMM_ImmediateData_bits  64
   166245 #define GEN75_MI_STORE_DATA_IMM_ImmediateData_bits  64
   166246 #define GEN7_MI_STORE_DATA_IMM_ImmediateData_bits  64
   166247 #define GEN6_MI_STORE_DATA_IMM_ImmediateData_bits  64
   166248 
   166249 static inline uint32_t ATTRIBUTE_PURE
   166250 MI_STORE_DATA_IMM_ImmediateData_bits(const struct gen_device_info *devinfo)
   166251 {
   166252    switch (devinfo->gen) {
   166253    case 10: return 64;
   166254    case 9: return 64;
   166255    case 8: return 64;
   166256    case 7:
   166257       if (devinfo->is_haswell) {
   166258          return 64;
   166259       } else {
   166260          return 64;
   166261       }
   166262    case 6: return 64;
   166263    case 5: return 0;
   166264    case 4:
   166265       if (devinfo->is_g4x) {
   166266          return 0;
   166267       } else {
   166268          return 0;
   166269       }
   166270    default:
   166271       unreachable("Invalid hardware generation");
   166272    }
   166273 }
   166274 
   166275 
   166276 
   166277 #define GEN10_MI_STORE_DATA_IMM_ImmediateData_start  96
   166278 #define GEN9_MI_STORE_DATA_IMM_ImmediateData_start  96
   166279 #define GEN8_MI_STORE_DATA_IMM_ImmediateData_start  96
   166280 #define GEN75_MI_STORE_DATA_IMM_ImmediateData_start  96
   166281 #define GEN7_MI_STORE_DATA_IMM_ImmediateData_start  96
   166282 #define GEN6_MI_STORE_DATA_IMM_ImmediateData_start  96
   166283 
   166284 static inline uint32_t ATTRIBUTE_PURE
   166285 MI_STORE_DATA_IMM_ImmediateData_start(const struct gen_device_info *devinfo)
   166286 {
   166287    switch (devinfo->gen) {
   166288    case 10: return 96;
   166289    case 9: return 96;
   166290    case 8: return 96;
   166291    case 7:
   166292       if (devinfo->is_haswell) {
   166293          return 96;
   166294       } else {
   166295          return 96;
   166296       }
   166297    case 6: return 96;
   166298    case 5: return 0;
   166299    case 4:
   166300       if (devinfo->is_g4x) {
   166301          return 0;
   166302       } else {
   166303          return 0;
   166304       }
   166305    default:
   166306       unreachable("Invalid hardware generation");
   166307    }
   166308 }
   166309 
   166310 
   166311 
   166312 /* MI_STORE_DATA_IMM::MI Command Opcode */
   166313 
   166314 
   166315 #define GEN10_MI_STORE_DATA_IMM_MICommandOpcode_bits  6
   166316 #define GEN9_MI_STORE_DATA_IMM_MICommandOpcode_bits  6
   166317 #define GEN8_MI_STORE_DATA_IMM_MICommandOpcode_bits  6
   166318 #define GEN75_MI_STORE_DATA_IMM_MICommandOpcode_bits  6
   166319 #define GEN7_MI_STORE_DATA_IMM_MICommandOpcode_bits  6
   166320 #define GEN6_MI_STORE_DATA_IMM_MICommandOpcode_bits  6
   166321 #define GEN5_MI_STORE_DATA_IMM_MICommandOpcode_bits  6
   166322 #define GEN45_MI_STORE_DATA_IMM_MICommandOpcode_bits  6
   166323 #define GEN4_MI_STORE_DATA_IMM_MICommandOpcode_bits  6
   166324 
   166325 static inline uint32_t ATTRIBUTE_PURE
   166326 MI_STORE_DATA_IMM_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   166327 {
   166328    switch (devinfo->gen) {
   166329    case 10: return 6;
   166330    case 9: return 6;
   166331    case 8: return 6;
   166332    case 7:
   166333       if (devinfo->is_haswell) {
   166334          return 6;
   166335       } else {
   166336          return 6;
   166337       }
   166338    case 6: return 6;
   166339    case 5: return 6;
   166340    case 4:
   166341       if (devinfo->is_g4x) {
   166342          return 6;
   166343       } else {
   166344          return 6;
   166345       }
   166346    default:
   166347       unreachable("Invalid hardware generation");
   166348    }
   166349 }
   166350 
   166351 
   166352 
   166353 #define GEN10_MI_STORE_DATA_IMM_MICommandOpcode_start  23
   166354 #define GEN9_MI_STORE_DATA_IMM_MICommandOpcode_start  23
   166355 #define GEN8_MI_STORE_DATA_IMM_MICommandOpcode_start  23
   166356 #define GEN75_MI_STORE_DATA_IMM_MICommandOpcode_start  23
   166357 #define GEN7_MI_STORE_DATA_IMM_MICommandOpcode_start  23
   166358 #define GEN6_MI_STORE_DATA_IMM_MICommandOpcode_start  23
   166359 #define GEN5_MI_STORE_DATA_IMM_MICommandOpcode_start  23
   166360 #define GEN45_MI_STORE_DATA_IMM_MICommandOpcode_start  23
   166361 #define GEN4_MI_STORE_DATA_IMM_MICommandOpcode_start  23
   166362 
   166363 static inline uint32_t ATTRIBUTE_PURE
   166364 MI_STORE_DATA_IMM_MICommandOpcode_start(const struct gen_device_info *devinfo)
   166365 {
   166366    switch (devinfo->gen) {
   166367    case 10: return 23;
   166368    case 9: return 23;
   166369    case 8: return 23;
   166370    case 7:
   166371       if (devinfo->is_haswell) {
   166372          return 23;
   166373       } else {
   166374          return 23;
   166375       }
   166376    case 6: return 23;
   166377    case 5: return 23;
   166378    case 4:
   166379       if (devinfo->is_g4x) {
   166380          return 23;
   166381       } else {
   166382          return 23;
   166383       }
   166384    default:
   166385       unreachable("Invalid hardware generation");
   166386    }
   166387 }
   166388 
   166389 
   166390 
   166391 /* MI_STORE_DATA_IMM::Memory Address Type */
   166392 
   166393 
   166394 #define GEN5_MI_STORE_DATA_IMM_MemoryAddressType_bits  1
   166395 #define GEN45_MI_STORE_DATA_IMM_MemoryAddressType_bits  1
   166396 #define GEN4_MI_STORE_DATA_IMM_MemoryAddressType_bits  1
   166397 
   166398 static inline uint32_t ATTRIBUTE_PURE
   166399 MI_STORE_DATA_IMM_MemoryAddressType_bits(const struct gen_device_info *devinfo)
   166400 {
   166401    switch (devinfo->gen) {
   166402    case 10: return 0;
   166403    case 9: return 0;
   166404    case 8: return 0;
   166405    case 7:
   166406       if (devinfo->is_haswell) {
   166407          return 0;
   166408       } else {
   166409          return 0;
   166410       }
   166411    case 6: return 0;
   166412    case 5: return 1;
   166413    case 4:
   166414       if (devinfo->is_g4x) {
   166415          return 1;
   166416       } else {
   166417          return 1;
   166418       }
   166419    default:
   166420       unreachable("Invalid hardware generation");
   166421    }
   166422 }
   166423 
   166424 
   166425 
   166426 #define GEN5_MI_STORE_DATA_IMM_MemoryAddressType_start  22
   166427 #define GEN45_MI_STORE_DATA_IMM_MemoryAddressType_start  22
   166428 #define GEN4_MI_STORE_DATA_IMM_MemoryAddressType_start  22
   166429 
   166430 static inline uint32_t ATTRIBUTE_PURE
   166431 MI_STORE_DATA_IMM_MemoryAddressType_start(const struct gen_device_info *devinfo)
   166432 {
   166433    switch (devinfo->gen) {
   166434    case 10: return 0;
   166435    case 9: return 0;
   166436    case 8: return 0;
   166437    case 7:
   166438       if (devinfo->is_haswell) {
   166439          return 0;
   166440       } else {
   166441          return 0;
   166442       }
   166443    case 6: return 0;
   166444    case 5: return 22;
   166445    case 4:
   166446       if (devinfo->is_g4x) {
   166447          return 22;
   166448       } else {
   166449          return 22;
   166450       }
   166451    default:
   166452       unreachable("Invalid hardware generation");
   166453    }
   166454 }
   166455 
   166456 
   166457 
   166458 /* MI_STORE_DATA_IMM::Physical Start Address Extension */
   166459 
   166460 
   166461 #define GEN5_MI_STORE_DATA_IMM_PhysicalStartAddressExtension_bits  4
   166462 #define GEN45_MI_STORE_DATA_IMM_PhysicalStartAddressExtension_bits  4
   166463 #define GEN4_MI_STORE_DATA_IMM_PhysicalStartAddressExtension_bits  4
   166464 
   166465 static inline uint32_t ATTRIBUTE_PURE
   166466 MI_STORE_DATA_IMM_PhysicalStartAddressExtension_bits(const struct gen_device_info *devinfo)
   166467 {
   166468    switch (devinfo->gen) {
   166469    case 10: return 0;
   166470    case 9: return 0;
   166471    case 8: return 0;
   166472    case 7:
   166473       if (devinfo->is_haswell) {
   166474          return 0;
   166475       } else {
   166476          return 0;
   166477       }
   166478    case 6: return 0;
   166479    case 5: return 4;
   166480    case 4:
   166481       if (devinfo->is_g4x) {
   166482          return 4;
   166483       } else {
   166484          return 4;
   166485       }
   166486    default:
   166487       unreachable("Invalid hardware generation");
   166488    }
   166489 }
   166490 
   166491 
   166492 
   166493 #define GEN5_MI_STORE_DATA_IMM_PhysicalStartAddressExtension_start  32
   166494 #define GEN45_MI_STORE_DATA_IMM_PhysicalStartAddressExtension_start  32
   166495 #define GEN4_MI_STORE_DATA_IMM_PhysicalStartAddressExtension_start  32
   166496 
   166497 static inline uint32_t ATTRIBUTE_PURE
   166498 MI_STORE_DATA_IMM_PhysicalStartAddressExtension_start(const struct gen_device_info *devinfo)
   166499 {
   166500    switch (devinfo->gen) {
   166501    case 10: return 0;
   166502    case 9: return 0;
   166503    case 8: return 0;
   166504    case 7:
   166505       if (devinfo->is_haswell) {
   166506          return 0;
   166507       } else {
   166508          return 0;
   166509       }
   166510    case 6: return 0;
   166511    case 5: return 32;
   166512    case 4:
   166513       if (devinfo->is_g4x) {
   166514          return 32;
   166515       } else {
   166516          return 32;
   166517       }
   166518    default:
   166519       unreachable("Invalid hardware generation");
   166520    }
   166521 }
   166522 
   166523 
   166524 
   166525 /* MI_STORE_DATA_IMM::Store Qword */
   166526 
   166527 
   166528 #define GEN10_MI_STORE_DATA_IMM_StoreQword_bits  1
   166529 #define GEN9_MI_STORE_DATA_IMM_StoreQword_bits  1
   166530 #define GEN8_MI_STORE_DATA_IMM_StoreQword_bits  1
   166531 
   166532 static inline uint32_t ATTRIBUTE_PURE
   166533 MI_STORE_DATA_IMM_StoreQword_bits(const struct gen_device_info *devinfo)
   166534 {
   166535    switch (devinfo->gen) {
   166536    case 10: return 1;
   166537    case 9: return 1;
   166538    case 8: return 1;
   166539    case 7:
   166540       if (devinfo->is_haswell) {
   166541          return 0;
   166542       } else {
   166543          return 0;
   166544       }
   166545    case 6: return 0;
   166546    case 5: return 0;
   166547    case 4:
   166548       if (devinfo->is_g4x) {
   166549          return 0;
   166550       } else {
   166551          return 0;
   166552       }
   166553    default:
   166554       unreachable("Invalid hardware generation");
   166555    }
   166556 }
   166557 
   166558 
   166559 
   166560 #define GEN10_MI_STORE_DATA_IMM_StoreQword_start  21
   166561 #define GEN9_MI_STORE_DATA_IMM_StoreQword_start  21
   166562 #define GEN8_MI_STORE_DATA_IMM_StoreQword_start  21
   166563 
   166564 static inline uint32_t ATTRIBUTE_PURE
   166565 MI_STORE_DATA_IMM_StoreQword_start(const struct gen_device_info *devinfo)
   166566 {
   166567    switch (devinfo->gen) {
   166568    case 10: return 21;
   166569    case 9: return 21;
   166570    case 8: return 21;
   166571    case 7:
   166572       if (devinfo->is_haswell) {
   166573          return 0;
   166574       } else {
   166575          return 0;
   166576       }
   166577    case 6: return 0;
   166578    case 5: return 0;
   166579    case 4:
   166580       if (devinfo->is_g4x) {
   166581          return 0;
   166582       } else {
   166583          return 0;
   166584       }
   166585    default:
   166586       unreachable("Invalid hardware generation");
   166587    }
   166588 }
   166589 
   166590 
   166591 
   166592 /* MI_STORE_DATA_IMM::Use Global GTT */
   166593 
   166594 
   166595 #define GEN10_MI_STORE_DATA_IMM_UseGlobalGTT_bits  1
   166596 #define GEN9_MI_STORE_DATA_IMM_UseGlobalGTT_bits  1
   166597 #define GEN8_MI_STORE_DATA_IMM_UseGlobalGTT_bits  1
   166598 #define GEN75_MI_STORE_DATA_IMM_UseGlobalGTT_bits  1
   166599 #define GEN7_MI_STORE_DATA_IMM_UseGlobalGTT_bits  1
   166600 #define GEN6_MI_STORE_DATA_IMM_UseGlobalGTT_bits  1
   166601 
   166602 static inline uint32_t ATTRIBUTE_PURE
   166603 MI_STORE_DATA_IMM_UseGlobalGTT_bits(const struct gen_device_info *devinfo)
   166604 {
   166605    switch (devinfo->gen) {
   166606    case 10: return 1;
   166607    case 9: return 1;
   166608    case 8: return 1;
   166609    case 7:
   166610       if (devinfo->is_haswell) {
   166611          return 1;
   166612       } else {
   166613          return 1;
   166614       }
   166615    case 6: return 1;
   166616    case 5: return 0;
   166617    case 4:
   166618       if (devinfo->is_g4x) {
   166619          return 0;
   166620       } else {
   166621          return 0;
   166622       }
   166623    default:
   166624       unreachable("Invalid hardware generation");
   166625    }
   166626 }
   166627 
   166628 
   166629 
   166630 #define GEN10_MI_STORE_DATA_IMM_UseGlobalGTT_start  22
   166631 #define GEN9_MI_STORE_DATA_IMM_UseGlobalGTT_start  22
   166632 #define GEN8_MI_STORE_DATA_IMM_UseGlobalGTT_start  22
   166633 #define GEN75_MI_STORE_DATA_IMM_UseGlobalGTT_start  22
   166634 #define GEN7_MI_STORE_DATA_IMM_UseGlobalGTT_start  22
   166635 #define GEN6_MI_STORE_DATA_IMM_UseGlobalGTT_start  22
   166636 
   166637 static inline uint32_t ATTRIBUTE_PURE
   166638 MI_STORE_DATA_IMM_UseGlobalGTT_start(const struct gen_device_info *devinfo)
   166639 {
   166640    switch (devinfo->gen) {
   166641    case 10: return 22;
   166642    case 9: return 22;
   166643    case 8: return 22;
   166644    case 7:
   166645       if (devinfo->is_haswell) {
   166646          return 22;
   166647       } else {
   166648          return 22;
   166649       }
   166650    case 6: return 22;
   166651    case 5: return 0;
   166652    case 4:
   166653       if (devinfo->is_g4x) {
   166654          return 0;
   166655       } else {
   166656          return 0;
   166657       }
   166658    default:
   166659       unreachable("Invalid hardware generation");
   166660    }
   166661 }
   166662 
   166663 
   166664 
   166665 /* MI_STORE_DATA_INDEX */
   166666 
   166667 
   166668 #define GEN10_MI_STORE_DATA_INDEX_length  3
   166669 #define GEN9_MI_STORE_DATA_INDEX_length  3
   166670 #define GEN8_MI_STORE_DATA_INDEX_length  3
   166671 #define GEN75_MI_STORE_DATA_INDEX_length  3
   166672 #define GEN7_MI_STORE_DATA_INDEX_length  3
   166673 #define GEN6_MI_STORE_DATA_INDEX_length  3
   166674 
   166675 static inline uint32_t ATTRIBUTE_PURE
   166676 MI_STORE_DATA_INDEX_length(const struct gen_device_info *devinfo)
   166677 {
   166678    switch (devinfo->gen) {
   166679    case 10: return 3;
   166680    case 9: return 3;
   166681    case 8: return 3;
   166682    case 7:
   166683       if (devinfo->is_haswell) {
   166684          return 3;
   166685       } else {
   166686          return 3;
   166687       }
   166688    case 6: return 3;
   166689    case 5: return 0;
   166690    case 4:
   166691       if (devinfo->is_g4x) {
   166692          return 0;
   166693       } else {
   166694          return 0;
   166695       }
   166696    default:
   166697       unreachable("Invalid hardware generation");
   166698    }
   166699 }
   166700 
   166701 
   166702 
   166703 /* MI_STORE_DATA_INDEX::Command Type */
   166704 
   166705 
   166706 #define GEN10_MI_STORE_DATA_INDEX_CommandType_bits  3
   166707 #define GEN9_MI_STORE_DATA_INDEX_CommandType_bits  3
   166708 #define GEN8_MI_STORE_DATA_INDEX_CommandType_bits  3
   166709 #define GEN75_MI_STORE_DATA_INDEX_CommandType_bits  3
   166710 #define GEN7_MI_STORE_DATA_INDEX_CommandType_bits  3
   166711 #define GEN6_MI_STORE_DATA_INDEX_CommandType_bits  3
   166712 
   166713 static inline uint32_t ATTRIBUTE_PURE
   166714 MI_STORE_DATA_INDEX_CommandType_bits(const struct gen_device_info *devinfo)
   166715 {
   166716    switch (devinfo->gen) {
   166717    case 10: return 3;
   166718    case 9: return 3;
   166719    case 8: return 3;
   166720    case 7:
   166721       if (devinfo->is_haswell) {
   166722          return 3;
   166723       } else {
   166724          return 3;
   166725       }
   166726    case 6: return 3;
   166727    case 5: return 0;
   166728    case 4:
   166729       if (devinfo->is_g4x) {
   166730          return 0;
   166731       } else {
   166732          return 0;
   166733       }
   166734    default:
   166735       unreachable("Invalid hardware generation");
   166736    }
   166737 }
   166738 
   166739 
   166740 
   166741 #define GEN10_MI_STORE_DATA_INDEX_CommandType_start  29
   166742 #define GEN9_MI_STORE_DATA_INDEX_CommandType_start  29
   166743 #define GEN8_MI_STORE_DATA_INDEX_CommandType_start  29
   166744 #define GEN75_MI_STORE_DATA_INDEX_CommandType_start  29
   166745 #define GEN7_MI_STORE_DATA_INDEX_CommandType_start  29
   166746 #define GEN6_MI_STORE_DATA_INDEX_CommandType_start  29
   166747 
   166748 static inline uint32_t ATTRIBUTE_PURE
   166749 MI_STORE_DATA_INDEX_CommandType_start(const struct gen_device_info *devinfo)
   166750 {
   166751    switch (devinfo->gen) {
   166752    case 10: return 29;
   166753    case 9: return 29;
   166754    case 8: return 29;
   166755    case 7:
   166756       if (devinfo->is_haswell) {
   166757          return 29;
   166758       } else {
   166759          return 29;
   166760       }
   166761    case 6: return 29;
   166762    case 5: return 0;
   166763    case 4:
   166764       if (devinfo->is_g4x) {
   166765          return 0;
   166766       } else {
   166767          return 0;
   166768       }
   166769    default:
   166770       unreachable("Invalid hardware generation");
   166771    }
   166772 }
   166773 
   166774 
   166775 
   166776 /* MI_STORE_DATA_INDEX::DWord Length */
   166777 
   166778 
   166779 #define GEN10_MI_STORE_DATA_INDEX_DWordLength_bits  8
   166780 #define GEN9_MI_STORE_DATA_INDEX_DWordLength_bits  8
   166781 #define GEN8_MI_STORE_DATA_INDEX_DWordLength_bits  8
   166782 #define GEN75_MI_STORE_DATA_INDEX_DWordLength_bits  8
   166783 #define GEN7_MI_STORE_DATA_INDEX_DWordLength_bits  8
   166784 #define GEN6_MI_STORE_DATA_INDEX_DWordLength_bits  8
   166785 
   166786 static inline uint32_t ATTRIBUTE_PURE
   166787 MI_STORE_DATA_INDEX_DWordLength_bits(const struct gen_device_info *devinfo)
   166788 {
   166789    switch (devinfo->gen) {
   166790    case 10: return 8;
   166791    case 9: return 8;
   166792    case 8: return 8;
   166793    case 7:
   166794       if (devinfo->is_haswell) {
   166795          return 8;
   166796       } else {
   166797          return 8;
   166798       }
   166799    case 6: return 8;
   166800    case 5: return 0;
   166801    case 4:
   166802       if (devinfo->is_g4x) {
   166803          return 0;
   166804       } else {
   166805          return 0;
   166806       }
   166807    default:
   166808       unreachable("Invalid hardware generation");
   166809    }
   166810 }
   166811 
   166812 
   166813 
   166814 #define GEN10_MI_STORE_DATA_INDEX_DWordLength_start  0
   166815 #define GEN9_MI_STORE_DATA_INDEX_DWordLength_start  0
   166816 #define GEN8_MI_STORE_DATA_INDEX_DWordLength_start  0
   166817 #define GEN75_MI_STORE_DATA_INDEX_DWordLength_start  0
   166818 #define GEN7_MI_STORE_DATA_INDEX_DWordLength_start  0
   166819 #define GEN6_MI_STORE_DATA_INDEX_DWordLength_start  0
   166820 
   166821 static inline uint32_t ATTRIBUTE_PURE
   166822 MI_STORE_DATA_INDEX_DWordLength_start(const struct gen_device_info *devinfo)
   166823 {
   166824    switch (devinfo->gen) {
   166825    case 10: return 0;
   166826    case 9: return 0;
   166827    case 8: return 0;
   166828    case 7:
   166829       if (devinfo->is_haswell) {
   166830          return 0;
   166831       } else {
   166832          return 0;
   166833       }
   166834    case 6: return 0;
   166835    case 5: return 0;
   166836    case 4:
   166837       if (devinfo->is_g4x) {
   166838          return 0;
   166839       } else {
   166840          return 0;
   166841       }
   166842    default:
   166843       unreachable("Invalid hardware generation");
   166844    }
   166845 }
   166846 
   166847 
   166848 
   166849 /* MI_STORE_DATA_INDEX::Data DWord 0 */
   166850 
   166851 
   166852 #define GEN10_MI_STORE_DATA_INDEX_DataDWord0_bits  32
   166853 #define GEN9_MI_STORE_DATA_INDEX_DataDWord0_bits  32
   166854 #define GEN8_MI_STORE_DATA_INDEX_DataDWord0_bits  32
   166855 #define GEN75_MI_STORE_DATA_INDEX_DataDWord0_bits  32
   166856 #define GEN7_MI_STORE_DATA_INDEX_DataDWord0_bits  32
   166857 #define GEN6_MI_STORE_DATA_INDEX_DataDWord0_bits  32
   166858 
   166859 static inline uint32_t ATTRIBUTE_PURE
   166860 MI_STORE_DATA_INDEX_DataDWord0_bits(const struct gen_device_info *devinfo)
   166861 {
   166862    switch (devinfo->gen) {
   166863    case 10: return 32;
   166864    case 9: return 32;
   166865    case 8: return 32;
   166866    case 7:
   166867       if (devinfo->is_haswell) {
   166868          return 32;
   166869       } else {
   166870          return 32;
   166871       }
   166872    case 6: return 32;
   166873    case 5: return 0;
   166874    case 4:
   166875       if (devinfo->is_g4x) {
   166876          return 0;
   166877       } else {
   166878          return 0;
   166879       }
   166880    default:
   166881       unreachable("Invalid hardware generation");
   166882    }
   166883 }
   166884 
   166885 
   166886 
   166887 #define GEN10_MI_STORE_DATA_INDEX_DataDWord0_start  64
   166888 #define GEN9_MI_STORE_DATA_INDEX_DataDWord0_start  64
   166889 #define GEN8_MI_STORE_DATA_INDEX_DataDWord0_start  64
   166890 #define GEN75_MI_STORE_DATA_INDEX_DataDWord0_start  64
   166891 #define GEN7_MI_STORE_DATA_INDEX_DataDWord0_start  64
   166892 #define GEN6_MI_STORE_DATA_INDEX_DataDWord0_start  64
   166893 
   166894 static inline uint32_t ATTRIBUTE_PURE
   166895 MI_STORE_DATA_INDEX_DataDWord0_start(const struct gen_device_info *devinfo)
   166896 {
   166897    switch (devinfo->gen) {
   166898    case 10: return 64;
   166899    case 9: return 64;
   166900    case 8: return 64;
   166901    case 7:
   166902       if (devinfo->is_haswell) {
   166903          return 64;
   166904       } else {
   166905          return 64;
   166906       }
   166907    case 6: return 64;
   166908    case 5: return 0;
   166909    case 4:
   166910       if (devinfo->is_g4x) {
   166911          return 0;
   166912       } else {
   166913          return 0;
   166914       }
   166915    default:
   166916       unreachable("Invalid hardware generation");
   166917    }
   166918 }
   166919 
   166920 
   166921 
   166922 /* MI_STORE_DATA_INDEX::Data DWord 1 */
   166923 
   166924 
   166925 #define GEN10_MI_STORE_DATA_INDEX_DataDWord1_bits  32
   166926 #define GEN9_MI_STORE_DATA_INDEX_DataDWord1_bits  32
   166927 #define GEN8_MI_STORE_DATA_INDEX_DataDWord1_bits  32
   166928 #define GEN75_MI_STORE_DATA_INDEX_DataDWord1_bits  32
   166929 #define GEN7_MI_STORE_DATA_INDEX_DataDWord1_bits  32
   166930 #define GEN6_MI_STORE_DATA_INDEX_DataDWord1_bits  32
   166931 
   166932 static inline uint32_t ATTRIBUTE_PURE
   166933 MI_STORE_DATA_INDEX_DataDWord1_bits(const struct gen_device_info *devinfo)
   166934 {
   166935    switch (devinfo->gen) {
   166936    case 10: return 32;
   166937    case 9: return 32;
   166938    case 8: return 32;
   166939    case 7:
   166940       if (devinfo->is_haswell) {
   166941          return 32;
   166942       } else {
   166943          return 32;
   166944       }
   166945    case 6: return 32;
   166946    case 5: return 0;
   166947    case 4:
   166948       if (devinfo->is_g4x) {
   166949          return 0;
   166950       } else {
   166951          return 0;
   166952       }
   166953    default:
   166954       unreachable("Invalid hardware generation");
   166955    }
   166956 }
   166957 
   166958 
   166959 
   166960 #define GEN10_MI_STORE_DATA_INDEX_DataDWord1_start  96
   166961 #define GEN9_MI_STORE_DATA_INDEX_DataDWord1_start  96
   166962 #define GEN8_MI_STORE_DATA_INDEX_DataDWord1_start  96
   166963 #define GEN75_MI_STORE_DATA_INDEX_DataDWord1_start  96
   166964 #define GEN7_MI_STORE_DATA_INDEX_DataDWord1_start  96
   166965 #define GEN6_MI_STORE_DATA_INDEX_DataDWord1_start  96
   166966 
   166967 static inline uint32_t ATTRIBUTE_PURE
   166968 MI_STORE_DATA_INDEX_DataDWord1_start(const struct gen_device_info *devinfo)
   166969 {
   166970    switch (devinfo->gen) {
   166971    case 10: return 96;
   166972    case 9: return 96;
   166973    case 8: return 96;
   166974    case 7:
   166975       if (devinfo->is_haswell) {
   166976          return 96;
   166977       } else {
   166978          return 96;
   166979       }
   166980    case 6: return 96;
   166981    case 5: return 0;
   166982    case 4:
   166983       if (devinfo->is_g4x) {
   166984          return 0;
   166985       } else {
   166986          return 0;
   166987       }
   166988    default:
   166989       unreachable("Invalid hardware generation");
   166990    }
   166991 }
   166992 
   166993 
   166994 
   166995 /* MI_STORE_DATA_INDEX::MI Command Opcode */
   166996 
   166997 
   166998 #define GEN10_MI_STORE_DATA_INDEX_MICommandOpcode_bits  6
   166999 #define GEN9_MI_STORE_DATA_INDEX_MICommandOpcode_bits  6
   167000 #define GEN8_MI_STORE_DATA_INDEX_MICommandOpcode_bits  6
   167001 #define GEN75_MI_STORE_DATA_INDEX_MICommandOpcode_bits  6
   167002 #define GEN7_MI_STORE_DATA_INDEX_MICommandOpcode_bits  6
   167003 #define GEN6_MI_STORE_DATA_INDEX_MICommandOpcode_bits  6
   167004 
   167005 static inline uint32_t ATTRIBUTE_PURE
   167006 MI_STORE_DATA_INDEX_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   167007 {
   167008    switch (devinfo->gen) {
   167009    case 10: return 6;
   167010    case 9: return 6;
   167011    case 8: return 6;
   167012    case 7:
   167013       if (devinfo->is_haswell) {
   167014          return 6;
   167015       } else {
   167016          return 6;
   167017       }
   167018    case 6: return 6;
   167019    case 5: return 0;
   167020    case 4:
   167021       if (devinfo->is_g4x) {
   167022          return 0;
   167023       } else {
   167024          return 0;
   167025       }
   167026    default:
   167027       unreachable("Invalid hardware generation");
   167028    }
   167029 }
   167030 
   167031 
   167032 
   167033 #define GEN10_MI_STORE_DATA_INDEX_MICommandOpcode_start  23
   167034 #define GEN9_MI_STORE_DATA_INDEX_MICommandOpcode_start  23
   167035 #define GEN8_MI_STORE_DATA_INDEX_MICommandOpcode_start  23
   167036 #define GEN75_MI_STORE_DATA_INDEX_MICommandOpcode_start  23
   167037 #define GEN7_MI_STORE_DATA_INDEX_MICommandOpcode_start  23
   167038 #define GEN6_MI_STORE_DATA_INDEX_MICommandOpcode_start  23
   167039 
   167040 static inline uint32_t ATTRIBUTE_PURE
   167041 MI_STORE_DATA_INDEX_MICommandOpcode_start(const struct gen_device_info *devinfo)
   167042 {
   167043    switch (devinfo->gen) {
   167044    case 10: return 23;
   167045    case 9: return 23;
   167046    case 8: return 23;
   167047    case 7:
   167048       if (devinfo->is_haswell) {
   167049          return 23;
   167050       } else {
   167051          return 23;
   167052       }
   167053    case 6: return 23;
   167054    case 5: return 0;
   167055    case 4:
   167056       if (devinfo->is_g4x) {
   167057          return 0;
   167058       } else {
   167059          return 0;
   167060       }
   167061    default:
   167062       unreachable("Invalid hardware generation");
   167063    }
   167064 }
   167065 
   167066 
   167067 
   167068 /* MI_STORE_DATA_INDEX::Offset */
   167069 
   167070 
   167071 #define GEN10_MI_STORE_DATA_INDEX_Offset_bits  10
   167072 #define GEN9_MI_STORE_DATA_INDEX_Offset_bits  10
   167073 #define GEN8_MI_STORE_DATA_INDEX_Offset_bits  10
   167074 #define GEN75_MI_STORE_DATA_INDEX_Offset_bits  10
   167075 #define GEN7_MI_STORE_DATA_INDEX_Offset_bits  10
   167076 #define GEN6_MI_STORE_DATA_INDEX_Offset_bits  10
   167077 
   167078 static inline uint32_t ATTRIBUTE_PURE
   167079 MI_STORE_DATA_INDEX_Offset_bits(const struct gen_device_info *devinfo)
   167080 {
   167081    switch (devinfo->gen) {
   167082    case 10: return 10;
   167083    case 9: return 10;
   167084    case 8: return 10;
   167085    case 7:
   167086       if (devinfo->is_haswell) {
   167087          return 10;
   167088       } else {
   167089          return 10;
   167090       }
   167091    case 6: return 10;
   167092    case 5: return 0;
   167093    case 4:
   167094       if (devinfo->is_g4x) {
   167095          return 0;
   167096       } else {
   167097          return 0;
   167098       }
   167099    default:
   167100       unreachable("Invalid hardware generation");
   167101    }
   167102 }
   167103 
   167104 
   167105 
   167106 #define GEN10_MI_STORE_DATA_INDEX_Offset_start  34
   167107 #define GEN9_MI_STORE_DATA_INDEX_Offset_start  34
   167108 #define GEN8_MI_STORE_DATA_INDEX_Offset_start  34
   167109 #define GEN75_MI_STORE_DATA_INDEX_Offset_start  34
   167110 #define GEN7_MI_STORE_DATA_INDEX_Offset_start  34
   167111 #define GEN6_MI_STORE_DATA_INDEX_Offset_start  34
   167112 
   167113 static inline uint32_t ATTRIBUTE_PURE
   167114 MI_STORE_DATA_INDEX_Offset_start(const struct gen_device_info *devinfo)
   167115 {
   167116    switch (devinfo->gen) {
   167117    case 10: return 34;
   167118    case 9: return 34;
   167119    case 8: return 34;
   167120    case 7:
   167121       if (devinfo->is_haswell) {
   167122          return 34;
   167123       } else {
   167124          return 34;
   167125       }
   167126    case 6: return 34;
   167127    case 5: return 0;
   167128    case 4:
   167129       if (devinfo->is_g4x) {
   167130          return 0;
   167131       } else {
   167132          return 0;
   167133       }
   167134    default:
   167135       unreachable("Invalid hardware generation");
   167136    }
   167137 }
   167138 
   167139 
   167140 
   167141 /* MI_STORE_DATA_INDEX::Use Per-Process Hardware Status Page */
   167142 
   167143 
   167144 #define GEN10_MI_STORE_DATA_INDEX_UsePerProcessHardwareStatusPage_bits  1
   167145 #define GEN9_MI_STORE_DATA_INDEX_UsePerProcessHardwareStatusPage_bits  1
   167146 #define GEN8_MI_STORE_DATA_INDEX_UsePerProcessHardwareStatusPage_bits  1
   167147 
   167148 static inline uint32_t ATTRIBUTE_PURE
   167149 MI_STORE_DATA_INDEX_UsePerProcessHardwareStatusPage_bits(const struct gen_device_info *devinfo)
   167150 {
   167151    switch (devinfo->gen) {
   167152    case 10: return 1;
   167153    case 9: return 1;
   167154    case 8: return 1;
   167155    case 7:
   167156       if (devinfo->is_haswell) {
   167157          return 0;
   167158       } else {
   167159          return 0;
   167160       }
   167161    case 6: return 0;
   167162    case 5: return 0;
   167163    case 4:
   167164       if (devinfo->is_g4x) {
   167165          return 0;
   167166       } else {
   167167          return 0;
   167168       }
   167169    default:
   167170       unreachable("Invalid hardware generation");
   167171    }
   167172 }
   167173 
   167174 
   167175 
   167176 #define GEN10_MI_STORE_DATA_INDEX_UsePerProcessHardwareStatusPage_start  21
   167177 #define GEN9_MI_STORE_DATA_INDEX_UsePerProcessHardwareStatusPage_start  21
   167178 #define GEN8_MI_STORE_DATA_INDEX_UsePerProcessHardwareStatusPage_start  21
   167179 
   167180 static inline uint32_t ATTRIBUTE_PURE
   167181 MI_STORE_DATA_INDEX_UsePerProcessHardwareStatusPage_start(const struct gen_device_info *devinfo)
   167182 {
   167183    switch (devinfo->gen) {
   167184    case 10: return 21;
   167185    case 9: return 21;
   167186    case 8: return 21;
   167187    case 7:
   167188       if (devinfo->is_haswell) {
   167189          return 0;
   167190       } else {
   167191          return 0;
   167192       }
   167193    case 6: return 0;
   167194    case 5: return 0;
   167195    case 4:
   167196       if (devinfo->is_g4x) {
   167197          return 0;
   167198       } else {
   167199          return 0;
   167200       }
   167201    default:
   167202       unreachable("Invalid hardware generation");
   167203    }
   167204 }
   167205 
   167206 
   167207 
   167208 /* MI_STORE_REGISTER_MEM */
   167209 
   167210 
   167211 #define GEN10_MI_STORE_REGISTER_MEM_length  4
   167212 #define GEN9_MI_STORE_REGISTER_MEM_length  4
   167213 #define GEN8_MI_STORE_REGISTER_MEM_length  4
   167214 #define GEN75_MI_STORE_REGISTER_MEM_length  3
   167215 #define GEN7_MI_STORE_REGISTER_MEM_length  3
   167216 #define GEN6_MI_STORE_REGISTER_MEM_length  3
   167217 #define GEN5_MI_STORE_REGISTER_MEM_length  3
   167218 #define GEN45_MI_STORE_REGISTER_MEM_length  3
   167219 #define GEN4_MI_STORE_REGISTER_MEM_length  3
   167220 
   167221 static inline uint32_t ATTRIBUTE_PURE
   167222 MI_STORE_REGISTER_MEM_length(const struct gen_device_info *devinfo)
   167223 {
   167224    switch (devinfo->gen) {
   167225    case 10: return 4;
   167226    case 9: return 4;
   167227    case 8: return 4;
   167228    case 7:
   167229       if (devinfo->is_haswell) {
   167230          return 3;
   167231       } else {
   167232          return 3;
   167233       }
   167234    case 6: return 3;
   167235    case 5: return 3;
   167236    case 4:
   167237       if (devinfo->is_g4x) {
   167238          return 3;
   167239       } else {
   167240          return 3;
   167241       }
   167242    default:
   167243       unreachable("Invalid hardware generation");
   167244    }
   167245 }
   167246 
   167247 
   167248 
   167249 /* MI_STORE_REGISTER_MEM::Command Type */
   167250 
   167251 
   167252 #define GEN10_MI_STORE_REGISTER_MEM_CommandType_bits  3
   167253 #define GEN9_MI_STORE_REGISTER_MEM_CommandType_bits  3
   167254 #define GEN8_MI_STORE_REGISTER_MEM_CommandType_bits  3
   167255 #define GEN75_MI_STORE_REGISTER_MEM_CommandType_bits  3
   167256 #define GEN7_MI_STORE_REGISTER_MEM_CommandType_bits  3
   167257 #define GEN6_MI_STORE_REGISTER_MEM_CommandType_bits  3
   167258 #define GEN5_MI_STORE_REGISTER_MEM_CommandType_bits  3
   167259 #define GEN45_MI_STORE_REGISTER_MEM_CommandType_bits  3
   167260 #define GEN4_MI_STORE_REGISTER_MEM_CommandType_bits  3
   167261 
   167262 static inline uint32_t ATTRIBUTE_PURE
   167263 MI_STORE_REGISTER_MEM_CommandType_bits(const struct gen_device_info *devinfo)
   167264 {
   167265    switch (devinfo->gen) {
   167266    case 10: return 3;
   167267    case 9: return 3;
   167268    case 8: return 3;
   167269    case 7:
   167270       if (devinfo->is_haswell) {
   167271          return 3;
   167272       } else {
   167273          return 3;
   167274       }
   167275    case 6: return 3;
   167276    case 5: return 3;
   167277    case 4:
   167278       if (devinfo->is_g4x) {
   167279          return 3;
   167280       } else {
   167281          return 3;
   167282       }
   167283    default:
   167284       unreachable("Invalid hardware generation");
   167285    }
   167286 }
   167287 
   167288 
   167289 
   167290 #define GEN10_MI_STORE_REGISTER_MEM_CommandType_start  29
   167291 #define GEN9_MI_STORE_REGISTER_MEM_CommandType_start  29
   167292 #define GEN8_MI_STORE_REGISTER_MEM_CommandType_start  29
   167293 #define GEN75_MI_STORE_REGISTER_MEM_CommandType_start  29
   167294 #define GEN7_MI_STORE_REGISTER_MEM_CommandType_start  29
   167295 #define GEN6_MI_STORE_REGISTER_MEM_CommandType_start  29
   167296 #define GEN5_MI_STORE_REGISTER_MEM_CommandType_start  29
   167297 #define GEN45_MI_STORE_REGISTER_MEM_CommandType_start  29
   167298 #define GEN4_MI_STORE_REGISTER_MEM_CommandType_start  29
   167299 
   167300 static inline uint32_t ATTRIBUTE_PURE
   167301 MI_STORE_REGISTER_MEM_CommandType_start(const struct gen_device_info *devinfo)
   167302 {
   167303    switch (devinfo->gen) {
   167304    case 10: return 29;
   167305    case 9: return 29;
   167306    case 8: return 29;
   167307    case 7:
   167308       if (devinfo->is_haswell) {
   167309          return 29;
   167310       } else {
   167311          return 29;
   167312       }
   167313    case 6: return 29;
   167314    case 5: return 29;
   167315    case 4:
   167316       if (devinfo->is_g4x) {
   167317          return 29;
   167318       } else {
   167319          return 29;
   167320       }
   167321    default:
   167322       unreachable("Invalid hardware generation");
   167323    }
   167324 }
   167325 
   167326 
   167327 
   167328 /* MI_STORE_REGISTER_MEM::DWord Length */
   167329 
   167330 
   167331 #define GEN10_MI_STORE_REGISTER_MEM_DWordLength_bits  8
   167332 #define GEN9_MI_STORE_REGISTER_MEM_DWordLength_bits  8
   167333 #define GEN8_MI_STORE_REGISTER_MEM_DWordLength_bits  8
   167334 #define GEN75_MI_STORE_REGISTER_MEM_DWordLength_bits  8
   167335 #define GEN7_MI_STORE_REGISTER_MEM_DWordLength_bits  8
   167336 #define GEN6_MI_STORE_REGISTER_MEM_DWordLength_bits  8
   167337 #define GEN5_MI_STORE_REGISTER_MEM_DWordLength_bits  8
   167338 #define GEN45_MI_STORE_REGISTER_MEM_DWordLength_bits  8
   167339 #define GEN4_MI_STORE_REGISTER_MEM_DWordLength_bits  8
   167340 
   167341 static inline uint32_t ATTRIBUTE_PURE
   167342 MI_STORE_REGISTER_MEM_DWordLength_bits(const struct gen_device_info *devinfo)
   167343 {
   167344    switch (devinfo->gen) {
   167345    case 10: return 8;
   167346    case 9: return 8;
   167347    case 8: return 8;
   167348    case 7:
   167349       if (devinfo->is_haswell) {
   167350          return 8;
   167351       } else {
   167352          return 8;
   167353       }
   167354    case 6: return 8;
   167355    case 5: return 8;
   167356    case 4:
   167357       if (devinfo->is_g4x) {
   167358          return 8;
   167359       } else {
   167360          return 8;
   167361       }
   167362    default:
   167363       unreachable("Invalid hardware generation");
   167364    }
   167365 }
   167366 
   167367 
   167368 
   167369 #define GEN10_MI_STORE_REGISTER_MEM_DWordLength_start  0
   167370 #define GEN9_MI_STORE_REGISTER_MEM_DWordLength_start  0
   167371 #define GEN8_MI_STORE_REGISTER_MEM_DWordLength_start  0
   167372 #define GEN75_MI_STORE_REGISTER_MEM_DWordLength_start  0
   167373 #define GEN7_MI_STORE_REGISTER_MEM_DWordLength_start  0
   167374 #define GEN6_MI_STORE_REGISTER_MEM_DWordLength_start  0
   167375 #define GEN5_MI_STORE_REGISTER_MEM_DWordLength_start  0
   167376 #define GEN45_MI_STORE_REGISTER_MEM_DWordLength_start  0
   167377 #define GEN4_MI_STORE_REGISTER_MEM_DWordLength_start  0
   167378 
   167379 static inline uint32_t ATTRIBUTE_PURE
   167380 MI_STORE_REGISTER_MEM_DWordLength_start(const struct gen_device_info *devinfo)
   167381 {
   167382    switch (devinfo->gen) {
   167383    case 10: return 0;
   167384    case 9: return 0;
   167385    case 8: return 0;
   167386    case 7:
   167387       if (devinfo->is_haswell) {
   167388          return 0;
   167389       } else {
   167390          return 0;
   167391       }
   167392    case 6: return 0;
   167393    case 5: return 0;
   167394    case 4:
   167395       if (devinfo->is_g4x) {
   167396          return 0;
   167397       } else {
   167398          return 0;
   167399       }
   167400    default:
   167401       unreachable("Invalid hardware generation");
   167402    }
   167403 }
   167404 
   167405 
   167406 
   167407 /* MI_STORE_REGISTER_MEM::MI Command Opcode */
   167408 
   167409 
   167410 #define GEN10_MI_STORE_REGISTER_MEM_MICommandOpcode_bits  6
   167411 #define GEN9_MI_STORE_REGISTER_MEM_MICommandOpcode_bits  6
   167412 #define GEN8_MI_STORE_REGISTER_MEM_MICommandOpcode_bits  6
   167413 #define GEN75_MI_STORE_REGISTER_MEM_MICommandOpcode_bits  6
   167414 #define GEN7_MI_STORE_REGISTER_MEM_MICommandOpcode_bits  6
   167415 #define GEN6_MI_STORE_REGISTER_MEM_MICommandOpcode_bits  6
   167416 #define GEN5_MI_STORE_REGISTER_MEM_MICommandOpcode_bits  6
   167417 #define GEN45_MI_STORE_REGISTER_MEM_MICommandOpcode_bits  6
   167418 #define GEN4_MI_STORE_REGISTER_MEM_MICommandOpcode_bits  6
   167419 
   167420 static inline uint32_t ATTRIBUTE_PURE
   167421 MI_STORE_REGISTER_MEM_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   167422 {
   167423    switch (devinfo->gen) {
   167424    case 10: return 6;
   167425    case 9: return 6;
   167426    case 8: return 6;
   167427    case 7:
   167428       if (devinfo->is_haswell) {
   167429          return 6;
   167430       } else {
   167431          return 6;
   167432       }
   167433    case 6: return 6;
   167434    case 5: return 6;
   167435    case 4:
   167436       if (devinfo->is_g4x) {
   167437          return 6;
   167438       } else {
   167439          return 6;
   167440       }
   167441    default:
   167442       unreachable("Invalid hardware generation");
   167443    }
   167444 }
   167445 
   167446 
   167447 
   167448 #define GEN10_MI_STORE_REGISTER_MEM_MICommandOpcode_start  23
   167449 #define GEN9_MI_STORE_REGISTER_MEM_MICommandOpcode_start  23
   167450 #define GEN8_MI_STORE_REGISTER_MEM_MICommandOpcode_start  23
   167451 #define GEN75_MI_STORE_REGISTER_MEM_MICommandOpcode_start  23
   167452 #define GEN7_MI_STORE_REGISTER_MEM_MICommandOpcode_start  23
   167453 #define GEN6_MI_STORE_REGISTER_MEM_MICommandOpcode_start  23
   167454 #define GEN5_MI_STORE_REGISTER_MEM_MICommandOpcode_start  23
   167455 #define GEN45_MI_STORE_REGISTER_MEM_MICommandOpcode_start  23
   167456 #define GEN4_MI_STORE_REGISTER_MEM_MICommandOpcode_start  23
   167457 
   167458 static inline uint32_t ATTRIBUTE_PURE
   167459 MI_STORE_REGISTER_MEM_MICommandOpcode_start(const struct gen_device_info *devinfo)
   167460 {
   167461    switch (devinfo->gen) {
   167462    case 10: return 23;
   167463    case 9: return 23;
   167464    case 8: return 23;
   167465    case 7:
   167466       if (devinfo->is_haswell) {
   167467          return 23;
   167468       } else {
   167469          return 23;
   167470       }
   167471    case 6: return 23;
   167472    case 5: return 23;
   167473    case 4:
   167474       if (devinfo->is_g4x) {
   167475          return 23;
   167476       } else {
   167477          return 23;
   167478       }
   167479    default:
   167480       unreachable("Invalid hardware generation");
   167481    }
   167482 }
   167483 
   167484 
   167485 
   167486 /* MI_STORE_REGISTER_MEM::Memory Address */
   167487 
   167488 
   167489 #define GEN10_MI_STORE_REGISTER_MEM_MemoryAddress_bits  62
   167490 #define GEN9_MI_STORE_REGISTER_MEM_MemoryAddress_bits  62
   167491 #define GEN8_MI_STORE_REGISTER_MEM_MemoryAddress_bits  62
   167492 #define GEN75_MI_STORE_REGISTER_MEM_MemoryAddress_bits  30
   167493 #define GEN7_MI_STORE_REGISTER_MEM_MemoryAddress_bits  30
   167494 #define GEN6_MI_STORE_REGISTER_MEM_MemoryAddress_bits  30
   167495 #define GEN5_MI_STORE_REGISTER_MEM_MemoryAddress_bits  30
   167496 #define GEN45_MI_STORE_REGISTER_MEM_MemoryAddress_bits  30
   167497 #define GEN4_MI_STORE_REGISTER_MEM_MemoryAddress_bits  30
   167498 
   167499 static inline uint32_t ATTRIBUTE_PURE
   167500 MI_STORE_REGISTER_MEM_MemoryAddress_bits(const struct gen_device_info *devinfo)
   167501 {
   167502    switch (devinfo->gen) {
   167503    case 10: return 62;
   167504    case 9: return 62;
   167505    case 8: return 62;
   167506    case 7:
   167507       if (devinfo->is_haswell) {
   167508          return 30;
   167509       } else {
   167510          return 30;
   167511       }
   167512    case 6: return 30;
   167513    case 5: return 30;
   167514    case 4:
   167515       if (devinfo->is_g4x) {
   167516          return 30;
   167517       } else {
   167518          return 30;
   167519       }
   167520    default:
   167521       unreachable("Invalid hardware generation");
   167522    }
   167523 }
   167524 
   167525 
   167526 
   167527 #define GEN10_MI_STORE_REGISTER_MEM_MemoryAddress_start  66
   167528 #define GEN9_MI_STORE_REGISTER_MEM_MemoryAddress_start  66
   167529 #define GEN8_MI_STORE_REGISTER_MEM_MemoryAddress_start  66
   167530 #define GEN75_MI_STORE_REGISTER_MEM_MemoryAddress_start  66
   167531 #define GEN7_MI_STORE_REGISTER_MEM_MemoryAddress_start  66
   167532 #define GEN6_MI_STORE_REGISTER_MEM_MemoryAddress_start  66
   167533 #define GEN5_MI_STORE_REGISTER_MEM_MemoryAddress_start  66
   167534 #define GEN45_MI_STORE_REGISTER_MEM_MemoryAddress_start  66
   167535 #define GEN4_MI_STORE_REGISTER_MEM_MemoryAddress_start  66
   167536 
   167537 static inline uint32_t ATTRIBUTE_PURE
   167538 MI_STORE_REGISTER_MEM_MemoryAddress_start(const struct gen_device_info *devinfo)
   167539 {
   167540    switch (devinfo->gen) {
   167541    case 10: return 66;
   167542    case 9: return 66;
   167543    case 8: return 66;
   167544    case 7:
   167545       if (devinfo->is_haswell) {
   167546          return 66;
   167547       } else {
   167548          return 66;
   167549       }
   167550    case 6: return 66;
   167551    case 5: return 66;
   167552    case 4:
   167553       if (devinfo->is_g4x) {
   167554          return 66;
   167555       } else {
   167556          return 66;
   167557       }
   167558    default:
   167559       unreachable("Invalid hardware generation");
   167560    }
   167561 }
   167562 
   167563 
   167564 
   167565 /* MI_STORE_REGISTER_MEM::Physical Start Address Extension */
   167566 
   167567 
   167568 #define GEN45_MI_STORE_REGISTER_MEM_PhysicalStartAddressExtension_bits  4
   167569 #define GEN4_MI_STORE_REGISTER_MEM_PhysicalStartAddressExtension_bits  4
   167570 
   167571 static inline uint32_t ATTRIBUTE_PURE
   167572 MI_STORE_REGISTER_MEM_PhysicalStartAddressExtension_bits(const struct gen_device_info *devinfo)
   167573 {
   167574    switch (devinfo->gen) {
   167575    case 10: return 0;
   167576    case 9: return 0;
   167577    case 8: return 0;
   167578    case 7:
   167579       if (devinfo->is_haswell) {
   167580          return 0;
   167581       } else {
   167582          return 0;
   167583       }
   167584    case 6: return 0;
   167585    case 5: return 0;
   167586    case 4:
   167587       if (devinfo->is_g4x) {
   167588          return 4;
   167589       } else {
   167590          return 4;
   167591       }
   167592    default:
   167593       unreachable("Invalid hardware generation");
   167594    }
   167595 }
   167596 
   167597 
   167598 
   167599 #define GEN45_MI_STORE_REGISTER_MEM_PhysicalStartAddressExtension_start  60
   167600 #define GEN4_MI_STORE_REGISTER_MEM_PhysicalStartAddressExtension_start  60
   167601 
   167602 static inline uint32_t ATTRIBUTE_PURE
   167603 MI_STORE_REGISTER_MEM_PhysicalStartAddressExtension_start(const struct gen_device_info *devinfo)
   167604 {
   167605    switch (devinfo->gen) {
   167606    case 10: return 0;
   167607    case 9: return 0;
   167608    case 8: return 0;
   167609    case 7:
   167610       if (devinfo->is_haswell) {
   167611          return 0;
   167612       } else {
   167613          return 0;
   167614       }
   167615    case 6: return 0;
   167616    case 5: return 0;
   167617    case 4:
   167618       if (devinfo->is_g4x) {
   167619          return 60;
   167620       } else {
   167621          return 60;
   167622       }
   167623    default:
   167624       unreachable("Invalid hardware generation");
   167625    }
   167626 }
   167627 
   167628 
   167629 
   167630 /* MI_STORE_REGISTER_MEM::Predicate Enable */
   167631 
   167632 
   167633 #define GEN10_MI_STORE_REGISTER_MEM_PredicateEnable_bits  1
   167634 #define GEN9_MI_STORE_REGISTER_MEM_PredicateEnable_bits  1
   167635 #define GEN8_MI_STORE_REGISTER_MEM_PredicateEnable_bits  1
   167636 #define GEN75_MI_STORE_REGISTER_MEM_PredicateEnable_bits  1
   167637 
   167638 static inline uint32_t ATTRIBUTE_PURE
   167639 MI_STORE_REGISTER_MEM_PredicateEnable_bits(const struct gen_device_info *devinfo)
   167640 {
   167641    switch (devinfo->gen) {
   167642    case 10: return 1;
   167643    case 9: return 1;
   167644    case 8: return 1;
   167645    case 7:
   167646       if (devinfo->is_haswell) {
   167647          return 1;
   167648       } else {
   167649          return 0;
   167650       }
   167651    case 6: return 0;
   167652    case 5: return 0;
   167653    case 4:
   167654       if (devinfo->is_g4x) {
   167655          return 0;
   167656       } else {
   167657          return 0;
   167658       }
   167659    default:
   167660       unreachable("Invalid hardware generation");
   167661    }
   167662 }
   167663 
   167664 
   167665 
   167666 #define GEN10_MI_STORE_REGISTER_MEM_PredicateEnable_start  21
   167667 #define GEN9_MI_STORE_REGISTER_MEM_PredicateEnable_start  21
   167668 #define GEN8_MI_STORE_REGISTER_MEM_PredicateEnable_start  21
   167669 #define GEN75_MI_STORE_REGISTER_MEM_PredicateEnable_start  21
   167670 
   167671 static inline uint32_t ATTRIBUTE_PURE
   167672 MI_STORE_REGISTER_MEM_PredicateEnable_start(const struct gen_device_info *devinfo)
   167673 {
   167674    switch (devinfo->gen) {
   167675    case 10: return 21;
   167676    case 9: return 21;
   167677    case 8: return 21;
   167678    case 7:
   167679       if (devinfo->is_haswell) {
   167680          return 21;
   167681       } else {
   167682          return 0;
   167683       }
   167684    case 6: return 0;
   167685    case 5: return 0;
   167686    case 4:
   167687       if (devinfo->is_g4x) {
   167688          return 0;
   167689       } else {
   167690          return 0;
   167691       }
   167692    default:
   167693       unreachable("Invalid hardware generation");
   167694    }
   167695 }
   167696 
   167697 
   167698 
   167699 /* MI_STORE_REGISTER_MEM::Register Address */
   167700 
   167701 
   167702 #define GEN10_MI_STORE_REGISTER_MEM_RegisterAddress_bits  21
   167703 #define GEN9_MI_STORE_REGISTER_MEM_RegisterAddress_bits  21
   167704 #define GEN8_MI_STORE_REGISTER_MEM_RegisterAddress_bits  21
   167705 #define GEN75_MI_STORE_REGISTER_MEM_RegisterAddress_bits  21
   167706 #define GEN7_MI_STORE_REGISTER_MEM_RegisterAddress_bits  21
   167707 #define GEN6_MI_STORE_REGISTER_MEM_RegisterAddress_bits  21
   167708 #define GEN5_MI_STORE_REGISTER_MEM_RegisterAddress_bits  24
   167709 #define GEN45_MI_STORE_REGISTER_MEM_RegisterAddress_bits  21
   167710 #define GEN4_MI_STORE_REGISTER_MEM_RegisterAddress_bits  21
   167711 
   167712 static inline uint32_t ATTRIBUTE_PURE
   167713 MI_STORE_REGISTER_MEM_RegisterAddress_bits(const struct gen_device_info *devinfo)
   167714 {
   167715    switch (devinfo->gen) {
   167716    case 10: return 21;
   167717    case 9: return 21;
   167718    case 8: return 21;
   167719    case 7:
   167720       if (devinfo->is_haswell) {
   167721          return 21;
   167722       } else {
   167723          return 21;
   167724       }
   167725    case 6: return 21;
   167726    case 5: return 24;
   167727    case 4:
   167728       if (devinfo->is_g4x) {
   167729          return 21;
   167730       } else {
   167731          return 21;
   167732       }
   167733    default:
   167734       unreachable("Invalid hardware generation");
   167735    }
   167736 }
   167737 
   167738 
   167739 
   167740 #define GEN10_MI_STORE_REGISTER_MEM_RegisterAddress_start  34
   167741 #define GEN9_MI_STORE_REGISTER_MEM_RegisterAddress_start  34
   167742 #define GEN8_MI_STORE_REGISTER_MEM_RegisterAddress_start  34
   167743 #define GEN75_MI_STORE_REGISTER_MEM_RegisterAddress_start  34
   167744 #define GEN7_MI_STORE_REGISTER_MEM_RegisterAddress_start  34
   167745 #define GEN6_MI_STORE_REGISTER_MEM_RegisterAddress_start  34
   167746 #define GEN5_MI_STORE_REGISTER_MEM_RegisterAddress_start  34
   167747 #define GEN45_MI_STORE_REGISTER_MEM_RegisterAddress_start  34
   167748 #define GEN4_MI_STORE_REGISTER_MEM_RegisterAddress_start  34
   167749 
   167750 static inline uint32_t ATTRIBUTE_PURE
   167751 MI_STORE_REGISTER_MEM_RegisterAddress_start(const struct gen_device_info *devinfo)
   167752 {
   167753    switch (devinfo->gen) {
   167754    case 10: return 34;
   167755    case 9: return 34;
   167756    case 8: return 34;
   167757    case 7:
   167758       if (devinfo->is_haswell) {
   167759          return 34;
   167760       } else {
   167761          return 34;
   167762       }
   167763    case 6: return 34;
   167764    case 5: return 34;
   167765    case 4:
   167766       if (devinfo->is_g4x) {
   167767          return 34;
   167768       } else {
   167769          return 34;
   167770       }
   167771    default:
   167772       unreachable("Invalid hardware generation");
   167773    }
   167774 }
   167775 
   167776 
   167777 
   167778 /* MI_STORE_REGISTER_MEM::Use Global GTT */
   167779 
   167780 
   167781 #define GEN10_MI_STORE_REGISTER_MEM_UseGlobalGTT_bits  1
   167782 #define GEN9_MI_STORE_REGISTER_MEM_UseGlobalGTT_bits  1
   167783 #define GEN8_MI_STORE_REGISTER_MEM_UseGlobalGTT_bits  1
   167784 #define GEN75_MI_STORE_REGISTER_MEM_UseGlobalGTT_bits  1
   167785 #define GEN7_MI_STORE_REGISTER_MEM_UseGlobalGTT_bits  1
   167786 #define GEN6_MI_STORE_REGISTER_MEM_UseGlobalGTT_bits  1
   167787 #define GEN5_MI_STORE_REGISTER_MEM_UseGlobalGTT_bits  1
   167788 #define GEN45_MI_STORE_REGISTER_MEM_UseGlobalGTT_bits  1
   167789 #define GEN4_MI_STORE_REGISTER_MEM_UseGlobalGTT_bits  1
   167790 
   167791 static inline uint32_t ATTRIBUTE_PURE
   167792 MI_STORE_REGISTER_MEM_UseGlobalGTT_bits(const struct gen_device_info *devinfo)
   167793 {
   167794    switch (devinfo->gen) {
   167795    case 10: return 1;
   167796    case 9: return 1;
   167797    case 8: return 1;
   167798    case 7:
   167799       if (devinfo->is_haswell) {
   167800          return 1;
   167801       } else {
   167802          return 1;
   167803       }
   167804    case 6: return 1;
   167805    case 5: return 1;
   167806    case 4:
   167807       if (devinfo->is_g4x) {
   167808          return 1;
   167809       } else {
   167810          return 1;
   167811       }
   167812    default:
   167813       unreachable("Invalid hardware generation");
   167814    }
   167815 }
   167816 
   167817 
   167818 
   167819 #define GEN10_MI_STORE_REGISTER_MEM_UseGlobalGTT_start  22
   167820 #define GEN9_MI_STORE_REGISTER_MEM_UseGlobalGTT_start  22
   167821 #define GEN8_MI_STORE_REGISTER_MEM_UseGlobalGTT_start  22
   167822 #define GEN75_MI_STORE_REGISTER_MEM_UseGlobalGTT_start  22
   167823 #define GEN7_MI_STORE_REGISTER_MEM_UseGlobalGTT_start  22
   167824 #define GEN6_MI_STORE_REGISTER_MEM_UseGlobalGTT_start  22
   167825 #define GEN5_MI_STORE_REGISTER_MEM_UseGlobalGTT_start  22
   167826 #define GEN45_MI_STORE_REGISTER_MEM_UseGlobalGTT_start  22
   167827 #define GEN4_MI_STORE_REGISTER_MEM_UseGlobalGTT_start  22
   167828 
   167829 static inline uint32_t ATTRIBUTE_PURE
   167830 MI_STORE_REGISTER_MEM_UseGlobalGTT_start(const struct gen_device_info *devinfo)
   167831 {
   167832    switch (devinfo->gen) {
   167833    case 10: return 22;
   167834    case 9: return 22;
   167835    case 8: return 22;
   167836    case 7:
   167837       if (devinfo->is_haswell) {
   167838          return 22;
   167839       } else {
   167840          return 22;
   167841       }
   167842    case 6: return 22;
   167843    case 5: return 22;
   167844    case 4:
   167845       if (devinfo->is_g4x) {
   167846          return 22;
   167847       } else {
   167848          return 22;
   167849       }
   167850    default:
   167851       unreachable("Invalid hardware generation");
   167852    }
   167853 }
   167854 
   167855 
   167856 
   167857 /* MI_STORE_URB_MEM */
   167858 
   167859 
   167860 #define GEN9_MI_STORE_URB_MEM_length  4
   167861 #define GEN8_MI_STORE_URB_MEM_length  4
   167862 #define GEN75_MI_STORE_URB_MEM_length  3
   167863 
   167864 static inline uint32_t ATTRIBUTE_PURE
   167865 MI_STORE_URB_MEM_length(const struct gen_device_info *devinfo)
   167866 {
   167867    switch (devinfo->gen) {
   167868    case 10: return 0;
   167869    case 9: return 4;
   167870    case 8: return 4;
   167871    case 7:
   167872       if (devinfo->is_haswell) {
   167873          return 3;
   167874       } else {
   167875          return 0;
   167876       }
   167877    case 6: return 0;
   167878    case 5: return 0;
   167879    case 4:
   167880       if (devinfo->is_g4x) {
   167881          return 0;
   167882       } else {
   167883          return 0;
   167884       }
   167885    default:
   167886       unreachable("Invalid hardware generation");
   167887    }
   167888 }
   167889 
   167890 
   167891 
   167892 /* MI_STORE_URB_MEM::Command Type */
   167893 
   167894 
   167895 #define GEN9_MI_STORE_URB_MEM_CommandType_bits  3
   167896 #define GEN8_MI_STORE_URB_MEM_CommandType_bits  3
   167897 #define GEN75_MI_STORE_URB_MEM_CommandType_bits  3
   167898 
   167899 static inline uint32_t ATTRIBUTE_PURE
   167900 MI_STORE_URB_MEM_CommandType_bits(const struct gen_device_info *devinfo)
   167901 {
   167902    switch (devinfo->gen) {
   167903    case 10: return 0;
   167904    case 9: return 3;
   167905    case 8: return 3;
   167906    case 7:
   167907       if (devinfo->is_haswell) {
   167908          return 3;
   167909       } else {
   167910          return 0;
   167911       }
   167912    case 6: return 0;
   167913    case 5: return 0;
   167914    case 4:
   167915       if (devinfo->is_g4x) {
   167916          return 0;
   167917       } else {
   167918          return 0;
   167919       }
   167920    default:
   167921       unreachable("Invalid hardware generation");
   167922    }
   167923 }
   167924 
   167925 
   167926 
   167927 #define GEN9_MI_STORE_URB_MEM_CommandType_start  29
   167928 #define GEN8_MI_STORE_URB_MEM_CommandType_start  29
   167929 #define GEN75_MI_STORE_URB_MEM_CommandType_start  29
   167930 
   167931 static inline uint32_t ATTRIBUTE_PURE
   167932 MI_STORE_URB_MEM_CommandType_start(const struct gen_device_info *devinfo)
   167933 {
   167934    switch (devinfo->gen) {
   167935    case 10: return 0;
   167936    case 9: return 29;
   167937    case 8: return 29;
   167938    case 7:
   167939       if (devinfo->is_haswell) {
   167940          return 29;
   167941       } else {
   167942          return 0;
   167943       }
   167944    case 6: return 0;
   167945    case 5: return 0;
   167946    case 4:
   167947       if (devinfo->is_g4x) {
   167948          return 0;
   167949       } else {
   167950          return 0;
   167951       }
   167952    default:
   167953       unreachable("Invalid hardware generation");
   167954    }
   167955 }
   167956 
   167957 
   167958 
   167959 /* MI_STORE_URB_MEM::DWord Length */
   167960 
   167961 
   167962 #define GEN9_MI_STORE_URB_MEM_DWordLength_bits  8
   167963 #define GEN8_MI_STORE_URB_MEM_DWordLength_bits  8
   167964 #define GEN75_MI_STORE_URB_MEM_DWordLength_bits  8
   167965 
   167966 static inline uint32_t ATTRIBUTE_PURE
   167967 MI_STORE_URB_MEM_DWordLength_bits(const struct gen_device_info *devinfo)
   167968 {
   167969    switch (devinfo->gen) {
   167970    case 10: return 0;
   167971    case 9: return 8;
   167972    case 8: return 8;
   167973    case 7:
   167974       if (devinfo->is_haswell) {
   167975          return 8;
   167976       } else {
   167977          return 0;
   167978       }
   167979    case 6: return 0;
   167980    case 5: return 0;
   167981    case 4:
   167982       if (devinfo->is_g4x) {
   167983          return 0;
   167984       } else {
   167985          return 0;
   167986       }
   167987    default:
   167988       unreachable("Invalid hardware generation");
   167989    }
   167990 }
   167991 
   167992 
   167993 
   167994 #define GEN9_MI_STORE_URB_MEM_DWordLength_start  0
   167995 #define GEN8_MI_STORE_URB_MEM_DWordLength_start  0
   167996 #define GEN75_MI_STORE_URB_MEM_DWordLength_start  0
   167997 
   167998 static inline uint32_t ATTRIBUTE_PURE
   167999 MI_STORE_URB_MEM_DWordLength_start(const struct gen_device_info *devinfo)
   168000 {
   168001    switch (devinfo->gen) {
   168002    case 10: return 0;
   168003    case 9: return 0;
   168004    case 8: return 0;
   168005    case 7:
   168006       if (devinfo->is_haswell) {
   168007          return 0;
   168008       } else {
   168009          return 0;
   168010       }
   168011    case 6: return 0;
   168012    case 5: return 0;
   168013    case 4:
   168014       if (devinfo->is_g4x) {
   168015          return 0;
   168016       } else {
   168017          return 0;
   168018       }
   168019    default:
   168020       unreachable("Invalid hardware generation");
   168021    }
   168022 }
   168023 
   168024 
   168025 
   168026 /* MI_STORE_URB_MEM::MI Command Opcode */
   168027 
   168028 
   168029 #define GEN9_MI_STORE_URB_MEM_MICommandOpcode_bits  6
   168030 #define GEN8_MI_STORE_URB_MEM_MICommandOpcode_bits  6
   168031 #define GEN75_MI_STORE_URB_MEM_MICommandOpcode_bits  6
   168032 
   168033 static inline uint32_t ATTRIBUTE_PURE
   168034 MI_STORE_URB_MEM_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   168035 {
   168036    switch (devinfo->gen) {
   168037    case 10: return 0;
   168038    case 9: return 6;
   168039    case 8: return 6;
   168040    case 7:
   168041       if (devinfo->is_haswell) {
   168042          return 6;
   168043       } else {
   168044          return 0;
   168045       }
   168046    case 6: return 0;
   168047    case 5: return 0;
   168048    case 4:
   168049       if (devinfo->is_g4x) {
   168050          return 0;
   168051       } else {
   168052          return 0;
   168053       }
   168054    default:
   168055       unreachable("Invalid hardware generation");
   168056    }
   168057 }
   168058 
   168059 
   168060 
   168061 #define GEN9_MI_STORE_URB_MEM_MICommandOpcode_start  23
   168062 #define GEN8_MI_STORE_URB_MEM_MICommandOpcode_start  23
   168063 #define GEN75_MI_STORE_URB_MEM_MICommandOpcode_start  23
   168064 
   168065 static inline uint32_t ATTRIBUTE_PURE
   168066 MI_STORE_URB_MEM_MICommandOpcode_start(const struct gen_device_info *devinfo)
   168067 {
   168068    switch (devinfo->gen) {
   168069    case 10: return 0;
   168070    case 9: return 23;
   168071    case 8: return 23;
   168072    case 7:
   168073       if (devinfo->is_haswell) {
   168074          return 23;
   168075       } else {
   168076          return 0;
   168077       }
   168078    case 6: return 0;
   168079    case 5: return 0;
   168080    case 4:
   168081       if (devinfo->is_g4x) {
   168082          return 0;
   168083       } else {
   168084          return 0;
   168085       }
   168086    default:
   168087       unreachable("Invalid hardware generation");
   168088    }
   168089 }
   168090 
   168091 
   168092 
   168093 /* MI_STORE_URB_MEM::Memory Address */
   168094 
   168095 
   168096 #define GEN9_MI_STORE_URB_MEM_MemoryAddress_bits  58
   168097 #define GEN8_MI_STORE_URB_MEM_MemoryAddress_bits  58
   168098 #define GEN75_MI_STORE_URB_MEM_MemoryAddress_bits  26
   168099 
   168100 static inline uint32_t ATTRIBUTE_PURE
   168101 MI_STORE_URB_MEM_MemoryAddress_bits(const struct gen_device_info *devinfo)
   168102 {
   168103    switch (devinfo->gen) {
   168104    case 10: return 0;
   168105    case 9: return 58;
   168106    case 8: return 58;
   168107    case 7:
   168108       if (devinfo->is_haswell) {
   168109          return 26;
   168110       } else {
   168111          return 0;
   168112       }
   168113    case 6: return 0;
   168114    case 5: return 0;
   168115    case 4:
   168116       if (devinfo->is_g4x) {
   168117          return 0;
   168118       } else {
   168119          return 0;
   168120       }
   168121    default:
   168122       unreachable("Invalid hardware generation");
   168123    }
   168124 }
   168125 
   168126 
   168127 
   168128 #define GEN9_MI_STORE_URB_MEM_MemoryAddress_start  70
   168129 #define GEN8_MI_STORE_URB_MEM_MemoryAddress_start  70
   168130 #define GEN75_MI_STORE_URB_MEM_MemoryAddress_start  70
   168131 
   168132 static inline uint32_t ATTRIBUTE_PURE
   168133 MI_STORE_URB_MEM_MemoryAddress_start(const struct gen_device_info *devinfo)
   168134 {
   168135    switch (devinfo->gen) {
   168136    case 10: return 0;
   168137    case 9: return 70;
   168138    case 8: return 70;
   168139    case 7:
   168140       if (devinfo->is_haswell) {
   168141          return 70;
   168142       } else {
   168143          return 0;
   168144       }
   168145    case 6: return 0;
   168146    case 5: return 0;
   168147    case 4:
   168148       if (devinfo->is_g4x) {
   168149          return 0;
   168150       } else {
   168151          return 0;
   168152       }
   168153    default:
   168154       unreachable("Invalid hardware generation");
   168155    }
   168156 }
   168157 
   168158 
   168159 
   168160 /* MI_STORE_URB_MEM::URB Address */
   168161 
   168162 
   168163 #define GEN9_MI_STORE_URB_MEM_URBAddress_bits  13
   168164 #define GEN8_MI_STORE_URB_MEM_URBAddress_bits  13
   168165 #define GEN75_MI_STORE_URB_MEM_URBAddress_bits  13
   168166 
   168167 static inline uint32_t ATTRIBUTE_PURE
   168168 MI_STORE_URB_MEM_URBAddress_bits(const struct gen_device_info *devinfo)
   168169 {
   168170    switch (devinfo->gen) {
   168171    case 10: return 0;
   168172    case 9: return 13;
   168173    case 8: return 13;
   168174    case 7:
   168175       if (devinfo->is_haswell) {
   168176          return 13;
   168177       } else {
   168178          return 0;
   168179       }
   168180    case 6: return 0;
   168181    case 5: return 0;
   168182    case 4:
   168183       if (devinfo->is_g4x) {
   168184          return 0;
   168185       } else {
   168186          return 0;
   168187       }
   168188    default:
   168189       unreachable("Invalid hardware generation");
   168190    }
   168191 }
   168192 
   168193 
   168194 
   168195 #define GEN9_MI_STORE_URB_MEM_URBAddress_start  34
   168196 #define GEN8_MI_STORE_URB_MEM_URBAddress_start  34
   168197 #define GEN75_MI_STORE_URB_MEM_URBAddress_start  34
   168198 
   168199 static inline uint32_t ATTRIBUTE_PURE
   168200 MI_STORE_URB_MEM_URBAddress_start(const struct gen_device_info *devinfo)
   168201 {
   168202    switch (devinfo->gen) {
   168203    case 10: return 0;
   168204    case 9: return 34;
   168205    case 8: return 34;
   168206    case 7:
   168207       if (devinfo->is_haswell) {
   168208          return 34;
   168209       } else {
   168210          return 0;
   168211       }
   168212    case 6: return 0;
   168213    case 5: return 0;
   168214    case 4:
   168215       if (devinfo->is_g4x) {
   168216          return 0;
   168217       } else {
   168218          return 0;
   168219       }
   168220    default:
   168221       unreachable("Invalid hardware generation");
   168222    }
   168223 }
   168224 
   168225 
   168226 
   168227 /* MI_SUSPEND_FLUSH */
   168228 
   168229 
   168230 #define GEN10_MI_SUSPEND_FLUSH_length  1
   168231 #define GEN9_MI_SUSPEND_FLUSH_length  1
   168232 #define GEN8_MI_SUSPEND_FLUSH_length  1
   168233 #define GEN75_MI_SUSPEND_FLUSH_length  1
   168234 #define GEN7_MI_SUSPEND_FLUSH_length  1
   168235 #define GEN6_MI_SUSPEND_FLUSH_length  1
   168236 
   168237 static inline uint32_t ATTRIBUTE_PURE
   168238 MI_SUSPEND_FLUSH_length(const struct gen_device_info *devinfo)
   168239 {
   168240    switch (devinfo->gen) {
   168241    case 10: return 1;
   168242    case 9: return 1;
   168243    case 8: return 1;
   168244    case 7:
   168245       if (devinfo->is_haswell) {
   168246          return 1;
   168247       } else {
   168248          return 1;
   168249       }
   168250    case 6: return 1;
   168251    case 5: return 0;
   168252    case 4:
   168253       if (devinfo->is_g4x) {
   168254          return 0;
   168255       } else {
   168256          return 0;
   168257       }
   168258    default:
   168259       unreachable("Invalid hardware generation");
   168260    }
   168261 }
   168262 
   168263 
   168264 
   168265 /* MI_SUSPEND_FLUSH::Command Type */
   168266 
   168267 
   168268 #define GEN10_MI_SUSPEND_FLUSH_CommandType_bits  3
   168269 #define GEN9_MI_SUSPEND_FLUSH_CommandType_bits  3
   168270 #define GEN8_MI_SUSPEND_FLUSH_CommandType_bits  3
   168271 #define GEN75_MI_SUSPEND_FLUSH_CommandType_bits  3
   168272 #define GEN7_MI_SUSPEND_FLUSH_CommandType_bits  3
   168273 #define GEN6_MI_SUSPEND_FLUSH_CommandType_bits  3
   168274 
   168275 static inline uint32_t ATTRIBUTE_PURE
   168276 MI_SUSPEND_FLUSH_CommandType_bits(const struct gen_device_info *devinfo)
   168277 {
   168278    switch (devinfo->gen) {
   168279    case 10: return 3;
   168280    case 9: return 3;
   168281    case 8: return 3;
   168282    case 7:
   168283       if (devinfo->is_haswell) {
   168284          return 3;
   168285       } else {
   168286          return 3;
   168287       }
   168288    case 6: return 3;
   168289    case 5: return 0;
   168290    case 4:
   168291       if (devinfo->is_g4x) {
   168292          return 0;
   168293       } else {
   168294          return 0;
   168295       }
   168296    default:
   168297       unreachable("Invalid hardware generation");
   168298    }
   168299 }
   168300 
   168301 
   168302 
   168303 #define GEN10_MI_SUSPEND_FLUSH_CommandType_start  29
   168304 #define GEN9_MI_SUSPEND_FLUSH_CommandType_start  29
   168305 #define GEN8_MI_SUSPEND_FLUSH_CommandType_start  29
   168306 #define GEN75_MI_SUSPEND_FLUSH_CommandType_start  29
   168307 #define GEN7_MI_SUSPEND_FLUSH_CommandType_start  29
   168308 #define GEN6_MI_SUSPEND_FLUSH_CommandType_start  29
   168309 
   168310 static inline uint32_t ATTRIBUTE_PURE
   168311 MI_SUSPEND_FLUSH_CommandType_start(const struct gen_device_info *devinfo)
   168312 {
   168313    switch (devinfo->gen) {
   168314    case 10: return 29;
   168315    case 9: return 29;
   168316    case 8: return 29;
   168317    case 7:
   168318       if (devinfo->is_haswell) {
   168319          return 29;
   168320       } else {
   168321          return 29;
   168322       }
   168323    case 6: return 29;
   168324    case 5: return 0;
   168325    case 4:
   168326       if (devinfo->is_g4x) {
   168327          return 0;
   168328       } else {
   168329          return 0;
   168330       }
   168331    default:
   168332       unreachable("Invalid hardware generation");
   168333    }
   168334 }
   168335 
   168336 
   168337 
   168338 /* MI_SUSPEND_FLUSH::MI Command Opcode */
   168339 
   168340 
   168341 #define GEN10_MI_SUSPEND_FLUSH_MICommandOpcode_bits  6
   168342 #define GEN9_MI_SUSPEND_FLUSH_MICommandOpcode_bits  6
   168343 #define GEN8_MI_SUSPEND_FLUSH_MICommandOpcode_bits  6
   168344 #define GEN75_MI_SUSPEND_FLUSH_MICommandOpcode_bits  6
   168345 #define GEN7_MI_SUSPEND_FLUSH_MICommandOpcode_bits  6
   168346 #define GEN6_MI_SUSPEND_FLUSH_MICommandOpcode_bits  6
   168347 
   168348 static inline uint32_t ATTRIBUTE_PURE
   168349 MI_SUSPEND_FLUSH_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   168350 {
   168351    switch (devinfo->gen) {
   168352    case 10: return 6;
   168353    case 9: return 6;
   168354    case 8: return 6;
   168355    case 7:
   168356       if (devinfo->is_haswell) {
   168357          return 6;
   168358       } else {
   168359          return 6;
   168360       }
   168361    case 6: return 6;
   168362    case 5: return 0;
   168363    case 4:
   168364       if (devinfo->is_g4x) {
   168365          return 0;
   168366       } else {
   168367          return 0;
   168368       }
   168369    default:
   168370       unreachable("Invalid hardware generation");
   168371    }
   168372 }
   168373 
   168374 
   168375 
   168376 #define GEN10_MI_SUSPEND_FLUSH_MICommandOpcode_start  23
   168377 #define GEN9_MI_SUSPEND_FLUSH_MICommandOpcode_start  23
   168378 #define GEN8_MI_SUSPEND_FLUSH_MICommandOpcode_start  23
   168379 #define GEN75_MI_SUSPEND_FLUSH_MICommandOpcode_start  23
   168380 #define GEN7_MI_SUSPEND_FLUSH_MICommandOpcode_start  23
   168381 #define GEN6_MI_SUSPEND_FLUSH_MICommandOpcode_start  23
   168382 
   168383 static inline uint32_t ATTRIBUTE_PURE
   168384 MI_SUSPEND_FLUSH_MICommandOpcode_start(const struct gen_device_info *devinfo)
   168385 {
   168386    switch (devinfo->gen) {
   168387    case 10: return 23;
   168388    case 9: return 23;
   168389    case 8: return 23;
   168390    case 7:
   168391       if (devinfo->is_haswell) {
   168392          return 23;
   168393       } else {
   168394          return 23;
   168395       }
   168396    case 6: return 23;
   168397    case 5: return 0;
   168398    case 4:
   168399       if (devinfo->is_g4x) {
   168400          return 0;
   168401       } else {
   168402          return 0;
   168403       }
   168404    default:
   168405       unreachable("Invalid hardware generation");
   168406    }
   168407 }
   168408 
   168409 
   168410 
   168411 /* MI_SUSPEND_FLUSH::Suspend Flush */
   168412 
   168413 
   168414 #define GEN10_MI_SUSPEND_FLUSH_SuspendFlush_bits  1
   168415 #define GEN9_MI_SUSPEND_FLUSH_SuspendFlush_bits  1
   168416 #define GEN8_MI_SUSPEND_FLUSH_SuspendFlush_bits  1
   168417 #define GEN75_MI_SUSPEND_FLUSH_SuspendFlush_bits  1
   168418 #define GEN7_MI_SUSPEND_FLUSH_SuspendFlush_bits  1
   168419 #define GEN6_MI_SUSPEND_FLUSH_SuspendFlush_bits  1
   168420 
   168421 static inline uint32_t ATTRIBUTE_PURE
   168422 MI_SUSPEND_FLUSH_SuspendFlush_bits(const struct gen_device_info *devinfo)
   168423 {
   168424    switch (devinfo->gen) {
   168425    case 10: return 1;
   168426    case 9: return 1;
   168427    case 8: return 1;
   168428    case 7:
   168429       if (devinfo->is_haswell) {
   168430          return 1;
   168431       } else {
   168432          return 1;
   168433       }
   168434    case 6: return 1;
   168435    case 5: return 0;
   168436    case 4:
   168437       if (devinfo->is_g4x) {
   168438          return 0;
   168439       } else {
   168440          return 0;
   168441       }
   168442    default:
   168443       unreachable("Invalid hardware generation");
   168444    }
   168445 }
   168446 
   168447 
   168448 
   168449 #define GEN10_MI_SUSPEND_FLUSH_SuspendFlush_start  0
   168450 #define GEN9_MI_SUSPEND_FLUSH_SuspendFlush_start  0
   168451 #define GEN8_MI_SUSPEND_FLUSH_SuspendFlush_start  0
   168452 #define GEN75_MI_SUSPEND_FLUSH_SuspendFlush_start  0
   168453 #define GEN7_MI_SUSPEND_FLUSH_SuspendFlush_start  0
   168454 #define GEN6_MI_SUSPEND_FLUSH_SuspendFlush_start  0
   168455 
   168456 static inline uint32_t ATTRIBUTE_PURE
   168457 MI_SUSPEND_FLUSH_SuspendFlush_start(const struct gen_device_info *devinfo)
   168458 {
   168459    switch (devinfo->gen) {
   168460    case 10: return 0;
   168461    case 9: return 0;
   168462    case 8: return 0;
   168463    case 7:
   168464       if (devinfo->is_haswell) {
   168465          return 0;
   168466       } else {
   168467          return 0;
   168468       }
   168469    case 6: return 0;
   168470    case 5: return 0;
   168471    case 4:
   168472       if (devinfo->is_g4x) {
   168473          return 0;
   168474       } else {
   168475          return 0;
   168476       }
   168477    default:
   168478       unreachable("Invalid hardware generation");
   168479    }
   168480 }
   168481 
   168482 
   168483 
   168484 /* MI_TOPOLOGY_FILTER */
   168485 
   168486 
   168487 #define GEN10_MI_TOPOLOGY_FILTER_length  1
   168488 #define GEN9_MI_TOPOLOGY_FILTER_length  1
   168489 #define GEN8_MI_TOPOLOGY_FILTER_length  1
   168490 #define GEN75_MI_TOPOLOGY_FILTER_length  1
   168491 #define GEN7_MI_TOPOLOGY_FILTER_length  1
   168492 
   168493 static inline uint32_t ATTRIBUTE_PURE
   168494 MI_TOPOLOGY_FILTER_length(const struct gen_device_info *devinfo)
   168495 {
   168496    switch (devinfo->gen) {
   168497    case 10: return 1;
   168498    case 9: return 1;
   168499    case 8: return 1;
   168500    case 7:
   168501       if (devinfo->is_haswell) {
   168502          return 1;
   168503       } else {
   168504          return 1;
   168505       }
   168506    case 6: return 0;
   168507    case 5: return 0;
   168508    case 4:
   168509       if (devinfo->is_g4x) {
   168510          return 0;
   168511       } else {
   168512          return 0;
   168513       }
   168514    default:
   168515       unreachable("Invalid hardware generation");
   168516    }
   168517 }
   168518 
   168519 
   168520 
   168521 /* MI_TOPOLOGY_FILTER::Command Type */
   168522 
   168523 
   168524 #define GEN10_MI_TOPOLOGY_FILTER_CommandType_bits  3
   168525 #define GEN9_MI_TOPOLOGY_FILTER_CommandType_bits  3
   168526 #define GEN8_MI_TOPOLOGY_FILTER_CommandType_bits  3
   168527 #define GEN75_MI_TOPOLOGY_FILTER_CommandType_bits  3
   168528 #define GEN7_MI_TOPOLOGY_FILTER_CommandType_bits  3
   168529 
   168530 static inline uint32_t ATTRIBUTE_PURE
   168531 MI_TOPOLOGY_FILTER_CommandType_bits(const struct gen_device_info *devinfo)
   168532 {
   168533    switch (devinfo->gen) {
   168534    case 10: return 3;
   168535    case 9: return 3;
   168536    case 8: return 3;
   168537    case 7:
   168538       if (devinfo->is_haswell) {
   168539          return 3;
   168540       } else {
   168541          return 3;
   168542       }
   168543    case 6: return 0;
   168544    case 5: return 0;
   168545    case 4:
   168546       if (devinfo->is_g4x) {
   168547          return 0;
   168548       } else {
   168549          return 0;
   168550       }
   168551    default:
   168552       unreachable("Invalid hardware generation");
   168553    }
   168554 }
   168555 
   168556 
   168557 
   168558 #define GEN10_MI_TOPOLOGY_FILTER_CommandType_start  29
   168559 #define GEN9_MI_TOPOLOGY_FILTER_CommandType_start  29
   168560 #define GEN8_MI_TOPOLOGY_FILTER_CommandType_start  29
   168561 #define GEN75_MI_TOPOLOGY_FILTER_CommandType_start  29
   168562 #define GEN7_MI_TOPOLOGY_FILTER_CommandType_start  29
   168563 
   168564 static inline uint32_t ATTRIBUTE_PURE
   168565 MI_TOPOLOGY_FILTER_CommandType_start(const struct gen_device_info *devinfo)
   168566 {
   168567    switch (devinfo->gen) {
   168568    case 10: return 29;
   168569    case 9: return 29;
   168570    case 8: return 29;
   168571    case 7:
   168572       if (devinfo->is_haswell) {
   168573          return 29;
   168574       } else {
   168575          return 29;
   168576       }
   168577    case 6: return 0;
   168578    case 5: return 0;
   168579    case 4:
   168580       if (devinfo->is_g4x) {
   168581          return 0;
   168582       } else {
   168583          return 0;
   168584       }
   168585    default:
   168586       unreachable("Invalid hardware generation");
   168587    }
   168588 }
   168589 
   168590 
   168591 
   168592 /* MI_TOPOLOGY_FILTER::MI Command Opcode */
   168593 
   168594 
   168595 #define GEN10_MI_TOPOLOGY_FILTER_MICommandOpcode_bits  6
   168596 #define GEN9_MI_TOPOLOGY_FILTER_MICommandOpcode_bits  6
   168597 #define GEN8_MI_TOPOLOGY_FILTER_MICommandOpcode_bits  6
   168598 #define GEN75_MI_TOPOLOGY_FILTER_MICommandOpcode_bits  6
   168599 #define GEN7_MI_TOPOLOGY_FILTER_MICommandOpcode_bits  6
   168600 
   168601 static inline uint32_t ATTRIBUTE_PURE
   168602 MI_TOPOLOGY_FILTER_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   168603 {
   168604    switch (devinfo->gen) {
   168605    case 10: return 6;
   168606    case 9: return 6;
   168607    case 8: return 6;
   168608    case 7:
   168609       if (devinfo->is_haswell) {
   168610          return 6;
   168611       } else {
   168612          return 6;
   168613       }
   168614    case 6: return 0;
   168615    case 5: return 0;
   168616    case 4:
   168617       if (devinfo->is_g4x) {
   168618          return 0;
   168619       } else {
   168620          return 0;
   168621       }
   168622    default:
   168623       unreachable("Invalid hardware generation");
   168624    }
   168625 }
   168626 
   168627 
   168628 
   168629 #define GEN10_MI_TOPOLOGY_FILTER_MICommandOpcode_start  23
   168630 #define GEN9_MI_TOPOLOGY_FILTER_MICommandOpcode_start  23
   168631 #define GEN8_MI_TOPOLOGY_FILTER_MICommandOpcode_start  23
   168632 #define GEN75_MI_TOPOLOGY_FILTER_MICommandOpcode_start  23
   168633 #define GEN7_MI_TOPOLOGY_FILTER_MICommandOpcode_start  23
   168634 
   168635 static inline uint32_t ATTRIBUTE_PURE
   168636 MI_TOPOLOGY_FILTER_MICommandOpcode_start(const struct gen_device_info *devinfo)
   168637 {
   168638    switch (devinfo->gen) {
   168639    case 10: return 23;
   168640    case 9: return 23;
   168641    case 8: return 23;
   168642    case 7:
   168643       if (devinfo->is_haswell) {
   168644          return 23;
   168645       } else {
   168646          return 23;
   168647       }
   168648    case 6: return 0;
   168649    case 5: return 0;
   168650    case 4:
   168651       if (devinfo->is_g4x) {
   168652          return 0;
   168653       } else {
   168654          return 0;
   168655       }
   168656    default:
   168657       unreachable("Invalid hardware generation");
   168658    }
   168659 }
   168660 
   168661 
   168662 
   168663 /* MI_TOPOLOGY_FILTER::Topology Filter Value */
   168664 
   168665 
   168666 #define GEN10_MI_TOPOLOGY_FILTER_TopologyFilterValue_bits  6
   168667 #define GEN9_MI_TOPOLOGY_FILTER_TopologyFilterValue_bits  6
   168668 #define GEN8_MI_TOPOLOGY_FILTER_TopologyFilterValue_bits  6
   168669 #define GEN75_MI_TOPOLOGY_FILTER_TopologyFilterValue_bits  6
   168670 #define GEN7_MI_TOPOLOGY_FILTER_TopologyFilterValue_bits  6
   168671 
   168672 static inline uint32_t ATTRIBUTE_PURE
   168673 MI_TOPOLOGY_FILTER_TopologyFilterValue_bits(const struct gen_device_info *devinfo)
   168674 {
   168675    switch (devinfo->gen) {
   168676    case 10: return 6;
   168677    case 9: return 6;
   168678    case 8: return 6;
   168679    case 7:
   168680       if (devinfo->is_haswell) {
   168681          return 6;
   168682       } else {
   168683          return 6;
   168684       }
   168685    case 6: return 0;
   168686    case 5: return 0;
   168687    case 4:
   168688       if (devinfo->is_g4x) {
   168689          return 0;
   168690       } else {
   168691          return 0;
   168692       }
   168693    default:
   168694       unreachable("Invalid hardware generation");
   168695    }
   168696 }
   168697 
   168698 
   168699 
   168700 #define GEN10_MI_TOPOLOGY_FILTER_TopologyFilterValue_start  0
   168701 #define GEN9_MI_TOPOLOGY_FILTER_TopologyFilterValue_start  0
   168702 #define GEN8_MI_TOPOLOGY_FILTER_TopologyFilterValue_start  0
   168703 #define GEN75_MI_TOPOLOGY_FILTER_TopologyFilterValue_start  0
   168704 #define GEN7_MI_TOPOLOGY_FILTER_TopologyFilterValue_start  0
   168705 
   168706 static inline uint32_t ATTRIBUTE_PURE
   168707 MI_TOPOLOGY_FILTER_TopologyFilterValue_start(const struct gen_device_info *devinfo)
   168708 {
   168709    switch (devinfo->gen) {
   168710    case 10: return 0;
   168711    case 9: return 0;
   168712    case 8: return 0;
   168713    case 7:
   168714       if (devinfo->is_haswell) {
   168715          return 0;
   168716       } else {
   168717          return 0;
   168718       }
   168719    case 6: return 0;
   168720    case 5: return 0;
   168721    case 4:
   168722       if (devinfo->is_g4x) {
   168723          return 0;
   168724       } else {
   168725          return 0;
   168726       }
   168727    default:
   168728       unreachable("Invalid hardware generation");
   168729    }
   168730 }
   168731 
   168732 
   168733 
   168734 /* MI_UPDATE_GTT */
   168735 
   168736 
   168737 
   168738 
   168739 
   168740 /* MI_UPDATE_GTT::Command Type */
   168741 
   168742 
   168743 #define GEN10_MI_UPDATE_GTT_CommandType_bits  3
   168744 
   168745 static inline uint32_t ATTRIBUTE_PURE
   168746 MI_UPDATE_GTT_CommandType_bits(const struct gen_device_info *devinfo)
   168747 {
   168748    switch (devinfo->gen) {
   168749    case 10: return 3;
   168750    case 9: return 0;
   168751    case 8: return 0;
   168752    case 7:
   168753       if (devinfo->is_haswell) {
   168754          return 0;
   168755       } else {
   168756          return 0;
   168757       }
   168758    case 6: return 0;
   168759    case 5: return 0;
   168760    case 4:
   168761       if (devinfo->is_g4x) {
   168762          return 0;
   168763       } else {
   168764          return 0;
   168765       }
   168766    default:
   168767       unreachable("Invalid hardware generation");
   168768    }
   168769 }
   168770 
   168771 
   168772 
   168773 #define GEN10_MI_UPDATE_GTT_CommandType_start  29
   168774 
   168775 static inline uint32_t ATTRIBUTE_PURE
   168776 MI_UPDATE_GTT_CommandType_start(const struct gen_device_info *devinfo)
   168777 {
   168778    switch (devinfo->gen) {
   168779    case 10: return 29;
   168780    case 9: return 0;
   168781    case 8: return 0;
   168782    case 7:
   168783       if (devinfo->is_haswell) {
   168784          return 0;
   168785       } else {
   168786          return 0;
   168787       }
   168788    case 6: return 0;
   168789    case 5: return 0;
   168790    case 4:
   168791       if (devinfo->is_g4x) {
   168792          return 0;
   168793       } else {
   168794          return 0;
   168795       }
   168796    default:
   168797       unreachable("Invalid hardware generation");
   168798    }
   168799 }
   168800 
   168801 
   168802 
   168803 /* MI_UPDATE_GTT::DWord Length */
   168804 
   168805 
   168806 #define GEN10_MI_UPDATE_GTT_DWordLength_bits  10
   168807 
   168808 static inline uint32_t ATTRIBUTE_PURE
   168809 MI_UPDATE_GTT_DWordLength_bits(const struct gen_device_info *devinfo)
   168810 {
   168811    switch (devinfo->gen) {
   168812    case 10: return 10;
   168813    case 9: return 0;
   168814    case 8: return 0;
   168815    case 7:
   168816       if (devinfo->is_haswell) {
   168817          return 0;
   168818       } else {
   168819          return 0;
   168820       }
   168821    case 6: return 0;
   168822    case 5: return 0;
   168823    case 4:
   168824       if (devinfo->is_g4x) {
   168825          return 0;
   168826       } else {
   168827          return 0;
   168828       }
   168829    default:
   168830       unreachable("Invalid hardware generation");
   168831    }
   168832 }
   168833 
   168834 
   168835 
   168836 #define GEN10_MI_UPDATE_GTT_DWordLength_start  0
   168837 
   168838 static inline uint32_t ATTRIBUTE_PURE
   168839 MI_UPDATE_GTT_DWordLength_start(const struct gen_device_info *devinfo)
   168840 {
   168841    switch (devinfo->gen) {
   168842    case 10: return 0;
   168843    case 9: return 0;
   168844    case 8: return 0;
   168845    case 7:
   168846       if (devinfo->is_haswell) {
   168847          return 0;
   168848       } else {
   168849          return 0;
   168850       }
   168851    case 6: return 0;
   168852    case 5: return 0;
   168853    case 4:
   168854       if (devinfo->is_g4x) {
   168855          return 0;
   168856       } else {
   168857          return 0;
   168858       }
   168859    default:
   168860       unreachable("Invalid hardware generation");
   168861    }
   168862 }
   168863 
   168864 
   168865 
   168866 /* MI_UPDATE_GTT::Entry Address */
   168867 
   168868 
   168869 #define GEN10_MI_UPDATE_GTT_EntryAddress_bits  20
   168870 
   168871 static inline uint32_t ATTRIBUTE_PURE
   168872 MI_UPDATE_GTT_EntryAddress_bits(const struct gen_device_info *devinfo)
   168873 {
   168874    switch (devinfo->gen) {
   168875    case 10: return 20;
   168876    case 9: return 0;
   168877    case 8: return 0;
   168878    case 7:
   168879       if (devinfo->is_haswell) {
   168880          return 0;
   168881       } else {
   168882          return 0;
   168883       }
   168884    case 6: return 0;
   168885    case 5: return 0;
   168886    case 4:
   168887       if (devinfo->is_g4x) {
   168888          return 0;
   168889       } else {
   168890          return 0;
   168891       }
   168892    default:
   168893       unreachable("Invalid hardware generation");
   168894    }
   168895 }
   168896 
   168897 
   168898 
   168899 #define GEN10_MI_UPDATE_GTT_EntryAddress_start  44
   168900 
   168901 static inline uint32_t ATTRIBUTE_PURE
   168902 MI_UPDATE_GTT_EntryAddress_start(const struct gen_device_info *devinfo)
   168903 {
   168904    switch (devinfo->gen) {
   168905    case 10: return 44;
   168906    case 9: return 0;
   168907    case 8: return 0;
   168908    case 7:
   168909       if (devinfo->is_haswell) {
   168910          return 0;
   168911       } else {
   168912          return 0;
   168913       }
   168914    case 6: return 0;
   168915    case 5: return 0;
   168916    case 4:
   168917       if (devinfo->is_g4x) {
   168918          return 0;
   168919       } else {
   168920          return 0;
   168921       }
   168922    default:
   168923       unreachable("Invalid hardware generation");
   168924    }
   168925 }
   168926 
   168927 
   168928 
   168929 /* MI_UPDATE_GTT::Entry Data */
   168930 
   168931 
   168932 #define GEN10_MI_UPDATE_GTT_EntryData_bits  64
   168933 
   168934 static inline uint32_t ATTRIBUTE_PURE
   168935 MI_UPDATE_GTT_EntryData_bits(const struct gen_device_info *devinfo)
   168936 {
   168937    switch (devinfo->gen) {
   168938    case 10: return 64;
   168939    case 9: return 0;
   168940    case 8: return 0;
   168941    case 7:
   168942       if (devinfo->is_haswell) {
   168943          return 0;
   168944       } else {
   168945          return 0;
   168946       }
   168947    case 6: return 0;
   168948    case 5: return 0;
   168949    case 4:
   168950       if (devinfo->is_g4x) {
   168951          return 0;
   168952       } else {
   168953          return 0;
   168954       }
   168955    default:
   168956       unreachable("Invalid hardware generation");
   168957    }
   168958 }
   168959 
   168960 
   168961 
   168962 #define GEN10_MI_UPDATE_GTT_EntryData_start  0
   168963 
   168964 static inline uint32_t ATTRIBUTE_PURE
   168965 MI_UPDATE_GTT_EntryData_start(const struct gen_device_info *devinfo)
   168966 {
   168967    switch (devinfo->gen) {
   168968    case 10: return 0;
   168969    case 9: return 0;
   168970    case 8: return 0;
   168971    case 7:
   168972       if (devinfo->is_haswell) {
   168973          return 0;
   168974       } else {
   168975          return 0;
   168976       }
   168977    case 6: return 0;
   168978    case 5: return 0;
   168979    case 4:
   168980       if (devinfo->is_g4x) {
   168981          return 0;
   168982       } else {
   168983          return 0;
   168984       }
   168985    default:
   168986       unreachable("Invalid hardware generation");
   168987    }
   168988 }
   168989 
   168990 
   168991 
   168992 /* MI_UPDATE_GTT::MI Command Opcode */
   168993 
   168994 
   168995 #define GEN10_MI_UPDATE_GTT_MICommandOpcode_bits  6
   168996 
   168997 static inline uint32_t ATTRIBUTE_PURE
   168998 MI_UPDATE_GTT_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   168999 {
   169000    switch (devinfo->gen) {
   169001    case 10: return 6;
   169002    case 9: return 0;
   169003    case 8: return 0;
   169004    case 7:
   169005       if (devinfo->is_haswell) {
   169006          return 0;
   169007       } else {
   169008          return 0;
   169009       }
   169010    case 6: return 0;
   169011    case 5: return 0;
   169012    case 4:
   169013       if (devinfo->is_g4x) {
   169014          return 0;
   169015       } else {
   169016          return 0;
   169017       }
   169018    default:
   169019       unreachable("Invalid hardware generation");
   169020    }
   169021 }
   169022 
   169023 
   169024 
   169025 #define GEN10_MI_UPDATE_GTT_MICommandOpcode_start  23
   169026 
   169027 static inline uint32_t ATTRIBUTE_PURE
   169028 MI_UPDATE_GTT_MICommandOpcode_start(const struct gen_device_info *devinfo)
   169029 {
   169030    switch (devinfo->gen) {
   169031    case 10: return 23;
   169032    case 9: return 0;
   169033    case 8: return 0;
   169034    case 7:
   169035       if (devinfo->is_haswell) {
   169036          return 0;
   169037       } else {
   169038          return 0;
   169039       }
   169040    case 6: return 0;
   169041    case 5: return 0;
   169042    case 4:
   169043       if (devinfo->is_g4x) {
   169044          return 0;
   169045       } else {
   169046          return 0;
   169047       }
   169048    default:
   169049       unreachable("Invalid hardware generation");
   169050    }
   169051 }
   169052 
   169053 
   169054 
   169055 /* MI_URB_ATOMIC_ALLOC */
   169056 
   169057 
   169058 #define GEN9_MI_URB_ATOMIC_ALLOC_length  1
   169059 #define GEN8_MI_URB_ATOMIC_ALLOC_length  1
   169060 #define GEN75_MI_URB_ATOMIC_ALLOC_length  1
   169061 
   169062 static inline uint32_t ATTRIBUTE_PURE
   169063 MI_URB_ATOMIC_ALLOC_length(const struct gen_device_info *devinfo)
   169064 {
   169065    switch (devinfo->gen) {
   169066    case 10: return 0;
   169067    case 9: return 1;
   169068    case 8: return 1;
   169069    case 7:
   169070       if (devinfo->is_haswell) {
   169071          return 1;
   169072       } else {
   169073          return 0;
   169074       }
   169075    case 6: return 0;
   169076    case 5: return 0;
   169077    case 4:
   169078       if (devinfo->is_g4x) {
   169079          return 0;
   169080       } else {
   169081          return 0;
   169082       }
   169083    default:
   169084       unreachable("Invalid hardware generation");
   169085    }
   169086 }
   169087 
   169088 
   169089 
   169090 /* MI_URB_ATOMIC_ALLOC::Command Type */
   169091 
   169092 
   169093 #define GEN9_MI_URB_ATOMIC_ALLOC_CommandType_bits  3
   169094 #define GEN8_MI_URB_ATOMIC_ALLOC_CommandType_bits  3
   169095 #define GEN75_MI_URB_ATOMIC_ALLOC_CommandType_bits  3
   169096 
   169097 static inline uint32_t ATTRIBUTE_PURE
   169098 MI_URB_ATOMIC_ALLOC_CommandType_bits(const struct gen_device_info *devinfo)
   169099 {
   169100    switch (devinfo->gen) {
   169101    case 10: return 0;
   169102    case 9: return 3;
   169103    case 8: return 3;
   169104    case 7:
   169105       if (devinfo->is_haswell) {
   169106          return 3;
   169107       } else {
   169108          return 0;
   169109       }
   169110    case 6: return 0;
   169111    case 5: return 0;
   169112    case 4:
   169113       if (devinfo->is_g4x) {
   169114          return 0;
   169115       } else {
   169116          return 0;
   169117       }
   169118    default:
   169119       unreachable("Invalid hardware generation");
   169120    }
   169121 }
   169122 
   169123 
   169124 
   169125 #define GEN9_MI_URB_ATOMIC_ALLOC_CommandType_start  29
   169126 #define GEN8_MI_URB_ATOMIC_ALLOC_CommandType_start  29
   169127 #define GEN75_MI_URB_ATOMIC_ALLOC_CommandType_start  29
   169128 
   169129 static inline uint32_t ATTRIBUTE_PURE
   169130 MI_URB_ATOMIC_ALLOC_CommandType_start(const struct gen_device_info *devinfo)
   169131 {
   169132    switch (devinfo->gen) {
   169133    case 10: return 0;
   169134    case 9: return 29;
   169135    case 8: return 29;
   169136    case 7:
   169137       if (devinfo->is_haswell) {
   169138          return 29;
   169139       } else {
   169140          return 0;
   169141       }
   169142    case 6: return 0;
   169143    case 5: return 0;
   169144    case 4:
   169145       if (devinfo->is_g4x) {
   169146          return 0;
   169147       } else {
   169148          return 0;
   169149       }
   169150    default:
   169151       unreachable("Invalid hardware generation");
   169152    }
   169153 }
   169154 
   169155 
   169156 
   169157 /* MI_URB_ATOMIC_ALLOC::MI Command Opcode */
   169158 
   169159 
   169160 #define GEN9_MI_URB_ATOMIC_ALLOC_MICommandOpcode_bits  6
   169161 #define GEN8_MI_URB_ATOMIC_ALLOC_MICommandOpcode_bits  6
   169162 #define GEN75_MI_URB_ATOMIC_ALLOC_MICommandOpcode_bits  6
   169163 
   169164 static inline uint32_t ATTRIBUTE_PURE
   169165 MI_URB_ATOMIC_ALLOC_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   169166 {
   169167    switch (devinfo->gen) {
   169168    case 10: return 0;
   169169    case 9: return 6;
   169170    case 8: return 6;
   169171    case 7:
   169172       if (devinfo->is_haswell) {
   169173          return 6;
   169174       } else {
   169175          return 0;
   169176       }
   169177    case 6: return 0;
   169178    case 5: return 0;
   169179    case 4:
   169180       if (devinfo->is_g4x) {
   169181          return 0;
   169182       } else {
   169183          return 0;
   169184       }
   169185    default:
   169186       unreachable("Invalid hardware generation");
   169187    }
   169188 }
   169189 
   169190 
   169191 
   169192 #define GEN9_MI_URB_ATOMIC_ALLOC_MICommandOpcode_start  23
   169193 #define GEN8_MI_URB_ATOMIC_ALLOC_MICommandOpcode_start  23
   169194 #define GEN75_MI_URB_ATOMIC_ALLOC_MICommandOpcode_start  23
   169195 
   169196 static inline uint32_t ATTRIBUTE_PURE
   169197 MI_URB_ATOMIC_ALLOC_MICommandOpcode_start(const struct gen_device_info *devinfo)
   169198 {
   169199    switch (devinfo->gen) {
   169200    case 10: return 0;
   169201    case 9: return 23;
   169202    case 8: return 23;
   169203    case 7:
   169204       if (devinfo->is_haswell) {
   169205          return 23;
   169206       } else {
   169207          return 0;
   169208       }
   169209    case 6: return 0;
   169210    case 5: return 0;
   169211    case 4:
   169212       if (devinfo->is_g4x) {
   169213          return 0;
   169214       } else {
   169215          return 0;
   169216       }
   169217    default:
   169218       unreachable("Invalid hardware generation");
   169219    }
   169220 }
   169221 
   169222 
   169223 
   169224 /* MI_URB_ATOMIC_ALLOC::URB Atomic Storage Offset */
   169225 
   169226 
   169227 #define GEN9_MI_URB_ATOMIC_ALLOC_URBAtomicStorageOffset_bits  8
   169228 #define GEN8_MI_URB_ATOMIC_ALLOC_URBAtomicStorageOffset_bits  8
   169229 #define GEN75_MI_URB_ATOMIC_ALLOC_URBAtomicStorageOffset_bits  8
   169230 
   169231 static inline uint32_t ATTRIBUTE_PURE
   169232 MI_URB_ATOMIC_ALLOC_URBAtomicStorageOffset_bits(const struct gen_device_info *devinfo)
   169233 {
   169234    switch (devinfo->gen) {
   169235    case 10: return 0;
   169236    case 9: return 8;
   169237    case 8: return 8;
   169238    case 7:
   169239       if (devinfo->is_haswell) {
   169240          return 8;
   169241       } else {
   169242          return 0;
   169243       }
   169244    case 6: return 0;
   169245    case 5: return 0;
   169246    case 4:
   169247       if (devinfo->is_g4x) {
   169248          return 0;
   169249       } else {
   169250          return 0;
   169251       }
   169252    default:
   169253       unreachable("Invalid hardware generation");
   169254    }
   169255 }
   169256 
   169257 
   169258 
   169259 #define GEN9_MI_URB_ATOMIC_ALLOC_URBAtomicStorageOffset_start  12
   169260 #define GEN8_MI_URB_ATOMIC_ALLOC_URBAtomicStorageOffset_start  12
   169261 #define GEN75_MI_URB_ATOMIC_ALLOC_URBAtomicStorageOffset_start  12
   169262 
   169263 static inline uint32_t ATTRIBUTE_PURE
   169264 MI_URB_ATOMIC_ALLOC_URBAtomicStorageOffset_start(const struct gen_device_info *devinfo)
   169265 {
   169266    switch (devinfo->gen) {
   169267    case 10: return 0;
   169268    case 9: return 12;
   169269    case 8: return 12;
   169270    case 7:
   169271       if (devinfo->is_haswell) {
   169272          return 12;
   169273       } else {
   169274          return 0;
   169275       }
   169276    case 6: return 0;
   169277    case 5: return 0;
   169278    case 4:
   169279       if (devinfo->is_g4x) {
   169280          return 0;
   169281       } else {
   169282          return 0;
   169283       }
   169284    default:
   169285       unreachable("Invalid hardware generation");
   169286    }
   169287 }
   169288 
   169289 
   169290 
   169291 /* MI_URB_ATOMIC_ALLOC::URB Atomic Storage Size */
   169292 
   169293 
   169294 #define GEN9_MI_URB_ATOMIC_ALLOC_URBAtomicStorageSize_bits  9
   169295 #define GEN8_MI_URB_ATOMIC_ALLOC_URBAtomicStorageSize_bits  9
   169296 #define GEN75_MI_URB_ATOMIC_ALLOC_URBAtomicStorageSize_bits  9
   169297 
   169298 static inline uint32_t ATTRIBUTE_PURE
   169299 MI_URB_ATOMIC_ALLOC_URBAtomicStorageSize_bits(const struct gen_device_info *devinfo)
   169300 {
   169301    switch (devinfo->gen) {
   169302    case 10: return 0;
   169303    case 9: return 9;
   169304    case 8: return 9;
   169305    case 7:
   169306       if (devinfo->is_haswell) {
   169307          return 9;
   169308       } else {
   169309          return 0;
   169310       }
   169311    case 6: return 0;
   169312    case 5: return 0;
   169313    case 4:
   169314       if (devinfo->is_g4x) {
   169315          return 0;
   169316       } else {
   169317          return 0;
   169318       }
   169319    default:
   169320       unreachable("Invalid hardware generation");
   169321    }
   169322 }
   169323 
   169324 
   169325 
   169326 #define GEN9_MI_URB_ATOMIC_ALLOC_URBAtomicStorageSize_start  0
   169327 #define GEN8_MI_URB_ATOMIC_ALLOC_URBAtomicStorageSize_start  0
   169328 #define GEN75_MI_URB_ATOMIC_ALLOC_URBAtomicStorageSize_start  0
   169329 
   169330 static inline uint32_t ATTRIBUTE_PURE
   169331 MI_URB_ATOMIC_ALLOC_URBAtomicStorageSize_start(const struct gen_device_info *devinfo)
   169332 {
   169333    switch (devinfo->gen) {
   169334    case 10: return 0;
   169335    case 9: return 0;
   169336    case 8: return 0;
   169337    case 7:
   169338       if (devinfo->is_haswell) {
   169339          return 0;
   169340       } else {
   169341          return 0;
   169342       }
   169343    case 6: return 0;
   169344    case 5: return 0;
   169345    case 4:
   169346       if (devinfo->is_g4x) {
   169347          return 0;
   169348       } else {
   169349          return 0;
   169350       }
   169351    default:
   169352       unreachable("Invalid hardware generation");
   169353    }
   169354 }
   169355 
   169356 
   169357 
   169358 /* MI_URB_CLEAR */
   169359 
   169360 
   169361 #define GEN8_MI_URB_CLEAR_length  2
   169362 #define GEN75_MI_URB_CLEAR_length  2
   169363 #define GEN7_MI_URB_CLEAR_length  2
   169364 #define GEN6_MI_URB_CLEAR_length  2
   169365 
   169366 static inline uint32_t ATTRIBUTE_PURE
   169367 MI_URB_CLEAR_length(const struct gen_device_info *devinfo)
   169368 {
   169369    switch (devinfo->gen) {
   169370    case 10: return 0;
   169371    case 9: return 0;
   169372    case 8: return 2;
   169373    case 7:
   169374       if (devinfo->is_haswell) {
   169375          return 2;
   169376       } else {
   169377          return 2;
   169378       }
   169379    case 6: return 2;
   169380    case 5: return 0;
   169381    case 4:
   169382       if (devinfo->is_g4x) {
   169383          return 0;
   169384       } else {
   169385          return 0;
   169386       }
   169387    default:
   169388       unreachable("Invalid hardware generation");
   169389    }
   169390 }
   169391 
   169392 
   169393 
   169394 /* MI_URB_CLEAR::Command Type */
   169395 
   169396 
   169397 #define GEN8_MI_URB_CLEAR_CommandType_bits  3
   169398 #define GEN75_MI_URB_CLEAR_CommandType_bits  3
   169399 #define GEN7_MI_URB_CLEAR_CommandType_bits  3
   169400 #define GEN6_MI_URB_CLEAR_CommandType_bits  3
   169401 
   169402 static inline uint32_t ATTRIBUTE_PURE
   169403 MI_URB_CLEAR_CommandType_bits(const struct gen_device_info *devinfo)
   169404 {
   169405    switch (devinfo->gen) {
   169406    case 10: return 0;
   169407    case 9: return 0;
   169408    case 8: return 3;
   169409    case 7:
   169410       if (devinfo->is_haswell) {
   169411          return 3;
   169412       } else {
   169413          return 3;
   169414       }
   169415    case 6: return 3;
   169416    case 5: return 0;
   169417    case 4:
   169418       if (devinfo->is_g4x) {
   169419          return 0;
   169420       } else {
   169421          return 0;
   169422       }
   169423    default:
   169424       unreachable("Invalid hardware generation");
   169425    }
   169426 }
   169427 
   169428 
   169429 
   169430 #define GEN8_MI_URB_CLEAR_CommandType_start  29
   169431 #define GEN75_MI_URB_CLEAR_CommandType_start  29
   169432 #define GEN7_MI_URB_CLEAR_CommandType_start  29
   169433 #define GEN6_MI_URB_CLEAR_CommandType_start  29
   169434 
   169435 static inline uint32_t ATTRIBUTE_PURE
   169436 MI_URB_CLEAR_CommandType_start(const struct gen_device_info *devinfo)
   169437 {
   169438    switch (devinfo->gen) {
   169439    case 10: return 0;
   169440    case 9: return 0;
   169441    case 8: return 29;
   169442    case 7:
   169443       if (devinfo->is_haswell) {
   169444          return 29;
   169445       } else {
   169446          return 29;
   169447       }
   169448    case 6: return 29;
   169449    case 5: return 0;
   169450    case 4:
   169451       if (devinfo->is_g4x) {
   169452          return 0;
   169453       } else {
   169454          return 0;
   169455       }
   169456    default:
   169457       unreachable("Invalid hardware generation");
   169458    }
   169459 }
   169460 
   169461 
   169462 
   169463 /* MI_URB_CLEAR::DWord Length */
   169464 
   169465 
   169466 #define GEN8_MI_URB_CLEAR_DWordLength_bits  8
   169467 #define GEN75_MI_URB_CLEAR_DWordLength_bits  8
   169468 #define GEN7_MI_URB_CLEAR_DWordLength_bits  8
   169469 #define GEN6_MI_URB_CLEAR_DWordLength_bits  8
   169470 
   169471 static inline uint32_t ATTRIBUTE_PURE
   169472 MI_URB_CLEAR_DWordLength_bits(const struct gen_device_info *devinfo)
   169473 {
   169474    switch (devinfo->gen) {
   169475    case 10: return 0;
   169476    case 9: return 0;
   169477    case 8: return 8;
   169478    case 7:
   169479       if (devinfo->is_haswell) {
   169480          return 8;
   169481       } else {
   169482          return 8;
   169483       }
   169484    case 6: return 8;
   169485    case 5: return 0;
   169486    case 4:
   169487       if (devinfo->is_g4x) {
   169488          return 0;
   169489       } else {
   169490          return 0;
   169491       }
   169492    default:
   169493       unreachable("Invalid hardware generation");
   169494    }
   169495 }
   169496 
   169497 
   169498 
   169499 #define GEN8_MI_URB_CLEAR_DWordLength_start  0
   169500 #define GEN75_MI_URB_CLEAR_DWordLength_start  0
   169501 #define GEN7_MI_URB_CLEAR_DWordLength_start  0
   169502 #define GEN6_MI_URB_CLEAR_DWordLength_start  0
   169503 
   169504 static inline uint32_t ATTRIBUTE_PURE
   169505 MI_URB_CLEAR_DWordLength_start(const struct gen_device_info *devinfo)
   169506 {
   169507    switch (devinfo->gen) {
   169508    case 10: return 0;
   169509    case 9: return 0;
   169510    case 8: return 0;
   169511    case 7:
   169512       if (devinfo->is_haswell) {
   169513          return 0;
   169514       } else {
   169515          return 0;
   169516       }
   169517    case 6: return 0;
   169518    case 5: return 0;
   169519    case 4:
   169520       if (devinfo->is_g4x) {
   169521          return 0;
   169522       } else {
   169523          return 0;
   169524       }
   169525    default:
   169526       unreachable("Invalid hardware generation");
   169527    }
   169528 }
   169529 
   169530 
   169531 
   169532 /* MI_URB_CLEAR::MI Command Opcode */
   169533 
   169534 
   169535 #define GEN8_MI_URB_CLEAR_MICommandOpcode_bits  6
   169536 #define GEN75_MI_URB_CLEAR_MICommandOpcode_bits  6
   169537 #define GEN7_MI_URB_CLEAR_MICommandOpcode_bits  6
   169538 #define GEN6_MI_URB_CLEAR_MICommandOpcode_bits  6
   169539 
   169540 static inline uint32_t ATTRIBUTE_PURE
   169541 MI_URB_CLEAR_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   169542 {
   169543    switch (devinfo->gen) {
   169544    case 10: return 0;
   169545    case 9: return 0;
   169546    case 8: return 6;
   169547    case 7:
   169548       if (devinfo->is_haswell) {
   169549          return 6;
   169550       } else {
   169551          return 6;
   169552       }
   169553    case 6: return 6;
   169554    case 5: return 0;
   169555    case 4:
   169556       if (devinfo->is_g4x) {
   169557          return 0;
   169558       } else {
   169559          return 0;
   169560       }
   169561    default:
   169562       unreachable("Invalid hardware generation");
   169563    }
   169564 }
   169565 
   169566 
   169567 
   169568 #define GEN8_MI_URB_CLEAR_MICommandOpcode_start  23
   169569 #define GEN75_MI_URB_CLEAR_MICommandOpcode_start  23
   169570 #define GEN7_MI_URB_CLEAR_MICommandOpcode_start  23
   169571 #define GEN6_MI_URB_CLEAR_MICommandOpcode_start  23
   169572 
   169573 static inline uint32_t ATTRIBUTE_PURE
   169574 MI_URB_CLEAR_MICommandOpcode_start(const struct gen_device_info *devinfo)
   169575 {
   169576    switch (devinfo->gen) {
   169577    case 10: return 0;
   169578    case 9: return 0;
   169579    case 8: return 23;
   169580    case 7:
   169581       if (devinfo->is_haswell) {
   169582          return 23;
   169583       } else {
   169584          return 23;
   169585       }
   169586    case 6: return 23;
   169587    case 5: return 0;
   169588    case 4:
   169589       if (devinfo->is_g4x) {
   169590          return 0;
   169591       } else {
   169592          return 0;
   169593       }
   169594    default:
   169595       unreachable("Invalid hardware generation");
   169596    }
   169597 }
   169598 
   169599 
   169600 
   169601 /* MI_URB_CLEAR::URB Address */
   169602 
   169603 
   169604 #define GEN8_MI_URB_CLEAR_URBAddress_bits  15
   169605 #define GEN75_MI_URB_CLEAR_URBAddress_bits  15
   169606 #define GEN7_MI_URB_CLEAR_URBAddress_bits  14
   169607 #define GEN6_MI_URB_CLEAR_URBAddress_bits  14
   169608 
   169609 static inline uint32_t ATTRIBUTE_PURE
   169610 MI_URB_CLEAR_URBAddress_bits(const struct gen_device_info *devinfo)
   169611 {
   169612    switch (devinfo->gen) {
   169613    case 10: return 0;
   169614    case 9: return 0;
   169615    case 8: return 15;
   169616    case 7:
   169617       if (devinfo->is_haswell) {
   169618          return 15;
   169619       } else {
   169620          return 14;
   169621       }
   169622    case 6: return 14;
   169623    case 5: return 0;
   169624    case 4:
   169625       if (devinfo->is_g4x) {
   169626          return 0;
   169627       } else {
   169628          return 0;
   169629       }
   169630    default:
   169631       unreachable("Invalid hardware generation");
   169632    }
   169633 }
   169634 
   169635 
   169636 
   169637 #define GEN8_MI_URB_CLEAR_URBAddress_start  32
   169638 #define GEN75_MI_URB_CLEAR_URBAddress_start  32
   169639 #define GEN7_MI_URB_CLEAR_URBAddress_start  32
   169640 #define GEN6_MI_URB_CLEAR_URBAddress_start  32
   169641 
   169642 static inline uint32_t ATTRIBUTE_PURE
   169643 MI_URB_CLEAR_URBAddress_start(const struct gen_device_info *devinfo)
   169644 {
   169645    switch (devinfo->gen) {
   169646    case 10: return 0;
   169647    case 9: return 0;
   169648    case 8: return 32;
   169649    case 7:
   169650       if (devinfo->is_haswell) {
   169651          return 32;
   169652       } else {
   169653          return 32;
   169654       }
   169655    case 6: return 32;
   169656    case 5: return 0;
   169657    case 4:
   169658       if (devinfo->is_g4x) {
   169659          return 0;
   169660       } else {
   169661          return 0;
   169662       }
   169663    default:
   169664       unreachable("Invalid hardware generation");
   169665    }
   169666 }
   169667 
   169668 
   169669 
   169670 /* MI_URB_CLEAR::URB Clear Length */
   169671 
   169672 
   169673 #define GEN8_MI_URB_CLEAR_URBClearLength_bits  14
   169674 #define GEN75_MI_URB_CLEAR_URBClearLength_bits  14
   169675 #define GEN7_MI_URB_CLEAR_URBClearLength_bits  13
   169676 #define GEN6_MI_URB_CLEAR_URBClearLength_bits  13
   169677 
   169678 static inline uint32_t ATTRIBUTE_PURE
   169679 MI_URB_CLEAR_URBClearLength_bits(const struct gen_device_info *devinfo)
   169680 {
   169681    switch (devinfo->gen) {
   169682    case 10: return 0;
   169683    case 9: return 0;
   169684    case 8: return 14;
   169685    case 7:
   169686       if (devinfo->is_haswell) {
   169687          return 14;
   169688       } else {
   169689          return 13;
   169690       }
   169691    case 6: return 13;
   169692    case 5: return 0;
   169693    case 4:
   169694       if (devinfo->is_g4x) {
   169695          return 0;
   169696       } else {
   169697          return 0;
   169698       }
   169699    default:
   169700       unreachable("Invalid hardware generation");
   169701    }
   169702 }
   169703 
   169704 
   169705 
   169706 #define GEN8_MI_URB_CLEAR_URBClearLength_start  48
   169707 #define GEN75_MI_URB_CLEAR_URBClearLength_start  48
   169708 #define GEN7_MI_URB_CLEAR_URBClearLength_start  48
   169709 #define GEN6_MI_URB_CLEAR_URBClearLength_start  48
   169710 
   169711 static inline uint32_t ATTRIBUTE_PURE
   169712 MI_URB_CLEAR_URBClearLength_start(const struct gen_device_info *devinfo)
   169713 {
   169714    switch (devinfo->gen) {
   169715    case 10: return 0;
   169716    case 9: return 0;
   169717    case 8: return 48;
   169718    case 7:
   169719       if (devinfo->is_haswell) {
   169720          return 48;
   169721       } else {
   169722          return 48;
   169723       }
   169724    case 6: return 48;
   169725    case 5: return 0;
   169726    case 4:
   169727       if (devinfo->is_g4x) {
   169728          return 0;
   169729       } else {
   169730          return 0;
   169731       }
   169732    default:
   169733       unreachable("Invalid hardware generation");
   169734    }
   169735 }
   169736 
   169737 
   169738 
   169739 /* MI_USER_INTERRUPT */
   169740 
   169741 
   169742 #define GEN10_MI_USER_INTERRUPT_length  1
   169743 #define GEN9_MI_USER_INTERRUPT_length  1
   169744 #define GEN8_MI_USER_INTERRUPT_length  1
   169745 #define GEN75_MI_USER_INTERRUPT_length  1
   169746 #define GEN7_MI_USER_INTERRUPT_length  1
   169747 #define GEN6_MI_USER_INTERRUPT_length  1
   169748 
   169749 static inline uint32_t ATTRIBUTE_PURE
   169750 MI_USER_INTERRUPT_length(const struct gen_device_info *devinfo)
   169751 {
   169752    switch (devinfo->gen) {
   169753    case 10: return 1;
   169754    case 9: return 1;
   169755    case 8: return 1;
   169756    case 7:
   169757       if (devinfo->is_haswell) {
   169758          return 1;
   169759       } else {
   169760          return 1;
   169761       }
   169762    case 6: return 1;
   169763    case 5: return 0;
   169764    case 4:
   169765       if (devinfo->is_g4x) {
   169766          return 0;
   169767       } else {
   169768          return 0;
   169769       }
   169770    default:
   169771       unreachable("Invalid hardware generation");
   169772    }
   169773 }
   169774 
   169775 
   169776 
   169777 /* MI_USER_INTERRUPT::Command Type */
   169778 
   169779 
   169780 #define GEN10_MI_USER_INTERRUPT_CommandType_bits  3
   169781 #define GEN9_MI_USER_INTERRUPT_CommandType_bits  3
   169782 #define GEN8_MI_USER_INTERRUPT_CommandType_bits  3
   169783 #define GEN75_MI_USER_INTERRUPT_CommandType_bits  3
   169784 #define GEN7_MI_USER_INTERRUPT_CommandType_bits  3
   169785 #define GEN6_MI_USER_INTERRUPT_CommandType_bits  3
   169786 
   169787 static inline uint32_t ATTRIBUTE_PURE
   169788 MI_USER_INTERRUPT_CommandType_bits(const struct gen_device_info *devinfo)
   169789 {
   169790    switch (devinfo->gen) {
   169791    case 10: return 3;
   169792    case 9: return 3;
   169793    case 8: return 3;
   169794    case 7:
   169795       if (devinfo->is_haswell) {
   169796          return 3;
   169797       } else {
   169798          return 3;
   169799       }
   169800    case 6: return 3;
   169801    case 5: return 0;
   169802    case 4:
   169803       if (devinfo->is_g4x) {
   169804          return 0;
   169805       } else {
   169806          return 0;
   169807       }
   169808    default:
   169809       unreachable("Invalid hardware generation");
   169810    }
   169811 }
   169812 
   169813 
   169814 
   169815 #define GEN10_MI_USER_INTERRUPT_CommandType_start  29
   169816 #define GEN9_MI_USER_INTERRUPT_CommandType_start  29
   169817 #define GEN8_MI_USER_INTERRUPT_CommandType_start  29
   169818 #define GEN75_MI_USER_INTERRUPT_CommandType_start  29
   169819 #define GEN7_MI_USER_INTERRUPT_CommandType_start  29
   169820 #define GEN6_MI_USER_INTERRUPT_CommandType_start  29
   169821 
   169822 static inline uint32_t ATTRIBUTE_PURE
   169823 MI_USER_INTERRUPT_CommandType_start(const struct gen_device_info *devinfo)
   169824 {
   169825    switch (devinfo->gen) {
   169826    case 10: return 29;
   169827    case 9: return 29;
   169828    case 8: return 29;
   169829    case 7:
   169830       if (devinfo->is_haswell) {
   169831          return 29;
   169832       } else {
   169833          return 29;
   169834       }
   169835    case 6: return 29;
   169836    case 5: return 0;
   169837    case 4:
   169838       if (devinfo->is_g4x) {
   169839          return 0;
   169840       } else {
   169841          return 0;
   169842       }
   169843    default:
   169844       unreachable("Invalid hardware generation");
   169845    }
   169846 }
   169847 
   169848 
   169849 
   169850 /* MI_USER_INTERRUPT::MI Command Opcode */
   169851 
   169852 
   169853 #define GEN10_MI_USER_INTERRUPT_MICommandOpcode_bits  6
   169854 #define GEN9_MI_USER_INTERRUPT_MICommandOpcode_bits  6
   169855 #define GEN8_MI_USER_INTERRUPT_MICommandOpcode_bits  6
   169856 #define GEN75_MI_USER_INTERRUPT_MICommandOpcode_bits  6
   169857 #define GEN7_MI_USER_INTERRUPT_MICommandOpcode_bits  6
   169858 #define GEN6_MI_USER_INTERRUPT_MICommandOpcode_bits  6
   169859 
   169860 static inline uint32_t ATTRIBUTE_PURE
   169861 MI_USER_INTERRUPT_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   169862 {
   169863    switch (devinfo->gen) {
   169864    case 10: return 6;
   169865    case 9: return 6;
   169866    case 8: return 6;
   169867    case 7:
   169868       if (devinfo->is_haswell) {
   169869          return 6;
   169870       } else {
   169871          return 6;
   169872       }
   169873    case 6: return 6;
   169874    case 5: return 0;
   169875    case 4:
   169876       if (devinfo->is_g4x) {
   169877          return 0;
   169878       } else {
   169879          return 0;
   169880       }
   169881    default:
   169882       unreachable("Invalid hardware generation");
   169883    }
   169884 }
   169885 
   169886 
   169887 
   169888 #define GEN10_MI_USER_INTERRUPT_MICommandOpcode_start  23
   169889 #define GEN9_MI_USER_INTERRUPT_MICommandOpcode_start  23
   169890 #define GEN8_MI_USER_INTERRUPT_MICommandOpcode_start  23
   169891 #define GEN75_MI_USER_INTERRUPT_MICommandOpcode_start  23
   169892 #define GEN7_MI_USER_INTERRUPT_MICommandOpcode_start  23
   169893 #define GEN6_MI_USER_INTERRUPT_MICommandOpcode_start  23
   169894 
   169895 static inline uint32_t ATTRIBUTE_PURE
   169896 MI_USER_INTERRUPT_MICommandOpcode_start(const struct gen_device_info *devinfo)
   169897 {
   169898    switch (devinfo->gen) {
   169899    case 10: return 23;
   169900    case 9: return 23;
   169901    case 8: return 23;
   169902    case 7:
   169903       if (devinfo->is_haswell) {
   169904          return 23;
   169905       } else {
   169906          return 23;
   169907       }
   169908    case 6: return 23;
   169909    case 5: return 0;
   169910    case 4:
   169911       if (devinfo->is_g4x) {
   169912          return 0;
   169913       } else {
   169914          return 0;
   169915       }
   169916    default:
   169917       unreachable("Invalid hardware generation");
   169918    }
   169919 }
   169920 
   169921 
   169922 
   169923 /* MI_WAIT_FOR_EVENT */
   169924 
   169925 
   169926 #define GEN10_MI_WAIT_FOR_EVENT_length  1
   169927 #define GEN9_MI_WAIT_FOR_EVENT_length  1
   169928 #define GEN8_MI_WAIT_FOR_EVENT_length  1
   169929 #define GEN75_MI_WAIT_FOR_EVENT_length  1
   169930 #define GEN7_MI_WAIT_FOR_EVENT_length  1
   169931 #define GEN6_MI_WAIT_FOR_EVENT_length  1
   169932 
   169933 static inline uint32_t ATTRIBUTE_PURE
   169934 MI_WAIT_FOR_EVENT_length(const struct gen_device_info *devinfo)
   169935 {
   169936    switch (devinfo->gen) {
   169937    case 10: return 1;
   169938    case 9: return 1;
   169939    case 8: return 1;
   169940    case 7:
   169941       if (devinfo->is_haswell) {
   169942          return 1;
   169943       } else {
   169944          return 1;
   169945       }
   169946    case 6: return 1;
   169947    case 5: return 0;
   169948    case 4:
   169949       if (devinfo->is_g4x) {
   169950          return 0;
   169951       } else {
   169952          return 0;
   169953       }
   169954    default:
   169955       unreachable("Invalid hardware generation");
   169956    }
   169957 }
   169958 
   169959 
   169960 
   169961 /* MI_WAIT_FOR_EVENT::Command Type */
   169962 
   169963 
   169964 #define GEN10_MI_WAIT_FOR_EVENT_CommandType_bits  3
   169965 #define GEN9_MI_WAIT_FOR_EVENT_CommandType_bits  3
   169966 #define GEN8_MI_WAIT_FOR_EVENT_CommandType_bits  3
   169967 #define GEN75_MI_WAIT_FOR_EVENT_CommandType_bits  3
   169968 #define GEN7_MI_WAIT_FOR_EVENT_CommandType_bits  3
   169969 #define GEN6_MI_WAIT_FOR_EVENT_CommandType_bits  3
   169970 
   169971 static inline uint32_t ATTRIBUTE_PURE
   169972 MI_WAIT_FOR_EVENT_CommandType_bits(const struct gen_device_info *devinfo)
   169973 {
   169974    switch (devinfo->gen) {
   169975    case 10: return 3;
   169976    case 9: return 3;
   169977    case 8: return 3;
   169978    case 7:
   169979       if (devinfo->is_haswell) {
   169980          return 3;
   169981       } else {
   169982          return 3;
   169983       }
   169984    case 6: return 3;
   169985    case 5: return 0;
   169986    case 4:
   169987       if (devinfo->is_g4x) {
   169988          return 0;
   169989       } else {
   169990          return 0;
   169991       }
   169992    default:
   169993       unreachable("Invalid hardware generation");
   169994    }
   169995 }
   169996 
   169997 
   169998 
   169999 #define GEN10_MI_WAIT_FOR_EVENT_CommandType_start  29
   170000 #define GEN9_MI_WAIT_FOR_EVENT_CommandType_start  29
   170001 #define GEN8_MI_WAIT_FOR_EVENT_CommandType_start  29
   170002 #define GEN75_MI_WAIT_FOR_EVENT_CommandType_start  29
   170003 #define GEN7_MI_WAIT_FOR_EVENT_CommandType_start  29
   170004 #define GEN6_MI_WAIT_FOR_EVENT_CommandType_start  29
   170005 
   170006 static inline uint32_t ATTRIBUTE_PURE
   170007 MI_WAIT_FOR_EVENT_CommandType_start(const struct gen_device_info *devinfo)
   170008 {
   170009    switch (devinfo->gen) {
   170010    case 10: return 29;
   170011    case 9: return 29;
   170012    case 8: return 29;
   170013    case 7:
   170014       if (devinfo->is_haswell) {
   170015          return 29;
   170016       } else {
   170017          return 29;
   170018       }
   170019    case 6: return 29;
   170020    case 5: return 0;
   170021    case 4:
   170022       if (devinfo->is_g4x) {
   170023          return 0;
   170024       } else {
   170025          return 0;
   170026       }
   170027    default:
   170028       unreachable("Invalid hardware generation");
   170029    }
   170030 }
   170031 
   170032 
   170033 
   170034 /* MI_WAIT_FOR_EVENT::Condition Code Wait Select */
   170035 
   170036 
   170037 #define GEN75_MI_WAIT_FOR_EVENT_ConditionCodeWaitSelect_bits  4
   170038 #define GEN7_MI_WAIT_FOR_EVENT_ConditionCodeWaitSelect_bits  4
   170039 #define GEN6_MI_WAIT_FOR_EVENT_ConditionCodeWaitSelect_bits  4
   170040 
   170041 static inline uint32_t ATTRIBUTE_PURE
   170042 MI_WAIT_FOR_EVENT_ConditionCodeWaitSelect_bits(const struct gen_device_info *devinfo)
   170043 {
   170044    switch (devinfo->gen) {
   170045    case 10: return 0;
   170046    case 9: return 0;
   170047    case 8: return 0;
   170048    case 7:
   170049       if (devinfo->is_haswell) {
   170050          return 4;
   170051       } else {
   170052          return 4;
   170053       }
   170054    case 6: return 4;
   170055    case 5: return 0;
   170056    case 4:
   170057       if (devinfo->is_g4x) {
   170058          return 0;
   170059       } else {
   170060          return 0;
   170061       }
   170062    default:
   170063       unreachable("Invalid hardware generation");
   170064    }
   170065 }
   170066 
   170067 
   170068 
   170069 #define GEN75_MI_WAIT_FOR_EVENT_ConditionCodeWaitSelect_start  16
   170070 #define GEN7_MI_WAIT_FOR_EVENT_ConditionCodeWaitSelect_start  16
   170071 #define GEN6_MI_WAIT_FOR_EVENT_ConditionCodeWaitSelect_start  16
   170072 
   170073 static inline uint32_t ATTRIBUTE_PURE
   170074 MI_WAIT_FOR_EVENT_ConditionCodeWaitSelect_start(const struct gen_device_info *devinfo)
   170075 {
   170076    switch (devinfo->gen) {
   170077    case 10: return 0;
   170078    case 9: return 0;
   170079    case 8: return 0;
   170080    case 7:
   170081       if (devinfo->is_haswell) {
   170082          return 16;
   170083       } else {
   170084          return 16;
   170085       }
   170086    case 6: return 16;
   170087    case 5: return 0;
   170088    case 4:
   170089       if (devinfo->is_g4x) {
   170090          return 0;
   170091       } else {
   170092          return 0;
   170093       }
   170094    default:
   170095       unreachable("Invalid hardware generation");
   170096    }
   170097 }
   170098 
   170099 
   170100 
   170101 /* MI_WAIT_FOR_EVENT::Display Pipe A Horizontal Blank Wait Enable */
   170102 
   170103 
   170104 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPipeAHorizontalBlankWaitEnable_bits  1
   170105 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPipeAHorizontalBlankWaitEnable_bits  1
   170106 #define GEN6_MI_WAIT_FOR_EVENT_DisplayPipeAHorizontalBlankWaitEnable_bits  1
   170107 
   170108 static inline uint32_t ATTRIBUTE_PURE
   170109 MI_WAIT_FOR_EVENT_DisplayPipeAHorizontalBlankWaitEnable_bits(const struct gen_device_info *devinfo)
   170110 {
   170111    switch (devinfo->gen) {
   170112    case 10: return 0;
   170113    case 9: return 0;
   170114    case 8: return 0;
   170115    case 7:
   170116       if (devinfo->is_haswell) {
   170117          return 1;
   170118       } else {
   170119          return 1;
   170120       }
   170121    case 6: return 1;
   170122    case 5: return 0;
   170123    case 4:
   170124       if (devinfo->is_g4x) {
   170125          return 0;
   170126       } else {
   170127          return 0;
   170128       }
   170129    default:
   170130       unreachable("Invalid hardware generation");
   170131    }
   170132 }
   170133 
   170134 
   170135 
   170136 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPipeAHorizontalBlankWaitEnable_start  5
   170137 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPipeAHorizontalBlankWaitEnable_start  5
   170138 #define GEN6_MI_WAIT_FOR_EVENT_DisplayPipeAHorizontalBlankWaitEnable_start  5
   170139 
   170140 static inline uint32_t ATTRIBUTE_PURE
   170141 MI_WAIT_FOR_EVENT_DisplayPipeAHorizontalBlankWaitEnable_start(const struct gen_device_info *devinfo)
   170142 {
   170143    switch (devinfo->gen) {
   170144    case 10: return 0;
   170145    case 9: return 0;
   170146    case 8: return 0;
   170147    case 7:
   170148       if (devinfo->is_haswell) {
   170149          return 5;
   170150       } else {
   170151          return 5;
   170152       }
   170153    case 6: return 5;
   170154    case 5: return 0;
   170155    case 4:
   170156       if (devinfo->is_g4x) {
   170157          return 0;
   170158       } else {
   170159          return 0;
   170160       }
   170161    default:
   170162       unreachable("Invalid hardware generation");
   170163    }
   170164 }
   170165 
   170166 
   170167 
   170168 /* MI_WAIT_FOR_EVENT::Display Pipe A Scan Line Wait Enable */
   170169 
   170170 
   170171 #define GEN8_MI_WAIT_FOR_EVENT_DisplayPipeAScanLineWaitEnable_bits  1
   170172 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPipeAScanLineWaitEnable_bits  1
   170173 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPipeAScanLineWaitEnable_bits  1
   170174 #define GEN6_MI_WAIT_FOR_EVENT_DisplayPipeAScanLineWaitEnable_bits  1
   170175 
   170176 static inline uint32_t ATTRIBUTE_PURE
   170177 MI_WAIT_FOR_EVENT_DisplayPipeAScanLineWaitEnable_bits(const struct gen_device_info *devinfo)
   170178 {
   170179    switch (devinfo->gen) {
   170180    case 10: return 0;
   170181    case 9: return 0;
   170182    case 8: return 1;
   170183    case 7:
   170184       if (devinfo->is_haswell) {
   170185          return 1;
   170186       } else {
   170187          return 1;
   170188       }
   170189    case 6: return 1;
   170190    case 5: return 0;
   170191    case 4:
   170192       if (devinfo->is_g4x) {
   170193          return 0;
   170194       } else {
   170195          return 0;
   170196       }
   170197    default:
   170198       unreachable("Invalid hardware generation");
   170199    }
   170200 }
   170201 
   170202 
   170203 
   170204 #define GEN8_MI_WAIT_FOR_EVENT_DisplayPipeAScanLineWaitEnable_start  0
   170205 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPipeAScanLineWaitEnable_start  0
   170206 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPipeAScanLineWaitEnable_start  0
   170207 #define GEN6_MI_WAIT_FOR_EVENT_DisplayPipeAScanLineWaitEnable_start  0
   170208 
   170209 static inline uint32_t ATTRIBUTE_PURE
   170210 MI_WAIT_FOR_EVENT_DisplayPipeAScanLineWaitEnable_start(const struct gen_device_info *devinfo)
   170211 {
   170212    switch (devinfo->gen) {
   170213    case 10: return 0;
   170214    case 9: return 0;
   170215    case 8: return 0;
   170216    case 7:
   170217       if (devinfo->is_haswell) {
   170218          return 0;
   170219       } else {
   170220          return 0;
   170221       }
   170222    case 6: return 0;
   170223    case 5: return 0;
   170224    case 4:
   170225       if (devinfo->is_g4x) {
   170226          return 0;
   170227       } else {
   170228          return 0;
   170229       }
   170230    default:
   170231       unreachable("Invalid hardware generation");
   170232    }
   170233 }
   170234 
   170235 
   170236 
   170237 /* MI_WAIT_FOR_EVENT::Display Pipe A Vertical Blank Wait Enable */
   170238 
   170239 
   170240 #define GEN8_MI_WAIT_FOR_EVENT_DisplayPipeAVerticalBlankWaitEnable_bits  1
   170241 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPipeAVerticalBlankWaitEnable_bits  1
   170242 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPipeAVerticalBlankWaitEnable_bits  1
   170243 #define GEN6_MI_WAIT_FOR_EVENT_DisplayPipeAVerticalBlankWaitEnable_bits  1
   170244 
   170245 static inline uint32_t ATTRIBUTE_PURE
   170246 MI_WAIT_FOR_EVENT_DisplayPipeAVerticalBlankWaitEnable_bits(const struct gen_device_info *devinfo)
   170247 {
   170248    switch (devinfo->gen) {
   170249    case 10: return 0;
   170250    case 9: return 0;
   170251    case 8: return 1;
   170252    case 7:
   170253       if (devinfo->is_haswell) {
   170254          return 1;
   170255       } else {
   170256          return 1;
   170257       }
   170258    case 6: return 1;
   170259    case 5: return 0;
   170260    case 4:
   170261       if (devinfo->is_g4x) {
   170262          return 0;
   170263       } else {
   170264          return 0;
   170265       }
   170266    default:
   170267       unreachable("Invalid hardware generation");
   170268    }
   170269 }
   170270 
   170271 
   170272 
   170273 #define GEN8_MI_WAIT_FOR_EVENT_DisplayPipeAVerticalBlankWaitEnable_start  3
   170274 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPipeAVerticalBlankWaitEnable_start  3
   170275 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPipeAVerticalBlankWaitEnable_start  3
   170276 #define GEN6_MI_WAIT_FOR_EVENT_DisplayPipeAVerticalBlankWaitEnable_start  3
   170277 
   170278 static inline uint32_t ATTRIBUTE_PURE
   170279 MI_WAIT_FOR_EVENT_DisplayPipeAVerticalBlankWaitEnable_start(const struct gen_device_info *devinfo)
   170280 {
   170281    switch (devinfo->gen) {
   170282    case 10: return 0;
   170283    case 9: return 0;
   170284    case 8: return 3;
   170285    case 7:
   170286       if (devinfo->is_haswell) {
   170287          return 3;
   170288       } else {
   170289          return 3;
   170290       }
   170291    case 6: return 3;
   170292    case 5: return 0;
   170293    case 4:
   170294       if (devinfo->is_g4x) {
   170295          return 0;
   170296       } else {
   170297          return 0;
   170298       }
   170299    default:
   170300       unreachable("Invalid hardware generation");
   170301    }
   170302 }
   170303 
   170304 
   170305 
   170306 /* MI_WAIT_FOR_EVENT::Display Pipe B Horizontal Blank Wait Enable */
   170307 
   170308 
   170309 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPipeBHorizontalBlankWaitEnable_bits  1
   170310 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPipeBHorizontalBlankWaitEnable_bits  1
   170311 #define GEN6_MI_WAIT_FOR_EVENT_DisplayPipeBHorizontalBlankWaitEnable_bits  1
   170312 
   170313 static inline uint32_t ATTRIBUTE_PURE
   170314 MI_WAIT_FOR_EVENT_DisplayPipeBHorizontalBlankWaitEnable_bits(const struct gen_device_info *devinfo)
   170315 {
   170316    switch (devinfo->gen) {
   170317    case 10: return 0;
   170318    case 9: return 0;
   170319    case 8: return 0;
   170320    case 7:
   170321       if (devinfo->is_haswell) {
   170322          return 1;
   170323       } else {
   170324          return 1;
   170325       }
   170326    case 6: return 1;
   170327    case 5: return 0;
   170328    case 4:
   170329       if (devinfo->is_g4x) {
   170330          return 0;
   170331       } else {
   170332          return 0;
   170333       }
   170334    default:
   170335       unreachable("Invalid hardware generation");
   170336    }
   170337 }
   170338 
   170339 
   170340 
   170341 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPipeBHorizontalBlankWaitEnable_start  13
   170342 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPipeBHorizontalBlankWaitEnable_start  13
   170343 #define GEN6_MI_WAIT_FOR_EVENT_DisplayPipeBHorizontalBlankWaitEnable_start  13
   170344 
   170345 static inline uint32_t ATTRIBUTE_PURE
   170346 MI_WAIT_FOR_EVENT_DisplayPipeBHorizontalBlankWaitEnable_start(const struct gen_device_info *devinfo)
   170347 {
   170348    switch (devinfo->gen) {
   170349    case 10: return 0;
   170350    case 9: return 0;
   170351    case 8: return 0;
   170352    case 7:
   170353       if (devinfo->is_haswell) {
   170354          return 13;
   170355       } else {
   170356          return 13;
   170357       }
   170358    case 6: return 13;
   170359    case 5: return 0;
   170360    case 4:
   170361       if (devinfo->is_g4x) {
   170362          return 0;
   170363       } else {
   170364          return 0;
   170365       }
   170366    default:
   170367       unreachable("Invalid hardware generation");
   170368    }
   170369 }
   170370 
   170371 
   170372 
   170373 /* MI_WAIT_FOR_EVENT::Display Pipe B Scan Line Wait Enable */
   170374 
   170375 
   170376 #define GEN8_MI_WAIT_FOR_EVENT_DisplayPipeBScanLineWaitEnable_bits  1
   170377 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPipeBScanLineWaitEnable_bits  1
   170378 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPipeBScanLineWaitEnable_bits  1
   170379 #define GEN6_MI_WAIT_FOR_EVENT_DisplayPipeBScanLineWaitEnable_bits  1
   170380 
   170381 static inline uint32_t ATTRIBUTE_PURE
   170382 MI_WAIT_FOR_EVENT_DisplayPipeBScanLineWaitEnable_bits(const struct gen_device_info *devinfo)
   170383 {
   170384    switch (devinfo->gen) {
   170385    case 10: return 0;
   170386    case 9: return 0;
   170387    case 8: return 1;
   170388    case 7:
   170389       if (devinfo->is_haswell) {
   170390          return 1;
   170391       } else {
   170392          return 1;
   170393       }
   170394    case 6: return 1;
   170395    case 5: return 0;
   170396    case 4:
   170397       if (devinfo->is_g4x) {
   170398          return 0;
   170399       } else {
   170400          return 0;
   170401       }
   170402    default:
   170403       unreachable("Invalid hardware generation");
   170404    }
   170405 }
   170406 
   170407 
   170408 
   170409 #define GEN8_MI_WAIT_FOR_EVENT_DisplayPipeBScanLineWaitEnable_start  8
   170410 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPipeBScanLineWaitEnable_start  8
   170411 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPipeBScanLineWaitEnable_start  8
   170412 #define GEN6_MI_WAIT_FOR_EVENT_DisplayPipeBScanLineWaitEnable_start  8
   170413 
   170414 static inline uint32_t ATTRIBUTE_PURE
   170415 MI_WAIT_FOR_EVENT_DisplayPipeBScanLineWaitEnable_start(const struct gen_device_info *devinfo)
   170416 {
   170417    switch (devinfo->gen) {
   170418    case 10: return 0;
   170419    case 9: return 0;
   170420    case 8: return 8;
   170421    case 7:
   170422       if (devinfo->is_haswell) {
   170423          return 8;
   170424       } else {
   170425          return 8;
   170426       }
   170427    case 6: return 8;
   170428    case 5: return 0;
   170429    case 4:
   170430       if (devinfo->is_g4x) {
   170431          return 0;
   170432       } else {
   170433          return 0;
   170434       }
   170435    default:
   170436       unreachable("Invalid hardware generation");
   170437    }
   170438 }
   170439 
   170440 
   170441 
   170442 /* MI_WAIT_FOR_EVENT::Display Pipe B Vertical Blank Wait Enable */
   170443 
   170444 
   170445 #define GEN8_MI_WAIT_FOR_EVENT_DisplayPipeBVerticalBlankWaitEnable_bits  1
   170446 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPipeBVerticalBlankWaitEnable_bits  1
   170447 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPipeBVerticalBlankWaitEnable_bits  1
   170448 #define GEN6_MI_WAIT_FOR_EVENT_DisplayPipeBVerticalBlankWaitEnable_bits  1
   170449 
   170450 static inline uint32_t ATTRIBUTE_PURE
   170451 MI_WAIT_FOR_EVENT_DisplayPipeBVerticalBlankWaitEnable_bits(const struct gen_device_info *devinfo)
   170452 {
   170453    switch (devinfo->gen) {
   170454    case 10: return 0;
   170455    case 9: return 0;
   170456    case 8: return 1;
   170457    case 7:
   170458       if (devinfo->is_haswell) {
   170459          return 1;
   170460       } else {
   170461          return 1;
   170462       }
   170463    case 6: return 1;
   170464    case 5: return 0;
   170465    case 4:
   170466       if (devinfo->is_g4x) {
   170467          return 0;
   170468       } else {
   170469          return 0;
   170470       }
   170471    default:
   170472       unreachable("Invalid hardware generation");
   170473    }
   170474 }
   170475 
   170476 
   170477 
   170478 #define GEN8_MI_WAIT_FOR_EVENT_DisplayPipeBVerticalBlankWaitEnable_start  11
   170479 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPipeBVerticalBlankWaitEnable_start  11
   170480 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPipeBVerticalBlankWaitEnable_start  11
   170481 #define GEN6_MI_WAIT_FOR_EVENT_DisplayPipeBVerticalBlankWaitEnable_start  11
   170482 
   170483 static inline uint32_t ATTRIBUTE_PURE
   170484 MI_WAIT_FOR_EVENT_DisplayPipeBVerticalBlankWaitEnable_start(const struct gen_device_info *devinfo)
   170485 {
   170486    switch (devinfo->gen) {
   170487    case 10: return 0;
   170488    case 9: return 0;
   170489    case 8: return 11;
   170490    case 7:
   170491       if (devinfo->is_haswell) {
   170492          return 11;
   170493       } else {
   170494          return 11;
   170495       }
   170496    case 6: return 11;
   170497    case 5: return 0;
   170498    case 4:
   170499       if (devinfo->is_g4x) {
   170500          return 0;
   170501       } else {
   170502          return 0;
   170503       }
   170504    default:
   170505       unreachable("Invalid hardware generation");
   170506    }
   170507 }
   170508 
   170509 
   170510 
   170511 /* MI_WAIT_FOR_EVENT::Display Pipe C Horizontal Blank Wait Enable */
   170512 
   170513 
   170514 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPipeCHorizontalBlankWaitEnable_bits  1
   170515 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPipeCHorizontalBlankWaitEnable_bits  1
   170516 
   170517 static inline uint32_t ATTRIBUTE_PURE
   170518 MI_WAIT_FOR_EVENT_DisplayPipeCHorizontalBlankWaitEnable_bits(const struct gen_device_info *devinfo)
   170519 {
   170520    switch (devinfo->gen) {
   170521    case 10: return 0;
   170522    case 9: return 0;
   170523    case 8: return 0;
   170524    case 7:
   170525       if (devinfo->is_haswell) {
   170526          return 1;
   170527       } else {
   170528          return 1;
   170529       }
   170530    case 6: return 0;
   170531    case 5: return 0;
   170532    case 4:
   170533       if (devinfo->is_g4x) {
   170534          return 0;
   170535       } else {
   170536          return 0;
   170537       }
   170538    default:
   170539       unreachable("Invalid hardware generation");
   170540    }
   170541 }
   170542 
   170543 
   170544 
   170545 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPipeCHorizontalBlankWaitEnable_start  22
   170546 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPipeCHorizontalBlankWaitEnable_start  22
   170547 
   170548 static inline uint32_t ATTRIBUTE_PURE
   170549 MI_WAIT_FOR_EVENT_DisplayPipeCHorizontalBlankWaitEnable_start(const struct gen_device_info *devinfo)
   170550 {
   170551    switch (devinfo->gen) {
   170552    case 10: return 0;
   170553    case 9: return 0;
   170554    case 8: return 0;
   170555    case 7:
   170556       if (devinfo->is_haswell) {
   170557          return 22;
   170558       } else {
   170559          return 22;
   170560       }
   170561    case 6: return 0;
   170562    case 5: return 0;
   170563    case 4:
   170564       if (devinfo->is_g4x) {
   170565          return 0;
   170566       } else {
   170567          return 0;
   170568       }
   170569    default:
   170570       unreachable("Invalid hardware generation");
   170571    }
   170572 }
   170573 
   170574 
   170575 
   170576 /* MI_WAIT_FOR_EVENT::Display Pipe C Scan Line Wait Enable */
   170577 
   170578 
   170579 #define GEN8_MI_WAIT_FOR_EVENT_DisplayPipeCScanLineWaitEnable_bits  1
   170580 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPipeCScanLineWaitEnable_bits  1
   170581 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPipeCScanLineWaitEnable_bits  1
   170582 
   170583 static inline uint32_t ATTRIBUTE_PURE
   170584 MI_WAIT_FOR_EVENT_DisplayPipeCScanLineWaitEnable_bits(const struct gen_device_info *devinfo)
   170585 {
   170586    switch (devinfo->gen) {
   170587    case 10: return 0;
   170588    case 9: return 0;
   170589    case 8: return 1;
   170590    case 7:
   170591       if (devinfo->is_haswell) {
   170592          return 1;
   170593       } else {
   170594          return 1;
   170595       }
   170596    case 6: return 0;
   170597    case 5: return 0;
   170598    case 4:
   170599       if (devinfo->is_g4x) {
   170600          return 0;
   170601       } else {
   170602          return 0;
   170603       }
   170604    default:
   170605       unreachable("Invalid hardware generation");
   170606    }
   170607 }
   170608 
   170609 
   170610 
   170611 #define GEN8_MI_WAIT_FOR_EVENT_DisplayPipeCScanLineWaitEnable_start  14
   170612 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPipeCScanLineWaitEnable_start  14
   170613 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPipeCScanLineWaitEnable_start  14
   170614 
   170615 static inline uint32_t ATTRIBUTE_PURE
   170616 MI_WAIT_FOR_EVENT_DisplayPipeCScanLineWaitEnable_start(const struct gen_device_info *devinfo)
   170617 {
   170618    switch (devinfo->gen) {
   170619    case 10: return 0;
   170620    case 9: return 0;
   170621    case 8: return 14;
   170622    case 7:
   170623       if (devinfo->is_haswell) {
   170624          return 14;
   170625       } else {
   170626          return 14;
   170627       }
   170628    case 6: return 0;
   170629    case 5: return 0;
   170630    case 4:
   170631       if (devinfo->is_g4x) {
   170632          return 0;
   170633       } else {
   170634          return 0;
   170635       }
   170636    default:
   170637       unreachable("Invalid hardware generation");
   170638    }
   170639 }
   170640 
   170641 
   170642 
   170643 /* MI_WAIT_FOR_EVENT::Display Pipe C Vertical Blank Wait Enable */
   170644 
   170645 
   170646 #define GEN8_MI_WAIT_FOR_EVENT_DisplayPipeCVerticalBlankWaitEnable_bits  1
   170647 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPipeCVerticalBlankWaitEnable_bits  1
   170648 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPipeCVerticalBlankWaitEnable_bits  1
   170649 
   170650 static inline uint32_t ATTRIBUTE_PURE
   170651 MI_WAIT_FOR_EVENT_DisplayPipeCVerticalBlankWaitEnable_bits(const struct gen_device_info *devinfo)
   170652 {
   170653    switch (devinfo->gen) {
   170654    case 10: return 0;
   170655    case 9: return 0;
   170656    case 8: return 1;
   170657    case 7:
   170658       if (devinfo->is_haswell) {
   170659          return 1;
   170660       } else {
   170661          return 1;
   170662       }
   170663    case 6: return 0;
   170664    case 5: return 0;
   170665    case 4:
   170666       if (devinfo->is_g4x) {
   170667          return 0;
   170668       } else {
   170669          return 0;
   170670       }
   170671    default:
   170672       unreachable("Invalid hardware generation");
   170673    }
   170674 }
   170675 
   170676 
   170677 
   170678 #define GEN8_MI_WAIT_FOR_EVENT_DisplayPipeCVerticalBlankWaitEnable_start  21
   170679 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPipeCVerticalBlankWaitEnable_start  21
   170680 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPipeCVerticalBlankWaitEnable_start  21
   170681 
   170682 static inline uint32_t ATTRIBUTE_PURE
   170683 MI_WAIT_FOR_EVENT_DisplayPipeCVerticalBlankWaitEnable_start(const struct gen_device_info *devinfo)
   170684 {
   170685    switch (devinfo->gen) {
   170686    case 10: return 0;
   170687    case 9: return 0;
   170688    case 8: return 21;
   170689    case 7:
   170690       if (devinfo->is_haswell) {
   170691          return 21;
   170692       } else {
   170693          return 21;
   170694       }
   170695    case 6: return 0;
   170696    case 5: return 0;
   170697    case 4:
   170698       if (devinfo->is_g4x) {
   170699          return 0;
   170700       } else {
   170701          return 0;
   170702       }
   170703    default:
   170704       unreachable("Invalid hardware generation");
   170705    }
   170706 }
   170707 
   170708 
   170709 
   170710 /* MI_WAIT_FOR_EVENT::Display Plane 1 A Vertical Blank Wait Enable */
   170711 
   170712 
   170713 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane1AVerticalBlankWaitEnable_bits  1
   170714 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane1AVerticalBlankWaitEnable_bits  1
   170715 
   170716 static inline uint32_t ATTRIBUTE_PURE
   170717 MI_WAIT_FOR_EVENT_DisplayPlane1AVerticalBlankWaitEnable_bits(const struct gen_device_info *devinfo)
   170718 {
   170719    switch (devinfo->gen) {
   170720    case 10: return 1;
   170721    case 9: return 1;
   170722    case 8: return 0;
   170723    case 7:
   170724       if (devinfo->is_haswell) {
   170725          return 0;
   170726       } else {
   170727          return 0;
   170728       }
   170729    case 6: return 0;
   170730    case 5: return 0;
   170731    case 4:
   170732       if (devinfo->is_g4x) {
   170733          return 0;
   170734       } else {
   170735          return 0;
   170736       }
   170737    default:
   170738       unreachable("Invalid hardware generation");
   170739    }
   170740 }
   170741 
   170742 
   170743 
   170744 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane1AVerticalBlankWaitEnable_start  3
   170745 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane1AVerticalBlankWaitEnable_start  3
   170746 
   170747 static inline uint32_t ATTRIBUTE_PURE
   170748 MI_WAIT_FOR_EVENT_DisplayPlane1AVerticalBlankWaitEnable_start(const struct gen_device_info *devinfo)
   170749 {
   170750    switch (devinfo->gen) {
   170751    case 10: return 3;
   170752    case 9: return 3;
   170753    case 8: return 0;
   170754    case 7:
   170755       if (devinfo->is_haswell) {
   170756          return 0;
   170757       } else {
   170758          return 0;
   170759       }
   170760    case 6: return 0;
   170761    case 5: return 0;
   170762    case 4:
   170763       if (devinfo->is_g4x) {
   170764          return 0;
   170765       } else {
   170766          return 0;
   170767       }
   170768    default:
   170769       unreachable("Invalid hardware generation");
   170770    }
   170771 }
   170772 
   170773 
   170774 
   170775 /* MI_WAIT_FOR_EVENT::Display Plane 1 B Scan Line Wait Enable */
   170776 
   170777 
   170778 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane1BScanLineWaitEnable_bits  1
   170779 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane1BScanLineWaitEnable_bits  1
   170780 
   170781 static inline uint32_t ATTRIBUTE_PURE
   170782 MI_WAIT_FOR_EVENT_DisplayPlane1BScanLineWaitEnable_bits(const struct gen_device_info *devinfo)
   170783 {
   170784    switch (devinfo->gen) {
   170785    case 10: return 1;
   170786    case 9: return 1;
   170787    case 8: return 0;
   170788    case 7:
   170789       if (devinfo->is_haswell) {
   170790          return 0;
   170791       } else {
   170792          return 0;
   170793       }
   170794    case 6: return 0;
   170795    case 5: return 0;
   170796    case 4:
   170797       if (devinfo->is_g4x) {
   170798          return 0;
   170799       } else {
   170800          return 0;
   170801       }
   170802    default:
   170803       unreachable("Invalid hardware generation");
   170804    }
   170805 }
   170806 
   170807 
   170808 
   170809 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane1BScanLineWaitEnable_start  8
   170810 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane1BScanLineWaitEnable_start  8
   170811 
   170812 static inline uint32_t ATTRIBUTE_PURE
   170813 MI_WAIT_FOR_EVENT_DisplayPlane1BScanLineWaitEnable_start(const struct gen_device_info *devinfo)
   170814 {
   170815    switch (devinfo->gen) {
   170816    case 10: return 8;
   170817    case 9: return 8;
   170818    case 8: return 0;
   170819    case 7:
   170820       if (devinfo->is_haswell) {
   170821          return 0;
   170822       } else {
   170823          return 0;
   170824       }
   170825    case 6: return 0;
   170826    case 5: return 0;
   170827    case 4:
   170828       if (devinfo->is_g4x) {
   170829          return 0;
   170830       } else {
   170831          return 0;
   170832       }
   170833    default:
   170834       unreachable("Invalid hardware generation");
   170835    }
   170836 }
   170837 
   170838 
   170839 
   170840 /* MI_WAIT_FOR_EVENT::Display Plane 1 B Vertical Blank Wait Enable */
   170841 
   170842 
   170843 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane1BVerticalBlankWaitEnable_bits  1
   170844 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane1BVerticalBlankWaitEnable_bits  1
   170845 
   170846 static inline uint32_t ATTRIBUTE_PURE
   170847 MI_WAIT_FOR_EVENT_DisplayPlane1BVerticalBlankWaitEnable_bits(const struct gen_device_info *devinfo)
   170848 {
   170849    switch (devinfo->gen) {
   170850    case 10: return 1;
   170851    case 9: return 1;
   170852    case 8: return 0;
   170853    case 7:
   170854       if (devinfo->is_haswell) {
   170855          return 0;
   170856       } else {
   170857          return 0;
   170858       }
   170859    case 6: return 0;
   170860    case 5: return 0;
   170861    case 4:
   170862       if (devinfo->is_g4x) {
   170863          return 0;
   170864       } else {
   170865          return 0;
   170866       }
   170867    default:
   170868       unreachable("Invalid hardware generation");
   170869    }
   170870 }
   170871 
   170872 
   170873 
   170874 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane1BVerticalBlankWaitEnable_start  11
   170875 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane1BVerticalBlankWaitEnable_start  11
   170876 
   170877 static inline uint32_t ATTRIBUTE_PURE
   170878 MI_WAIT_FOR_EVENT_DisplayPlane1BVerticalBlankWaitEnable_start(const struct gen_device_info *devinfo)
   170879 {
   170880    switch (devinfo->gen) {
   170881    case 10: return 11;
   170882    case 9: return 11;
   170883    case 8: return 0;
   170884    case 7:
   170885       if (devinfo->is_haswell) {
   170886          return 0;
   170887       } else {
   170888          return 0;
   170889       }
   170890    case 6: return 0;
   170891    case 5: return 0;
   170892    case 4:
   170893       if (devinfo->is_g4x) {
   170894          return 0;
   170895       } else {
   170896          return 0;
   170897       }
   170898    default:
   170899       unreachable("Invalid hardware generation");
   170900    }
   170901 }
   170902 
   170903 
   170904 
   170905 /* MI_WAIT_FOR_EVENT::Display Plane 1 C Scan Line Wait Enable */
   170906 
   170907 
   170908 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane1CScanLineWaitEnable_bits  1
   170909 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane1CScanLineWaitEnable_bits  1
   170910 
   170911 static inline uint32_t ATTRIBUTE_PURE
   170912 MI_WAIT_FOR_EVENT_DisplayPlane1CScanLineWaitEnable_bits(const struct gen_device_info *devinfo)
   170913 {
   170914    switch (devinfo->gen) {
   170915    case 10: return 1;
   170916    case 9: return 1;
   170917    case 8: return 0;
   170918    case 7:
   170919       if (devinfo->is_haswell) {
   170920          return 0;
   170921       } else {
   170922          return 0;
   170923       }
   170924    case 6: return 0;
   170925    case 5: return 0;
   170926    case 4:
   170927       if (devinfo->is_g4x) {
   170928          return 0;
   170929       } else {
   170930          return 0;
   170931       }
   170932    default:
   170933       unreachable("Invalid hardware generation");
   170934    }
   170935 }
   170936 
   170937 
   170938 
   170939 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane1CScanLineWaitEnable_start  14
   170940 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane1CScanLineWaitEnable_start  14
   170941 
   170942 static inline uint32_t ATTRIBUTE_PURE
   170943 MI_WAIT_FOR_EVENT_DisplayPlane1CScanLineWaitEnable_start(const struct gen_device_info *devinfo)
   170944 {
   170945    switch (devinfo->gen) {
   170946    case 10: return 14;
   170947    case 9: return 14;
   170948    case 8: return 0;
   170949    case 7:
   170950       if (devinfo->is_haswell) {
   170951          return 0;
   170952       } else {
   170953          return 0;
   170954       }
   170955    case 6: return 0;
   170956    case 5: return 0;
   170957    case 4:
   170958       if (devinfo->is_g4x) {
   170959          return 0;
   170960       } else {
   170961          return 0;
   170962       }
   170963    default:
   170964       unreachable("Invalid hardware generation");
   170965    }
   170966 }
   170967 
   170968 
   170969 
   170970 /* MI_WAIT_FOR_EVENT::Display Plane 1 C Vertical Blank Wait Enable */
   170971 
   170972 
   170973 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane1CVerticalBlankWaitEnable_bits  1
   170974 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane1CVerticalBlankWaitEnable_bits  1
   170975 
   170976 static inline uint32_t ATTRIBUTE_PURE
   170977 MI_WAIT_FOR_EVENT_DisplayPlane1CVerticalBlankWaitEnable_bits(const struct gen_device_info *devinfo)
   170978 {
   170979    switch (devinfo->gen) {
   170980    case 10: return 1;
   170981    case 9: return 1;
   170982    case 8: return 0;
   170983    case 7:
   170984       if (devinfo->is_haswell) {
   170985          return 0;
   170986       } else {
   170987          return 0;
   170988       }
   170989    case 6: return 0;
   170990    case 5: return 0;
   170991    case 4:
   170992       if (devinfo->is_g4x) {
   170993          return 0;
   170994       } else {
   170995          return 0;
   170996       }
   170997    default:
   170998       unreachable("Invalid hardware generation");
   170999    }
   171000 }
   171001 
   171002 
   171003 
   171004 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane1CVerticalBlankWaitEnable_start  21
   171005 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane1CVerticalBlankWaitEnable_start  21
   171006 
   171007 static inline uint32_t ATTRIBUTE_PURE
   171008 MI_WAIT_FOR_EVENT_DisplayPlane1CVerticalBlankWaitEnable_start(const struct gen_device_info *devinfo)
   171009 {
   171010    switch (devinfo->gen) {
   171011    case 10: return 21;
   171012    case 9: return 21;
   171013    case 8: return 0;
   171014    case 7:
   171015       if (devinfo->is_haswell) {
   171016          return 0;
   171017       } else {
   171018          return 0;
   171019       }
   171020    case 6: return 0;
   171021    case 5: return 0;
   171022    case 4:
   171023       if (devinfo->is_g4x) {
   171024          return 0;
   171025       } else {
   171026          return 0;
   171027       }
   171028    default:
   171029       unreachable("Invalid hardware generation");
   171030    }
   171031 }
   171032 
   171033 
   171034 
   171035 /* MI_WAIT_FOR_EVENT::Display Plane 1 Flip Pending Wait Enable */
   171036 
   171037 
   171038 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane1FlipPendingWaitEnable_bits  1
   171039 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane1FlipPendingWaitEnable_bits  1
   171040 
   171041 static inline uint32_t ATTRIBUTE_PURE
   171042 MI_WAIT_FOR_EVENT_DisplayPlane1FlipPendingWaitEnable_bits(const struct gen_device_info *devinfo)
   171043 {
   171044    switch (devinfo->gen) {
   171045    case 10: return 1;
   171046    case 9: return 1;
   171047    case 8: return 0;
   171048    case 7:
   171049       if (devinfo->is_haswell) {
   171050          return 0;
   171051       } else {
   171052          return 0;
   171053       }
   171054    case 6: return 0;
   171055    case 5: return 0;
   171056    case 4:
   171057       if (devinfo->is_g4x) {
   171058          return 0;
   171059       } else {
   171060          return 0;
   171061       }
   171062    default:
   171063       unreachable("Invalid hardware generation");
   171064    }
   171065 }
   171066 
   171067 
   171068 
   171069 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane1FlipPendingWaitEnable_start  1
   171070 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane1FlipPendingWaitEnable_start  1
   171071 
   171072 static inline uint32_t ATTRIBUTE_PURE
   171073 MI_WAIT_FOR_EVENT_DisplayPlane1FlipPendingWaitEnable_start(const struct gen_device_info *devinfo)
   171074 {
   171075    switch (devinfo->gen) {
   171076    case 10: return 1;
   171077    case 9: return 1;
   171078    case 8: return 0;
   171079    case 7:
   171080       if (devinfo->is_haswell) {
   171081          return 0;
   171082       } else {
   171083          return 0;
   171084       }
   171085    case 6: return 0;
   171086    case 5: return 0;
   171087    case 4:
   171088       if (devinfo->is_g4x) {
   171089          return 0;
   171090       } else {
   171091          return 0;
   171092       }
   171093    default:
   171094       unreachable("Invalid hardware generation");
   171095    }
   171096 }
   171097 
   171098 
   171099 
   171100 /* MI_WAIT_FOR_EVENT::Display Plane 10 Flip Pending Wait Enable */
   171101 
   171102 
   171103 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane10FlipPendingWaitEnable_bits  1
   171104 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane10FlipPendingWaitEnable_bits  1
   171105 
   171106 static inline uint32_t ATTRIBUTE_PURE
   171107 MI_WAIT_FOR_EVENT_DisplayPlane10FlipPendingWaitEnable_bits(const struct gen_device_info *devinfo)
   171108 {
   171109    switch (devinfo->gen) {
   171110    case 10: return 1;
   171111    case 9: return 1;
   171112    case 8: return 0;
   171113    case 7:
   171114       if (devinfo->is_haswell) {
   171115          return 0;
   171116       } else {
   171117          return 0;
   171118       }
   171119    case 6: return 0;
   171120    case 5: return 0;
   171121    case 4:
   171122       if (devinfo->is_g4x) {
   171123          return 0;
   171124       } else {
   171125          return 0;
   171126       }
   171127    default:
   171128       unreachable("Invalid hardware generation");
   171129    }
   171130 }
   171131 
   171132 
   171133 
   171134 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane10FlipPendingWaitEnable_start  17
   171135 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane10FlipPendingWaitEnable_start  17
   171136 
   171137 static inline uint32_t ATTRIBUTE_PURE
   171138 MI_WAIT_FOR_EVENT_DisplayPlane10FlipPendingWaitEnable_start(const struct gen_device_info *devinfo)
   171139 {
   171140    switch (devinfo->gen) {
   171141    case 10: return 17;
   171142    case 9: return 17;
   171143    case 8: return 0;
   171144    case 7:
   171145       if (devinfo->is_haswell) {
   171146          return 0;
   171147       } else {
   171148          return 0;
   171149       }
   171150    case 6: return 0;
   171151    case 5: return 0;
   171152    case 4:
   171153       if (devinfo->is_g4x) {
   171154          return 0;
   171155       } else {
   171156          return 0;
   171157       }
   171158    default:
   171159       unreachable("Invalid hardware generation");
   171160    }
   171161 }
   171162 
   171163 
   171164 
   171165 /* MI_WAIT_FOR_EVENT::Display Plane 11 Flip Pending Wait Enable */
   171166 
   171167 
   171168 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane11FlipPendingWaitEnable_bits  1
   171169 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane11FlipPendingWaitEnable_bits  1
   171170 
   171171 static inline uint32_t ATTRIBUTE_PURE
   171172 MI_WAIT_FOR_EVENT_DisplayPlane11FlipPendingWaitEnable_bits(const struct gen_device_info *devinfo)
   171173 {
   171174    switch (devinfo->gen) {
   171175    case 10: return 1;
   171176    case 9: return 1;
   171177    case 8: return 0;
   171178    case 7:
   171179       if (devinfo->is_haswell) {
   171180          return 0;
   171181       } else {
   171182          return 0;
   171183       }
   171184    case 6: return 0;
   171185    case 5: return 0;
   171186    case 4:
   171187       if (devinfo->is_g4x) {
   171188          return 0;
   171189       } else {
   171190          return 0;
   171191       }
   171192    default:
   171193       unreachable("Invalid hardware generation");
   171194    }
   171195 }
   171196 
   171197 
   171198 
   171199 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane11FlipPendingWaitEnable_start  18
   171200 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane11FlipPendingWaitEnable_start  18
   171201 
   171202 static inline uint32_t ATTRIBUTE_PURE
   171203 MI_WAIT_FOR_EVENT_DisplayPlane11FlipPendingWaitEnable_start(const struct gen_device_info *devinfo)
   171204 {
   171205    switch (devinfo->gen) {
   171206    case 10: return 18;
   171207    case 9: return 18;
   171208    case 8: return 0;
   171209    case 7:
   171210       if (devinfo->is_haswell) {
   171211          return 0;
   171212       } else {
   171213          return 0;
   171214       }
   171215    case 6: return 0;
   171216    case 5: return 0;
   171217    case 4:
   171218       if (devinfo->is_g4x) {
   171219          return 0;
   171220       } else {
   171221          return 0;
   171222       }
   171223    default:
   171224       unreachable("Invalid hardware generation");
   171225    }
   171226 }
   171227 
   171228 
   171229 
   171230 /* MI_WAIT_FOR_EVENT::Display Plane 12 Flip Pending Wait Enable */
   171231 
   171232 
   171233 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane12FlipPendingWaitEnable_bits  1
   171234 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane12FlipPendingWaitEnable_bits  1
   171235 
   171236 static inline uint32_t ATTRIBUTE_PURE
   171237 MI_WAIT_FOR_EVENT_DisplayPlane12FlipPendingWaitEnable_bits(const struct gen_device_info *devinfo)
   171238 {
   171239    switch (devinfo->gen) {
   171240    case 10: return 1;
   171241    case 9: return 1;
   171242    case 8: return 0;
   171243    case 7:
   171244       if (devinfo->is_haswell) {
   171245          return 0;
   171246       } else {
   171247          return 0;
   171248       }
   171249    case 6: return 0;
   171250    case 5: return 0;
   171251    case 4:
   171252       if (devinfo->is_g4x) {
   171253          return 0;
   171254       } else {
   171255          return 0;
   171256       }
   171257    default:
   171258       unreachable("Invalid hardware generation");
   171259    }
   171260 }
   171261 
   171262 
   171263 
   171264 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane12FlipPendingWaitEnable_start  19
   171265 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane12FlipPendingWaitEnable_start  19
   171266 
   171267 static inline uint32_t ATTRIBUTE_PURE
   171268 MI_WAIT_FOR_EVENT_DisplayPlane12FlipPendingWaitEnable_start(const struct gen_device_info *devinfo)
   171269 {
   171270    switch (devinfo->gen) {
   171271    case 10: return 19;
   171272    case 9: return 19;
   171273    case 8: return 0;
   171274    case 7:
   171275       if (devinfo->is_haswell) {
   171276          return 0;
   171277       } else {
   171278          return 0;
   171279       }
   171280    case 6: return 0;
   171281    case 5: return 0;
   171282    case 4:
   171283       if (devinfo->is_g4x) {
   171284          return 0;
   171285       } else {
   171286          return 0;
   171287       }
   171288    default:
   171289       unreachable("Invalid hardware generation");
   171290    }
   171291 }
   171292 
   171293 
   171294 
   171295 /* MI_WAIT_FOR_EVENT::Display Plane 2 Flip Pending Wait Enable */
   171296 
   171297 
   171298 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane2FlipPendingWaitEnable_bits  1
   171299 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane2FlipPendingWaitEnable_bits  1
   171300 
   171301 static inline uint32_t ATTRIBUTE_PURE
   171302 MI_WAIT_FOR_EVENT_DisplayPlane2FlipPendingWaitEnable_bits(const struct gen_device_info *devinfo)
   171303 {
   171304    switch (devinfo->gen) {
   171305    case 10: return 1;
   171306    case 9: return 1;
   171307    case 8: return 0;
   171308    case 7:
   171309       if (devinfo->is_haswell) {
   171310          return 0;
   171311       } else {
   171312          return 0;
   171313       }
   171314    case 6: return 0;
   171315    case 5: return 0;
   171316    case 4:
   171317       if (devinfo->is_g4x) {
   171318          return 0;
   171319       } else {
   171320          return 0;
   171321       }
   171322    default:
   171323       unreachable("Invalid hardware generation");
   171324    }
   171325 }
   171326 
   171327 
   171328 
   171329 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane2FlipPendingWaitEnable_start  9
   171330 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane2FlipPendingWaitEnable_start  9
   171331 
   171332 static inline uint32_t ATTRIBUTE_PURE
   171333 MI_WAIT_FOR_EVENT_DisplayPlane2FlipPendingWaitEnable_start(const struct gen_device_info *devinfo)
   171334 {
   171335    switch (devinfo->gen) {
   171336    case 10: return 9;
   171337    case 9: return 9;
   171338    case 8: return 0;
   171339    case 7:
   171340       if (devinfo->is_haswell) {
   171341          return 0;
   171342       } else {
   171343          return 0;
   171344       }
   171345    case 6: return 0;
   171346    case 5: return 0;
   171347    case 4:
   171348       if (devinfo->is_g4x) {
   171349          return 0;
   171350       } else {
   171351          return 0;
   171352       }
   171353    default:
   171354       unreachable("Invalid hardware generation");
   171355    }
   171356 }
   171357 
   171358 
   171359 
   171360 /* MI_WAIT_FOR_EVENT::Display Plane 3 Flip Pending Wait Enable */
   171361 
   171362 
   171363 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane3FlipPendingWaitEnable_bits  1
   171364 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane3FlipPendingWaitEnable_bits  1
   171365 
   171366 static inline uint32_t ATTRIBUTE_PURE
   171367 MI_WAIT_FOR_EVENT_DisplayPlane3FlipPendingWaitEnable_bits(const struct gen_device_info *devinfo)
   171368 {
   171369    switch (devinfo->gen) {
   171370    case 10: return 1;
   171371    case 9: return 1;
   171372    case 8: return 0;
   171373    case 7:
   171374       if (devinfo->is_haswell) {
   171375          return 0;
   171376       } else {
   171377          return 0;
   171378       }
   171379    case 6: return 0;
   171380    case 5: return 0;
   171381    case 4:
   171382       if (devinfo->is_g4x) {
   171383          return 0;
   171384       } else {
   171385          return 0;
   171386       }
   171387    default:
   171388       unreachable("Invalid hardware generation");
   171389    }
   171390 }
   171391 
   171392 
   171393 
   171394 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane3FlipPendingWaitEnable_start  15
   171395 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane3FlipPendingWaitEnable_start  15
   171396 
   171397 static inline uint32_t ATTRIBUTE_PURE
   171398 MI_WAIT_FOR_EVENT_DisplayPlane3FlipPendingWaitEnable_start(const struct gen_device_info *devinfo)
   171399 {
   171400    switch (devinfo->gen) {
   171401    case 10: return 15;
   171402    case 9: return 15;
   171403    case 8: return 0;
   171404    case 7:
   171405       if (devinfo->is_haswell) {
   171406          return 0;
   171407       } else {
   171408          return 0;
   171409       }
   171410    case 6: return 0;
   171411    case 5: return 0;
   171412    case 4:
   171413       if (devinfo->is_g4x) {
   171414          return 0;
   171415       } else {
   171416          return 0;
   171417       }
   171418    default:
   171419       unreachable("Invalid hardware generation");
   171420    }
   171421 }
   171422 
   171423 
   171424 
   171425 /* MI_WAIT_FOR_EVENT::Display Plane 4 Flip Pending Wait Enable */
   171426 
   171427 
   171428 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane4FlipPendingWaitEnable_bits  1
   171429 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane4FlipPendingWaitEnable_bits  1
   171430 
   171431 static inline uint32_t ATTRIBUTE_PURE
   171432 MI_WAIT_FOR_EVENT_DisplayPlane4FlipPendingWaitEnable_bits(const struct gen_device_info *devinfo)
   171433 {
   171434    switch (devinfo->gen) {
   171435    case 10: return 1;
   171436    case 9: return 1;
   171437    case 8: return 0;
   171438    case 7:
   171439       if (devinfo->is_haswell) {
   171440          return 0;
   171441       } else {
   171442          return 0;
   171443       }
   171444    case 6: return 0;
   171445    case 5: return 0;
   171446    case 4:
   171447       if (devinfo->is_g4x) {
   171448          return 0;
   171449       } else {
   171450          return 0;
   171451       }
   171452    default:
   171453       unreachable("Invalid hardware generation");
   171454    }
   171455 }
   171456 
   171457 
   171458 
   171459 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane4FlipPendingWaitEnable_start  2
   171460 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane4FlipPendingWaitEnable_start  2
   171461 
   171462 static inline uint32_t ATTRIBUTE_PURE
   171463 MI_WAIT_FOR_EVENT_DisplayPlane4FlipPendingWaitEnable_start(const struct gen_device_info *devinfo)
   171464 {
   171465    switch (devinfo->gen) {
   171466    case 10: return 2;
   171467    case 9: return 2;
   171468    case 8: return 0;
   171469    case 7:
   171470       if (devinfo->is_haswell) {
   171471          return 0;
   171472       } else {
   171473          return 0;
   171474       }
   171475    case 6: return 0;
   171476    case 5: return 0;
   171477    case 4:
   171478       if (devinfo->is_g4x) {
   171479          return 0;
   171480       } else {
   171481          return 0;
   171482       }
   171483    default:
   171484       unreachable("Invalid hardware generation");
   171485    }
   171486 }
   171487 
   171488 
   171489 
   171490 /* MI_WAIT_FOR_EVENT::Display Plane 5 Flip Pending Wait Enable */
   171491 
   171492 
   171493 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane5FlipPendingWaitEnable_bits  1
   171494 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane5FlipPendingWaitEnable_bits  1
   171495 
   171496 static inline uint32_t ATTRIBUTE_PURE
   171497 MI_WAIT_FOR_EVENT_DisplayPlane5FlipPendingWaitEnable_bits(const struct gen_device_info *devinfo)
   171498 {
   171499    switch (devinfo->gen) {
   171500    case 10: return 1;
   171501    case 9: return 1;
   171502    case 8: return 0;
   171503    case 7:
   171504       if (devinfo->is_haswell) {
   171505          return 0;
   171506       } else {
   171507          return 0;
   171508       }
   171509    case 6: return 0;
   171510    case 5: return 0;
   171511    case 4:
   171512       if (devinfo->is_g4x) {
   171513          return 0;
   171514       } else {
   171515          return 0;
   171516       }
   171517    default:
   171518       unreachable("Invalid hardware generation");
   171519    }
   171520 }
   171521 
   171522 
   171523 
   171524 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane5FlipPendingWaitEnable_start  10
   171525 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane5FlipPendingWaitEnable_start  10
   171526 
   171527 static inline uint32_t ATTRIBUTE_PURE
   171528 MI_WAIT_FOR_EVENT_DisplayPlane5FlipPendingWaitEnable_start(const struct gen_device_info *devinfo)
   171529 {
   171530    switch (devinfo->gen) {
   171531    case 10: return 10;
   171532    case 9: return 10;
   171533    case 8: return 0;
   171534    case 7:
   171535       if (devinfo->is_haswell) {
   171536          return 0;
   171537       } else {
   171538          return 0;
   171539       }
   171540    case 6: return 0;
   171541    case 5: return 0;
   171542    case 4:
   171543       if (devinfo->is_g4x) {
   171544          return 0;
   171545       } else {
   171546          return 0;
   171547       }
   171548    default:
   171549       unreachable("Invalid hardware generation");
   171550    }
   171551 }
   171552 
   171553 
   171554 
   171555 /* MI_WAIT_FOR_EVENT::Display Plane 6 Flip Pending Wait Enable */
   171556 
   171557 
   171558 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane6FlipPendingWaitEnable_bits  1
   171559 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane6FlipPendingWaitEnable_bits  1
   171560 
   171561 static inline uint32_t ATTRIBUTE_PURE
   171562 MI_WAIT_FOR_EVENT_DisplayPlane6FlipPendingWaitEnable_bits(const struct gen_device_info *devinfo)
   171563 {
   171564    switch (devinfo->gen) {
   171565    case 10: return 1;
   171566    case 9: return 1;
   171567    case 8: return 0;
   171568    case 7:
   171569       if (devinfo->is_haswell) {
   171570          return 0;
   171571       } else {
   171572          return 0;
   171573       }
   171574    case 6: return 0;
   171575    case 5: return 0;
   171576    case 4:
   171577       if (devinfo->is_g4x) {
   171578          return 0;
   171579       } else {
   171580          return 0;
   171581       }
   171582    default:
   171583       unreachable("Invalid hardware generation");
   171584    }
   171585 }
   171586 
   171587 
   171588 
   171589 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane6FlipPendingWaitEnable_start  20
   171590 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane6FlipPendingWaitEnable_start  20
   171591 
   171592 static inline uint32_t ATTRIBUTE_PURE
   171593 MI_WAIT_FOR_EVENT_DisplayPlane6FlipPendingWaitEnable_start(const struct gen_device_info *devinfo)
   171594 {
   171595    switch (devinfo->gen) {
   171596    case 10: return 20;
   171597    case 9: return 20;
   171598    case 8: return 0;
   171599    case 7:
   171600       if (devinfo->is_haswell) {
   171601          return 0;
   171602       } else {
   171603          return 0;
   171604       }
   171605    case 6: return 0;
   171606    case 5: return 0;
   171607    case 4:
   171608       if (devinfo->is_g4x) {
   171609          return 0;
   171610       } else {
   171611          return 0;
   171612       }
   171613    default:
   171614       unreachable("Invalid hardware generation");
   171615    }
   171616 }
   171617 
   171618 
   171619 
   171620 /* MI_WAIT_FOR_EVENT::Display Plane 7 Flip Pending Wait Enable */
   171621 
   171622 
   171623 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane7FlipPendingWaitEnable_bits  1
   171624 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane7FlipPendingWaitEnable_bits  1
   171625 
   171626 static inline uint32_t ATTRIBUTE_PURE
   171627 MI_WAIT_FOR_EVENT_DisplayPlane7FlipPendingWaitEnable_bits(const struct gen_device_info *devinfo)
   171628 {
   171629    switch (devinfo->gen) {
   171630    case 10: return 1;
   171631    case 9: return 1;
   171632    case 8: return 0;
   171633    case 7:
   171634       if (devinfo->is_haswell) {
   171635          return 0;
   171636       } else {
   171637          return 0;
   171638       }
   171639    case 6: return 0;
   171640    case 5: return 0;
   171641    case 4:
   171642       if (devinfo->is_g4x) {
   171643          return 0;
   171644       } else {
   171645          return 0;
   171646       }
   171647    default:
   171648       unreachable("Invalid hardware generation");
   171649    }
   171650 }
   171651 
   171652 
   171653 
   171654 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane7FlipPendingWaitEnable_start  6
   171655 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane7FlipPendingWaitEnable_start  6
   171656 
   171657 static inline uint32_t ATTRIBUTE_PURE
   171658 MI_WAIT_FOR_EVENT_DisplayPlane7FlipPendingWaitEnable_start(const struct gen_device_info *devinfo)
   171659 {
   171660    switch (devinfo->gen) {
   171661    case 10: return 6;
   171662    case 9: return 6;
   171663    case 8: return 0;
   171664    case 7:
   171665       if (devinfo->is_haswell) {
   171666          return 0;
   171667       } else {
   171668          return 0;
   171669       }
   171670    case 6: return 0;
   171671    case 5: return 0;
   171672    case 4:
   171673       if (devinfo->is_g4x) {
   171674          return 0;
   171675       } else {
   171676          return 0;
   171677       }
   171678    default:
   171679       unreachable("Invalid hardware generation");
   171680    }
   171681 }
   171682 
   171683 
   171684 
   171685 /* MI_WAIT_FOR_EVENT::Display Plane 8 Flip Pending Wait Enable */
   171686 
   171687 
   171688 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane8FlipPendingWaitEnable_bits  1
   171689 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane8FlipPendingWaitEnable_bits  1
   171690 
   171691 static inline uint32_t ATTRIBUTE_PURE
   171692 MI_WAIT_FOR_EVENT_DisplayPlane8FlipPendingWaitEnable_bits(const struct gen_device_info *devinfo)
   171693 {
   171694    switch (devinfo->gen) {
   171695    case 10: return 1;
   171696    case 9: return 1;
   171697    case 8: return 0;
   171698    case 7:
   171699       if (devinfo->is_haswell) {
   171700          return 0;
   171701       } else {
   171702          return 0;
   171703       }
   171704    case 6: return 0;
   171705    case 5: return 0;
   171706    case 4:
   171707       if (devinfo->is_g4x) {
   171708          return 0;
   171709       } else {
   171710          return 0;
   171711       }
   171712    default:
   171713       unreachable("Invalid hardware generation");
   171714    }
   171715 }
   171716 
   171717 
   171718 
   171719 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane8FlipPendingWaitEnable_start  7
   171720 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane8FlipPendingWaitEnable_start  7
   171721 
   171722 static inline uint32_t ATTRIBUTE_PURE
   171723 MI_WAIT_FOR_EVENT_DisplayPlane8FlipPendingWaitEnable_start(const struct gen_device_info *devinfo)
   171724 {
   171725    switch (devinfo->gen) {
   171726    case 10: return 7;
   171727    case 9: return 7;
   171728    case 8: return 0;
   171729    case 7:
   171730       if (devinfo->is_haswell) {
   171731          return 0;
   171732       } else {
   171733          return 0;
   171734       }
   171735    case 6: return 0;
   171736    case 5: return 0;
   171737    case 4:
   171738       if (devinfo->is_g4x) {
   171739          return 0;
   171740       } else {
   171741          return 0;
   171742       }
   171743    default:
   171744       unreachable("Invalid hardware generation");
   171745    }
   171746 }
   171747 
   171748 
   171749 
   171750 /* MI_WAIT_FOR_EVENT::Display Plane 9 Flip Pending Wait Enable */
   171751 
   171752 
   171753 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane9FlipPendingWaitEnable_bits  1
   171754 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane9FlipPendingWaitEnable_bits  1
   171755 
   171756 static inline uint32_t ATTRIBUTE_PURE
   171757 MI_WAIT_FOR_EVENT_DisplayPlane9FlipPendingWaitEnable_bits(const struct gen_device_info *devinfo)
   171758 {
   171759    switch (devinfo->gen) {
   171760    case 10: return 1;
   171761    case 9: return 1;
   171762    case 8: return 0;
   171763    case 7:
   171764       if (devinfo->is_haswell) {
   171765          return 0;
   171766       } else {
   171767          return 0;
   171768       }
   171769    case 6: return 0;
   171770    case 5: return 0;
   171771    case 4:
   171772       if (devinfo->is_g4x) {
   171773          return 0;
   171774       } else {
   171775          return 0;
   171776       }
   171777    default:
   171778       unreachable("Invalid hardware generation");
   171779    }
   171780 }
   171781 
   171782 
   171783 
   171784 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlane9FlipPendingWaitEnable_start  16
   171785 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlane9FlipPendingWaitEnable_start  16
   171786 
   171787 static inline uint32_t ATTRIBUTE_PURE
   171788 MI_WAIT_FOR_EVENT_DisplayPlane9FlipPendingWaitEnable_start(const struct gen_device_info *devinfo)
   171789 {
   171790    switch (devinfo->gen) {
   171791    case 10: return 16;
   171792    case 9: return 16;
   171793    case 8: return 0;
   171794    case 7:
   171795       if (devinfo->is_haswell) {
   171796          return 0;
   171797       } else {
   171798          return 0;
   171799       }
   171800    case 6: return 0;
   171801    case 5: return 0;
   171802    case 4:
   171803       if (devinfo->is_g4x) {
   171804          return 0;
   171805       } else {
   171806          return 0;
   171807       }
   171808    default:
   171809       unreachable("Invalid hardware generation");
   171810    }
   171811 }
   171812 
   171813 
   171814 
   171815 /* MI_WAIT_FOR_EVENT::Display Plane A Flip Pending Wait Enable */
   171816 
   171817 
   171818 #define GEN8_MI_WAIT_FOR_EVENT_DisplayPlaneAFlipPendingWaitEnable_bits  1
   171819 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPlaneAFlipPendingWaitEnable_bits  1
   171820 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPlaneAFlipPendingWaitEnable_bits  1
   171821 #define GEN6_MI_WAIT_FOR_EVENT_DisplayPlaneAFlipPendingWaitEnable_bits  1
   171822 
   171823 static inline uint32_t ATTRIBUTE_PURE
   171824 MI_WAIT_FOR_EVENT_DisplayPlaneAFlipPendingWaitEnable_bits(const struct gen_device_info *devinfo)
   171825 {
   171826    switch (devinfo->gen) {
   171827    case 10: return 0;
   171828    case 9: return 0;
   171829    case 8: return 1;
   171830    case 7:
   171831       if (devinfo->is_haswell) {
   171832          return 1;
   171833       } else {
   171834          return 1;
   171835       }
   171836    case 6: return 1;
   171837    case 5: return 0;
   171838    case 4:
   171839       if (devinfo->is_g4x) {
   171840          return 0;
   171841       } else {
   171842          return 0;
   171843       }
   171844    default:
   171845       unreachable("Invalid hardware generation");
   171846    }
   171847 }
   171848 
   171849 
   171850 
   171851 #define GEN8_MI_WAIT_FOR_EVENT_DisplayPlaneAFlipPendingWaitEnable_start  1
   171852 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPlaneAFlipPendingWaitEnable_start  1
   171853 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPlaneAFlipPendingWaitEnable_start  1
   171854 #define GEN6_MI_WAIT_FOR_EVENT_DisplayPlaneAFlipPendingWaitEnable_start  1
   171855 
   171856 static inline uint32_t ATTRIBUTE_PURE
   171857 MI_WAIT_FOR_EVENT_DisplayPlaneAFlipPendingWaitEnable_start(const struct gen_device_info *devinfo)
   171858 {
   171859    switch (devinfo->gen) {
   171860    case 10: return 0;
   171861    case 9: return 0;
   171862    case 8: return 1;
   171863    case 7:
   171864       if (devinfo->is_haswell) {
   171865          return 1;
   171866       } else {
   171867          return 1;
   171868       }
   171869    case 6: return 1;
   171870    case 5: return 0;
   171871    case 4:
   171872       if (devinfo->is_g4x) {
   171873          return 0;
   171874       } else {
   171875          return 0;
   171876       }
   171877    default:
   171878       unreachable("Invalid hardware generation");
   171879    }
   171880 }
   171881 
   171882 
   171883 
   171884 /* MI_WAIT_FOR_EVENT::Display Plane B Flip Pending Wait Enable */
   171885 
   171886 
   171887 #define GEN8_MI_WAIT_FOR_EVENT_DisplayPlaneBFlipPendingWaitEnable_bits  1
   171888 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPlaneBFlipPendingWaitEnable_bits  1
   171889 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPlaneBFlipPendingWaitEnable_bits  1
   171890 #define GEN6_MI_WAIT_FOR_EVENT_DisplayPlaneBFlipPendingWaitEnable_bits  1
   171891 
   171892 static inline uint32_t ATTRIBUTE_PURE
   171893 MI_WAIT_FOR_EVENT_DisplayPlaneBFlipPendingWaitEnable_bits(const struct gen_device_info *devinfo)
   171894 {
   171895    switch (devinfo->gen) {
   171896    case 10: return 0;
   171897    case 9: return 0;
   171898    case 8: return 1;
   171899    case 7:
   171900       if (devinfo->is_haswell) {
   171901          return 1;
   171902       } else {
   171903          return 1;
   171904       }
   171905    case 6: return 1;
   171906    case 5: return 0;
   171907    case 4:
   171908       if (devinfo->is_g4x) {
   171909          return 0;
   171910       } else {
   171911          return 0;
   171912       }
   171913    default:
   171914       unreachable("Invalid hardware generation");
   171915    }
   171916 }
   171917 
   171918 
   171919 
   171920 #define GEN8_MI_WAIT_FOR_EVENT_DisplayPlaneBFlipPendingWaitEnable_start  9
   171921 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPlaneBFlipPendingWaitEnable_start  9
   171922 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPlaneBFlipPendingWaitEnable_start  9
   171923 #define GEN6_MI_WAIT_FOR_EVENT_DisplayPlaneBFlipPendingWaitEnable_start  9
   171924 
   171925 static inline uint32_t ATTRIBUTE_PURE
   171926 MI_WAIT_FOR_EVENT_DisplayPlaneBFlipPendingWaitEnable_start(const struct gen_device_info *devinfo)
   171927 {
   171928    switch (devinfo->gen) {
   171929    case 10: return 0;
   171930    case 9: return 0;
   171931    case 8: return 9;
   171932    case 7:
   171933       if (devinfo->is_haswell) {
   171934          return 9;
   171935       } else {
   171936          return 9;
   171937       }
   171938    case 6: return 9;
   171939    case 5: return 0;
   171940    case 4:
   171941       if (devinfo->is_g4x) {
   171942          return 0;
   171943       } else {
   171944          return 0;
   171945       }
   171946    default:
   171947       unreachable("Invalid hardware generation");
   171948    }
   171949 }
   171950 
   171951 
   171952 
   171953 /* MI_WAIT_FOR_EVENT::Display Plane C Flip Pending Wait Enable */
   171954 
   171955 
   171956 #define GEN8_MI_WAIT_FOR_EVENT_DisplayPlaneCFlipPendingWaitEnable_bits  1
   171957 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPlaneCFlipPendingWaitEnable_bits  1
   171958 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPlaneCFlipPendingWaitEnable_bits  1
   171959 
   171960 static inline uint32_t ATTRIBUTE_PURE
   171961 MI_WAIT_FOR_EVENT_DisplayPlaneCFlipPendingWaitEnable_bits(const struct gen_device_info *devinfo)
   171962 {
   171963    switch (devinfo->gen) {
   171964    case 10: return 0;
   171965    case 9: return 0;
   171966    case 8: return 1;
   171967    case 7:
   171968       if (devinfo->is_haswell) {
   171969          return 1;
   171970       } else {
   171971          return 1;
   171972       }
   171973    case 6: return 0;
   171974    case 5: return 0;
   171975    case 4:
   171976       if (devinfo->is_g4x) {
   171977          return 0;
   171978       } else {
   171979          return 0;
   171980       }
   171981    default:
   171982       unreachable("Invalid hardware generation");
   171983    }
   171984 }
   171985 
   171986 
   171987 
   171988 #define GEN8_MI_WAIT_FOR_EVENT_DisplayPlaneCFlipPendingWaitEnable_start  15
   171989 #define GEN75_MI_WAIT_FOR_EVENT_DisplayPlaneCFlipPendingWaitEnable_start  15
   171990 #define GEN7_MI_WAIT_FOR_EVENT_DisplayPlaneCFlipPendingWaitEnable_start  15
   171991 
   171992 static inline uint32_t ATTRIBUTE_PURE
   171993 MI_WAIT_FOR_EVENT_DisplayPlaneCFlipPendingWaitEnable_start(const struct gen_device_info *devinfo)
   171994 {
   171995    switch (devinfo->gen) {
   171996    case 10: return 0;
   171997    case 9: return 0;
   171998    case 8: return 15;
   171999    case 7:
   172000       if (devinfo->is_haswell) {
   172001          return 15;
   172002       } else {
   172003          return 15;
   172004       }
   172005    case 6: return 0;
   172006    case 5: return 0;
   172007    case 4:
   172008       if (devinfo->is_g4x) {
   172009          return 0;
   172010       } else {
   172011          return 0;
   172012       }
   172013    default:
   172014       unreachable("Invalid hardware generation");
   172015    }
   172016 }
   172017 
   172018 
   172019 
   172020 /* MI_WAIT_FOR_EVENT::Display Plnae 1 A Scan Line Wait Enable */
   172021 
   172022 
   172023 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlnae1AScanLineWaitEnable_bits  1
   172024 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlnae1AScanLineWaitEnable_bits  1
   172025 
   172026 static inline uint32_t ATTRIBUTE_PURE
   172027 MI_WAIT_FOR_EVENT_DisplayPlnae1AScanLineWaitEnable_bits(const struct gen_device_info *devinfo)
   172028 {
   172029    switch (devinfo->gen) {
   172030    case 10: return 1;
   172031    case 9: return 1;
   172032    case 8: return 0;
   172033    case 7:
   172034       if (devinfo->is_haswell) {
   172035          return 0;
   172036       } else {
   172037          return 0;
   172038       }
   172039    case 6: return 0;
   172040    case 5: return 0;
   172041    case 4:
   172042       if (devinfo->is_g4x) {
   172043          return 0;
   172044       } else {
   172045          return 0;
   172046       }
   172047    default:
   172048       unreachable("Invalid hardware generation");
   172049    }
   172050 }
   172051 
   172052 
   172053 
   172054 #define GEN10_MI_WAIT_FOR_EVENT_DisplayPlnae1AScanLineWaitEnable_start  0
   172055 #define GEN9_MI_WAIT_FOR_EVENT_DisplayPlnae1AScanLineWaitEnable_start  0
   172056 
   172057 static inline uint32_t ATTRIBUTE_PURE
   172058 MI_WAIT_FOR_EVENT_DisplayPlnae1AScanLineWaitEnable_start(const struct gen_device_info *devinfo)
   172059 {
   172060    switch (devinfo->gen) {
   172061    case 10: return 0;
   172062    case 9: return 0;
   172063    case 8: return 0;
   172064    case 7:
   172065       if (devinfo->is_haswell) {
   172066          return 0;
   172067       } else {
   172068          return 0;
   172069       }
   172070    case 6: return 0;
   172071    case 5: return 0;
   172072    case 4:
   172073       if (devinfo->is_g4x) {
   172074          return 0;
   172075       } else {
   172076          return 0;
   172077       }
   172078    default:
   172079       unreachable("Invalid hardware generation");
   172080    }
   172081 }
   172082 
   172083 
   172084 
   172085 /* MI_WAIT_FOR_EVENT::Display Sprite A Flip Pending Wait Enable */
   172086 
   172087 
   172088 #define GEN8_MI_WAIT_FOR_EVENT_DisplaySpriteAFlipPendingWaitEnable_bits  1
   172089 #define GEN75_MI_WAIT_FOR_EVENT_DisplaySpriteAFlipPendingWaitEnable_bits  1
   172090 #define GEN7_MI_WAIT_FOR_EVENT_DisplaySpriteAFlipPendingWaitEnable_bits  1
   172091 #define GEN6_MI_WAIT_FOR_EVENT_DisplaySpriteAFlipPendingWaitEnable_bits  1
   172092 
   172093 static inline uint32_t ATTRIBUTE_PURE
   172094 MI_WAIT_FOR_EVENT_DisplaySpriteAFlipPendingWaitEnable_bits(const struct gen_device_info *devinfo)
   172095 {
   172096    switch (devinfo->gen) {
   172097    case 10: return 0;
   172098    case 9: return 0;
   172099    case 8: return 1;
   172100    case 7:
   172101       if (devinfo->is_haswell) {
   172102          return 1;
   172103       } else {
   172104          return 1;
   172105       }
   172106    case 6: return 1;
   172107    case 5: return 0;
   172108    case 4:
   172109       if (devinfo->is_g4x) {
   172110          return 0;
   172111       } else {
   172112          return 0;
   172113       }
   172114    default:
   172115       unreachable("Invalid hardware generation");
   172116    }
   172117 }
   172118 
   172119 
   172120 
   172121 #define GEN8_MI_WAIT_FOR_EVENT_DisplaySpriteAFlipPendingWaitEnable_start  2
   172122 #define GEN75_MI_WAIT_FOR_EVENT_DisplaySpriteAFlipPendingWaitEnable_start  2
   172123 #define GEN7_MI_WAIT_FOR_EVENT_DisplaySpriteAFlipPendingWaitEnable_start  2
   172124 #define GEN6_MI_WAIT_FOR_EVENT_DisplaySpriteAFlipPendingWaitEnable_start  2
   172125 
   172126 static inline uint32_t ATTRIBUTE_PURE
   172127 MI_WAIT_FOR_EVENT_DisplaySpriteAFlipPendingWaitEnable_start(const struct gen_device_info *devinfo)
   172128 {
   172129    switch (devinfo->gen) {
   172130    case 10: return 0;
   172131    case 9: return 0;
   172132    case 8: return 2;
   172133    case 7:
   172134       if (devinfo->is_haswell) {
   172135          return 2;
   172136       } else {
   172137          return 2;
   172138       }
   172139    case 6: return 2;
   172140    case 5: return 0;
   172141    case 4:
   172142       if (devinfo->is_g4x) {
   172143          return 0;
   172144       } else {
   172145          return 0;
   172146       }
   172147    default:
   172148       unreachable("Invalid hardware generation");
   172149    }
   172150 }
   172151 
   172152 
   172153 
   172154 /* MI_WAIT_FOR_EVENT::Display Sprite B Flip Pending Wait Enable */
   172155 
   172156 
   172157 #define GEN8_MI_WAIT_FOR_EVENT_DisplaySpriteBFlipPendingWaitEnable_bits  1
   172158 #define GEN75_MI_WAIT_FOR_EVENT_DisplaySpriteBFlipPendingWaitEnable_bits  1
   172159 #define GEN7_MI_WAIT_FOR_EVENT_DisplaySpriteBFlipPendingWaitEnable_bits  1
   172160 #define GEN6_MI_WAIT_FOR_EVENT_DisplaySpriteBFlipPendingWaitEnable_bits  1
   172161 
   172162 static inline uint32_t ATTRIBUTE_PURE
   172163 MI_WAIT_FOR_EVENT_DisplaySpriteBFlipPendingWaitEnable_bits(const struct gen_device_info *devinfo)
   172164 {
   172165    switch (devinfo->gen) {
   172166    case 10: return 0;
   172167    case 9: return 0;
   172168    case 8: return 1;
   172169    case 7:
   172170       if (devinfo->is_haswell) {
   172171          return 1;
   172172       } else {
   172173          return 1;
   172174       }
   172175    case 6: return 1;
   172176    case 5: return 0;
   172177    case 4:
   172178       if (devinfo->is_g4x) {
   172179          return 0;
   172180       } else {
   172181          return 0;
   172182       }
   172183    default:
   172184       unreachable("Invalid hardware generation");
   172185    }
   172186 }
   172187 
   172188 
   172189 
   172190 #define GEN8_MI_WAIT_FOR_EVENT_DisplaySpriteBFlipPendingWaitEnable_start  10
   172191 #define GEN75_MI_WAIT_FOR_EVENT_DisplaySpriteBFlipPendingWaitEnable_start  10
   172192 #define GEN7_MI_WAIT_FOR_EVENT_DisplaySpriteBFlipPendingWaitEnable_start  10
   172193 #define GEN6_MI_WAIT_FOR_EVENT_DisplaySpriteBFlipPendingWaitEnable_start  10
   172194 
   172195 static inline uint32_t ATTRIBUTE_PURE
   172196 MI_WAIT_FOR_EVENT_DisplaySpriteBFlipPendingWaitEnable_start(const struct gen_device_info *devinfo)
   172197 {
   172198    switch (devinfo->gen) {
   172199    case 10: return 0;
   172200    case 9: return 0;
   172201    case 8: return 10;
   172202    case 7:
   172203       if (devinfo->is_haswell) {
   172204          return 10;
   172205       } else {
   172206          return 10;
   172207       }
   172208    case 6: return 10;
   172209    case 5: return 0;
   172210    case 4:
   172211       if (devinfo->is_g4x) {
   172212          return 0;
   172213       } else {
   172214          return 0;
   172215       }
   172216    default:
   172217       unreachable("Invalid hardware generation");
   172218    }
   172219 }
   172220 
   172221 
   172222 
   172223 /* MI_WAIT_FOR_EVENT::Display Sprite C Flip Pending Wait Enable */
   172224 
   172225 
   172226 #define GEN8_MI_WAIT_FOR_EVENT_DisplaySpriteCFlipPendingWaitEnable_bits  1
   172227 #define GEN75_MI_WAIT_FOR_EVENT_DisplaySpriteCFlipPendingWaitEnable_bits  1
   172228 #define GEN7_MI_WAIT_FOR_EVENT_DisplaySpriteCFlipPendingWaitEnable_bits  1
   172229 
   172230 static inline uint32_t ATTRIBUTE_PURE
   172231 MI_WAIT_FOR_EVENT_DisplaySpriteCFlipPendingWaitEnable_bits(const struct gen_device_info *devinfo)
   172232 {
   172233    switch (devinfo->gen) {
   172234    case 10: return 0;
   172235    case 9: return 0;
   172236    case 8: return 1;
   172237    case 7:
   172238       if (devinfo->is_haswell) {
   172239          return 1;
   172240       } else {
   172241          return 1;
   172242       }
   172243    case 6: return 0;
   172244    case 5: return 0;
   172245    case 4:
   172246       if (devinfo->is_g4x) {
   172247          return 0;
   172248       } else {
   172249          return 0;
   172250       }
   172251    default:
   172252       unreachable("Invalid hardware generation");
   172253    }
   172254 }
   172255 
   172256 
   172257 
   172258 #define GEN8_MI_WAIT_FOR_EVENT_DisplaySpriteCFlipPendingWaitEnable_start  20
   172259 #define GEN75_MI_WAIT_FOR_EVENT_DisplaySpriteCFlipPendingWaitEnable_start  20
   172260 #define GEN7_MI_WAIT_FOR_EVENT_DisplaySpriteCFlipPendingWaitEnable_start  20
   172261 
   172262 static inline uint32_t ATTRIBUTE_PURE
   172263 MI_WAIT_FOR_EVENT_DisplaySpriteCFlipPendingWaitEnable_start(const struct gen_device_info *devinfo)
   172264 {
   172265    switch (devinfo->gen) {
   172266    case 10: return 0;
   172267    case 9: return 0;
   172268    case 8: return 20;
   172269    case 7:
   172270       if (devinfo->is_haswell) {
   172271          return 20;
   172272       } else {
   172273          return 20;
   172274       }
   172275    case 6: return 0;
   172276    case 5: return 0;
   172277    case 4:
   172278       if (devinfo->is_g4x) {
   172279          return 0;
   172280       } else {
   172281          return 0;
   172282       }
   172283    default:
   172284       unreachable("Invalid hardware generation");
   172285    }
   172286 }
   172287 
   172288 
   172289 
   172290 /* MI_WAIT_FOR_EVENT::MI Command Opcode */
   172291 
   172292 
   172293 #define GEN10_MI_WAIT_FOR_EVENT_MICommandOpcode_bits  6
   172294 #define GEN9_MI_WAIT_FOR_EVENT_MICommandOpcode_bits  6
   172295 #define GEN8_MI_WAIT_FOR_EVENT_MICommandOpcode_bits  6
   172296 #define GEN75_MI_WAIT_FOR_EVENT_MICommandOpcode_bits  6
   172297 #define GEN7_MI_WAIT_FOR_EVENT_MICommandOpcode_bits  6
   172298 #define GEN6_MI_WAIT_FOR_EVENT_MICommandOpcode_bits  6
   172299 
   172300 static inline uint32_t ATTRIBUTE_PURE
   172301 MI_WAIT_FOR_EVENT_MICommandOpcode_bits(const struct gen_device_info *devinfo)
   172302 {
   172303    switch (devinfo->gen) {
   172304    case 10: return 6;
   172305    case 9: return 6;
   172306    case 8: return 6;
   172307    case 7:
   172308       if (devinfo->is_haswell) {
   172309          return 6;
   172310       } else {
   172311          return 6;
   172312       }
   172313    case 6: return 6;
   172314    case 5: return 0;
   172315    case 4:
   172316       if (devinfo->is_g4x) {
   172317          return 0;
   172318       } else {
   172319          return 0;
   172320       }
   172321    default:
   172322       unreachable("Invalid hardware generation");
   172323    }
   172324 }
   172325 
   172326 
   172327 
   172328 #define GEN10_MI_WAIT_FOR_EVENT_MICommandOpcode_start  23
   172329 #define GEN9_MI_WAIT_FOR_EVENT_MICommandOpcode_start  23
   172330 #define GEN8_MI_WAIT_FOR_EVENT_MICommandOpcode_start  23
   172331 #define GEN75_MI_WAIT_FOR_EVENT_MICommandOpcode_start  23
   172332 #define GEN7_MI_WAIT_FOR_EVENT_MICommandOpcode_start  23
   172333 #define GEN6_MI_WAIT_FOR_EVENT_MICommandOpcode_start  23
   172334 
   172335 static inline uint32_t ATTRIBUTE_PURE
   172336 MI_WAIT_FOR_EVENT_MICommandOpcode_start(const struct gen_device_info *devinfo)
   172337 {
   172338    switch (devinfo->gen) {
   172339    case 10: return 23;
   172340    case 9: return 23;
   172341    case 8: return 23;
   172342    case 7:
   172343       if (devinfo->is_haswell) {
   172344          return 23;
   172345       } else {
   172346          return 23;
   172347       }
   172348    case 6: return 23;
   172349    case 5: return 0;
   172350    case 4:
   172351       if (devinfo->is_g4x) {
   172352          return 0;
   172353       } else {
   172354          return 0;
   172355       }
   172356    default:
   172357       unreachable("Invalid hardware generation");
   172358    }
   172359 }
   172360 
   172361 
   172362 
   172363 /* PALETTE_ENTRY */
   172364 
   172365 
   172366 #define GEN10_PALETTE_ENTRY_length  1
   172367 #define GEN9_PALETTE_ENTRY_length  1
   172368 #define GEN8_PALETTE_ENTRY_length  1
   172369 #define GEN75_PALETTE_ENTRY_length  1
   172370 #define GEN7_PALETTE_ENTRY_length  1
   172371 #define GEN6_PALETTE_ENTRY_length  1
   172372 
   172373 static inline uint32_t ATTRIBUTE_PURE
   172374 PALETTE_ENTRY_length(const struct gen_device_info *devinfo)
   172375 {
   172376    switch (devinfo->gen) {
   172377    case 10: return 1;
   172378    case 9: return 1;
   172379    case 8: return 1;
   172380    case 7:
   172381       if (devinfo->is_haswell) {
   172382          return 1;
   172383       } else {
   172384          return 1;
   172385       }
   172386    case 6: return 1;
   172387    case 5: return 0;
   172388    case 4:
   172389       if (devinfo->is_g4x) {
   172390          return 0;
   172391       } else {
   172392          return 0;
   172393       }
   172394    default:
   172395       unreachable("Invalid hardware generation");
   172396    }
   172397 }
   172398 
   172399 
   172400 
   172401 /* PALETTE_ENTRY::Alpha */
   172402 
   172403 
   172404 #define GEN10_PALETTE_ENTRY_Alpha_bits  8
   172405 #define GEN9_PALETTE_ENTRY_Alpha_bits  8
   172406 #define GEN8_PALETTE_ENTRY_Alpha_bits  8
   172407 #define GEN75_PALETTE_ENTRY_Alpha_bits  8
   172408 #define GEN7_PALETTE_ENTRY_Alpha_bits  8
   172409 #define GEN6_PALETTE_ENTRY_Alpha_bits  8
   172410 
   172411 static inline uint32_t ATTRIBUTE_PURE
   172412 PALETTE_ENTRY_Alpha_bits(const struct gen_device_info *devinfo)
   172413 {
   172414    switch (devinfo->gen) {
   172415    case 10: return 8;
   172416    case 9: return 8;
   172417    case 8: return 8;
   172418    case 7:
   172419       if (devinfo->is_haswell) {
   172420          return 8;
   172421       } else {
   172422          return 8;
   172423       }
   172424    case 6: return 8;
   172425    case 5: return 0;
   172426    case 4:
   172427       if (devinfo->is_g4x) {
   172428          return 0;
   172429       } else {
   172430          return 0;
   172431       }
   172432    default:
   172433       unreachable("Invalid hardware generation");
   172434    }
   172435 }
   172436 
   172437 
   172438 
   172439 #define GEN10_PALETTE_ENTRY_Alpha_start  24
   172440 #define GEN9_PALETTE_ENTRY_Alpha_start  24
   172441 #define GEN8_PALETTE_ENTRY_Alpha_start  24
   172442 #define GEN75_PALETTE_ENTRY_Alpha_start  24
   172443 #define GEN7_PALETTE_ENTRY_Alpha_start  24
   172444 #define GEN6_PALETTE_ENTRY_Alpha_start  24
   172445 
   172446 static inline uint32_t ATTRIBUTE_PURE
   172447 PALETTE_ENTRY_Alpha_start(const struct gen_device_info *devinfo)
   172448 {
   172449    switch (devinfo->gen) {
   172450    case 10: return 24;
   172451    case 9: return 24;
   172452    case 8: return 24;
   172453    case 7:
   172454       if (devinfo->is_haswell) {
   172455          return 24;
   172456       } else {
   172457          return 24;
   172458       }
   172459    case 6: return 24;
   172460    case 5: return 0;
   172461    case 4:
   172462       if (devinfo->is_g4x) {
   172463          return 0;
   172464       } else {
   172465          return 0;
   172466       }
   172467    default:
   172468       unreachable("Invalid hardware generation");
   172469    }
   172470 }
   172471 
   172472 
   172473 
   172474 /* PALETTE_ENTRY::Blue */
   172475 
   172476 
   172477 #define GEN10_PALETTE_ENTRY_Blue_bits  8
   172478 #define GEN9_PALETTE_ENTRY_Blue_bits  8
   172479 #define GEN8_PALETTE_ENTRY_Blue_bits  8
   172480 #define GEN75_PALETTE_ENTRY_Blue_bits  8
   172481 #define GEN7_PALETTE_ENTRY_Blue_bits  8
   172482 #define GEN6_PALETTE_ENTRY_Blue_bits  8
   172483 
   172484 static inline uint32_t ATTRIBUTE_PURE
   172485 PALETTE_ENTRY_Blue_bits(const struct gen_device_info *devinfo)
   172486 {
   172487    switch (devinfo->gen) {
   172488    case 10: return 8;
   172489    case 9: return 8;
   172490    case 8: return 8;
   172491    case 7:
   172492       if (devinfo->is_haswell) {
   172493          return 8;
   172494       } else {
   172495          return 8;
   172496       }
   172497    case 6: return 8;
   172498    case 5: return 0;
   172499    case 4:
   172500       if (devinfo->is_g4x) {
   172501          return 0;
   172502       } else {
   172503          return 0;
   172504       }
   172505    default:
   172506       unreachable("Invalid hardware generation");
   172507    }
   172508 }
   172509 
   172510 
   172511 
   172512 #define GEN10_PALETTE_ENTRY_Blue_start  0
   172513 #define GEN9_PALETTE_ENTRY_Blue_start  0
   172514 #define GEN8_PALETTE_ENTRY_Blue_start  0
   172515 #define GEN75_PALETTE_ENTRY_Blue_start  0
   172516 #define GEN7_PALETTE_ENTRY_Blue_start  0
   172517 #define GEN6_PALETTE_ENTRY_Blue_start  0
   172518 
   172519 static inline uint32_t ATTRIBUTE_PURE
   172520 PALETTE_ENTRY_Blue_start(const struct gen_device_info *devinfo)
   172521 {
   172522    switch (devinfo->gen) {
   172523    case 10: return 0;
   172524    case 9: return 0;
   172525    case 8: return 0;
   172526    case 7:
   172527       if (devinfo->is_haswell) {
   172528          return 0;
   172529       } else {
   172530          return 0;
   172531       }
   172532    case 6: return 0;
   172533    case 5: return 0;
   172534    case 4:
   172535       if (devinfo->is_g4x) {
   172536          return 0;
   172537       } else {
   172538          return 0;
   172539       }
   172540    default:
   172541       unreachable("Invalid hardware generation");
   172542    }
   172543 }
   172544 
   172545 
   172546 
   172547 /* PALETTE_ENTRY::Green */
   172548 
   172549 
   172550 #define GEN10_PALETTE_ENTRY_Green_bits  8
   172551 #define GEN9_PALETTE_ENTRY_Green_bits  8
   172552 #define GEN8_PALETTE_ENTRY_Green_bits  8
   172553 #define GEN75_PALETTE_ENTRY_Green_bits  8
   172554 #define GEN7_PALETTE_ENTRY_Green_bits  8
   172555 #define GEN6_PALETTE_ENTRY_Green_bits  8
   172556 
   172557 static inline uint32_t ATTRIBUTE_PURE
   172558 PALETTE_ENTRY_Green_bits(const struct gen_device_info *devinfo)
   172559 {
   172560    switch (devinfo->gen) {
   172561    case 10: return 8;
   172562    case 9: return 8;
   172563    case 8: return 8;
   172564    case 7:
   172565       if (devinfo->is_haswell) {
   172566          return 8;
   172567       } else {
   172568          return 8;
   172569       }
   172570    case 6: return 8;
   172571    case 5: return 0;
   172572    case 4:
   172573       if (devinfo->is_g4x) {
   172574          return 0;
   172575       } else {
   172576          return 0;
   172577       }
   172578    default:
   172579       unreachable("Invalid hardware generation");
   172580    }
   172581 }
   172582 
   172583 
   172584 
   172585 #define GEN10_PALETTE_ENTRY_Green_start  8
   172586 #define GEN9_PALETTE_ENTRY_Green_start  8
   172587 #define GEN8_PALETTE_ENTRY_Green_start  8
   172588 #define GEN75_PALETTE_ENTRY_Green_start  8
   172589 #define GEN7_PALETTE_ENTRY_Green_start  8
   172590 #define GEN6_PALETTE_ENTRY_Green_start  8
   172591 
   172592 static inline uint32_t ATTRIBUTE_PURE
   172593 PALETTE_ENTRY_Green_start(const struct gen_device_info *devinfo)
   172594 {
   172595    switch (devinfo->gen) {
   172596    case 10: return 8;
   172597    case 9: return 8;
   172598    case 8: return 8;
   172599    case 7:
   172600       if (devinfo->is_haswell) {
   172601          return 8;
   172602       } else {
   172603          return 8;
   172604       }
   172605    case 6: return 8;
   172606    case 5: return 0;
   172607    case 4:
   172608       if (devinfo->is_g4x) {
   172609          return 0;
   172610       } else {
   172611          return 0;
   172612       }
   172613    default:
   172614       unreachable("Invalid hardware generation");
   172615    }
   172616 }
   172617 
   172618 
   172619 
   172620 /* PALETTE_ENTRY::Red */
   172621 
   172622 
   172623 #define GEN10_PALETTE_ENTRY_Red_bits  8
   172624 #define GEN9_PALETTE_ENTRY_Red_bits  8
   172625 #define GEN8_PALETTE_ENTRY_Red_bits  8
   172626 #define GEN75_PALETTE_ENTRY_Red_bits  8
   172627 #define GEN7_PALETTE_ENTRY_Red_bits  8
   172628 #define GEN6_PALETTE_ENTRY_Red_bits  8
   172629 
   172630 static inline uint32_t ATTRIBUTE_PURE
   172631 PALETTE_ENTRY_Red_bits(const struct gen_device_info *devinfo)
   172632 {
   172633    switch (devinfo->gen) {
   172634    case 10: return 8;
   172635    case 9: return 8;
   172636    case 8: return 8;
   172637    case 7:
   172638       if (devinfo->is_haswell) {
   172639          return 8;
   172640       } else {
   172641          return 8;
   172642       }
   172643    case 6: return 8;
   172644    case 5: return 0;
   172645    case 4:
   172646       if (devinfo->is_g4x) {
   172647          return 0;
   172648       } else {
   172649          return 0;
   172650       }
   172651    default:
   172652       unreachable("Invalid hardware generation");
   172653    }
   172654 }
   172655 
   172656 
   172657 
   172658 #define GEN10_PALETTE_ENTRY_Red_start  16
   172659 #define GEN9_PALETTE_ENTRY_Red_start  16
   172660 #define GEN8_PALETTE_ENTRY_Red_start  16
   172661 #define GEN75_PALETTE_ENTRY_Red_start  16
   172662 #define GEN7_PALETTE_ENTRY_Red_start  16
   172663 #define GEN6_PALETTE_ENTRY_Red_start  16
   172664 
   172665 static inline uint32_t ATTRIBUTE_PURE
   172666 PALETTE_ENTRY_Red_start(const struct gen_device_info *devinfo)
   172667 {
   172668    switch (devinfo->gen) {
   172669    case 10: return 16;
   172670    case 9: return 16;
   172671    case 8: return 16;
   172672    case 7:
   172673       if (devinfo->is_haswell) {
   172674          return 16;
   172675       } else {
   172676          return 16;
   172677       }
   172678    case 6: return 16;
   172679    case 5: return 0;
   172680    case 4:
   172681       if (devinfo->is_g4x) {
   172682          return 0;
   172683       } else {
   172684          return 0;
   172685       }
   172686    default:
   172687       unreachable("Invalid hardware generation");
   172688    }
   172689 }
   172690 
   172691 
   172692 
   172693 /* PIPELINE_SELECT */
   172694 
   172695 
   172696 #define GEN10_PIPELINE_SELECT_length  1
   172697 #define GEN9_PIPELINE_SELECT_length  1
   172698 #define GEN8_PIPELINE_SELECT_length  1
   172699 #define GEN75_PIPELINE_SELECT_length  1
   172700 #define GEN7_PIPELINE_SELECT_length  1
   172701 #define GEN6_PIPELINE_SELECT_length  1
   172702 #define GEN5_PIPELINE_SELECT_length  1
   172703 #define GEN45_PIPELINE_SELECT_length  1
   172704 #define GEN4_PIPELINE_SELECT_length  1
   172705 
   172706 static inline uint32_t ATTRIBUTE_PURE
   172707 PIPELINE_SELECT_length(const struct gen_device_info *devinfo)
   172708 {
   172709    switch (devinfo->gen) {
   172710    case 10: return 1;
   172711    case 9: return 1;
   172712    case 8: return 1;
   172713    case 7:
   172714       if (devinfo->is_haswell) {
   172715          return 1;
   172716       } else {
   172717          return 1;
   172718       }
   172719    case 6: return 1;
   172720    case 5: return 1;
   172721    case 4:
   172722       if (devinfo->is_g4x) {
   172723          return 1;
   172724       } else {
   172725          return 1;
   172726       }
   172727    default:
   172728       unreachable("Invalid hardware generation");
   172729    }
   172730 }
   172731 
   172732 
   172733 
   172734 /* PIPELINE_SELECT::3D Command Opcode */
   172735 
   172736 
   172737 #define GEN10_PIPELINE_SELECT_3DCommandOpcode_bits  3
   172738 #define GEN9_PIPELINE_SELECT_3DCommandOpcode_bits  3
   172739 #define GEN8_PIPELINE_SELECT_3DCommandOpcode_bits  3
   172740 #define GEN75_PIPELINE_SELECT_3DCommandOpcode_bits  3
   172741 #define GEN7_PIPELINE_SELECT_3DCommandOpcode_bits  3
   172742 #define GEN6_PIPELINE_SELECT_3DCommandOpcode_bits  3
   172743 #define GEN5_PIPELINE_SELECT_3DCommandOpcode_bits  3
   172744 #define GEN45_PIPELINE_SELECT_3DCommandOpcode_bits  3
   172745 #define GEN4_PIPELINE_SELECT_3DCommandOpcode_bits  3
   172746 
   172747 static inline uint32_t ATTRIBUTE_PURE
   172748 PIPELINE_SELECT_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   172749 {
   172750    switch (devinfo->gen) {
   172751    case 10: return 3;
   172752    case 9: return 3;
   172753    case 8: return 3;
   172754    case 7:
   172755       if (devinfo->is_haswell) {
   172756          return 3;
   172757       } else {
   172758          return 3;
   172759       }
   172760    case 6: return 3;
   172761    case 5: return 3;
   172762    case 4:
   172763       if (devinfo->is_g4x) {
   172764          return 3;
   172765       } else {
   172766          return 3;
   172767       }
   172768    default:
   172769       unreachable("Invalid hardware generation");
   172770    }
   172771 }
   172772 
   172773 
   172774 
   172775 #define GEN10_PIPELINE_SELECT_3DCommandOpcode_start  24
   172776 #define GEN9_PIPELINE_SELECT_3DCommandOpcode_start  24
   172777 #define GEN8_PIPELINE_SELECT_3DCommandOpcode_start  24
   172778 #define GEN75_PIPELINE_SELECT_3DCommandOpcode_start  24
   172779 #define GEN7_PIPELINE_SELECT_3DCommandOpcode_start  24
   172780 #define GEN6_PIPELINE_SELECT_3DCommandOpcode_start  24
   172781 #define GEN5_PIPELINE_SELECT_3DCommandOpcode_start  24
   172782 #define GEN45_PIPELINE_SELECT_3DCommandOpcode_start  24
   172783 #define GEN4_PIPELINE_SELECT_3DCommandOpcode_start  24
   172784 
   172785 static inline uint32_t ATTRIBUTE_PURE
   172786 PIPELINE_SELECT_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   172787 {
   172788    switch (devinfo->gen) {
   172789    case 10: return 24;
   172790    case 9: return 24;
   172791    case 8: return 24;
   172792    case 7:
   172793       if (devinfo->is_haswell) {
   172794          return 24;
   172795       } else {
   172796          return 24;
   172797       }
   172798    case 6: return 24;
   172799    case 5: return 24;
   172800    case 4:
   172801       if (devinfo->is_g4x) {
   172802          return 24;
   172803       } else {
   172804          return 24;
   172805       }
   172806    default:
   172807       unreachable("Invalid hardware generation");
   172808    }
   172809 }
   172810 
   172811 
   172812 
   172813 /* PIPELINE_SELECT::3D Command Sub Opcode */
   172814 
   172815 
   172816 #define GEN10_PIPELINE_SELECT_3DCommandSubOpcode_bits  8
   172817 #define GEN9_PIPELINE_SELECT_3DCommandSubOpcode_bits  8
   172818 #define GEN8_PIPELINE_SELECT_3DCommandSubOpcode_bits  8
   172819 #define GEN75_PIPELINE_SELECT_3DCommandSubOpcode_bits  8
   172820 #define GEN7_PIPELINE_SELECT_3DCommandSubOpcode_bits  8
   172821 #define GEN6_PIPELINE_SELECT_3DCommandSubOpcode_bits  8
   172822 #define GEN5_PIPELINE_SELECT_3DCommandSubOpcode_bits  8
   172823 #define GEN45_PIPELINE_SELECT_3DCommandSubOpcode_bits  8
   172824 #define GEN4_PIPELINE_SELECT_3DCommandSubOpcode_bits  8
   172825 
   172826 static inline uint32_t ATTRIBUTE_PURE
   172827 PIPELINE_SELECT_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   172828 {
   172829    switch (devinfo->gen) {
   172830    case 10: return 8;
   172831    case 9: return 8;
   172832    case 8: return 8;
   172833    case 7:
   172834       if (devinfo->is_haswell) {
   172835          return 8;
   172836       } else {
   172837          return 8;
   172838       }
   172839    case 6: return 8;
   172840    case 5: return 8;
   172841    case 4:
   172842       if (devinfo->is_g4x) {
   172843          return 8;
   172844       } else {
   172845          return 8;
   172846       }
   172847    default:
   172848       unreachable("Invalid hardware generation");
   172849    }
   172850 }
   172851 
   172852 
   172853 
   172854 #define GEN10_PIPELINE_SELECT_3DCommandSubOpcode_start  16
   172855 #define GEN9_PIPELINE_SELECT_3DCommandSubOpcode_start  16
   172856 #define GEN8_PIPELINE_SELECT_3DCommandSubOpcode_start  16
   172857 #define GEN75_PIPELINE_SELECT_3DCommandSubOpcode_start  16
   172858 #define GEN7_PIPELINE_SELECT_3DCommandSubOpcode_start  16
   172859 #define GEN6_PIPELINE_SELECT_3DCommandSubOpcode_start  16
   172860 #define GEN5_PIPELINE_SELECT_3DCommandSubOpcode_start  16
   172861 #define GEN45_PIPELINE_SELECT_3DCommandSubOpcode_start  16
   172862 #define GEN4_PIPELINE_SELECT_3DCommandSubOpcode_start  16
   172863 
   172864 static inline uint32_t ATTRIBUTE_PURE
   172865 PIPELINE_SELECT_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   172866 {
   172867    switch (devinfo->gen) {
   172868    case 10: return 16;
   172869    case 9: return 16;
   172870    case 8: return 16;
   172871    case 7:
   172872       if (devinfo->is_haswell) {
   172873          return 16;
   172874       } else {
   172875          return 16;
   172876       }
   172877    case 6: return 16;
   172878    case 5: return 16;
   172879    case 4:
   172880       if (devinfo->is_g4x) {
   172881          return 16;
   172882       } else {
   172883          return 16;
   172884       }
   172885    default:
   172886       unreachable("Invalid hardware generation");
   172887    }
   172888 }
   172889 
   172890 
   172891 
   172892 /* PIPELINE_SELECT::Command SubType */
   172893 
   172894 
   172895 #define GEN10_PIPELINE_SELECT_CommandSubType_bits  2
   172896 #define GEN9_PIPELINE_SELECT_CommandSubType_bits  2
   172897 #define GEN8_PIPELINE_SELECT_CommandSubType_bits  2
   172898 #define GEN75_PIPELINE_SELECT_CommandSubType_bits  2
   172899 #define GEN7_PIPELINE_SELECT_CommandSubType_bits  2
   172900 #define GEN6_PIPELINE_SELECT_CommandSubType_bits  2
   172901 #define GEN5_PIPELINE_SELECT_CommandSubType_bits  2
   172902 #define GEN45_PIPELINE_SELECT_CommandSubType_bits  2
   172903 #define GEN4_PIPELINE_SELECT_CommandSubType_bits  2
   172904 
   172905 static inline uint32_t ATTRIBUTE_PURE
   172906 PIPELINE_SELECT_CommandSubType_bits(const struct gen_device_info *devinfo)
   172907 {
   172908    switch (devinfo->gen) {
   172909    case 10: return 2;
   172910    case 9: return 2;
   172911    case 8: return 2;
   172912    case 7:
   172913       if (devinfo->is_haswell) {
   172914          return 2;
   172915       } else {
   172916          return 2;
   172917       }
   172918    case 6: return 2;
   172919    case 5: return 2;
   172920    case 4:
   172921       if (devinfo->is_g4x) {
   172922          return 2;
   172923       } else {
   172924          return 2;
   172925       }
   172926    default:
   172927       unreachable("Invalid hardware generation");
   172928    }
   172929 }
   172930 
   172931 
   172932 
   172933 #define GEN10_PIPELINE_SELECT_CommandSubType_start  27
   172934 #define GEN9_PIPELINE_SELECT_CommandSubType_start  27
   172935 #define GEN8_PIPELINE_SELECT_CommandSubType_start  27
   172936 #define GEN75_PIPELINE_SELECT_CommandSubType_start  27
   172937 #define GEN7_PIPELINE_SELECT_CommandSubType_start  27
   172938 #define GEN6_PIPELINE_SELECT_CommandSubType_start  27
   172939 #define GEN5_PIPELINE_SELECT_CommandSubType_start  27
   172940 #define GEN45_PIPELINE_SELECT_CommandSubType_start  27
   172941 #define GEN4_PIPELINE_SELECT_CommandSubType_start  27
   172942 
   172943 static inline uint32_t ATTRIBUTE_PURE
   172944 PIPELINE_SELECT_CommandSubType_start(const struct gen_device_info *devinfo)
   172945 {
   172946    switch (devinfo->gen) {
   172947    case 10: return 27;
   172948    case 9: return 27;
   172949    case 8: return 27;
   172950    case 7:
   172951       if (devinfo->is_haswell) {
   172952          return 27;
   172953       } else {
   172954          return 27;
   172955       }
   172956    case 6: return 27;
   172957    case 5: return 27;
   172958    case 4:
   172959       if (devinfo->is_g4x) {
   172960          return 27;
   172961       } else {
   172962          return 27;
   172963       }
   172964    default:
   172965       unreachable("Invalid hardware generation");
   172966    }
   172967 }
   172968 
   172969 
   172970 
   172971 /* PIPELINE_SELECT::Command Type */
   172972 
   172973 
   172974 #define GEN10_PIPELINE_SELECT_CommandType_bits  3
   172975 #define GEN9_PIPELINE_SELECT_CommandType_bits  3
   172976 #define GEN8_PIPELINE_SELECT_CommandType_bits  3
   172977 #define GEN75_PIPELINE_SELECT_CommandType_bits  3
   172978 #define GEN7_PIPELINE_SELECT_CommandType_bits  3
   172979 #define GEN6_PIPELINE_SELECT_CommandType_bits  3
   172980 #define GEN5_PIPELINE_SELECT_CommandType_bits  3
   172981 #define GEN45_PIPELINE_SELECT_CommandType_bits  3
   172982 #define GEN4_PIPELINE_SELECT_CommandType_bits  3
   172983 
   172984 static inline uint32_t ATTRIBUTE_PURE
   172985 PIPELINE_SELECT_CommandType_bits(const struct gen_device_info *devinfo)
   172986 {
   172987    switch (devinfo->gen) {
   172988    case 10: return 3;
   172989    case 9: return 3;
   172990    case 8: return 3;
   172991    case 7:
   172992       if (devinfo->is_haswell) {
   172993          return 3;
   172994       } else {
   172995          return 3;
   172996       }
   172997    case 6: return 3;
   172998    case 5: return 3;
   172999    case 4:
   173000       if (devinfo->is_g4x) {
   173001          return 3;
   173002       } else {
   173003          return 3;
   173004       }
   173005    default:
   173006       unreachable("Invalid hardware generation");
   173007    }
   173008 }
   173009 
   173010 
   173011 
   173012 #define GEN10_PIPELINE_SELECT_CommandType_start  29
   173013 #define GEN9_PIPELINE_SELECT_CommandType_start  29
   173014 #define GEN8_PIPELINE_SELECT_CommandType_start  29
   173015 #define GEN75_PIPELINE_SELECT_CommandType_start  29
   173016 #define GEN7_PIPELINE_SELECT_CommandType_start  29
   173017 #define GEN6_PIPELINE_SELECT_CommandType_start  29
   173018 #define GEN5_PIPELINE_SELECT_CommandType_start  29
   173019 #define GEN45_PIPELINE_SELECT_CommandType_start  29
   173020 #define GEN4_PIPELINE_SELECT_CommandType_start  29
   173021 
   173022 static inline uint32_t ATTRIBUTE_PURE
   173023 PIPELINE_SELECT_CommandType_start(const struct gen_device_info *devinfo)
   173024 {
   173025    switch (devinfo->gen) {
   173026    case 10: return 29;
   173027    case 9: return 29;
   173028    case 8: return 29;
   173029    case 7:
   173030       if (devinfo->is_haswell) {
   173031          return 29;
   173032       } else {
   173033          return 29;
   173034       }
   173035    case 6: return 29;
   173036    case 5: return 29;
   173037    case 4:
   173038       if (devinfo->is_g4x) {
   173039          return 29;
   173040       } else {
   173041          return 29;
   173042       }
   173043    default:
   173044       unreachable("Invalid hardware generation");
   173045    }
   173046 }
   173047 
   173048 
   173049 
   173050 /* PIPELINE_SELECT::Force Media Awake */
   173051 
   173052 
   173053 #define GEN10_PIPELINE_SELECT_ForceMediaAwake_bits  1
   173054 #define GEN9_PIPELINE_SELECT_ForceMediaAwake_bits  1
   173055 
   173056 static inline uint32_t ATTRIBUTE_PURE
   173057 PIPELINE_SELECT_ForceMediaAwake_bits(const struct gen_device_info *devinfo)
   173058 {
   173059    switch (devinfo->gen) {
   173060    case 10: return 1;
   173061    case 9: return 1;
   173062    case 8: return 0;
   173063    case 7:
   173064       if (devinfo->is_haswell) {
   173065          return 0;
   173066       } else {
   173067          return 0;
   173068       }
   173069    case 6: return 0;
   173070    case 5: return 0;
   173071    case 4:
   173072       if (devinfo->is_g4x) {
   173073          return 0;
   173074       } else {
   173075          return 0;
   173076       }
   173077    default:
   173078       unreachable("Invalid hardware generation");
   173079    }
   173080 }
   173081 
   173082 
   173083 
   173084 #define GEN10_PIPELINE_SELECT_ForceMediaAwake_start  5
   173085 #define GEN9_PIPELINE_SELECT_ForceMediaAwake_start  5
   173086 
   173087 static inline uint32_t ATTRIBUTE_PURE
   173088 PIPELINE_SELECT_ForceMediaAwake_start(const struct gen_device_info *devinfo)
   173089 {
   173090    switch (devinfo->gen) {
   173091    case 10: return 5;
   173092    case 9: return 5;
   173093    case 8: return 0;
   173094    case 7:
   173095       if (devinfo->is_haswell) {
   173096          return 0;
   173097       } else {
   173098          return 0;
   173099       }
   173100    case 6: return 0;
   173101    case 5: return 0;
   173102    case 4:
   173103       if (devinfo->is_g4x) {
   173104          return 0;
   173105       } else {
   173106          return 0;
   173107       }
   173108    default:
   173109       unreachable("Invalid hardware generation");
   173110    }
   173111 }
   173112 
   173113 
   173114 
   173115 /* PIPELINE_SELECT::Mask Bits */
   173116 
   173117 
   173118 #define GEN10_PIPELINE_SELECT_MaskBits_bits  8
   173119 #define GEN9_PIPELINE_SELECT_MaskBits_bits  8
   173120 
   173121 static inline uint32_t ATTRIBUTE_PURE
   173122 PIPELINE_SELECT_MaskBits_bits(const struct gen_device_info *devinfo)
   173123 {
   173124    switch (devinfo->gen) {
   173125    case 10: return 8;
   173126    case 9: return 8;
   173127    case 8: return 0;
   173128    case 7:
   173129       if (devinfo->is_haswell) {
   173130          return 0;
   173131       } else {
   173132          return 0;
   173133       }
   173134    case 6: return 0;
   173135    case 5: return 0;
   173136    case 4:
   173137       if (devinfo->is_g4x) {
   173138          return 0;
   173139       } else {
   173140          return 0;
   173141       }
   173142    default:
   173143       unreachable("Invalid hardware generation");
   173144    }
   173145 }
   173146 
   173147 
   173148 
   173149 #define GEN10_PIPELINE_SELECT_MaskBits_start  8
   173150 #define GEN9_PIPELINE_SELECT_MaskBits_start  8
   173151 
   173152 static inline uint32_t ATTRIBUTE_PURE
   173153 PIPELINE_SELECT_MaskBits_start(const struct gen_device_info *devinfo)
   173154 {
   173155    switch (devinfo->gen) {
   173156    case 10: return 8;
   173157    case 9: return 8;
   173158    case 8: return 0;
   173159    case 7:
   173160       if (devinfo->is_haswell) {
   173161          return 0;
   173162       } else {
   173163          return 0;
   173164       }
   173165    case 6: return 0;
   173166    case 5: return 0;
   173167    case 4:
   173168       if (devinfo->is_g4x) {
   173169          return 0;
   173170       } else {
   173171          return 0;
   173172       }
   173173    default:
   173174       unreachable("Invalid hardware generation");
   173175    }
   173176 }
   173177 
   173178 
   173179 
   173180 /* PIPELINE_SELECT::Media Sampler DOP Clock Gate Enable */
   173181 
   173182 
   173183 #define GEN10_PIPELINE_SELECT_MediaSamplerDOPClockGateEnable_bits  1
   173184 #define GEN9_PIPELINE_SELECT_MediaSamplerDOPClockGateEnable_bits  1
   173185 
   173186 static inline uint32_t ATTRIBUTE_PURE
   173187 PIPELINE_SELECT_MediaSamplerDOPClockGateEnable_bits(const struct gen_device_info *devinfo)
   173188 {
   173189    switch (devinfo->gen) {
   173190    case 10: return 1;
   173191    case 9: return 1;
   173192    case 8: return 0;
   173193    case 7:
   173194       if (devinfo->is_haswell) {
   173195          return 0;
   173196       } else {
   173197          return 0;
   173198       }
   173199    case 6: return 0;
   173200    case 5: return 0;
   173201    case 4:
   173202       if (devinfo->is_g4x) {
   173203          return 0;
   173204       } else {
   173205          return 0;
   173206       }
   173207    default:
   173208       unreachable("Invalid hardware generation");
   173209    }
   173210 }
   173211 
   173212 
   173213 
   173214 #define GEN10_PIPELINE_SELECT_MediaSamplerDOPClockGateEnable_start  4
   173215 #define GEN9_PIPELINE_SELECT_MediaSamplerDOPClockGateEnable_start  4
   173216 
   173217 static inline uint32_t ATTRIBUTE_PURE
   173218 PIPELINE_SELECT_MediaSamplerDOPClockGateEnable_start(const struct gen_device_info *devinfo)
   173219 {
   173220    switch (devinfo->gen) {
   173221    case 10: return 4;
   173222    case 9: return 4;
   173223    case 8: return 0;
   173224    case 7:
   173225       if (devinfo->is_haswell) {
   173226          return 0;
   173227       } else {
   173228          return 0;
   173229       }
   173230    case 6: return 0;
   173231    case 5: return 0;
   173232    case 4:
   173233       if (devinfo->is_g4x) {
   173234          return 0;
   173235       } else {
   173236          return 0;
   173237       }
   173238    default:
   173239       unreachable("Invalid hardware generation");
   173240    }
   173241 }
   173242 
   173243 
   173244 
   173245 /* PIPELINE_SELECT::Pipeline Selection */
   173246 
   173247 
   173248 #define GEN10_PIPELINE_SELECT_PipelineSelection_bits  2
   173249 #define GEN9_PIPELINE_SELECT_PipelineSelection_bits  2
   173250 #define GEN8_PIPELINE_SELECT_PipelineSelection_bits  2
   173251 #define GEN75_PIPELINE_SELECT_PipelineSelection_bits  2
   173252 #define GEN7_PIPELINE_SELECT_PipelineSelection_bits  2
   173253 #define GEN6_PIPELINE_SELECT_PipelineSelection_bits  2
   173254 #define GEN5_PIPELINE_SELECT_PipelineSelection_bits  2
   173255 #define GEN45_PIPELINE_SELECT_PipelineSelection_bits  2
   173256 #define GEN4_PIPELINE_SELECT_PipelineSelection_bits  1
   173257 
   173258 static inline uint32_t ATTRIBUTE_PURE
   173259 PIPELINE_SELECT_PipelineSelection_bits(const struct gen_device_info *devinfo)
   173260 {
   173261    switch (devinfo->gen) {
   173262    case 10: return 2;
   173263    case 9: return 2;
   173264    case 8: return 2;
   173265    case 7:
   173266       if (devinfo->is_haswell) {
   173267          return 2;
   173268       } else {
   173269          return 2;
   173270       }
   173271    case 6: return 2;
   173272    case 5: return 2;
   173273    case 4:
   173274       if (devinfo->is_g4x) {
   173275          return 2;
   173276       } else {
   173277          return 1;
   173278       }
   173279    default:
   173280       unreachable("Invalid hardware generation");
   173281    }
   173282 }
   173283 
   173284 
   173285 
   173286 #define GEN10_PIPELINE_SELECT_PipelineSelection_start  0
   173287 #define GEN9_PIPELINE_SELECT_PipelineSelection_start  0
   173288 #define GEN8_PIPELINE_SELECT_PipelineSelection_start  0
   173289 #define GEN75_PIPELINE_SELECT_PipelineSelection_start  0
   173290 #define GEN7_PIPELINE_SELECT_PipelineSelection_start  0
   173291 #define GEN6_PIPELINE_SELECT_PipelineSelection_start  0
   173292 #define GEN5_PIPELINE_SELECT_PipelineSelection_start  0
   173293 #define GEN45_PIPELINE_SELECT_PipelineSelection_start  0
   173294 #define GEN4_PIPELINE_SELECT_PipelineSelection_start  0
   173295 
   173296 static inline uint32_t ATTRIBUTE_PURE
   173297 PIPELINE_SELECT_PipelineSelection_start(const struct gen_device_info *devinfo)
   173298 {
   173299    switch (devinfo->gen) {
   173300    case 10: return 0;
   173301    case 9: return 0;
   173302    case 8: return 0;
   173303    case 7:
   173304       if (devinfo->is_haswell) {
   173305          return 0;
   173306       } else {
   173307          return 0;
   173308       }
   173309    case 6: return 0;
   173310    case 5: return 0;
   173311    case 4:
   173312       if (devinfo->is_g4x) {
   173313          return 0;
   173314       } else {
   173315          return 0;
   173316       }
   173317    default:
   173318       unreachable("Invalid hardware generation");
   173319    }
   173320 }
   173321 
   173322 
   173323 
   173324 /* PIPE_CONTROL */
   173325 
   173326 
   173327 #define GEN10_PIPE_CONTROL_length  6
   173328 #define GEN9_PIPE_CONTROL_length  6
   173329 #define GEN8_PIPE_CONTROL_length  6
   173330 #define GEN75_PIPE_CONTROL_length  5
   173331 #define GEN7_PIPE_CONTROL_length  5
   173332 #define GEN6_PIPE_CONTROL_length  5
   173333 #define GEN5_PIPE_CONTROL_length  4
   173334 #define GEN45_PIPE_CONTROL_length  4
   173335 #define GEN4_PIPE_CONTROL_length  4
   173336 
   173337 static inline uint32_t ATTRIBUTE_PURE
   173338 PIPE_CONTROL_length(const struct gen_device_info *devinfo)
   173339 {
   173340    switch (devinfo->gen) {
   173341    case 10: return 6;
   173342    case 9: return 6;
   173343    case 8: return 6;
   173344    case 7:
   173345       if (devinfo->is_haswell) {
   173346          return 5;
   173347       } else {
   173348          return 5;
   173349       }
   173350    case 6: return 5;
   173351    case 5: return 4;
   173352    case 4:
   173353       if (devinfo->is_g4x) {
   173354          return 4;
   173355       } else {
   173356          return 4;
   173357       }
   173358    default:
   173359       unreachable("Invalid hardware generation");
   173360    }
   173361 }
   173362 
   173363 
   173364 
   173365 /* PIPE_CONTROL::3D Command Opcode */
   173366 
   173367 
   173368 #define GEN10_PIPE_CONTROL_3DCommandOpcode_bits  3
   173369 #define GEN9_PIPE_CONTROL_3DCommandOpcode_bits  3
   173370 #define GEN8_PIPE_CONTROL_3DCommandOpcode_bits  3
   173371 #define GEN75_PIPE_CONTROL_3DCommandOpcode_bits  3
   173372 #define GEN7_PIPE_CONTROL_3DCommandOpcode_bits  3
   173373 #define GEN6_PIPE_CONTROL_3DCommandOpcode_bits  3
   173374 #define GEN5_PIPE_CONTROL_3DCommandOpcode_bits  3
   173375 #define GEN45_PIPE_CONTROL_3DCommandOpcode_bits  3
   173376 #define GEN4_PIPE_CONTROL_3DCommandOpcode_bits  3
   173377 
   173378 static inline uint32_t ATTRIBUTE_PURE
   173379 PIPE_CONTROL_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   173380 {
   173381    switch (devinfo->gen) {
   173382    case 10: return 3;
   173383    case 9: return 3;
   173384    case 8: return 3;
   173385    case 7:
   173386       if (devinfo->is_haswell) {
   173387          return 3;
   173388       } else {
   173389          return 3;
   173390       }
   173391    case 6: return 3;
   173392    case 5: return 3;
   173393    case 4:
   173394       if (devinfo->is_g4x) {
   173395          return 3;
   173396       } else {
   173397          return 3;
   173398       }
   173399    default:
   173400       unreachable("Invalid hardware generation");
   173401    }
   173402 }
   173403 
   173404 
   173405 
   173406 #define GEN10_PIPE_CONTROL_3DCommandOpcode_start  24
   173407 #define GEN9_PIPE_CONTROL_3DCommandOpcode_start  24
   173408 #define GEN8_PIPE_CONTROL_3DCommandOpcode_start  24
   173409 #define GEN75_PIPE_CONTROL_3DCommandOpcode_start  24
   173410 #define GEN7_PIPE_CONTROL_3DCommandOpcode_start  24
   173411 #define GEN6_PIPE_CONTROL_3DCommandOpcode_start  24
   173412 #define GEN5_PIPE_CONTROL_3DCommandOpcode_start  24
   173413 #define GEN45_PIPE_CONTROL_3DCommandOpcode_start  24
   173414 #define GEN4_PIPE_CONTROL_3DCommandOpcode_start  24
   173415 
   173416 static inline uint32_t ATTRIBUTE_PURE
   173417 PIPE_CONTROL_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   173418 {
   173419    switch (devinfo->gen) {
   173420    case 10: return 24;
   173421    case 9: return 24;
   173422    case 8: return 24;
   173423    case 7:
   173424       if (devinfo->is_haswell) {
   173425          return 24;
   173426       } else {
   173427          return 24;
   173428       }
   173429    case 6: return 24;
   173430    case 5: return 24;
   173431    case 4:
   173432       if (devinfo->is_g4x) {
   173433          return 24;
   173434       } else {
   173435          return 24;
   173436       }
   173437    default:
   173438       unreachable("Invalid hardware generation");
   173439    }
   173440 }
   173441 
   173442 
   173443 
   173444 /* PIPE_CONTROL::3D Command Sub Opcode */
   173445 
   173446 
   173447 #define GEN10_PIPE_CONTROL_3DCommandSubOpcode_bits  8
   173448 #define GEN9_PIPE_CONTROL_3DCommandSubOpcode_bits  8
   173449 #define GEN8_PIPE_CONTROL_3DCommandSubOpcode_bits  8
   173450 #define GEN75_PIPE_CONTROL_3DCommandSubOpcode_bits  8
   173451 #define GEN7_PIPE_CONTROL_3DCommandSubOpcode_bits  8
   173452 #define GEN6_PIPE_CONTROL_3DCommandSubOpcode_bits  8
   173453 #define GEN5_PIPE_CONTROL_3DCommandSubOpcode_bits  8
   173454 #define GEN45_PIPE_CONTROL_3DCommandSubOpcode_bits  8
   173455 #define GEN4_PIPE_CONTROL_3DCommandSubOpcode_bits  8
   173456 
   173457 static inline uint32_t ATTRIBUTE_PURE
   173458 PIPE_CONTROL_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   173459 {
   173460    switch (devinfo->gen) {
   173461    case 10: return 8;
   173462    case 9: return 8;
   173463    case 8: return 8;
   173464    case 7:
   173465       if (devinfo->is_haswell) {
   173466          return 8;
   173467       } else {
   173468          return 8;
   173469       }
   173470    case 6: return 8;
   173471    case 5: return 8;
   173472    case 4:
   173473       if (devinfo->is_g4x) {
   173474          return 8;
   173475       } else {
   173476          return 8;
   173477       }
   173478    default:
   173479       unreachable("Invalid hardware generation");
   173480    }
   173481 }
   173482 
   173483 
   173484 
   173485 #define GEN10_PIPE_CONTROL_3DCommandSubOpcode_start  16
   173486 #define GEN9_PIPE_CONTROL_3DCommandSubOpcode_start  16
   173487 #define GEN8_PIPE_CONTROL_3DCommandSubOpcode_start  16
   173488 #define GEN75_PIPE_CONTROL_3DCommandSubOpcode_start  16
   173489 #define GEN7_PIPE_CONTROL_3DCommandSubOpcode_start  16
   173490 #define GEN6_PIPE_CONTROL_3DCommandSubOpcode_start  16
   173491 #define GEN5_PIPE_CONTROL_3DCommandSubOpcode_start  16
   173492 #define GEN45_PIPE_CONTROL_3DCommandSubOpcode_start  16
   173493 #define GEN4_PIPE_CONTROL_3DCommandSubOpcode_start  16
   173494 
   173495 static inline uint32_t ATTRIBUTE_PURE
   173496 PIPE_CONTROL_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   173497 {
   173498    switch (devinfo->gen) {
   173499    case 10: return 16;
   173500    case 9: return 16;
   173501    case 8: return 16;
   173502    case 7:
   173503       if (devinfo->is_haswell) {
   173504          return 16;
   173505       } else {
   173506          return 16;
   173507       }
   173508    case 6: return 16;
   173509    case 5: return 16;
   173510    case 4:
   173511       if (devinfo->is_g4x) {
   173512          return 16;
   173513       } else {
   173514          return 16;
   173515       }
   173516    default:
   173517       unreachable("Invalid hardware generation");
   173518    }
   173519 }
   173520 
   173521 
   173522 
   173523 /* PIPE_CONTROL::Address */
   173524 
   173525 
   173526 #define GEN10_PIPE_CONTROL_Address_bits  46
   173527 #define GEN9_PIPE_CONTROL_Address_bits  46
   173528 #define GEN8_PIPE_CONTROL_Address_bits  46
   173529 #define GEN75_PIPE_CONTROL_Address_bits  30
   173530 #define GEN7_PIPE_CONTROL_Address_bits  30
   173531 #define GEN6_PIPE_CONTROL_Address_bits  29
   173532 #define GEN5_PIPE_CONTROL_Address_bits  29
   173533 #define GEN45_PIPE_CONTROL_Address_bits  29
   173534 #define GEN4_PIPE_CONTROL_Address_bits  29
   173535 
   173536 static inline uint32_t ATTRIBUTE_PURE
   173537 PIPE_CONTROL_Address_bits(const struct gen_device_info *devinfo)
   173538 {
   173539    switch (devinfo->gen) {
   173540    case 10: return 46;
   173541    case 9: return 46;
   173542    case 8: return 46;
   173543    case 7:
   173544       if (devinfo->is_haswell) {
   173545          return 30;
   173546       } else {
   173547          return 30;
   173548       }
   173549    case 6: return 29;
   173550    case 5: return 29;
   173551    case 4:
   173552       if (devinfo->is_g4x) {
   173553          return 29;
   173554       } else {
   173555          return 29;
   173556       }
   173557    default:
   173558       unreachable("Invalid hardware generation");
   173559    }
   173560 }
   173561 
   173562 
   173563 
   173564 #define GEN10_PIPE_CONTROL_Address_start  66
   173565 #define GEN9_PIPE_CONTROL_Address_start  66
   173566 #define GEN8_PIPE_CONTROL_Address_start  66
   173567 #define GEN75_PIPE_CONTROL_Address_start  66
   173568 #define GEN7_PIPE_CONTROL_Address_start  66
   173569 #define GEN6_PIPE_CONTROL_Address_start  67
   173570 #define GEN5_PIPE_CONTROL_Address_start  35
   173571 #define GEN45_PIPE_CONTROL_Address_start  35
   173572 #define GEN4_PIPE_CONTROL_Address_start  35
   173573 
   173574 static inline uint32_t ATTRIBUTE_PURE
   173575 PIPE_CONTROL_Address_start(const struct gen_device_info *devinfo)
   173576 {
   173577    switch (devinfo->gen) {
   173578    case 10: return 66;
   173579    case 9: return 66;
   173580    case 8: return 66;
   173581    case 7:
   173582       if (devinfo->is_haswell) {
   173583          return 66;
   173584       } else {
   173585          return 66;
   173586       }
   173587    case 6: return 67;
   173588    case 5: return 35;
   173589    case 4:
   173590       if (devinfo->is_g4x) {
   173591          return 35;
   173592       } else {
   173593          return 35;
   173594       }
   173595    default:
   173596       unreachable("Invalid hardware generation");
   173597    }
   173598 }
   173599 
   173600 
   173601 
   173602 /* PIPE_CONTROL::Command Streamer Stall Enable */
   173603 
   173604 
   173605 #define GEN10_PIPE_CONTROL_CommandStreamerStallEnable_bits  1
   173606 #define GEN9_PIPE_CONTROL_CommandStreamerStallEnable_bits  1
   173607 #define GEN8_PIPE_CONTROL_CommandStreamerStallEnable_bits  1
   173608 #define GEN75_PIPE_CONTROL_CommandStreamerStallEnable_bits  1
   173609 #define GEN7_PIPE_CONTROL_CommandStreamerStallEnable_bits  1
   173610 #define GEN6_PIPE_CONTROL_CommandStreamerStallEnable_bits  1
   173611 
   173612 static inline uint32_t ATTRIBUTE_PURE
   173613 PIPE_CONTROL_CommandStreamerStallEnable_bits(const struct gen_device_info *devinfo)
   173614 {
   173615    switch (devinfo->gen) {
   173616    case 10: return 1;
   173617    case 9: return 1;
   173618    case 8: return 1;
   173619    case 7:
   173620       if (devinfo->is_haswell) {
   173621          return 1;
   173622       } else {
   173623          return 1;
   173624       }
   173625    case 6: return 1;
   173626    case 5: return 0;
   173627    case 4:
   173628       if (devinfo->is_g4x) {
   173629          return 0;
   173630       } else {
   173631          return 0;
   173632       }
   173633    default:
   173634       unreachable("Invalid hardware generation");
   173635    }
   173636 }
   173637 
   173638 
   173639 
   173640 #define GEN10_PIPE_CONTROL_CommandStreamerStallEnable_start  52
   173641 #define GEN9_PIPE_CONTROL_CommandStreamerStallEnable_start  52
   173642 #define GEN8_PIPE_CONTROL_CommandStreamerStallEnable_start  52
   173643 #define GEN75_PIPE_CONTROL_CommandStreamerStallEnable_start  52
   173644 #define GEN7_PIPE_CONTROL_CommandStreamerStallEnable_start  52
   173645 #define GEN6_PIPE_CONTROL_CommandStreamerStallEnable_start  52
   173646 
   173647 static inline uint32_t ATTRIBUTE_PURE
   173648 PIPE_CONTROL_CommandStreamerStallEnable_start(const struct gen_device_info *devinfo)
   173649 {
   173650    switch (devinfo->gen) {
   173651    case 10: return 52;
   173652    case 9: return 52;
   173653    case 8: return 52;
   173654    case 7:
   173655       if (devinfo->is_haswell) {
   173656          return 52;
   173657       } else {
   173658          return 52;
   173659       }
   173660    case 6: return 52;
   173661    case 5: return 0;
   173662    case 4:
   173663       if (devinfo->is_g4x) {
   173664          return 0;
   173665       } else {
   173666          return 0;
   173667       }
   173668    default:
   173669       unreachable("Invalid hardware generation");
   173670    }
   173671 }
   173672 
   173673 
   173674 
   173675 /* PIPE_CONTROL::Command SubType */
   173676 
   173677 
   173678 #define GEN10_PIPE_CONTROL_CommandSubType_bits  2
   173679 #define GEN9_PIPE_CONTROL_CommandSubType_bits  2
   173680 #define GEN8_PIPE_CONTROL_CommandSubType_bits  2
   173681 #define GEN75_PIPE_CONTROL_CommandSubType_bits  2
   173682 #define GEN7_PIPE_CONTROL_CommandSubType_bits  2
   173683 #define GEN6_PIPE_CONTROL_CommandSubType_bits  2
   173684 #define GEN5_PIPE_CONTROL_CommandSubType_bits  2
   173685 #define GEN45_PIPE_CONTROL_CommandSubType_bits  2
   173686 #define GEN4_PIPE_CONTROL_CommandSubType_bits  2
   173687 
   173688 static inline uint32_t ATTRIBUTE_PURE
   173689 PIPE_CONTROL_CommandSubType_bits(const struct gen_device_info *devinfo)
   173690 {
   173691    switch (devinfo->gen) {
   173692    case 10: return 2;
   173693    case 9: return 2;
   173694    case 8: return 2;
   173695    case 7:
   173696       if (devinfo->is_haswell) {
   173697          return 2;
   173698       } else {
   173699          return 2;
   173700       }
   173701    case 6: return 2;
   173702    case 5: return 2;
   173703    case 4:
   173704       if (devinfo->is_g4x) {
   173705          return 2;
   173706       } else {
   173707          return 2;
   173708       }
   173709    default:
   173710       unreachable("Invalid hardware generation");
   173711    }
   173712 }
   173713 
   173714 
   173715 
   173716 #define GEN10_PIPE_CONTROL_CommandSubType_start  27
   173717 #define GEN9_PIPE_CONTROL_CommandSubType_start  27
   173718 #define GEN8_PIPE_CONTROL_CommandSubType_start  27
   173719 #define GEN75_PIPE_CONTROL_CommandSubType_start  27
   173720 #define GEN7_PIPE_CONTROL_CommandSubType_start  27
   173721 #define GEN6_PIPE_CONTROL_CommandSubType_start  27
   173722 #define GEN5_PIPE_CONTROL_CommandSubType_start  27
   173723 #define GEN45_PIPE_CONTROL_CommandSubType_start  27
   173724 #define GEN4_PIPE_CONTROL_CommandSubType_start  27
   173725 
   173726 static inline uint32_t ATTRIBUTE_PURE
   173727 PIPE_CONTROL_CommandSubType_start(const struct gen_device_info *devinfo)
   173728 {
   173729    switch (devinfo->gen) {
   173730    case 10: return 27;
   173731    case 9: return 27;
   173732    case 8: return 27;
   173733    case 7:
   173734       if (devinfo->is_haswell) {
   173735          return 27;
   173736       } else {
   173737          return 27;
   173738       }
   173739    case 6: return 27;
   173740    case 5: return 27;
   173741    case 4:
   173742       if (devinfo->is_g4x) {
   173743          return 27;
   173744       } else {
   173745          return 27;
   173746       }
   173747    default:
   173748       unreachable("Invalid hardware generation");
   173749    }
   173750 }
   173751 
   173752 
   173753 
   173754 /* PIPE_CONTROL::Command Type */
   173755 
   173756 
   173757 #define GEN10_PIPE_CONTROL_CommandType_bits  3
   173758 #define GEN9_PIPE_CONTROL_CommandType_bits  3
   173759 #define GEN8_PIPE_CONTROL_CommandType_bits  3
   173760 #define GEN75_PIPE_CONTROL_CommandType_bits  3
   173761 #define GEN7_PIPE_CONTROL_CommandType_bits  3
   173762 #define GEN6_PIPE_CONTROL_CommandType_bits  3
   173763 #define GEN5_PIPE_CONTROL_CommandType_bits  3
   173764 #define GEN45_PIPE_CONTROL_CommandType_bits  3
   173765 #define GEN4_PIPE_CONTROL_CommandType_bits  3
   173766 
   173767 static inline uint32_t ATTRIBUTE_PURE
   173768 PIPE_CONTROL_CommandType_bits(const struct gen_device_info *devinfo)
   173769 {
   173770    switch (devinfo->gen) {
   173771    case 10: return 3;
   173772    case 9: return 3;
   173773    case 8: return 3;
   173774    case 7:
   173775       if (devinfo->is_haswell) {
   173776          return 3;
   173777       } else {
   173778          return 3;
   173779       }
   173780    case 6: return 3;
   173781    case 5: return 3;
   173782    case 4:
   173783       if (devinfo->is_g4x) {
   173784          return 3;
   173785       } else {
   173786          return 3;
   173787       }
   173788    default:
   173789       unreachable("Invalid hardware generation");
   173790    }
   173791 }
   173792 
   173793 
   173794 
   173795 #define GEN10_PIPE_CONTROL_CommandType_start  29
   173796 #define GEN9_PIPE_CONTROL_CommandType_start  29
   173797 #define GEN8_PIPE_CONTROL_CommandType_start  29
   173798 #define GEN75_PIPE_CONTROL_CommandType_start  29
   173799 #define GEN7_PIPE_CONTROL_CommandType_start  29
   173800 #define GEN6_PIPE_CONTROL_CommandType_start  29
   173801 #define GEN5_PIPE_CONTROL_CommandType_start  29
   173802 #define GEN45_PIPE_CONTROL_CommandType_start  29
   173803 #define GEN4_PIPE_CONTROL_CommandType_start  29
   173804 
   173805 static inline uint32_t ATTRIBUTE_PURE
   173806 PIPE_CONTROL_CommandType_start(const struct gen_device_info *devinfo)
   173807 {
   173808    switch (devinfo->gen) {
   173809    case 10: return 29;
   173810    case 9: return 29;
   173811    case 8: return 29;
   173812    case 7:
   173813       if (devinfo->is_haswell) {
   173814          return 29;
   173815       } else {
   173816          return 29;
   173817       }
   173818    case 6: return 29;
   173819    case 5: return 29;
   173820    case 4:
   173821       if (devinfo->is_g4x) {
   173822          return 29;
   173823       } else {
   173824          return 29;
   173825       }
   173826    default:
   173827       unreachable("Invalid hardware generation");
   173828    }
   173829 }
   173830 
   173831 
   173832 
   173833 /* PIPE_CONTROL::Constant Cache Invalidation Enable */
   173834 
   173835 
   173836 #define GEN10_PIPE_CONTROL_ConstantCacheInvalidationEnable_bits  1
   173837 #define GEN9_PIPE_CONTROL_ConstantCacheInvalidationEnable_bits  1
   173838 #define GEN8_PIPE_CONTROL_ConstantCacheInvalidationEnable_bits  1
   173839 #define GEN75_PIPE_CONTROL_ConstantCacheInvalidationEnable_bits  1
   173840 #define GEN7_PIPE_CONTROL_ConstantCacheInvalidationEnable_bits  1
   173841 #define GEN6_PIPE_CONTROL_ConstantCacheInvalidationEnable_bits  1
   173842 
   173843 static inline uint32_t ATTRIBUTE_PURE
   173844 PIPE_CONTROL_ConstantCacheInvalidationEnable_bits(const struct gen_device_info *devinfo)
   173845 {
   173846    switch (devinfo->gen) {
   173847    case 10: return 1;
   173848    case 9: return 1;
   173849    case 8: return 1;
   173850    case 7:
   173851       if (devinfo->is_haswell) {
   173852          return 1;
   173853       } else {
   173854          return 1;
   173855       }
   173856    case 6: return 1;
   173857    case 5: return 0;
   173858    case 4:
   173859       if (devinfo->is_g4x) {
   173860          return 0;
   173861       } else {
   173862          return 0;
   173863       }
   173864    default:
   173865       unreachable("Invalid hardware generation");
   173866    }
   173867 }
   173868 
   173869 
   173870 
   173871 #define GEN10_PIPE_CONTROL_ConstantCacheInvalidationEnable_start  35
   173872 #define GEN9_PIPE_CONTROL_ConstantCacheInvalidationEnable_start  35
   173873 #define GEN8_PIPE_CONTROL_ConstantCacheInvalidationEnable_start  35
   173874 #define GEN75_PIPE_CONTROL_ConstantCacheInvalidationEnable_start  35
   173875 #define GEN7_PIPE_CONTROL_ConstantCacheInvalidationEnable_start  35
   173876 #define GEN6_PIPE_CONTROL_ConstantCacheInvalidationEnable_start  35
   173877 
   173878 static inline uint32_t ATTRIBUTE_PURE
   173879 PIPE_CONTROL_ConstantCacheInvalidationEnable_start(const struct gen_device_info *devinfo)
   173880 {
   173881    switch (devinfo->gen) {
   173882    case 10: return 35;
   173883    case 9: return 35;
   173884    case 8: return 35;
   173885    case 7:
   173886       if (devinfo->is_haswell) {
   173887          return 35;
   173888       } else {
   173889          return 35;
   173890       }
   173891    case 6: return 35;
   173892    case 5: return 0;
   173893    case 4:
   173894       if (devinfo->is_g4x) {
   173895          return 0;
   173896       } else {
   173897          return 0;
   173898       }
   173899    default:
   173900       unreachable("Invalid hardware generation");
   173901    }
   173902 }
   173903 
   173904 
   173905 
   173906 /* PIPE_CONTROL::DC Flush Enable */
   173907 
   173908 
   173909 #define GEN10_PIPE_CONTROL_DCFlushEnable_bits  1
   173910 #define GEN9_PIPE_CONTROL_DCFlushEnable_bits  1
   173911 #define GEN8_PIPE_CONTROL_DCFlushEnable_bits  1
   173912 #define GEN75_PIPE_CONTROL_DCFlushEnable_bits  1
   173913 #define GEN7_PIPE_CONTROL_DCFlushEnable_bits  1
   173914 
   173915 static inline uint32_t ATTRIBUTE_PURE
   173916 PIPE_CONTROL_DCFlushEnable_bits(const struct gen_device_info *devinfo)
   173917 {
   173918    switch (devinfo->gen) {
   173919    case 10: return 1;
   173920    case 9: return 1;
   173921    case 8: return 1;
   173922    case 7:
   173923       if (devinfo->is_haswell) {
   173924          return 1;
   173925       } else {
   173926          return 1;
   173927       }
   173928    case 6: return 0;
   173929    case 5: return 0;
   173930    case 4:
   173931       if (devinfo->is_g4x) {
   173932          return 0;
   173933       } else {
   173934          return 0;
   173935       }
   173936    default:
   173937       unreachable("Invalid hardware generation");
   173938    }
   173939 }
   173940 
   173941 
   173942 
   173943 #define GEN10_PIPE_CONTROL_DCFlushEnable_start  37
   173944 #define GEN9_PIPE_CONTROL_DCFlushEnable_start  37
   173945 #define GEN8_PIPE_CONTROL_DCFlushEnable_start  37
   173946 #define GEN75_PIPE_CONTROL_DCFlushEnable_start  37
   173947 #define GEN7_PIPE_CONTROL_DCFlushEnable_start  37
   173948 
   173949 static inline uint32_t ATTRIBUTE_PURE
   173950 PIPE_CONTROL_DCFlushEnable_start(const struct gen_device_info *devinfo)
   173951 {
   173952    switch (devinfo->gen) {
   173953    case 10: return 37;
   173954    case 9: return 37;
   173955    case 8: return 37;
   173956    case 7:
   173957       if (devinfo->is_haswell) {
   173958          return 37;
   173959       } else {
   173960          return 37;
   173961       }
   173962    case 6: return 0;
   173963    case 5: return 0;
   173964    case 4:
   173965       if (devinfo->is_g4x) {
   173966          return 0;
   173967       } else {
   173968          return 0;
   173969       }
   173970    default:
   173971       unreachable("Invalid hardware generation");
   173972    }
   173973 }
   173974 
   173975 
   173976 
   173977 /* PIPE_CONTROL::DWord Length */
   173978 
   173979 
   173980 #define GEN10_PIPE_CONTROL_DWordLength_bits  8
   173981 #define GEN9_PIPE_CONTROL_DWordLength_bits  8
   173982 #define GEN8_PIPE_CONTROL_DWordLength_bits  8
   173983 #define GEN75_PIPE_CONTROL_DWordLength_bits  8
   173984 #define GEN7_PIPE_CONTROL_DWordLength_bits  8
   173985 #define GEN6_PIPE_CONTROL_DWordLength_bits  8
   173986 #define GEN5_PIPE_CONTROL_DWordLength_bits  8
   173987 #define GEN45_PIPE_CONTROL_DWordLength_bits  8
   173988 #define GEN4_PIPE_CONTROL_DWordLength_bits  8
   173989 
   173990 static inline uint32_t ATTRIBUTE_PURE
   173991 PIPE_CONTROL_DWordLength_bits(const struct gen_device_info *devinfo)
   173992 {
   173993    switch (devinfo->gen) {
   173994    case 10: return 8;
   173995    case 9: return 8;
   173996    case 8: return 8;
   173997    case 7:
   173998       if (devinfo->is_haswell) {
   173999          return 8;
   174000       } else {
   174001          return 8;
   174002       }
   174003    case 6: return 8;
   174004    case 5: return 8;
   174005    case 4:
   174006       if (devinfo->is_g4x) {
   174007          return 8;
   174008       } else {
   174009          return 8;
   174010       }
   174011    default:
   174012       unreachable("Invalid hardware generation");
   174013    }
   174014 }
   174015 
   174016 
   174017 
   174018 #define GEN10_PIPE_CONTROL_DWordLength_start  0
   174019 #define GEN9_PIPE_CONTROL_DWordLength_start  0
   174020 #define GEN8_PIPE_CONTROL_DWordLength_start  0
   174021 #define GEN75_PIPE_CONTROL_DWordLength_start  0
   174022 #define GEN7_PIPE_CONTROL_DWordLength_start  0
   174023 #define GEN6_PIPE_CONTROL_DWordLength_start  0
   174024 #define GEN5_PIPE_CONTROL_DWordLength_start  0
   174025 #define GEN45_PIPE_CONTROL_DWordLength_start  0
   174026 #define GEN4_PIPE_CONTROL_DWordLength_start  0
   174027 
   174028 static inline uint32_t ATTRIBUTE_PURE
   174029 PIPE_CONTROL_DWordLength_start(const struct gen_device_info *devinfo)
   174030 {
   174031    switch (devinfo->gen) {
   174032    case 10: return 0;
   174033    case 9: return 0;
   174034    case 8: return 0;
   174035    case 7:
   174036       if (devinfo->is_haswell) {
   174037          return 0;
   174038       } else {
   174039          return 0;
   174040       }
   174041    case 6: return 0;
   174042    case 5: return 0;
   174043    case 4:
   174044       if (devinfo->is_g4x) {
   174045          return 0;
   174046       } else {
   174047          return 0;
   174048       }
   174049    default:
   174050       unreachable("Invalid hardware generation");
   174051    }
   174052 }
   174053 
   174054 
   174055 
   174056 /* PIPE_CONTROL::Depth Cache Flush Enable */
   174057 
   174058 
   174059 #define GEN10_PIPE_CONTROL_DepthCacheFlushEnable_bits  1
   174060 #define GEN9_PIPE_CONTROL_DepthCacheFlushEnable_bits  1
   174061 #define GEN8_PIPE_CONTROL_DepthCacheFlushEnable_bits  1
   174062 #define GEN75_PIPE_CONTROL_DepthCacheFlushEnable_bits  1
   174063 #define GEN7_PIPE_CONTROL_DepthCacheFlushEnable_bits  1
   174064 #define GEN6_PIPE_CONTROL_DepthCacheFlushEnable_bits  1
   174065 
   174066 static inline uint32_t ATTRIBUTE_PURE
   174067 PIPE_CONTROL_DepthCacheFlushEnable_bits(const struct gen_device_info *devinfo)
   174068 {
   174069    switch (devinfo->gen) {
   174070    case 10: return 1;
   174071    case 9: return 1;
   174072    case 8: return 1;
   174073    case 7:
   174074       if (devinfo->is_haswell) {
   174075          return 1;
   174076       } else {
   174077          return 1;
   174078       }
   174079    case 6: return 1;
   174080    case 5: return 0;
   174081    case 4:
   174082       if (devinfo->is_g4x) {
   174083          return 0;
   174084       } else {
   174085          return 0;
   174086       }
   174087    default:
   174088       unreachable("Invalid hardware generation");
   174089    }
   174090 }
   174091 
   174092 
   174093 
   174094 #define GEN10_PIPE_CONTROL_DepthCacheFlushEnable_start  32
   174095 #define GEN9_PIPE_CONTROL_DepthCacheFlushEnable_start  32
   174096 #define GEN8_PIPE_CONTROL_DepthCacheFlushEnable_start  32
   174097 #define GEN75_PIPE_CONTROL_DepthCacheFlushEnable_start  32
   174098 #define GEN7_PIPE_CONTROL_DepthCacheFlushEnable_start  32
   174099 #define GEN6_PIPE_CONTROL_DepthCacheFlushEnable_start  32
   174100 
   174101 static inline uint32_t ATTRIBUTE_PURE
   174102 PIPE_CONTROL_DepthCacheFlushEnable_start(const struct gen_device_info *devinfo)
   174103 {
   174104    switch (devinfo->gen) {
   174105    case 10: return 32;
   174106    case 9: return 32;
   174107    case 8: return 32;
   174108    case 7:
   174109       if (devinfo->is_haswell) {
   174110          return 32;
   174111       } else {
   174112          return 32;
   174113       }
   174114    case 6: return 32;
   174115    case 5: return 0;
   174116    case 4:
   174117       if (devinfo->is_g4x) {
   174118          return 0;
   174119       } else {
   174120          return 0;
   174121       }
   174122    default:
   174123       unreachable("Invalid hardware generation");
   174124    }
   174125 }
   174126 
   174127 
   174128 
   174129 /* PIPE_CONTROL::Depth Cache Flush Inhibit */
   174130 
   174131 
   174132 #define GEN5_PIPE_CONTROL_DepthCacheFlushInhibit_bits  1
   174133 
   174134 static inline uint32_t ATTRIBUTE_PURE
   174135 PIPE_CONTROL_DepthCacheFlushInhibit_bits(const struct gen_device_info *devinfo)
   174136 {
   174137    switch (devinfo->gen) {
   174138    case 10: return 0;
   174139    case 9: return 0;
   174140    case 8: return 0;
   174141    case 7:
   174142       if (devinfo->is_haswell) {
   174143          return 0;
   174144       } else {
   174145          return 0;
   174146       }
   174147    case 6: return 0;
   174148    case 5: return 1;
   174149    case 4:
   174150       if (devinfo->is_g4x) {
   174151          return 0;
   174152       } else {
   174153          return 0;
   174154       }
   174155    default:
   174156       unreachable("Invalid hardware generation");
   174157    }
   174158 }
   174159 
   174160 
   174161 
   174162 #define GEN5_PIPE_CONTROL_DepthCacheFlushInhibit_start  32
   174163 
   174164 static inline uint32_t ATTRIBUTE_PURE
   174165 PIPE_CONTROL_DepthCacheFlushInhibit_start(const struct gen_device_info *devinfo)
   174166 {
   174167    switch (devinfo->gen) {
   174168    case 10: return 0;
   174169    case 9: return 0;
   174170    case 8: return 0;
   174171    case 7:
   174172       if (devinfo->is_haswell) {
   174173          return 0;
   174174       } else {
   174175          return 0;
   174176       }
   174177    case 6: return 0;
   174178    case 5: return 32;
   174179    case 4:
   174180       if (devinfo->is_g4x) {
   174181          return 0;
   174182       } else {
   174183          return 0;
   174184       }
   174185    default:
   174186       unreachable("Invalid hardware generation");
   174187    }
   174188 }
   174189 
   174190 
   174191 
   174192 /* PIPE_CONTROL::Depth Stall Enable */
   174193 
   174194 
   174195 #define GEN10_PIPE_CONTROL_DepthStallEnable_bits  1
   174196 #define GEN9_PIPE_CONTROL_DepthStallEnable_bits  1
   174197 #define GEN8_PIPE_CONTROL_DepthStallEnable_bits  1
   174198 #define GEN75_PIPE_CONTROL_DepthStallEnable_bits  1
   174199 #define GEN7_PIPE_CONTROL_DepthStallEnable_bits  1
   174200 #define GEN6_PIPE_CONTROL_DepthStallEnable_bits  1
   174201 #define GEN5_PIPE_CONTROL_DepthStallEnable_bits  1
   174202 #define GEN45_PIPE_CONTROL_DepthStallEnable_bits  1
   174203 #define GEN4_PIPE_CONTROL_DepthStallEnable_bits  1
   174204 
   174205 static inline uint32_t ATTRIBUTE_PURE
   174206 PIPE_CONTROL_DepthStallEnable_bits(const struct gen_device_info *devinfo)
   174207 {
   174208    switch (devinfo->gen) {
   174209    case 10: return 1;
   174210    case 9: return 1;
   174211    case 8: return 1;
   174212    case 7:
   174213       if (devinfo->is_haswell) {
   174214          return 1;
   174215       } else {
   174216          return 1;
   174217       }
   174218    case 6: return 1;
   174219    case 5: return 1;
   174220    case 4:
   174221       if (devinfo->is_g4x) {
   174222          return 1;
   174223       } else {
   174224          return 1;
   174225       }
   174226    default:
   174227       unreachable("Invalid hardware generation");
   174228    }
   174229 }
   174230 
   174231 
   174232 
   174233 #define GEN10_PIPE_CONTROL_DepthStallEnable_start  45
   174234 #define GEN9_PIPE_CONTROL_DepthStallEnable_start  45
   174235 #define GEN8_PIPE_CONTROL_DepthStallEnable_start  45
   174236 #define GEN75_PIPE_CONTROL_DepthStallEnable_start  45
   174237 #define GEN7_PIPE_CONTROL_DepthStallEnable_start  45
   174238 #define GEN6_PIPE_CONTROL_DepthStallEnable_start  45
   174239 #define GEN5_PIPE_CONTROL_DepthStallEnable_start  13
   174240 #define GEN45_PIPE_CONTROL_DepthStallEnable_start  13
   174241 #define GEN4_PIPE_CONTROL_DepthStallEnable_start  13
   174242 
   174243 static inline uint32_t ATTRIBUTE_PURE
   174244 PIPE_CONTROL_DepthStallEnable_start(const struct gen_device_info *devinfo)
   174245 {
   174246    switch (devinfo->gen) {
   174247    case 10: return 45;
   174248    case 9: return 45;
   174249    case 8: return 45;
   174250    case 7:
   174251       if (devinfo->is_haswell) {
   174252          return 45;
   174253       } else {
   174254          return 45;
   174255       }
   174256    case 6: return 45;
   174257    case 5: return 13;
   174258    case 4:
   174259       if (devinfo->is_g4x) {
   174260          return 13;
   174261       } else {
   174262          return 13;
   174263       }
   174264    default:
   174265       unreachable("Invalid hardware generation");
   174266    }
   174267 }
   174268 
   174269 
   174270 
   174271 /* PIPE_CONTROL::Destination Address Type */
   174272 
   174273 
   174274 #define GEN10_PIPE_CONTROL_DestinationAddressType_bits  1
   174275 #define GEN9_PIPE_CONTROL_DestinationAddressType_bits  1
   174276 #define GEN8_PIPE_CONTROL_DestinationAddressType_bits  1
   174277 #define GEN75_PIPE_CONTROL_DestinationAddressType_bits  1
   174278 #define GEN7_PIPE_CONTROL_DestinationAddressType_bits  1
   174279 #define GEN6_PIPE_CONTROL_DestinationAddressType_bits  1
   174280 #define GEN5_PIPE_CONTROL_DestinationAddressType_bits  1
   174281 #define GEN45_PIPE_CONTROL_DestinationAddressType_bits  1
   174282 #define GEN4_PIPE_CONTROL_DestinationAddressType_bits  1
   174283 
   174284 static inline uint32_t ATTRIBUTE_PURE
   174285 PIPE_CONTROL_DestinationAddressType_bits(const struct gen_device_info *devinfo)
   174286 {
   174287    switch (devinfo->gen) {
   174288    case 10: return 1;
   174289    case 9: return 1;
   174290    case 8: return 1;
   174291    case 7:
   174292       if (devinfo->is_haswell) {
   174293          return 1;
   174294       } else {
   174295          return 1;
   174296       }
   174297    case 6: return 1;
   174298    case 5: return 1;
   174299    case 4:
   174300       if (devinfo->is_g4x) {
   174301          return 1;
   174302       } else {
   174303          return 1;
   174304       }
   174305    default:
   174306       unreachable("Invalid hardware generation");
   174307    }
   174308 }
   174309 
   174310 
   174311 
   174312 #define GEN10_PIPE_CONTROL_DestinationAddressType_start  56
   174313 #define GEN9_PIPE_CONTROL_DestinationAddressType_start  56
   174314 #define GEN8_PIPE_CONTROL_DestinationAddressType_start  56
   174315 #define GEN75_PIPE_CONTROL_DestinationAddressType_start  56
   174316 #define GEN7_PIPE_CONTROL_DestinationAddressType_start  56
   174317 #define GEN6_PIPE_CONTROL_DestinationAddressType_start  66
   174318 #define GEN5_PIPE_CONTROL_DestinationAddressType_start  34
   174319 #define GEN45_PIPE_CONTROL_DestinationAddressType_start  34
   174320 #define GEN4_PIPE_CONTROL_DestinationAddressType_start  34
   174321 
   174322 static inline uint32_t ATTRIBUTE_PURE
   174323 PIPE_CONTROL_DestinationAddressType_start(const struct gen_device_info *devinfo)
   174324 {
   174325    switch (devinfo->gen) {
   174326    case 10: return 56;
   174327    case 9: return 56;
   174328    case 8: return 56;
   174329    case 7:
   174330       if (devinfo->is_haswell) {
   174331          return 56;
   174332       } else {
   174333          return 56;
   174334       }
   174335    case 6: return 66;
   174336    case 5: return 34;
   174337    case 4:
   174338       if (devinfo->is_g4x) {
   174339          return 34;
   174340       } else {
   174341          return 34;
   174342       }
   174343    default:
   174344       unreachable("Invalid hardware generation");
   174345    }
   174346 }
   174347 
   174348 
   174349 
   174350 /* PIPE_CONTROL::Flush LLC */
   174351 
   174352 
   174353 #define GEN10_PIPE_CONTROL_FlushLLC_bits  1
   174354 #define GEN9_PIPE_CONTROL_FlushLLC_bits  1
   174355 
   174356 static inline uint32_t ATTRIBUTE_PURE
   174357 PIPE_CONTROL_FlushLLC_bits(const struct gen_device_info *devinfo)
   174358 {
   174359    switch (devinfo->gen) {
   174360    case 10: return 1;
   174361    case 9: return 1;
   174362    case 8: return 0;
   174363    case 7:
   174364       if (devinfo->is_haswell) {
   174365          return 0;
   174366       } else {
   174367          return 0;
   174368       }
   174369    case 6: return 0;
   174370    case 5: return 0;
   174371    case 4:
   174372       if (devinfo->is_g4x) {
   174373          return 0;
   174374       } else {
   174375          return 0;
   174376       }
   174377    default:
   174378       unreachable("Invalid hardware generation");
   174379    }
   174380 }
   174381 
   174382 
   174383 
   174384 #define GEN10_PIPE_CONTROL_FlushLLC_start  58
   174385 #define GEN9_PIPE_CONTROL_FlushLLC_start  58
   174386 
   174387 static inline uint32_t ATTRIBUTE_PURE
   174388 PIPE_CONTROL_FlushLLC_start(const struct gen_device_info *devinfo)
   174389 {
   174390    switch (devinfo->gen) {
   174391    case 10: return 58;
   174392    case 9: return 58;
   174393    case 8: return 0;
   174394    case 7:
   174395       if (devinfo->is_haswell) {
   174396          return 0;
   174397       } else {
   174398          return 0;
   174399       }
   174400    case 6: return 0;
   174401    case 5: return 0;
   174402    case 4:
   174403       if (devinfo->is_g4x) {
   174404          return 0;
   174405       } else {
   174406          return 0;
   174407       }
   174408    default:
   174409       unreachable("Invalid hardware generation");
   174410    }
   174411 }
   174412 
   174413 
   174414 
   174415 /* PIPE_CONTROL::Generic Media State Clear */
   174416 
   174417 
   174418 #define GEN10_PIPE_CONTROL_GenericMediaStateClear_bits  1
   174419 #define GEN9_PIPE_CONTROL_GenericMediaStateClear_bits  1
   174420 #define GEN8_PIPE_CONTROL_GenericMediaStateClear_bits  1
   174421 #define GEN75_PIPE_CONTROL_GenericMediaStateClear_bits  1
   174422 #define GEN7_PIPE_CONTROL_GenericMediaStateClear_bits  1
   174423 #define GEN6_PIPE_CONTROL_GenericMediaStateClear_bits  1
   174424 
   174425 static inline uint32_t ATTRIBUTE_PURE
   174426 PIPE_CONTROL_GenericMediaStateClear_bits(const struct gen_device_info *devinfo)
   174427 {
   174428    switch (devinfo->gen) {
   174429    case 10: return 1;
   174430    case 9: return 1;
   174431    case 8: return 1;
   174432    case 7:
   174433       if (devinfo->is_haswell) {
   174434          return 1;
   174435       } else {
   174436          return 1;
   174437       }
   174438    case 6: return 1;
   174439    case 5: return 0;
   174440    case 4:
   174441       if (devinfo->is_g4x) {
   174442          return 0;
   174443       } else {
   174444          return 0;
   174445       }
   174446    default:
   174447       unreachable("Invalid hardware generation");
   174448    }
   174449 }
   174450 
   174451 
   174452 
   174453 #define GEN10_PIPE_CONTROL_GenericMediaStateClear_start  48
   174454 #define GEN9_PIPE_CONTROL_GenericMediaStateClear_start  48
   174455 #define GEN8_PIPE_CONTROL_GenericMediaStateClear_start  48
   174456 #define GEN75_PIPE_CONTROL_GenericMediaStateClear_start  48
   174457 #define GEN7_PIPE_CONTROL_GenericMediaStateClear_start  48
   174458 #define GEN6_PIPE_CONTROL_GenericMediaStateClear_start  48
   174459 
   174460 static inline uint32_t ATTRIBUTE_PURE
   174461 PIPE_CONTROL_GenericMediaStateClear_start(const struct gen_device_info *devinfo)
   174462 {
   174463    switch (devinfo->gen) {
   174464    case 10: return 48;
   174465    case 9: return 48;
   174466    case 8: return 48;
   174467    case 7:
   174468       if (devinfo->is_haswell) {
   174469          return 48;
   174470       } else {
   174471          return 48;
   174472       }
   174473    case 6: return 48;
   174474    case 5: return 0;
   174475    case 4:
   174476       if (devinfo->is_g4x) {
   174477          return 0;
   174478       } else {
   174479          return 0;
   174480       }
   174481    default:
   174482       unreachable("Invalid hardware generation");
   174483    }
   174484 }
   174485 
   174486 
   174487 
   174488 /* PIPE_CONTROL::Global Snapshot Count Reset */
   174489 
   174490 
   174491 #define GEN10_PIPE_CONTROL_GlobalSnapshotCountReset_bits  1
   174492 #define GEN9_PIPE_CONTROL_GlobalSnapshotCountReset_bits  1
   174493 #define GEN8_PIPE_CONTROL_GlobalSnapshotCountReset_bits  1
   174494 #define GEN75_PIPE_CONTROL_GlobalSnapshotCountReset_bits  1
   174495 #define GEN7_PIPE_CONTROL_GlobalSnapshotCountReset_bits  1
   174496 #define GEN6_PIPE_CONTROL_GlobalSnapshotCountReset_bits  1
   174497 
   174498 static inline uint32_t ATTRIBUTE_PURE
   174499 PIPE_CONTROL_GlobalSnapshotCountReset_bits(const struct gen_device_info *devinfo)
   174500 {
   174501    switch (devinfo->gen) {
   174502    case 10: return 1;
   174503    case 9: return 1;
   174504    case 8: return 1;
   174505    case 7:
   174506       if (devinfo->is_haswell) {
   174507          return 1;
   174508       } else {
   174509          return 1;
   174510       }
   174511    case 6: return 1;
   174512    case 5: return 0;
   174513    case 4:
   174514       if (devinfo->is_g4x) {
   174515          return 0;
   174516       } else {
   174517          return 0;
   174518       }
   174519    default:
   174520       unreachable("Invalid hardware generation");
   174521    }
   174522 }
   174523 
   174524 
   174525 
   174526 #define GEN10_PIPE_CONTROL_GlobalSnapshotCountReset_start  51
   174527 #define GEN9_PIPE_CONTROL_GlobalSnapshotCountReset_start  51
   174528 #define GEN8_PIPE_CONTROL_GlobalSnapshotCountReset_start  51
   174529 #define GEN75_PIPE_CONTROL_GlobalSnapshotCountReset_start  51
   174530 #define GEN7_PIPE_CONTROL_GlobalSnapshotCountReset_start  51
   174531 #define GEN6_PIPE_CONTROL_GlobalSnapshotCountReset_start  51
   174532 
   174533 static inline uint32_t ATTRIBUTE_PURE
   174534 PIPE_CONTROL_GlobalSnapshotCountReset_start(const struct gen_device_info *devinfo)
   174535 {
   174536    switch (devinfo->gen) {
   174537    case 10: return 51;
   174538    case 9: return 51;
   174539    case 8: return 51;
   174540    case 7:
   174541       if (devinfo->is_haswell) {
   174542          return 51;
   174543       } else {
   174544          return 51;
   174545       }
   174546    case 6: return 51;
   174547    case 5: return 0;
   174548    case 4:
   174549       if (devinfo->is_g4x) {
   174550          return 0;
   174551       } else {
   174552          return 0;
   174553       }
   174554    default:
   174555       unreachable("Invalid hardware generation");
   174556    }
   174557 }
   174558 
   174559 
   174560 
   174561 /* PIPE_CONTROL::Immediate Data */
   174562 
   174563 
   174564 #define GEN10_PIPE_CONTROL_ImmediateData_bits  64
   174565 #define GEN9_PIPE_CONTROL_ImmediateData_bits  64
   174566 #define GEN8_PIPE_CONTROL_ImmediateData_bits  64
   174567 #define GEN75_PIPE_CONTROL_ImmediateData_bits  64
   174568 #define GEN7_PIPE_CONTROL_ImmediateData_bits  64
   174569 #define GEN6_PIPE_CONTROL_ImmediateData_bits  64
   174570 #define GEN5_PIPE_CONTROL_ImmediateData_bits  64
   174571 #define GEN45_PIPE_CONTROL_ImmediateData_bits  64
   174572 #define GEN4_PIPE_CONTROL_ImmediateData_bits  64
   174573 
   174574 static inline uint32_t ATTRIBUTE_PURE
   174575 PIPE_CONTROL_ImmediateData_bits(const struct gen_device_info *devinfo)
   174576 {
   174577    switch (devinfo->gen) {
   174578    case 10: return 64;
   174579    case 9: return 64;
   174580    case 8: return 64;
   174581    case 7:
   174582       if (devinfo->is_haswell) {
   174583          return 64;
   174584       } else {
   174585          return 64;
   174586       }
   174587    case 6: return 64;
   174588    case 5: return 64;
   174589    case 4:
   174590       if (devinfo->is_g4x) {
   174591          return 64;
   174592       } else {
   174593          return 64;
   174594       }
   174595    default:
   174596       unreachable("Invalid hardware generation");
   174597    }
   174598 }
   174599 
   174600 
   174601 
   174602 #define GEN10_PIPE_CONTROL_ImmediateData_start  128
   174603 #define GEN9_PIPE_CONTROL_ImmediateData_start  128
   174604 #define GEN8_PIPE_CONTROL_ImmediateData_start  128
   174605 #define GEN75_PIPE_CONTROL_ImmediateData_start  96
   174606 #define GEN7_PIPE_CONTROL_ImmediateData_start  96
   174607 #define GEN6_PIPE_CONTROL_ImmediateData_start  96
   174608 #define GEN5_PIPE_CONTROL_ImmediateData_start  64
   174609 #define GEN45_PIPE_CONTROL_ImmediateData_start  64
   174610 #define GEN4_PIPE_CONTROL_ImmediateData_start  64
   174611 
   174612 static inline uint32_t ATTRIBUTE_PURE
   174613 PIPE_CONTROL_ImmediateData_start(const struct gen_device_info *devinfo)
   174614 {
   174615    switch (devinfo->gen) {
   174616    case 10: return 128;
   174617    case 9: return 128;
   174618    case 8: return 128;
   174619    case 7:
   174620       if (devinfo->is_haswell) {
   174621          return 96;
   174622       } else {
   174623          return 96;
   174624       }
   174625    case 6: return 96;
   174626    case 5: return 64;
   174627    case 4:
   174628       if (devinfo->is_g4x) {
   174629          return 64;
   174630       } else {
   174631          return 64;
   174632       }
   174633    default:
   174634       unreachable("Invalid hardware generation");
   174635    }
   174636 }
   174637 
   174638 
   174639 
   174640 /* PIPE_CONTROL::Indirect State Pointers Disable */
   174641 
   174642 
   174643 #define GEN10_PIPE_CONTROL_IndirectStatePointersDisable_bits  1
   174644 #define GEN9_PIPE_CONTROL_IndirectStatePointersDisable_bits  1
   174645 #define GEN8_PIPE_CONTROL_IndirectStatePointersDisable_bits  1
   174646 #define GEN75_PIPE_CONTROL_IndirectStatePointersDisable_bits  1
   174647 #define GEN7_PIPE_CONTROL_IndirectStatePointersDisable_bits  1
   174648 #define GEN6_PIPE_CONTROL_IndirectStatePointersDisable_bits  1
   174649 #define GEN5_PIPE_CONTROL_IndirectStatePointersDisable_bits  1
   174650 #define GEN45_PIPE_CONTROL_IndirectStatePointersDisable_bits  1
   174651 
   174652 static inline uint32_t ATTRIBUTE_PURE
   174653 PIPE_CONTROL_IndirectStatePointersDisable_bits(const struct gen_device_info *devinfo)
   174654 {
   174655    switch (devinfo->gen) {
   174656    case 10: return 1;
   174657    case 9: return 1;
   174658    case 8: return 1;
   174659    case 7:
   174660       if (devinfo->is_haswell) {
   174661          return 1;
   174662       } else {
   174663          return 1;
   174664       }
   174665    case 6: return 1;
   174666    case 5: return 1;
   174667    case 4:
   174668       if (devinfo->is_g4x) {
   174669          return 1;
   174670       } else {
   174671          return 0;
   174672       }
   174673    default:
   174674       unreachable("Invalid hardware generation");
   174675    }
   174676 }
   174677 
   174678 
   174679 
   174680 #define GEN10_PIPE_CONTROL_IndirectStatePointersDisable_start  41
   174681 #define GEN9_PIPE_CONTROL_IndirectStatePointersDisable_start  41
   174682 #define GEN8_PIPE_CONTROL_IndirectStatePointersDisable_start  41
   174683 #define GEN75_PIPE_CONTROL_IndirectStatePointersDisable_start  41
   174684 #define GEN7_PIPE_CONTROL_IndirectStatePointersDisable_start  41
   174685 #define GEN6_PIPE_CONTROL_IndirectStatePointersDisable_start  41
   174686 #define GEN5_PIPE_CONTROL_IndirectStatePointersDisable_start  9
   174687 #define GEN45_PIPE_CONTROL_IndirectStatePointersDisable_start  9
   174688 
   174689 static inline uint32_t ATTRIBUTE_PURE
   174690 PIPE_CONTROL_IndirectStatePointersDisable_start(const struct gen_device_info *devinfo)
   174691 {
   174692    switch (devinfo->gen) {
   174693    case 10: return 41;
   174694    case 9: return 41;
   174695    case 8: return 41;
   174696    case 7:
   174697       if (devinfo->is_haswell) {
   174698          return 41;
   174699       } else {
   174700          return 41;
   174701       }
   174702    case 6: return 41;
   174703    case 5: return 9;
   174704    case 4:
   174705       if (devinfo->is_g4x) {
   174706          return 9;
   174707       } else {
   174708          return 0;
   174709       }
   174710    default:
   174711       unreachable("Invalid hardware generation");
   174712    }
   174713 }
   174714 
   174715 
   174716 
   174717 /* PIPE_CONTROL::Instruction Cache Invalidate Enable */
   174718 
   174719 
   174720 #define GEN10_PIPE_CONTROL_InstructionCacheInvalidateEnable_bits  1
   174721 #define GEN9_PIPE_CONTROL_InstructionCacheInvalidateEnable_bits  1
   174722 #define GEN8_PIPE_CONTROL_InstructionCacheInvalidateEnable_bits  1
   174723 #define GEN75_PIPE_CONTROL_InstructionCacheInvalidateEnable_bits  1
   174724 #define GEN7_PIPE_CONTROL_InstructionCacheInvalidateEnable_bits  1
   174725 #define GEN6_PIPE_CONTROL_InstructionCacheInvalidateEnable_bits  1
   174726 #define GEN5_PIPE_CONTROL_InstructionCacheInvalidateEnable_bits  1
   174727 #define GEN45_PIPE_CONTROL_InstructionCacheInvalidateEnable_bits  1
   174728 #define GEN4_PIPE_CONTROL_InstructionCacheInvalidateEnable_bits  1
   174729 
   174730 static inline uint32_t ATTRIBUTE_PURE
   174731 PIPE_CONTROL_InstructionCacheInvalidateEnable_bits(const struct gen_device_info *devinfo)
   174732 {
   174733    switch (devinfo->gen) {
   174734    case 10: return 1;
   174735    case 9: return 1;
   174736    case 8: return 1;
   174737    case 7:
   174738       if (devinfo->is_haswell) {
   174739          return 1;
   174740       } else {
   174741          return 1;
   174742       }
   174743    case 6: return 1;
   174744    case 5: return 1;
   174745    case 4:
   174746       if (devinfo->is_g4x) {
   174747          return 1;
   174748       } else {
   174749          return 1;
   174750       }
   174751    default:
   174752       unreachable("Invalid hardware generation");
   174753    }
   174754 }
   174755 
   174756 
   174757 
   174758 #define GEN10_PIPE_CONTROL_InstructionCacheInvalidateEnable_start  43
   174759 #define GEN9_PIPE_CONTROL_InstructionCacheInvalidateEnable_start  43
   174760 #define GEN8_PIPE_CONTROL_InstructionCacheInvalidateEnable_start  43
   174761 #define GEN75_PIPE_CONTROL_InstructionCacheInvalidateEnable_start  43
   174762 #define GEN7_PIPE_CONTROL_InstructionCacheInvalidateEnable_start  43
   174763 #define GEN6_PIPE_CONTROL_InstructionCacheInvalidateEnable_start  43
   174764 #define GEN5_PIPE_CONTROL_InstructionCacheInvalidateEnable_start  11
   174765 #define GEN45_PIPE_CONTROL_InstructionCacheInvalidateEnable_start  11
   174766 #define GEN4_PIPE_CONTROL_InstructionCacheInvalidateEnable_start  11
   174767 
   174768 static inline uint32_t ATTRIBUTE_PURE
   174769 PIPE_CONTROL_InstructionCacheInvalidateEnable_start(const struct gen_device_info *devinfo)
   174770 {
   174771    switch (devinfo->gen) {
   174772    case 10: return 43;
   174773    case 9: return 43;
   174774    case 8: return 43;
   174775    case 7:
   174776       if (devinfo->is_haswell) {
   174777          return 43;
   174778       } else {
   174779          return 43;
   174780       }
   174781    case 6: return 43;
   174782    case 5: return 11;
   174783    case 4:
   174784       if (devinfo->is_g4x) {
   174785          return 11;
   174786       } else {
   174787          return 11;
   174788       }
   174789    default:
   174790       unreachable("Invalid hardware generation");
   174791    }
   174792 }
   174793 
   174794 
   174795 
   174796 /* PIPE_CONTROL::LRI Post Sync Operation */
   174797 
   174798 
   174799 #define GEN10_PIPE_CONTROL_LRIPostSyncOperation_bits  1
   174800 #define GEN9_PIPE_CONTROL_LRIPostSyncOperation_bits  1
   174801 #define GEN8_PIPE_CONTROL_LRIPostSyncOperation_bits  1
   174802 #define GEN75_PIPE_CONTROL_LRIPostSyncOperation_bits  1
   174803 #define GEN7_PIPE_CONTROL_LRIPostSyncOperation_bits  1
   174804 
   174805 static inline uint32_t ATTRIBUTE_PURE
   174806 PIPE_CONTROL_LRIPostSyncOperation_bits(const struct gen_device_info *devinfo)
   174807 {
   174808    switch (devinfo->gen) {
   174809    case 10: return 1;
   174810    case 9: return 1;
   174811    case 8: return 1;
   174812    case 7:
   174813       if (devinfo->is_haswell) {
   174814          return 1;
   174815       } else {
   174816          return 1;
   174817       }
   174818    case 6: return 0;
   174819    case 5: return 0;
   174820    case 4:
   174821       if (devinfo->is_g4x) {
   174822          return 0;
   174823       } else {
   174824          return 0;
   174825       }
   174826    default:
   174827       unreachable("Invalid hardware generation");
   174828    }
   174829 }
   174830 
   174831 
   174832 
   174833 #define GEN10_PIPE_CONTROL_LRIPostSyncOperation_start  55
   174834 #define GEN9_PIPE_CONTROL_LRIPostSyncOperation_start  55
   174835 #define GEN8_PIPE_CONTROL_LRIPostSyncOperation_start  55
   174836 #define GEN75_PIPE_CONTROL_LRIPostSyncOperation_start  55
   174837 #define GEN7_PIPE_CONTROL_LRIPostSyncOperation_start  55
   174838 
   174839 static inline uint32_t ATTRIBUTE_PURE
   174840 PIPE_CONTROL_LRIPostSyncOperation_start(const struct gen_device_info *devinfo)
   174841 {
   174842    switch (devinfo->gen) {
   174843    case 10: return 55;
   174844    case 9: return 55;
   174845    case 8: return 55;
   174846    case 7:
   174847       if (devinfo->is_haswell) {
   174848          return 55;
   174849       } else {
   174850          return 55;
   174851       }
   174852    case 6: return 0;
   174853    case 5: return 0;
   174854    case 4:
   174855       if (devinfo->is_g4x) {
   174856          return 0;
   174857       } else {
   174858          return 0;
   174859       }
   174860    default:
   174861       unreachable("Invalid hardware generation");
   174862    }
   174863 }
   174864 
   174865 
   174866 
   174867 /* PIPE_CONTROL::Notify Enable */
   174868 
   174869 
   174870 #define GEN10_PIPE_CONTROL_NotifyEnable_bits  1
   174871 #define GEN9_PIPE_CONTROL_NotifyEnable_bits  1
   174872 #define GEN8_PIPE_CONTROL_NotifyEnable_bits  1
   174873 #define GEN75_PIPE_CONTROL_NotifyEnable_bits  1
   174874 #define GEN7_PIPE_CONTROL_NotifyEnable_bits  1
   174875 #define GEN6_PIPE_CONTROL_NotifyEnable_bits  1
   174876 #define GEN5_PIPE_CONTROL_NotifyEnable_bits  1
   174877 #define GEN45_PIPE_CONTROL_NotifyEnable_bits  1
   174878 #define GEN4_PIPE_CONTROL_NotifyEnable_bits  1
   174879 
   174880 static inline uint32_t ATTRIBUTE_PURE
   174881 PIPE_CONTROL_NotifyEnable_bits(const struct gen_device_info *devinfo)
   174882 {
   174883    switch (devinfo->gen) {
   174884    case 10: return 1;
   174885    case 9: return 1;
   174886    case 8: return 1;
   174887    case 7:
   174888       if (devinfo->is_haswell) {
   174889          return 1;
   174890       } else {
   174891          return 1;
   174892       }
   174893    case 6: return 1;
   174894    case 5: return 1;
   174895    case 4:
   174896       if (devinfo->is_g4x) {
   174897          return 1;
   174898       } else {
   174899          return 1;
   174900       }
   174901    default:
   174902       unreachable("Invalid hardware generation");
   174903    }
   174904 }
   174905 
   174906 
   174907 
   174908 #define GEN10_PIPE_CONTROL_NotifyEnable_start  40
   174909 #define GEN9_PIPE_CONTROL_NotifyEnable_start  40
   174910 #define GEN8_PIPE_CONTROL_NotifyEnable_start  40
   174911 #define GEN75_PIPE_CONTROL_NotifyEnable_start  40
   174912 #define GEN7_PIPE_CONTROL_NotifyEnable_start  40
   174913 #define GEN6_PIPE_CONTROL_NotifyEnable_start  40
   174914 #define GEN5_PIPE_CONTROL_NotifyEnable_start  8
   174915 #define GEN45_PIPE_CONTROL_NotifyEnable_start  8
   174916 #define GEN4_PIPE_CONTROL_NotifyEnable_start  8
   174917 
   174918 static inline uint32_t ATTRIBUTE_PURE
   174919 PIPE_CONTROL_NotifyEnable_start(const struct gen_device_info *devinfo)
   174920 {
   174921    switch (devinfo->gen) {
   174922    case 10: return 40;
   174923    case 9: return 40;
   174924    case 8: return 40;
   174925    case 7:
   174926       if (devinfo->is_haswell) {
   174927          return 40;
   174928       } else {
   174929          return 40;
   174930       }
   174931    case 6: return 40;
   174932    case 5: return 8;
   174933    case 4:
   174934       if (devinfo->is_g4x) {
   174935          return 8;
   174936       } else {
   174937          return 8;
   174938       }
   174939    default:
   174940       unreachable("Invalid hardware generation");
   174941    }
   174942 }
   174943 
   174944 
   174945 
   174946 /* PIPE_CONTROL::PSD Sync Enable */
   174947 
   174948 
   174949 #define GEN10_PIPE_CONTROL_PSDSyncEnable_bits  1
   174950 
   174951 static inline uint32_t ATTRIBUTE_PURE
   174952 PIPE_CONTROL_PSDSyncEnable_bits(const struct gen_device_info *devinfo)
   174953 {
   174954    switch (devinfo->gen) {
   174955    case 10: return 1;
   174956    case 9: return 0;
   174957    case 8: return 0;
   174958    case 7:
   174959       if (devinfo->is_haswell) {
   174960          return 0;
   174961       } else {
   174962          return 0;
   174963       }
   174964    case 6: return 0;
   174965    case 5: return 0;
   174966    case 4:
   174967       if (devinfo->is_g4x) {
   174968          return 0;
   174969       } else {
   174970          return 0;
   174971       }
   174972    default:
   174973       unreachable("Invalid hardware generation");
   174974    }
   174975 }
   174976 
   174977 
   174978 
   174979 #define GEN10_PIPE_CONTROL_PSDSyncEnable_start  49
   174980 
   174981 static inline uint32_t ATTRIBUTE_PURE
   174982 PIPE_CONTROL_PSDSyncEnable_start(const struct gen_device_info *devinfo)
   174983 {
   174984    switch (devinfo->gen) {
   174985    case 10: return 49;
   174986    case 9: return 0;
   174987    case 8: return 0;
   174988    case 7:
   174989       if (devinfo->is_haswell) {
   174990          return 0;
   174991       } else {
   174992          return 0;
   174993       }
   174994    case 6: return 0;
   174995    case 5: return 0;
   174996    case 4:
   174997       if (devinfo->is_g4x) {
   174998          return 0;
   174999       } else {
   175000          return 0;
   175001       }
   175002    default:
   175003       unreachable("Invalid hardware generation");
   175004    }
   175005 }
   175006 
   175007 
   175008 
   175009 /* PIPE_CONTROL::Pipe Control Flush Enable */
   175010 
   175011 
   175012 #define GEN10_PIPE_CONTROL_PipeControlFlushEnable_bits  1
   175013 #define GEN9_PIPE_CONTROL_PipeControlFlushEnable_bits  1
   175014 #define GEN8_PIPE_CONTROL_PipeControlFlushEnable_bits  1
   175015 #define GEN75_PIPE_CONTROL_PipeControlFlushEnable_bits  1
   175016 #define GEN7_PIPE_CONTROL_PipeControlFlushEnable_bits  1
   175017 
   175018 static inline uint32_t ATTRIBUTE_PURE
   175019 PIPE_CONTROL_PipeControlFlushEnable_bits(const struct gen_device_info *devinfo)
   175020 {
   175021    switch (devinfo->gen) {
   175022    case 10: return 1;
   175023    case 9: return 1;
   175024    case 8: return 1;
   175025    case 7:
   175026       if (devinfo->is_haswell) {
   175027          return 1;
   175028       } else {
   175029          return 1;
   175030       }
   175031    case 6: return 0;
   175032    case 5: return 0;
   175033    case 4:
   175034       if (devinfo->is_g4x) {
   175035          return 0;
   175036       } else {
   175037          return 0;
   175038       }
   175039    default:
   175040       unreachable("Invalid hardware generation");
   175041    }
   175042 }
   175043 
   175044 
   175045 
   175046 #define GEN10_PIPE_CONTROL_PipeControlFlushEnable_start  39
   175047 #define GEN9_PIPE_CONTROL_PipeControlFlushEnable_start  39
   175048 #define GEN8_PIPE_CONTROL_PipeControlFlushEnable_start  39
   175049 #define GEN75_PIPE_CONTROL_PipeControlFlushEnable_start  39
   175050 #define GEN7_PIPE_CONTROL_PipeControlFlushEnable_start  39
   175051 
   175052 static inline uint32_t ATTRIBUTE_PURE
   175053 PIPE_CONTROL_PipeControlFlushEnable_start(const struct gen_device_info *devinfo)
   175054 {
   175055    switch (devinfo->gen) {
   175056    case 10: return 39;
   175057    case 9: return 39;
   175058    case 8: return 39;
   175059    case 7:
   175060       if (devinfo->is_haswell) {
   175061          return 39;
   175062       } else {
   175063          return 39;
   175064       }
   175065    case 6: return 0;
   175066    case 5: return 0;
   175067    case 4:
   175068       if (devinfo->is_g4x) {
   175069          return 0;
   175070       } else {
   175071          return 0;
   175072       }
   175073    default:
   175074       unreachable("Invalid hardware generation");
   175075    }
   175076 }
   175077 
   175078 
   175079 
   175080 /* PIPE_CONTROL::Post Sync Operation */
   175081 
   175082 
   175083 #define GEN10_PIPE_CONTROL_PostSyncOperation_bits  2
   175084 #define GEN9_PIPE_CONTROL_PostSyncOperation_bits  2
   175085 #define GEN8_PIPE_CONTROL_PostSyncOperation_bits  2
   175086 #define GEN75_PIPE_CONTROL_PostSyncOperation_bits  2
   175087 #define GEN7_PIPE_CONTROL_PostSyncOperation_bits  2
   175088 #define GEN6_PIPE_CONTROL_PostSyncOperation_bits  2
   175089 #define GEN5_PIPE_CONTROL_PostSyncOperation_bits  2
   175090 #define GEN45_PIPE_CONTROL_PostSyncOperation_bits  2
   175091 #define GEN4_PIPE_CONTROL_PostSyncOperation_bits  2
   175092 
   175093 static inline uint32_t ATTRIBUTE_PURE
   175094 PIPE_CONTROL_PostSyncOperation_bits(const struct gen_device_info *devinfo)
   175095 {
   175096    switch (devinfo->gen) {
   175097    case 10: return 2;
   175098    case 9: return 2;
   175099    case 8: return 2;
   175100    case 7:
   175101       if (devinfo->is_haswell) {
   175102          return 2;
   175103       } else {
   175104          return 2;
   175105       }
   175106    case 6: return 2;
   175107    case 5: return 2;
   175108    case 4:
   175109       if (devinfo->is_g4x) {
   175110          return 2;
   175111       } else {
   175112          return 2;
   175113       }
   175114    default:
   175115       unreachable("Invalid hardware generation");
   175116    }
   175117 }
   175118 
   175119 
   175120 
   175121 #define GEN10_PIPE_CONTROL_PostSyncOperation_start  46
   175122 #define GEN9_PIPE_CONTROL_PostSyncOperation_start  46
   175123 #define GEN8_PIPE_CONTROL_PostSyncOperation_start  46
   175124 #define GEN75_PIPE_CONTROL_PostSyncOperation_start  46
   175125 #define GEN7_PIPE_CONTROL_PostSyncOperation_start  46
   175126 #define GEN6_PIPE_CONTROL_PostSyncOperation_start  46
   175127 #define GEN5_PIPE_CONTROL_PostSyncOperation_start  14
   175128 #define GEN45_PIPE_CONTROL_PostSyncOperation_start  14
   175129 #define GEN4_PIPE_CONTROL_PostSyncOperation_start  14
   175130 
   175131 static inline uint32_t ATTRIBUTE_PURE
   175132 PIPE_CONTROL_PostSyncOperation_start(const struct gen_device_info *devinfo)
   175133 {
   175134    switch (devinfo->gen) {
   175135    case 10: return 46;
   175136    case 9: return 46;
   175137    case 8: return 46;
   175138    case 7:
   175139       if (devinfo->is_haswell) {
   175140          return 46;
   175141       } else {
   175142          return 46;
   175143       }
   175144    case 6: return 46;
   175145    case 5: return 14;
   175146    case 4:
   175147       if (devinfo->is_g4x) {
   175148          return 14;
   175149       } else {
   175150          return 14;
   175151       }
   175152    default:
   175153       unreachable("Invalid hardware generation");
   175154    }
   175155 }
   175156 
   175157 
   175158 
   175159 /* PIPE_CONTROL::Render Target Cache Flush Enable */
   175160 
   175161 
   175162 #define GEN10_PIPE_CONTROL_RenderTargetCacheFlushEnable_bits  1
   175163 #define GEN9_PIPE_CONTROL_RenderTargetCacheFlushEnable_bits  1
   175164 #define GEN8_PIPE_CONTROL_RenderTargetCacheFlushEnable_bits  1
   175165 #define GEN75_PIPE_CONTROL_RenderTargetCacheFlushEnable_bits  1
   175166 #define GEN7_PIPE_CONTROL_RenderTargetCacheFlushEnable_bits  1
   175167 #define GEN6_PIPE_CONTROL_RenderTargetCacheFlushEnable_bits  1
   175168 
   175169 static inline uint32_t ATTRIBUTE_PURE
   175170 PIPE_CONTROL_RenderTargetCacheFlushEnable_bits(const struct gen_device_info *devinfo)
   175171 {
   175172    switch (devinfo->gen) {
   175173    case 10: return 1;
   175174    case 9: return 1;
   175175    case 8: return 1;
   175176    case 7:
   175177       if (devinfo->is_haswell) {
   175178          return 1;
   175179       } else {
   175180          return 1;
   175181       }
   175182    case 6: return 1;
   175183    case 5: return 0;
   175184    case 4:
   175185       if (devinfo->is_g4x) {
   175186          return 0;
   175187       } else {
   175188          return 0;
   175189       }
   175190    default:
   175191       unreachable("Invalid hardware generation");
   175192    }
   175193 }
   175194 
   175195 
   175196 
   175197 #define GEN10_PIPE_CONTROL_RenderTargetCacheFlushEnable_start  44
   175198 #define GEN9_PIPE_CONTROL_RenderTargetCacheFlushEnable_start  44
   175199 #define GEN8_PIPE_CONTROL_RenderTargetCacheFlushEnable_start  44
   175200 #define GEN75_PIPE_CONTROL_RenderTargetCacheFlushEnable_start  44
   175201 #define GEN7_PIPE_CONTROL_RenderTargetCacheFlushEnable_start  44
   175202 #define GEN6_PIPE_CONTROL_RenderTargetCacheFlushEnable_start  44
   175203 
   175204 static inline uint32_t ATTRIBUTE_PURE
   175205 PIPE_CONTROL_RenderTargetCacheFlushEnable_start(const struct gen_device_info *devinfo)
   175206 {
   175207    switch (devinfo->gen) {
   175208    case 10: return 44;
   175209    case 9: return 44;
   175210    case 8: return 44;
   175211    case 7:
   175212       if (devinfo->is_haswell) {
   175213          return 44;
   175214       } else {
   175215          return 44;
   175216       }
   175217    case 6: return 44;
   175218    case 5: return 0;
   175219    case 4:
   175220       if (devinfo->is_g4x) {
   175221          return 0;
   175222       } else {
   175223          return 0;
   175224       }
   175225    default:
   175226       unreachable("Invalid hardware generation");
   175227    }
   175228 }
   175229 
   175230 
   175231 
   175232 /* PIPE_CONTROL::Stall At Pixel Scoreboard */
   175233 
   175234 
   175235 #define GEN10_PIPE_CONTROL_StallAtPixelScoreboard_bits  1
   175236 #define GEN9_PIPE_CONTROL_StallAtPixelScoreboard_bits  1
   175237 #define GEN8_PIPE_CONTROL_StallAtPixelScoreboard_bits  1
   175238 #define GEN75_PIPE_CONTROL_StallAtPixelScoreboard_bits  1
   175239 #define GEN7_PIPE_CONTROL_StallAtPixelScoreboard_bits  1
   175240 #define GEN6_PIPE_CONTROL_StallAtPixelScoreboard_bits  1
   175241 #define GEN5_PIPE_CONTROL_StallAtPixelScoreboard_bits  1
   175242 
   175243 static inline uint32_t ATTRIBUTE_PURE
   175244 PIPE_CONTROL_StallAtPixelScoreboard_bits(const struct gen_device_info *devinfo)
   175245 {
   175246    switch (devinfo->gen) {
   175247    case 10: return 1;
   175248    case 9: return 1;
   175249    case 8: return 1;
   175250    case 7:
   175251       if (devinfo->is_haswell) {
   175252          return 1;
   175253       } else {
   175254          return 1;
   175255       }
   175256    case 6: return 1;
   175257    case 5: return 1;
   175258    case 4:
   175259       if (devinfo->is_g4x) {
   175260          return 0;
   175261       } else {
   175262          return 0;
   175263       }
   175264    default:
   175265       unreachable("Invalid hardware generation");
   175266    }
   175267 }
   175268 
   175269 
   175270 
   175271 #define GEN10_PIPE_CONTROL_StallAtPixelScoreboard_start  33
   175272 #define GEN9_PIPE_CONTROL_StallAtPixelScoreboard_start  33
   175273 #define GEN8_PIPE_CONTROL_StallAtPixelScoreboard_start  33
   175274 #define GEN75_PIPE_CONTROL_StallAtPixelScoreboard_start  33
   175275 #define GEN7_PIPE_CONTROL_StallAtPixelScoreboard_start  33
   175276 #define GEN6_PIPE_CONTROL_StallAtPixelScoreboard_start  33
   175277 #define GEN5_PIPE_CONTROL_StallAtPixelScoreboard_start  33
   175278 
   175279 static inline uint32_t ATTRIBUTE_PURE
   175280 PIPE_CONTROL_StallAtPixelScoreboard_start(const struct gen_device_info *devinfo)
   175281 {
   175282    switch (devinfo->gen) {
   175283    case 10: return 33;
   175284    case 9: return 33;
   175285    case 8: return 33;
   175286    case 7:
   175287       if (devinfo->is_haswell) {
   175288          return 33;
   175289       } else {
   175290          return 33;
   175291       }
   175292    case 6: return 33;
   175293    case 5: return 33;
   175294    case 4:
   175295       if (devinfo->is_g4x) {
   175296          return 0;
   175297       } else {
   175298          return 0;
   175299       }
   175300    default:
   175301       unreachable("Invalid hardware generation");
   175302    }
   175303 }
   175304 
   175305 
   175306 
   175307 /* PIPE_CONTROL::State Cache Invalidation Enable */
   175308 
   175309 
   175310 #define GEN10_PIPE_CONTROL_StateCacheInvalidationEnable_bits  1
   175311 #define GEN9_PIPE_CONTROL_StateCacheInvalidationEnable_bits  1
   175312 #define GEN8_PIPE_CONTROL_StateCacheInvalidationEnable_bits  1
   175313 #define GEN75_PIPE_CONTROL_StateCacheInvalidationEnable_bits  1
   175314 #define GEN7_PIPE_CONTROL_StateCacheInvalidationEnable_bits  1
   175315 #define GEN6_PIPE_CONTROL_StateCacheInvalidationEnable_bits  1
   175316 
   175317 static inline uint32_t ATTRIBUTE_PURE
   175318 PIPE_CONTROL_StateCacheInvalidationEnable_bits(const struct gen_device_info *devinfo)
   175319 {
   175320    switch (devinfo->gen) {
   175321    case 10: return 1;
   175322    case 9: return 1;
   175323    case 8: return 1;
   175324    case 7:
   175325       if (devinfo->is_haswell) {
   175326          return 1;
   175327       } else {
   175328          return 1;
   175329       }
   175330    case 6: return 1;
   175331    case 5: return 0;
   175332    case 4:
   175333       if (devinfo->is_g4x) {
   175334          return 0;
   175335       } else {
   175336          return 0;
   175337       }
   175338    default:
   175339       unreachable("Invalid hardware generation");
   175340    }
   175341 }
   175342 
   175343 
   175344 
   175345 #define GEN10_PIPE_CONTROL_StateCacheInvalidationEnable_start  34
   175346 #define GEN9_PIPE_CONTROL_StateCacheInvalidationEnable_start  34
   175347 #define GEN8_PIPE_CONTROL_StateCacheInvalidationEnable_start  34
   175348 #define GEN75_PIPE_CONTROL_StateCacheInvalidationEnable_start  34
   175349 #define GEN7_PIPE_CONTROL_StateCacheInvalidationEnable_start  34
   175350 #define GEN6_PIPE_CONTROL_StateCacheInvalidationEnable_start  34
   175351 
   175352 static inline uint32_t ATTRIBUTE_PURE
   175353 PIPE_CONTROL_StateCacheInvalidationEnable_start(const struct gen_device_info *devinfo)
   175354 {
   175355    switch (devinfo->gen) {
   175356    case 10: return 34;
   175357    case 9: return 34;
   175358    case 8: return 34;
   175359    case 7:
   175360       if (devinfo->is_haswell) {
   175361          return 34;
   175362       } else {
   175363          return 34;
   175364       }
   175365    case 6: return 34;
   175366    case 5: return 0;
   175367    case 4:
   175368       if (devinfo->is_g4x) {
   175369          return 0;
   175370       } else {
   175371          return 0;
   175372       }
   175373    default:
   175374       unreachable("Invalid hardware generation");
   175375    }
   175376 }
   175377 
   175378 
   175379 
   175380 /* PIPE_CONTROL::Store Data Index */
   175381 
   175382 
   175383 #define GEN10_PIPE_CONTROL_StoreDataIndex_bits  1
   175384 #define GEN9_PIPE_CONTROL_StoreDataIndex_bits  1
   175385 #define GEN8_PIPE_CONTROL_StoreDataIndex_bits  1
   175386 #define GEN75_PIPE_CONTROL_StoreDataIndex_bits  1
   175387 #define GEN7_PIPE_CONTROL_StoreDataIndex_bits  1
   175388 #define GEN6_PIPE_CONTROL_StoreDataIndex_bits  1
   175389 
   175390 static inline uint32_t ATTRIBUTE_PURE
   175391 PIPE_CONTROL_StoreDataIndex_bits(const struct gen_device_info *devinfo)
   175392 {
   175393    switch (devinfo->gen) {
   175394    case 10: return 1;
   175395    case 9: return 1;
   175396    case 8: return 1;
   175397    case 7:
   175398       if (devinfo->is_haswell) {
   175399          return 1;
   175400       } else {
   175401          return 1;
   175402       }
   175403    case 6: return 1;
   175404    case 5: return 0;
   175405    case 4:
   175406       if (devinfo->is_g4x) {
   175407          return 0;
   175408       } else {
   175409          return 0;
   175410       }
   175411    default:
   175412       unreachable("Invalid hardware generation");
   175413    }
   175414 }
   175415 
   175416 
   175417 
   175418 #define GEN10_PIPE_CONTROL_StoreDataIndex_start  53
   175419 #define GEN9_PIPE_CONTROL_StoreDataIndex_start  53
   175420 #define GEN8_PIPE_CONTROL_StoreDataIndex_start  53
   175421 #define GEN75_PIPE_CONTROL_StoreDataIndex_start  53
   175422 #define GEN7_PIPE_CONTROL_StoreDataIndex_start  53
   175423 #define GEN6_PIPE_CONTROL_StoreDataIndex_start  53
   175424 
   175425 static inline uint32_t ATTRIBUTE_PURE
   175426 PIPE_CONTROL_StoreDataIndex_start(const struct gen_device_info *devinfo)
   175427 {
   175428    switch (devinfo->gen) {
   175429    case 10: return 53;
   175430    case 9: return 53;
   175431    case 8: return 53;
   175432    case 7:
   175433       if (devinfo->is_haswell) {
   175434          return 53;
   175435       } else {
   175436          return 53;
   175437       }
   175438    case 6: return 53;
   175439    case 5: return 0;
   175440    case 4:
   175441       if (devinfo->is_g4x) {
   175442          return 0;
   175443       } else {
   175444          return 0;
   175445       }
   175446    default:
   175447       unreachable("Invalid hardware generation");
   175448    }
   175449 }
   175450 
   175451 
   175452 
   175453 /* PIPE_CONTROL::Synchronize GFDT Surface */
   175454 
   175455 
   175456 #define GEN6_PIPE_CONTROL_SynchronizeGFDTSurface_bits  1
   175457 
   175458 static inline uint32_t ATTRIBUTE_PURE
   175459 PIPE_CONTROL_SynchronizeGFDTSurface_bits(const struct gen_device_info *devinfo)
   175460 {
   175461    switch (devinfo->gen) {
   175462    case 10: return 0;
   175463    case 9: return 0;
   175464    case 8: return 0;
   175465    case 7:
   175466       if (devinfo->is_haswell) {
   175467          return 0;
   175468       } else {
   175469          return 0;
   175470       }
   175471    case 6: return 1;
   175472    case 5: return 0;
   175473    case 4:
   175474       if (devinfo->is_g4x) {
   175475          return 0;
   175476       } else {
   175477          return 0;
   175478       }
   175479    default:
   175480       unreachable("Invalid hardware generation");
   175481    }
   175482 }
   175483 
   175484 
   175485 
   175486 #define GEN6_PIPE_CONTROL_SynchronizeGFDTSurface_start  49
   175487 
   175488 static inline uint32_t ATTRIBUTE_PURE
   175489 PIPE_CONTROL_SynchronizeGFDTSurface_start(const struct gen_device_info *devinfo)
   175490 {
   175491    switch (devinfo->gen) {
   175492    case 10: return 0;
   175493    case 9: return 0;
   175494    case 8: return 0;
   175495    case 7:
   175496       if (devinfo->is_haswell) {
   175497          return 0;
   175498       } else {
   175499          return 0;
   175500       }
   175501    case 6: return 49;
   175502    case 5: return 0;
   175503    case 4:
   175504       if (devinfo->is_g4x) {
   175505          return 0;
   175506       } else {
   175507          return 0;
   175508       }
   175509    default:
   175510       unreachable("Invalid hardware generation");
   175511    }
   175512 }
   175513 
   175514 
   175515 
   175516 /* PIPE_CONTROL::TLB Invalidate */
   175517 
   175518 
   175519 #define GEN10_PIPE_CONTROL_TLBInvalidate_bits  1
   175520 #define GEN9_PIPE_CONTROL_TLBInvalidate_bits  1
   175521 #define GEN8_PIPE_CONTROL_TLBInvalidate_bits  1
   175522 #define GEN75_PIPE_CONTROL_TLBInvalidate_bits  1
   175523 #define GEN7_PIPE_CONTROL_TLBInvalidate_bits  1
   175524 #define GEN6_PIPE_CONTROL_TLBInvalidate_bits  1
   175525 
   175526 static inline uint32_t ATTRIBUTE_PURE
   175527 PIPE_CONTROL_TLBInvalidate_bits(const struct gen_device_info *devinfo)
   175528 {
   175529    switch (devinfo->gen) {
   175530    case 10: return 1;
   175531    case 9: return 1;
   175532    case 8: return 1;
   175533    case 7:
   175534       if (devinfo->is_haswell) {
   175535          return 1;
   175536       } else {
   175537          return 1;
   175538       }
   175539    case 6: return 1;
   175540    case 5: return 0;
   175541    case 4:
   175542       if (devinfo->is_g4x) {
   175543          return 0;
   175544       } else {
   175545          return 0;
   175546       }
   175547    default:
   175548       unreachable("Invalid hardware generation");
   175549    }
   175550 }
   175551 
   175552 
   175553 
   175554 #define GEN10_PIPE_CONTROL_TLBInvalidate_start  50
   175555 #define GEN9_PIPE_CONTROL_TLBInvalidate_start  50
   175556 #define GEN8_PIPE_CONTROL_TLBInvalidate_start  50
   175557 #define GEN75_PIPE_CONTROL_TLBInvalidate_start  50
   175558 #define GEN7_PIPE_CONTROL_TLBInvalidate_start  50
   175559 #define GEN6_PIPE_CONTROL_TLBInvalidate_start  50
   175560 
   175561 static inline uint32_t ATTRIBUTE_PURE
   175562 PIPE_CONTROL_TLBInvalidate_start(const struct gen_device_info *devinfo)
   175563 {
   175564    switch (devinfo->gen) {
   175565    case 10: return 50;
   175566    case 9: return 50;
   175567    case 8: return 50;
   175568    case 7:
   175569       if (devinfo->is_haswell) {
   175570          return 50;
   175571       } else {
   175572          return 50;
   175573       }
   175574    case 6: return 50;
   175575    case 5: return 0;
   175576    case 4:
   175577       if (devinfo->is_g4x) {
   175578          return 0;
   175579       } else {
   175580          return 0;
   175581       }
   175582    default:
   175583       unreachable("Invalid hardware generation");
   175584    }
   175585 }
   175586 
   175587 
   175588 
   175589 /* PIPE_CONTROL::Texture Cache Flush Enable */
   175590 
   175591 
   175592 #define GEN5_PIPE_CONTROL_TextureCacheFlushEnable_bits  1
   175593 #define GEN45_PIPE_CONTROL_TextureCacheFlushEnable_bits  1
   175594 
   175595 static inline uint32_t ATTRIBUTE_PURE
   175596 PIPE_CONTROL_TextureCacheFlushEnable_bits(const struct gen_device_info *devinfo)
   175597 {
   175598    switch (devinfo->gen) {
   175599    case 10: return 0;
   175600    case 9: return 0;
   175601    case 8: return 0;
   175602    case 7:
   175603       if (devinfo->is_haswell) {
   175604          return 0;
   175605       } else {
   175606          return 0;
   175607       }
   175608    case 6: return 0;
   175609    case 5: return 1;
   175610    case 4:
   175611       if (devinfo->is_g4x) {
   175612          return 1;
   175613       } else {
   175614          return 0;
   175615       }
   175616    default:
   175617       unreachable("Invalid hardware generation");
   175618    }
   175619 }
   175620 
   175621 
   175622 
   175623 #define GEN5_PIPE_CONTROL_TextureCacheFlushEnable_start  10
   175624 #define GEN45_PIPE_CONTROL_TextureCacheFlushEnable_start  10
   175625 
   175626 static inline uint32_t ATTRIBUTE_PURE
   175627 PIPE_CONTROL_TextureCacheFlushEnable_start(const struct gen_device_info *devinfo)
   175628 {
   175629    switch (devinfo->gen) {
   175630    case 10: return 0;
   175631    case 9: return 0;
   175632    case 8: return 0;
   175633    case 7:
   175634       if (devinfo->is_haswell) {
   175635          return 0;
   175636       } else {
   175637          return 0;
   175638       }
   175639    case 6: return 0;
   175640    case 5: return 10;
   175641    case 4:
   175642       if (devinfo->is_g4x) {
   175643          return 10;
   175644       } else {
   175645          return 0;
   175646       }
   175647    default:
   175648       unreachable("Invalid hardware generation");
   175649    }
   175650 }
   175651 
   175652 
   175653 
   175654 /* PIPE_CONTROL::Texture Cache Invalidation Enable */
   175655 
   175656 
   175657 #define GEN10_PIPE_CONTROL_TextureCacheInvalidationEnable_bits  1
   175658 #define GEN9_PIPE_CONTROL_TextureCacheInvalidationEnable_bits  1
   175659 #define GEN8_PIPE_CONTROL_TextureCacheInvalidationEnable_bits  1
   175660 #define GEN75_PIPE_CONTROL_TextureCacheInvalidationEnable_bits  1
   175661 #define GEN7_PIPE_CONTROL_TextureCacheInvalidationEnable_bits  1
   175662 #define GEN6_PIPE_CONTROL_TextureCacheInvalidationEnable_bits  1
   175663 
   175664 static inline uint32_t ATTRIBUTE_PURE
   175665 PIPE_CONTROL_TextureCacheInvalidationEnable_bits(const struct gen_device_info *devinfo)
   175666 {
   175667    switch (devinfo->gen) {
   175668    case 10: return 1;
   175669    case 9: return 1;
   175670    case 8: return 1;
   175671    case 7:
   175672       if (devinfo->is_haswell) {
   175673          return 1;
   175674       } else {
   175675          return 1;
   175676       }
   175677    case 6: return 1;
   175678    case 5: return 0;
   175679    case 4:
   175680       if (devinfo->is_g4x) {
   175681          return 0;
   175682       } else {
   175683          return 0;
   175684       }
   175685    default:
   175686       unreachable("Invalid hardware generation");
   175687    }
   175688 }
   175689 
   175690 
   175691 
   175692 #define GEN10_PIPE_CONTROL_TextureCacheInvalidationEnable_start  42
   175693 #define GEN9_PIPE_CONTROL_TextureCacheInvalidationEnable_start  42
   175694 #define GEN8_PIPE_CONTROL_TextureCacheInvalidationEnable_start  42
   175695 #define GEN75_PIPE_CONTROL_TextureCacheInvalidationEnable_start  42
   175696 #define GEN7_PIPE_CONTROL_TextureCacheInvalidationEnable_start  42
   175697 #define GEN6_PIPE_CONTROL_TextureCacheInvalidationEnable_start  42
   175698 
   175699 static inline uint32_t ATTRIBUTE_PURE
   175700 PIPE_CONTROL_TextureCacheInvalidationEnable_start(const struct gen_device_info *devinfo)
   175701 {
   175702    switch (devinfo->gen) {
   175703    case 10: return 42;
   175704    case 9: return 42;
   175705    case 8: return 42;
   175706    case 7:
   175707       if (devinfo->is_haswell) {
   175708          return 42;
   175709       } else {
   175710          return 42;
   175711       }
   175712    case 6: return 42;
   175713    case 5: return 0;
   175714    case 4:
   175715       if (devinfo->is_g4x) {
   175716          return 0;
   175717       } else {
   175718          return 0;
   175719       }
   175720    default:
   175721       unreachable("Invalid hardware generation");
   175722    }
   175723 }
   175724 
   175725 
   175726 
   175727 /* PIPE_CONTROL::VF Cache Invalidation Enable */
   175728 
   175729 
   175730 #define GEN10_PIPE_CONTROL_VFCacheInvalidationEnable_bits  1
   175731 #define GEN9_PIPE_CONTROL_VFCacheInvalidationEnable_bits  1
   175732 #define GEN8_PIPE_CONTROL_VFCacheInvalidationEnable_bits  1
   175733 #define GEN75_PIPE_CONTROL_VFCacheInvalidationEnable_bits  1
   175734 #define GEN7_PIPE_CONTROL_VFCacheInvalidationEnable_bits  1
   175735 #define GEN6_PIPE_CONTROL_VFCacheInvalidationEnable_bits  1
   175736 
   175737 static inline uint32_t ATTRIBUTE_PURE
   175738 PIPE_CONTROL_VFCacheInvalidationEnable_bits(const struct gen_device_info *devinfo)
   175739 {
   175740    switch (devinfo->gen) {
   175741    case 10: return 1;
   175742    case 9: return 1;
   175743    case 8: return 1;
   175744    case 7:
   175745       if (devinfo->is_haswell) {
   175746          return 1;
   175747       } else {
   175748          return 1;
   175749       }
   175750    case 6: return 1;
   175751    case 5: return 0;
   175752    case 4:
   175753       if (devinfo->is_g4x) {
   175754          return 0;
   175755       } else {
   175756          return 0;
   175757       }
   175758    default:
   175759       unreachable("Invalid hardware generation");
   175760    }
   175761 }
   175762 
   175763 
   175764 
   175765 #define GEN10_PIPE_CONTROL_VFCacheInvalidationEnable_start  36
   175766 #define GEN9_PIPE_CONTROL_VFCacheInvalidationEnable_start  36
   175767 #define GEN8_PIPE_CONTROL_VFCacheInvalidationEnable_start  36
   175768 #define GEN75_PIPE_CONTROL_VFCacheInvalidationEnable_start  36
   175769 #define GEN7_PIPE_CONTROL_VFCacheInvalidationEnable_start  36
   175770 #define GEN6_PIPE_CONTROL_VFCacheInvalidationEnable_start  36
   175771 
   175772 static inline uint32_t ATTRIBUTE_PURE
   175773 PIPE_CONTROL_VFCacheInvalidationEnable_start(const struct gen_device_info *devinfo)
   175774 {
   175775    switch (devinfo->gen) {
   175776    case 10: return 36;
   175777    case 9: return 36;
   175778    case 8: return 36;
   175779    case 7:
   175780       if (devinfo->is_haswell) {
   175781          return 36;
   175782       } else {
   175783          return 36;
   175784       }
   175785    case 6: return 36;
   175786    case 5: return 0;
   175787    case 4:
   175788       if (devinfo->is_g4x) {
   175789          return 0;
   175790       } else {
   175791          return 0;
   175792       }
   175793    default:
   175794       unreachable("Invalid hardware generation");
   175795    }
   175796 }
   175797 
   175798 
   175799 
   175800 /* PIPE_CONTROL::Write Cache Flush */
   175801 
   175802 
   175803 #define GEN5_PIPE_CONTROL_WriteCacheFlush_bits  1
   175804 #define GEN45_PIPE_CONTROL_WriteCacheFlush_bits  1
   175805 #define GEN4_PIPE_CONTROL_WriteCacheFlush_bits  1
   175806 
   175807 static inline uint32_t ATTRIBUTE_PURE
   175808 PIPE_CONTROL_WriteCacheFlush_bits(const struct gen_device_info *devinfo)
   175809 {
   175810    switch (devinfo->gen) {
   175811    case 10: return 0;
   175812    case 9: return 0;
   175813    case 8: return 0;
   175814    case 7:
   175815       if (devinfo->is_haswell) {
   175816          return 0;
   175817       } else {
   175818          return 0;
   175819       }
   175820    case 6: return 0;
   175821    case 5: return 1;
   175822    case 4:
   175823       if (devinfo->is_g4x) {
   175824          return 1;
   175825       } else {
   175826          return 1;
   175827       }
   175828    default:
   175829       unreachable("Invalid hardware generation");
   175830    }
   175831 }
   175832 
   175833 
   175834 
   175835 #define GEN5_PIPE_CONTROL_WriteCacheFlush_start  12
   175836 #define GEN45_PIPE_CONTROL_WriteCacheFlush_start  12
   175837 #define GEN4_PIPE_CONTROL_WriteCacheFlush_start  12
   175838 
   175839 static inline uint32_t ATTRIBUTE_PURE
   175840 PIPE_CONTROL_WriteCacheFlush_start(const struct gen_device_info *devinfo)
   175841 {
   175842    switch (devinfo->gen) {
   175843    case 10: return 0;
   175844    case 9: return 0;
   175845    case 8: return 0;
   175846    case 7:
   175847       if (devinfo->is_haswell) {
   175848          return 0;
   175849       } else {
   175850          return 0;
   175851       }
   175852    case 6: return 0;
   175853    case 5: return 12;
   175854    case 4:
   175855       if (devinfo->is_g4x) {
   175856          return 12;
   175857       } else {
   175858          return 12;
   175859       }
   175860    default:
   175861       unreachable("Invalid hardware generation");
   175862    }
   175863 }
   175864 
   175865 
   175866 
   175867 /* PS_INVOCATION_COUNT */
   175868 
   175869 
   175870 #define GEN10_PS_INVOCATION_COUNT_length  2
   175871 #define GEN9_PS_INVOCATION_COUNT_length  2
   175872 #define GEN8_PS_INVOCATION_COUNT_length  2
   175873 #define GEN75_PS_INVOCATION_COUNT_length  2
   175874 #define GEN7_PS_INVOCATION_COUNT_length  2
   175875 
   175876 static inline uint32_t ATTRIBUTE_PURE
   175877 PS_INVOCATION_COUNT_length(const struct gen_device_info *devinfo)
   175878 {
   175879    switch (devinfo->gen) {
   175880    case 10: return 2;
   175881    case 9: return 2;
   175882    case 8: return 2;
   175883    case 7:
   175884       if (devinfo->is_haswell) {
   175885          return 2;
   175886       } else {
   175887          return 2;
   175888       }
   175889    case 6: return 0;
   175890    case 5: return 0;
   175891    case 4:
   175892       if (devinfo->is_g4x) {
   175893          return 0;
   175894       } else {
   175895          return 0;
   175896       }
   175897    default:
   175898       unreachable("Invalid hardware generation");
   175899    }
   175900 }
   175901 
   175902 
   175903 
   175904 /* PS_INVOCATION_COUNT::PS Invocation Count Report */
   175905 
   175906 
   175907 #define GEN10_PS_INVOCATION_COUNT_PSInvocationCountReport_bits  64
   175908 #define GEN9_PS_INVOCATION_COUNT_PSInvocationCountReport_bits  64
   175909 #define GEN8_PS_INVOCATION_COUNT_PSInvocationCountReport_bits  64
   175910 #define GEN75_PS_INVOCATION_COUNT_PSInvocationCountReport_bits  64
   175911 #define GEN7_PS_INVOCATION_COUNT_PSInvocationCountReport_bits  64
   175912 
   175913 static inline uint32_t ATTRIBUTE_PURE
   175914 PS_INVOCATION_COUNT_PSInvocationCountReport_bits(const struct gen_device_info *devinfo)
   175915 {
   175916    switch (devinfo->gen) {
   175917    case 10: return 64;
   175918    case 9: return 64;
   175919    case 8: return 64;
   175920    case 7:
   175921       if (devinfo->is_haswell) {
   175922          return 64;
   175923       } else {
   175924          return 64;
   175925       }
   175926    case 6: return 0;
   175927    case 5: return 0;
   175928    case 4:
   175929       if (devinfo->is_g4x) {
   175930          return 0;
   175931       } else {
   175932          return 0;
   175933       }
   175934    default:
   175935       unreachable("Invalid hardware generation");
   175936    }
   175937 }
   175938 
   175939 
   175940 
   175941 #define GEN10_PS_INVOCATION_COUNT_PSInvocationCountReport_start  0
   175942 #define GEN9_PS_INVOCATION_COUNT_PSInvocationCountReport_start  0
   175943 #define GEN8_PS_INVOCATION_COUNT_PSInvocationCountReport_start  0
   175944 #define GEN75_PS_INVOCATION_COUNT_PSInvocationCountReport_start  0
   175945 #define GEN7_PS_INVOCATION_COUNT_PSInvocationCountReport_start  0
   175946 
   175947 static inline uint32_t ATTRIBUTE_PURE
   175948 PS_INVOCATION_COUNT_PSInvocationCountReport_start(const struct gen_device_info *devinfo)
   175949 {
   175950    switch (devinfo->gen) {
   175951    case 10: return 0;
   175952    case 9: return 0;
   175953    case 8: return 0;
   175954    case 7:
   175955       if (devinfo->is_haswell) {
   175956          return 0;
   175957       } else {
   175958          return 0;
   175959       }
   175960    case 6: return 0;
   175961    case 5: return 0;
   175962    case 4:
   175963       if (devinfo->is_g4x) {
   175964          return 0;
   175965       } else {
   175966          return 0;
   175967       }
   175968    default:
   175969       unreachable("Invalid hardware generation");
   175970    }
   175971 }
   175972 
   175973 
   175974 
   175975 /* RCS_FAULT_REG */
   175976 
   175977 
   175978 #define GEN75_RCS_FAULT_REG_length  1
   175979 #define GEN7_RCS_FAULT_REG_length  1
   175980 #define GEN6_RCS_FAULT_REG_length  1
   175981 
   175982 static inline uint32_t ATTRIBUTE_PURE
   175983 RCS_FAULT_REG_length(const struct gen_device_info *devinfo)
   175984 {
   175985    switch (devinfo->gen) {
   175986    case 10: return 0;
   175987    case 9: return 0;
   175988    case 8: return 0;
   175989    case 7:
   175990       if (devinfo->is_haswell) {
   175991          return 1;
   175992       } else {
   175993          return 1;
   175994       }
   175995    case 6: return 1;
   175996    case 5: return 0;
   175997    case 4:
   175998       if (devinfo->is_g4x) {
   175999          return 0;
   176000       } else {
   176001          return 0;
   176002       }
   176003    default:
   176004       unreachable("Invalid hardware generation");
   176005    }
   176006 }
   176007 
   176008 
   176009 
   176010 /* RCS_FAULT_REG::Fault Type */
   176011 
   176012 
   176013 #define GEN75_RCS_FAULT_REG_FaultType_bits  2
   176014 #define GEN7_RCS_FAULT_REG_FaultType_bits  2
   176015 #define GEN6_RCS_FAULT_REG_FaultType_bits  2
   176016 
   176017 static inline uint32_t ATTRIBUTE_PURE
   176018 RCS_FAULT_REG_FaultType_bits(const struct gen_device_info *devinfo)
   176019 {
   176020    switch (devinfo->gen) {
   176021    case 10: return 0;
   176022    case 9: return 0;
   176023    case 8: return 0;
   176024    case 7:
   176025       if (devinfo->is_haswell) {
   176026          return 2;
   176027       } else {
   176028          return 2;
   176029       }
   176030    case 6: return 2;
   176031    case 5: return 0;
   176032    case 4:
   176033       if (devinfo->is_g4x) {
   176034          return 0;
   176035       } else {
   176036          return 0;
   176037       }
   176038    default:
   176039       unreachable("Invalid hardware generation");
   176040    }
   176041 }
   176042 
   176043 
   176044 
   176045 #define GEN75_RCS_FAULT_REG_FaultType_start  1
   176046 #define GEN7_RCS_FAULT_REG_FaultType_start  1
   176047 #define GEN6_RCS_FAULT_REG_FaultType_start  1
   176048 
   176049 static inline uint32_t ATTRIBUTE_PURE
   176050 RCS_FAULT_REG_FaultType_start(const struct gen_device_info *devinfo)
   176051 {
   176052    switch (devinfo->gen) {
   176053    case 10: return 0;
   176054    case 9: return 0;
   176055    case 8: return 0;
   176056    case 7:
   176057       if (devinfo->is_haswell) {
   176058          return 1;
   176059       } else {
   176060          return 1;
   176061       }
   176062    case 6: return 1;
   176063    case 5: return 0;
   176064    case 4:
   176065       if (devinfo->is_g4x) {
   176066          return 0;
   176067       } else {
   176068          return 0;
   176069       }
   176070    default:
   176071       unreachable("Invalid hardware generation");
   176072    }
   176073 }
   176074 
   176075 
   176076 
   176077 /* RCS_FAULT_REG::GTTSEL */
   176078 
   176079 
   176080 #define GEN75_RCS_FAULT_REG_GTTSEL_bits  -9
   176081 #define GEN7_RCS_FAULT_REG_GTTSEL_bits  -9
   176082 #define GEN6_RCS_FAULT_REG_GTTSEL_bits  -9
   176083 
   176084 static inline uint32_t ATTRIBUTE_PURE
   176085 RCS_FAULT_REG_GTTSEL_bits(const struct gen_device_info *devinfo)
   176086 {
   176087    switch (devinfo->gen) {
   176088    case 10: return 0;
   176089    case 9: return 0;
   176090    case 8: return 0;
   176091    case 7:
   176092       if (devinfo->is_haswell) {
   176093          return -9;
   176094       } else {
   176095          return -9;
   176096       }
   176097    case 6: return -9;
   176098    case 5: return 0;
   176099    case 4:
   176100       if (devinfo->is_g4x) {
   176101          return 0;
   176102       } else {
   176103          return 0;
   176104       }
   176105    default:
   176106       unreachable("Invalid hardware generation");
   176107    }
   176108 }
   176109 
   176110 
   176111 
   176112 #define GEN75_RCS_FAULT_REG_GTTSEL_start  11
   176113 #define GEN7_RCS_FAULT_REG_GTTSEL_start  11
   176114 #define GEN6_RCS_FAULT_REG_GTTSEL_start  11
   176115 
   176116 static inline uint32_t ATTRIBUTE_PURE
   176117 RCS_FAULT_REG_GTTSEL_start(const struct gen_device_info *devinfo)
   176118 {
   176119    switch (devinfo->gen) {
   176120    case 10: return 0;
   176121    case 9: return 0;
   176122    case 8: return 0;
   176123    case 7:
   176124       if (devinfo->is_haswell) {
   176125          return 11;
   176126       } else {
   176127          return 11;
   176128       }
   176129    case 6: return 11;
   176130    case 5: return 0;
   176131    case 4:
   176132       if (devinfo->is_g4x) {
   176133          return 0;
   176134       } else {
   176135          return 0;
   176136       }
   176137    default:
   176138       unreachable("Invalid hardware generation");
   176139    }
   176140 }
   176141 
   176142 
   176143 
   176144 /* RCS_FAULT_REG::SRCID of Fault */
   176145 
   176146 
   176147 #define GEN75_RCS_FAULT_REG_SRCIDofFault_bits  8
   176148 #define GEN7_RCS_FAULT_REG_SRCIDofFault_bits  8
   176149 #define GEN6_RCS_FAULT_REG_SRCIDofFault_bits  8
   176150 
   176151 static inline uint32_t ATTRIBUTE_PURE
   176152 RCS_FAULT_REG_SRCIDofFault_bits(const struct gen_device_info *devinfo)
   176153 {
   176154    switch (devinfo->gen) {
   176155    case 10: return 0;
   176156    case 9: return 0;
   176157    case 8: return 0;
   176158    case 7:
   176159       if (devinfo->is_haswell) {
   176160          return 8;
   176161       } else {
   176162          return 8;
   176163       }
   176164    case 6: return 8;
   176165    case 5: return 0;
   176166    case 4:
   176167       if (devinfo->is_g4x) {
   176168          return 0;
   176169       } else {
   176170          return 0;
   176171       }
   176172    default:
   176173       unreachable("Invalid hardware generation");
   176174    }
   176175 }
   176176 
   176177 
   176178 
   176179 #define GEN75_RCS_FAULT_REG_SRCIDofFault_start  3
   176180 #define GEN7_RCS_FAULT_REG_SRCIDofFault_start  3
   176181 #define GEN6_RCS_FAULT_REG_SRCIDofFault_start  3
   176182 
   176183 static inline uint32_t ATTRIBUTE_PURE
   176184 RCS_FAULT_REG_SRCIDofFault_start(const struct gen_device_info *devinfo)
   176185 {
   176186    switch (devinfo->gen) {
   176187    case 10: return 0;
   176188    case 9: return 0;
   176189    case 8: return 0;
   176190    case 7:
   176191       if (devinfo->is_haswell) {
   176192          return 3;
   176193       } else {
   176194          return 3;
   176195       }
   176196    case 6: return 3;
   176197    case 5: return 0;
   176198    case 4:
   176199       if (devinfo->is_g4x) {
   176200          return 0;
   176201       } else {
   176202          return 0;
   176203       }
   176204    default:
   176205       unreachable("Invalid hardware generation");
   176206    }
   176207 }
   176208 
   176209 
   176210 
   176211 /* RCS_FAULT_REG::Valid Bit */
   176212 
   176213 
   176214 #define GEN75_RCS_FAULT_REG_ValidBit_bits  1
   176215 #define GEN7_RCS_FAULT_REG_ValidBit_bits  1
   176216 #define GEN6_RCS_FAULT_REG_ValidBit_bits  1
   176217 
   176218 static inline uint32_t ATTRIBUTE_PURE
   176219 RCS_FAULT_REG_ValidBit_bits(const struct gen_device_info *devinfo)
   176220 {
   176221    switch (devinfo->gen) {
   176222    case 10: return 0;
   176223    case 9: return 0;
   176224    case 8: return 0;
   176225    case 7:
   176226       if (devinfo->is_haswell) {
   176227          return 1;
   176228       } else {
   176229          return 1;
   176230       }
   176231    case 6: return 1;
   176232    case 5: return 0;
   176233    case 4:
   176234       if (devinfo->is_g4x) {
   176235          return 0;
   176236       } else {
   176237          return 0;
   176238       }
   176239    default:
   176240       unreachable("Invalid hardware generation");
   176241    }
   176242 }
   176243 
   176244 
   176245 
   176246 #define GEN75_RCS_FAULT_REG_ValidBit_start  0
   176247 #define GEN7_RCS_FAULT_REG_ValidBit_start  0
   176248 #define GEN6_RCS_FAULT_REG_ValidBit_start  0
   176249 
   176250 static inline uint32_t ATTRIBUTE_PURE
   176251 RCS_FAULT_REG_ValidBit_start(const struct gen_device_info *devinfo)
   176252 {
   176253    switch (devinfo->gen) {
   176254    case 10: return 0;
   176255    case 9: return 0;
   176256    case 8: return 0;
   176257    case 7:
   176258       if (devinfo->is_haswell) {
   176259          return 0;
   176260       } else {
   176261          return 0;
   176262       }
   176263    case 6: return 0;
   176264    case 5: return 0;
   176265    case 4:
   176266       if (devinfo->is_g4x) {
   176267          return 0;
   176268       } else {
   176269          return 0;
   176270       }
   176271    default:
   176272       unreachable("Invalid hardware generation");
   176273    }
   176274 }
   176275 
   176276 
   176277 
   176278 /* RCS_FAULT_REG::Virtual Address of Fault */
   176279 
   176280 
   176281 #define GEN75_RCS_FAULT_REG_VirtualAddressofFault_bits  20
   176282 #define GEN7_RCS_FAULT_REG_VirtualAddressofFault_bits  20
   176283 #define GEN6_RCS_FAULT_REG_VirtualAddressofFault_bits  20
   176284 
   176285 static inline uint32_t ATTRIBUTE_PURE
   176286 RCS_FAULT_REG_VirtualAddressofFault_bits(const struct gen_device_info *devinfo)
   176287 {
   176288    switch (devinfo->gen) {
   176289    case 10: return 0;
   176290    case 9: return 0;
   176291    case 8: return 0;
   176292    case 7:
   176293       if (devinfo->is_haswell) {
   176294          return 20;
   176295       } else {
   176296          return 20;
   176297       }
   176298    case 6: return 20;
   176299    case 5: return 0;
   176300    case 4:
   176301       if (devinfo->is_g4x) {
   176302          return 0;
   176303       } else {
   176304          return 0;
   176305       }
   176306    default:
   176307       unreachable("Invalid hardware generation");
   176308    }
   176309 }
   176310 
   176311 
   176312 
   176313 #define GEN75_RCS_FAULT_REG_VirtualAddressofFault_start  12
   176314 #define GEN7_RCS_FAULT_REG_VirtualAddressofFault_start  12
   176315 #define GEN6_RCS_FAULT_REG_VirtualAddressofFault_start  12
   176316 
   176317 static inline uint32_t ATTRIBUTE_PURE
   176318 RCS_FAULT_REG_VirtualAddressofFault_start(const struct gen_device_info *devinfo)
   176319 {
   176320    switch (devinfo->gen) {
   176321    case 10: return 0;
   176322    case 9: return 0;
   176323    case 8: return 0;
   176324    case 7:
   176325       if (devinfo->is_haswell) {
   176326          return 12;
   176327       } else {
   176328          return 12;
   176329       }
   176330    case 6: return 12;
   176331    case 5: return 0;
   176332    case 4:
   176333       if (devinfo->is_g4x) {
   176334          return 0;
   176335       } else {
   176336          return 0;
   176337       }
   176338    default:
   176339       unreachable("Invalid hardware generation");
   176340    }
   176341 }
   176342 
   176343 
   176344 
   176345 /* RCS_RING_BUFFER_CTL */
   176346 
   176347 
   176348 #define GEN9_RCS_RING_BUFFER_CTL_length  1
   176349 #define GEN8_RCS_RING_BUFFER_CTL_length  1
   176350 #define GEN75_RCS_RING_BUFFER_CTL_length  1
   176351 #define GEN7_RCS_RING_BUFFER_CTL_length  1
   176352 #define GEN6_RCS_RING_BUFFER_CTL_length  1
   176353 
   176354 static inline uint32_t ATTRIBUTE_PURE
   176355 RCS_RING_BUFFER_CTL_length(const struct gen_device_info *devinfo)
   176356 {
   176357    switch (devinfo->gen) {
   176358    case 10: return 0;
   176359    case 9: return 1;
   176360    case 8: return 1;
   176361    case 7:
   176362       if (devinfo->is_haswell) {
   176363          return 1;
   176364       } else {
   176365          return 1;
   176366       }
   176367    case 6: return 1;
   176368    case 5: return 0;
   176369    case 4:
   176370       if (devinfo->is_g4x) {
   176371          return 0;
   176372       } else {
   176373          return 0;
   176374       }
   176375    default:
   176376       unreachable("Invalid hardware generation");
   176377    }
   176378 }
   176379 
   176380 
   176381 
   176382 /* RCS_RING_BUFFER_CTL::Automatic Report Head Pointer */
   176383 
   176384 
   176385 #define GEN9_RCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits  2
   176386 #define GEN8_RCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits  2
   176387 #define GEN75_RCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits  2
   176388 #define GEN7_RCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits  2
   176389 #define GEN6_RCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits  2
   176390 
   176391 static inline uint32_t ATTRIBUTE_PURE
   176392 RCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits(const struct gen_device_info *devinfo)
   176393 {
   176394    switch (devinfo->gen) {
   176395    case 10: return 0;
   176396    case 9: return 2;
   176397    case 8: return 2;
   176398    case 7:
   176399       if (devinfo->is_haswell) {
   176400          return 2;
   176401       } else {
   176402          return 2;
   176403       }
   176404    case 6: return 2;
   176405    case 5: return 0;
   176406    case 4:
   176407       if (devinfo->is_g4x) {
   176408          return 0;
   176409       } else {
   176410          return 0;
   176411       }
   176412    default:
   176413       unreachable("Invalid hardware generation");
   176414    }
   176415 }
   176416 
   176417 
   176418 
   176419 #define GEN9_RCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start  1
   176420 #define GEN8_RCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start  1
   176421 #define GEN75_RCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start  1
   176422 #define GEN7_RCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start  1
   176423 #define GEN6_RCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start  1
   176424 
   176425 static inline uint32_t ATTRIBUTE_PURE
   176426 RCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start(const struct gen_device_info *devinfo)
   176427 {
   176428    switch (devinfo->gen) {
   176429    case 10: return 0;
   176430    case 9: return 1;
   176431    case 8: return 1;
   176432    case 7:
   176433       if (devinfo->is_haswell) {
   176434          return 1;
   176435       } else {
   176436          return 1;
   176437       }
   176438    case 6: return 1;
   176439    case 5: return 0;
   176440    case 4:
   176441       if (devinfo->is_g4x) {
   176442          return 0;
   176443       } else {
   176444          return 0;
   176445       }
   176446    default:
   176447       unreachable("Invalid hardware generation");
   176448    }
   176449 }
   176450 
   176451 
   176452 
   176453 /* RCS_RING_BUFFER_CTL::Buffer Length (in pages - 1) */
   176454 
   176455 
   176456 #define GEN9_RCS_RING_BUFFER_CTL_BufferLengthinpages1_bits  9
   176457 #define GEN8_RCS_RING_BUFFER_CTL_BufferLengthinpages1_bits  9
   176458 #define GEN75_RCS_RING_BUFFER_CTL_BufferLengthinpages1_bits  9
   176459 #define GEN7_RCS_RING_BUFFER_CTL_BufferLengthinpages1_bits  9
   176460 #define GEN6_RCS_RING_BUFFER_CTL_BufferLengthinpages1_bits  9
   176461 
   176462 static inline uint32_t ATTRIBUTE_PURE
   176463 RCS_RING_BUFFER_CTL_BufferLengthinpages1_bits(const struct gen_device_info *devinfo)
   176464 {
   176465    switch (devinfo->gen) {
   176466    case 10: return 0;
   176467    case 9: return 9;
   176468    case 8: return 9;
   176469    case 7:
   176470       if (devinfo->is_haswell) {
   176471          return 9;
   176472       } else {
   176473          return 9;
   176474       }
   176475    case 6: return 9;
   176476    case 5: return 0;
   176477    case 4:
   176478       if (devinfo->is_g4x) {
   176479          return 0;
   176480       } else {
   176481          return 0;
   176482       }
   176483    default:
   176484       unreachable("Invalid hardware generation");
   176485    }
   176486 }
   176487 
   176488 
   176489 
   176490 #define GEN9_RCS_RING_BUFFER_CTL_BufferLengthinpages1_start  12
   176491 #define GEN8_RCS_RING_BUFFER_CTL_BufferLengthinpages1_start  12
   176492 #define GEN75_RCS_RING_BUFFER_CTL_BufferLengthinpages1_start  12
   176493 #define GEN7_RCS_RING_BUFFER_CTL_BufferLengthinpages1_start  12
   176494 #define GEN6_RCS_RING_BUFFER_CTL_BufferLengthinpages1_start  12
   176495 
   176496 static inline uint32_t ATTRIBUTE_PURE
   176497 RCS_RING_BUFFER_CTL_BufferLengthinpages1_start(const struct gen_device_info *devinfo)
   176498 {
   176499    switch (devinfo->gen) {
   176500    case 10: return 0;
   176501    case 9: return 12;
   176502    case 8: return 12;
   176503    case 7:
   176504       if (devinfo->is_haswell) {
   176505          return 12;
   176506       } else {
   176507          return 12;
   176508       }
   176509    case 6: return 12;
   176510    case 5: return 0;
   176511    case 4:
   176512       if (devinfo->is_g4x) {
   176513          return 0;
   176514       } else {
   176515          return 0;
   176516       }
   176517    default:
   176518       unreachable("Invalid hardware generation");
   176519    }
   176520 }
   176521 
   176522 
   176523 
   176524 /* RCS_RING_BUFFER_CTL::RBWait */
   176525 
   176526 
   176527 #define GEN9_RCS_RING_BUFFER_CTL_RBWait_bits  1
   176528 #define GEN8_RCS_RING_BUFFER_CTL_RBWait_bits  1
   176529 #define GEN75_RCS_RING_BUFFER_CTL_RBWait_bits  1
   176530 #define GEN7_RCS_RING_BUFFER_CTL_RBWait_bits  1
   176531 #define GEN6_RCS_RING_BUFFER_CTL_RBWait_bits  1
   176532 
   176533 static inline uint32_t ATTRIBUTE_PURE
   176534 RCS_RING_BUFFER_CTL_RBWait_bits(const struct gen_device_info *devinfo)
   176535 {
   176536    switch (devinfo->gen) {
   176537    case 10: return 0;
   176538    case 9: return 1;
   176539    case 8: return 1;
   176540    case 7:
   176541       if (devinfo->is_haswell) {
   176542          return 1;
   176543       } else {
   176544          return 1;
   176545       }
   176546    case 6: return 1;
   176547    case 5: return 0;
   176548    case 4:
   176549       if (devinfo->is_g4x) {
   176550          return 0;
   176551       } else {
   176552          return 0;
   176553       }
   176554    default:
   176555       unreachable("Invalid hardware generation");
   176556    }
   176557 }
   176558 
   176559 
   176560 
   176561 #define GEN9_RCS_RING_BUFFER_CTL_RBWait_start  11
   176562 #define GEN8_RCS_RING_BUFFER_CTL_RBWait_start  11
   176563 #define GEN75_RCS_RING_BUFFER_CTL_RBWait_start  11
   176564 #define GEN7_RCS_RING_BUFFER_CTL_RBWait_start  11
   176565 #define GEN6_RCS_RING_BUFFER_CTL_RBWait_start  11
   176566 
   176567 static inline uint32_t ATTRIBUTE_PURE
   176568 RCS_RING_BUFFER_CTL_RBWait_start(const struct gen_device_info *devinfo)
   176569 {
   176570    switch (devinfo->gen) {
   176571    case 10: return 0;
   176572    case 9: return 11;
   176573    case 8: return 11;
   176574    case 7:
   176575       if (devinfo->is_haswell) {
   176576          return 11;
   176577       } else {
   176578          return 11;
   176579       }
   176580    case 6: return 11;
   176581    case 5: return 0;
   176582    case 4:
   176583       if (devinfo->is_g4x) {
   176584          return 0;
   176585       } else {
   176586          return 0;
   176587       }
   176588    default:
   176589       unreachable("Invalid hardware generation");
   176590    }
   176591 }
   176592 
   176593 
   176594 
   176595 /* RCS_RING_BUFFER_CTL::Ring Buffer Enable */
   176596 
   176597 
   176598 #define GEN9_RCS_RING_BUFFER_CTL_RingBufferEnable_bits  1
   176599 #define GEN8_RCS_RING_BUFFER_CTL_RingBufferEnable_bits  1
   176600 #define GEN75_RCS_RING_BUFFER_CTL_RingBufferEnable_bits  1
   176601 #define GEN7_RCS_RING_BUFFER_CTL_RingBufferEnable_bits  1
   176602 #define GEN6_RCS_RING_BUFFER_CTL_RingBufferEnable_bits  1
   176603 
   176604 static inline uint32_t ATTRIBUTE_PURE
   176605 RCS_RING_BUFFER_CTL_RingBufferEnable_bits(const struct gen_device_info *devinfo)
   176606 {
   176607    switch (devinfo->gen) {
   176608    case 10: return 0;
   176609    case 9: return 1;
   176610    case 8: return 1;
   176611    case 7:
   176612       if (devinfo->is_haswell) {
   176613          return 1;
   176614       } else {
   176615          return 1;
   176616       }
   176617    case 6: return 1;
   176618    case 5: return 0;
   176619    case 4:
   176620       if (devinfo->is_g4x) {
   176621          return 0;
   176622       } else {
   176623          return 0;
   176624       }
   176625    default:
   176626       unreachable("Invalid hardware generation");
   176627    }
   176628 }
   176629 
   176630 
   176631 
   176632 #define GEN9_RCS_RING_BUFFER_CTL_RingBufferEnable_start  0
   176633 #define GEN8_RCS_RING_BUFFER_CTL_RingBufferEnable_start  0
   176634 #define GEN75_RCS_RING_BUFFER_CTL_RingBufferEnable_start  0
   176635 #define GEN7_RCS_RING_BUFFER_CTL_RingBufferEnable_start  0
   176636 #define GEN6_RCS_RING_BUFFER_CTL_RingBufferEnable_start  0
   176637 
   176638 static inline uint32_t ATTRIBUTE_PURE
   176639 RCS_RING_BUFFER_CTL_RingBufferEnable_start(const struct gen_device_info *devinfo)
   176640 {
   176641    switch (devinfo->gen) {
   176642    case 10: return 0;
   176643    case 9: return 0;
   176644    case 8: return 0;
   176645    case 7:
   176646       if (devinfo->is_haswell) {
   176647          return 0;
   176648       } else {
   176649          return 0;
   176650       }
   176651    case 6: return 0;
   176652    case 5: return 0;
   176653    case 4:
   176654       if (devinfo->is_g4x) {
   176655          return 0;
   176656       } else {
   176657          return 0;
   176658       }
   176659    default:
   176660       unreachable("Invalid hardware generation");
   176661    }
   176662 }
   176663 
   176664 
   176665 
   176666 /* RCS_RING_BUFFER_CTL::Semaphore Wait */
   176667 
   176668 
   176669 #define GEN9_RCS_RING_BUFFER_CTL_SemaphoreWait_bits  1
   176670 #define GEN8_RCS_RING_BUFFER_CTL_SemaphoreWait_bits  1
   176671 #define GEN75_RCS_RING_BUFFER_CTL_SemaphoreWait_bits  1
   176672 #define GEN7_RCS_RING_BUFFER_CTL_SemaphoreWait_bits  1
   176673 #define GEN6_RCS_RING_BUFFER_CTL_SemaphoreWait_bits  1
   176674 
   176675 static inline uint32_t ATTRIBUTE_PURE
   176676 RCS_RING_BUFFER_CTL_SemaphoreWait_bits(const struct gen_device_info *devinfo)
   176677 {
   176678    switch (devinfo->gen) {
   176679    case 10: return 0;
   176680    case 9: return 1;
   176681    case 8: return 1;
   176682    case 7:
   176683       if (devinfo->is_haswell) {
   176684          return 1;
   176685       } else {
   176686          return 1;
   176687       }
   176688    case 6: return 1;
   176689    case 5: return 0;
   176690    case 4:
   176691       if (devinfo->is_g4x) {
   176692          return 0;
   176693       } else {
   176694          return 0;
   176695       }
   176696    default:
   176697       unreachable("Invalid hardware generation");
   176698    }
   176699 }
   176700 
   176701 
   176702 
   176703 #define GEN9_RCS_RING_BUFFER_CTL_SemaphoreWait_start  10
   176704 #define GEN8_RCS_RING_BUFFER_CTL_SemaphoreWait_start  10
   176705 #define GEN75_RCS_RING_BUFFER_CTL_SemaphoreWait_start  10
   176706 #define GEN7_RCS_RING_BUFFER_CTL_SemaphoreWait_start  10
   176707 #define GEN6_RCS_RING_BUFFER_CTL_SemaphoreWait_start  10
   176708 
   176709 static inline uint32_t ATTRIBUTE_PURE
   176710 RCS_RING_BUFFER_CTL_SemaphoreWait_start(const struct gen_device_info *devinfo)
   176711 {
   176712    switch (devinfo->gen) {
   176713    case 10: return 0;
   176714    case 9: return 10;
   176715    case 8: return 10;
   176716    case 7:
   176717       if (devinfo->is_haswell) {
   176718          return 10;
   176719       } else {
   176720          return 10;
   176721       }
   176722    case 6: return 10;
   176723    case 5: return 0;
   176724    case 4:
   176725       if (devinfo->is_g4x) {
   176726          return 0;
   176727       } else {
   176728          return 0;
   176729       }
   176730    default:
   176731       unreachable("Invalid hardware generation");
   176732    }
   176733 }
   176734 
   176735 
   176736 
   176737 /* RENDER_SURFACE_STATE */
   176738 
   176739 
   176740 #define GEN10_RENDER_SURFACE_STATE_length  16
   176741 #define GEN9_RENDER_SURFACE_STATE_length  16
   176742 #define GEN8_RENDER_SURFACE_STATE_length  16
   176743 #define GEN75_RENDER_SURFACE_STATE_length  8
   176744 #define GEN7_RENDER_SURFACE_STATE_length  8
   176745 #define GEN6_RENDER_SURFACE_STATE_length  6
   176746 #define GEN5_RENDER_SURFACE_STATE_length  6
   176747 #define GEN45_RENDER_SURFACE_STATE_length  6
   176748 #define GEN4_RENDER_SURFACE_STATE_length  5
   176749 
   176750 static inline uint32_t ATTRIBUTE_PURE
   176751 RENDER_SURFACE_STATE_length(const struct gen_device_info *devinfo)
   176752 {
   176753    switch (devinfo->gen) {
   176754    case 10: return 16;
   176755    case 9: return 16;
   176756    case 8: return 16;
   176757    case 7:
   176758       if (devinfo->is_haswell) {
   176759          return 8;
   176760       } else {
   176761          return 8;
   176762       }
   176763    case 6: return 6;
   176764    case 5: return 6;
   176765    case 4:
   176766       if (devinfo->is_g4x) {
   176767          return 6;
   176768       } else {
   176769          return 5;
   176770       }
   176771    default:
   176772       unreachable("Invalid hardware generation");
   176773    }
   176774 }
   176775 
   176776 
   176777 
   176778 /* RENDER_SURFACE_STATE::Alpha Clear Color */
   176779 
   176780 
   176781 #define GEN10_RENDER_SURFACE_STATE_AlphaClearColor_bits  32
   176782 #define GEN9_RENDER_SURFACE_STATE_AlphaClearColor_bits  32
   176783 #define GEN8_RENDER_SURFACE_STATE_AlphaClearColor_bits  1
   176784 #define GEN75_RENDER_SURFACE_STATE_AlphaClearColor_bits  1
   176785 #define GEN7_RENDER_SURFACE_STATE_AlphaClearColor_bits  1
   176786 
   176787 static inline uint32_t ATTRIBUTE_PURE
   176788 RENDER_SURFACE_STATE_AlphaClearColor_bits(const struct gen_device_info *devinfo)
   176789 {
   176790    switch (devinfo->gen) {
   176791    case 10: return 32;
   176792    case 9: return 32;
   176793    case 8: return 1;
   176794    case 7:
   176795       if (devinfo->is_haswell) {
   176796          return 1;
   176797       } else {
   176798          return 1;
   176799       }
   176800    case 6: return 0;
   176801    case 5: return 0;
   176802    case 4:
   176803       if (devinfo->is_g4x) {
   176804          return 0;
   176805       } else {
   176806          return 0;
   176807       }
   176808    default:
   176809       unreachable("Invalid hardware generation");
   176810    }
   176811 }
   176812 
   176813 
   176814 
   176815 #define GEN10_RENDER_SURFACE_STATE_AlphaClearColor_start  480
   176816 #define GEN9_RENDER_SURFACE_STATE_AlphaClearColor_start  480
   176817 #define GEN8_RENDER_SURFACE_STATE_AlphaClearColor_start  252
   176818 #define GEN75_RENDER_SURFACE_STATE_AlphaClearColor_start  252
   176819 #define GEN7_RENDER_SURFACE_STATE_AlphaClearColor_start  252
   176820 
   176821 static inline uint32_t ATTRIBUTE_PURE
   176822 RENDER_SURFACE_STATE_AlphaClearColor_start(const struct gen_device_info *devinfo)
   176823 {
   176824    switch (devinfo->gen) {
   176825    case 10: return 480;
   176826    case 9: return 480;
   176827    case 8: return 252;
   176828    case 7:
   176829       if (devinfo->is_haswell) {
   176830          return 252;
   176831       } else {
   176832          return 252;
   176833       }
   176834    case 6: return 0;
   176835    case 5: return 0;
   176836    case 4:
   176837       if (devinfo->is_g4x) {
   176838          return 0;
   176839       } else {
   176840          return 0;
   176841       }
   176842    default:
   176843       unreachable("Invalid hardware generation");
   176844    }
   176845 }
   176846 
   176847 
   176848 
   176849 /* RENDER_SURFACE_STATE::Append Counter Address */
   176850 
   176851 
   176852 #define GEN75_RENDER_SURFACE_STATE_AppendCounterAddress_bits  26
   176853 #define GEN7_RENDER_SURFACE_STATE_AppendCounterAddress_bits  26
   176854 
   176855 static inline uint32_t ATTRIBUTE_PURE
   176856 RENDER_SURFACE_STATE_AppendCounterAddress_bits(const struct gen_device_info *devinfo)
   176857 {
   176858    switch (devinfo->gen) {
   176859    case 10: return 0;
   176860    case 9: return 0;
   176861    case 8: return 0;
   176862    case 7:
   176863       if (devinfo->is_haswell) {
   176864          return 26;
   176865       } else {
   176866          return 26;
   176867       }
   176868    case 6: return 0;
   176869    case 5: return 0;
   176870    case 4:
   176871       if (devinfo->is_g4x) {
   176872          return 0;
   176873       } else {
   176874          return 0;
   176875       }
   176876    default:
   176877       unreachable("Invalid hardware generation");
   176878    }
   176879 }
   176880 
   176881 
   176882 
   176883 #define GEN75_RENDER_SURFACE_STATE_AppendCounterAddress_start  198
   176884 #define GEN7_RENDER_SURFACE_STATE_AppendCounterAddress_start  198
   176885 
   176886 static inline uint32_t ATTRIBUTE_PURE
   176887 RENDER_SURFACE_STATE_AppendCounterAddress_start(const struct gen_device_info *devinfo)
   176888 {
   176889    switch (devinfo->gen) {
   176890    case 10: return 0;
   176891    case 9: return 0;
   176892    case 8: return 0;
   176893    case 7:
   176894       if (devinfo->is_haswell) {
   176895          return 198;
   176896       } else {
   176897          return 198;
   176898       }
   176899    case 6: return 0;
   176900    case 5: return 0;
   176901    case 4:
   176902       if (devinfo->is_g4x) {
   176903          return 0;
   176904       } else {
   176905          return 0;
   176906       }
   176907    default:
   176908       unreachable("Invalid hardware generation");
   176909    }
   176910 }
   176911 
   176912 
   176913 
   176914 /* RENDER_SURFACE_STATE::Append Counter Enable */
   176915 
   176916 
   176917 #define GEN75_RENDER_SURFACE_STATE_AppendCounterEnable_bits  1
   176918 #define GEN7_RENDER_SURFACE_STATE_AppendCounterEnable_bits  1
   176919 
   176920 static inline uint32_t ATTRIBUTE_PURE
   176921 RENDER_SURFACE_STATE_AppendCounterEnable_bits(const struct gen_device_info *devinfo)
   176922 {
   176923    switch (devinfo->gen) {
   176924    case 10: return 0;
   176925    case 9: return 0;
   176926    case 8: return 0;
   176927    case 7:
   176928       if (devinfo->is_haswell) {
   176929          return 1;
   176930       } else {
   176931          return 1;
   176932       }
   176933    case 6: return 0;
   176934    case 5: return 0;
   176935    case 4:
   176936       if (devinfo->is_g4x) {
   176937          return 0;
   176938       } else {
   176939          return 0;
   176940       }
   176941    default:
   176942       unreachable("Invalid hardware generation");
   176943    }
   176944 }
   176945 
   176946 
   176947 
   176948 #define GEN75_RENDER_SURFACE_STATE_AppendCounterEnable_start  193
   176949 #define GEN7_RENDER_SURFACE_STATE_AppendCounterEnable_start  193
   176950 
   176951 static inline uint32_t ATTRIBUTE_PURE
   176952 RENDER_SURFACE_STATE_AppendCounterEnable_start(const struct gen_device_info *devinfo)
   176953 {
   176954    switch (devinfo->gen) {
   176955    case 10: return 0;
   176956    case 9: return 0;
   176957    case 8: return 0;
   176958    case 7:
   176959       if (devinfo->is_haswell) {
   176960          return 193;
   176961       } else {
   176962          return 193;
   176963       }
   176964    case 6: return 0;
   176965    case 5: return 0;
   176966    case 4:
   176967       if (devinfo->is_g4x) {
   176968          return 0;
   176969       } else {
   176970          return 0;
   176971       }
   176972    default:
   176973       unreachable("Invalid hardware generation");
   176974    }
   176975 }
   176976 
   176977 
   176978 
   176979 /* RENDER_SURFACE_STATE::Auxiliary Surface Base Address */
   176980 
   176981 
   176982 #define GEN10_RENDER_SURFACE_STATE_AuxiliarySurfaceBaseAddress_bits  52
   176983 #define GEN9_RENDER_SURFACE_STATE_AuxiliarySurfaceBaseAddress_bits  52
   176984 #define GEN8_RENDER_SURFACE_STATE_AuxiliarySurfaceBaseAddress_bits  52
   176985 #define GEN75_RENDER_SURFACE_STATE_AuxiliarySurfaceBaseAddress_bits  20
   176986 #define GEN7_RENDER_SURFACE_STATE_AuxiliarySurfaceBaseAddress_bits  20
   176987 
   176988 static inline uint32_t ATTRIBUTE_PURE
   176989 RENDER_SURFACE_STATE_AuxiliarySurfaceBaseAddress_bits(const struct gen_device_info *devinfo)
   176990 {
   176991    switch (devinfo->gen) {
   176992    case 10: return 52;
   176993    case 9: return 52;
   176994    case 8: return 52;
   176995    case 7:
   176996       if (devinfo->is_haswell) {
   176997          return 20;
   176998       } else {
   176999          return 20;
   177000       }
   177001    case 6: return 0;
   177002    case 5: return 0;
   177003    case 4:
   177004       if (devinfo->is_g4x) {
   177005          return 0;
   177006       } else {
   177007          return 0;
   177008       }
   177009    default:
   177010       unreachable("Invalid hardware generation");
   177011    }
   177012 }
   177013 
   177014 
   177015 
   177016 #define GEN10_RENDER_SURFACE_STATE_AuxiliarySurfaceBaseAddress_start  332
   177017 #define GEN9_RENDER_SURFACE_STATE_AuxiliarySurfaceBaseAddress_start  332
   177018 #define GEN8_RENDER_SURFACE_STATE_AuxiliarySurfaceBaseAddress_start  332
   177019 #define GEN75_RENDER_SURFACE_STATE_AuxiliarySurfaceBaseAddress_start  204
   177020 #define GEN7_RENDER_SURFACE_STATE_AuxiliarySurfaceBaseAddress_start  204
   177021 
   177022 static inline uint32_t ATTRIBUTE_PURE
   177023 RENDER_SURFACE_STATE_AuxiliarySurfaceBaseAddress_start(const struct gen_device_info *devinfo)
   177024 {
   177025    switch (devinfo->gen) {
   177026    case 10: return 332;
   177027    case 9: return 332;
   177028    case 8: return 332;
   177029    case 7:
   177030       if (devinfo->is_haswell) {
   177031          return 204;
   177032       } else {
   177033          return 204;
   177034       }
   177035    case 6: return 0;
   177036    case 5: return 0;
   177037    case 4:
   177038       if (devinfo->is_g4x) {
   177039          return 0;
   177040       } else {
   177041          return 0;
   177042       }
   177043    default:
   177044       unreachable("Invalid hardware generation");
   177045    }
   177046 }
   177047 
   177048 
   177049 
   177050 /* RENDER_SURFACE_STATE::Auxiliary Surface Mode */
   177051 
   177052 
   177053 #define GEN10_RENDER_SURFACE_STATE_AuxiliarySurfaceMode_bits  3
   177054 #define GEN9_RENDER_SURFACE_STATE_AuxiliarySurfaceMode_bits  3
   177055 #define GEN8_RENDER_SURFACE_STATE_AuxiliarySurfaceMode_bits  3
   177056 
   177057 static inline uint32_t ATTRIBUTE_PURE
   177058 RENDER_SURFACE_STATE_AuxiliarySurfaceMode_bits(const struct gen_device_info *devinfo)
   177059 {
   177060    switch (devinfo->gen) {
   177061    case 10: return 3;
   177062    case 9: return 3;
   177063    case 8: return 3;
   177064    case 7:
   177065       if (devinfo->is_haswell) {
   177066          return 0;
   177067       } else {
   177068          return 0;
   177069       }
   177070    case 6: return 0;
   177071    case 5: return 0;
   177072    case 4:
   177073       if (devinfo->is_g4x) {
   177074          return 0;
   177075       } else {
   177076          return 0;
   177077       }
   177078    default:
   177079       unreachable("Invalid hardware generation");
   177080    }
   177081 }
   177082 
   177083 
   177084 
   177085 #define GEN10_RENDER_SURFACE_STATE_AuxiliarySurfaceMode_start  192
   177086 #define GEN9_RENDER_SURFACE_STATE_AuxiliarySurfaceMode_start  192
   177087 #define GEN8_RENDER_SURFACE_STATE_AuxiliarySurfaceMode_start  192
   177088 
   177089 static inline uint32_t ATTRIBUTE_PURE
   177090 RENDER_SURFACE_STATE_AuxiliarySurfaceMode_start(const struct gen_device_info *devinfo)
   177091 {
   177092    switch (devinfo->gen) {
   177093    case 10: return 192;
   177094    case 9: return 192;
   177095    case 8: return 192;
   177096    case 7:
   177097       if (devinfo->is_haswell) {
   177098          return 0;
   177099       } else {
   177100          return 0;
   177101       }
   177102    case 6: return 0;
   177103    case 5: return 0;
   177104    case 4:
   177105       if (devinfo->is_g4x) {
   177106          return 0;
   177107       } else {
   177108          return 0;
   177109       }
   177110    default:
   177111       unreachable("Invalid hardware generation");
   177112    }
   177113 }
   177114 
   177115 
   177116 
   177117 /* RENDER_SURFACE_STATE::Auxiliary Surface Pitch */
   177118 
   177119 
   177120 #define GEN10_RENDER_SURFACE_STATE_AuxiliarySurfacePitch_bits  9
   177121 #define GEN9_RENDER_SURFACE_STATE_AuxiliarySurfacePitch_bits  9
   177122 #define GEN8_RENDER_SURFACE_STATE_AuxiliarySurfacePitch_bits  9
   177123 #define GEN75_RENDER_SURFACE_STATE_AuxiliarySurfacePitch_bits  9
   177124 #define GEN7_RENDER_SURFACE_STATE_AuxiliarySurfacePitch_bits  9
   177125 
   177126 static inline uint32_t ATTRIBUTE_PURE
   177127 RENDER_SURFACE_STATE_AuxiliarySurfacePitch_bits(const struct gen_device_info *devinfo)
   177128 {
   177129    switch (devinfo->gen) {
   177130    case 10: return 9;
   177131    case 9: return 9;
   177132    case 8: return 9;
   177133    case 7:
   177134       if (devinfo->is_haswell) {
   177135          return 9;
   177136       } else {
   177137          return 9;
   177138       }
   177139    case 6: return 0;
   177140    case 5: return 0;
   177141    case 4:
   177142       if (devinfo->is_g4x) {
   177143          return 0;
   177144       } else {
   177145          return 0;
   177146       }
   177147    default:
   177148       unreachable("Invalid hardware generation");
   177149    }
   177150 }
   177151 
   177152 
   177153 
   177154 #define GEN10_RENDER_SURFACE_STATE_AuxiliarySurfacePitch_start  195
   177155 #define GEN9_RENDER_SURFACE_STATE_AuxiliarySurfacePitch_start  195
   177156 #define GEN8_RENDER_SURFACE_STATE_AuxiliarySurfacePitch_start  195
   177157 #define GEN75_RENDER_SURFACE_STATE_AuxiliarySurfacePitch_start  195
   177158 #define GEN7_RENDER_SURFACE_STATE_AuxiliarySurfacePitch_start  195
   177159 
   177160 static inline uint32_t ATTRIBUTE_PURE
   177161 RENDER_SURFACE_STATE_AuxiliarySurfacePitch_start(const struct gen_device_info *devinfo)
   177162 {
   177163    switch (devinfo->gen) {
   177164    case 10: return 195;
   177165    case 9: return 195;
   177166    case 8: return 195;
   177167    case 7:
   177168       if (devinfo->is_haswell) {
   177169          return 195;
   177170       } else {
   177171          return 195;
   177172       }
   177173    case 6: return 0;
   177174    case 5: return 0;
   177175    case 4:
   177176       if (devinfo->is_g4x) {
   177177          return 0;
   177178       } else {
   177179          return 0;
   177180       }
   177181    default:
   177182       unreachable("Invalid hardware generation");
   177183    }
   177184 }
   177185 
   177186 
   177187 
   177188 /* RENDER_SURFACE_STATE::Auxiliary Surface QPitch */
   177189 
   177190 
   177191 #define GEN10_RENDER_SURFACE_STATE_AuxiliarySurfaceQPitch_bits  15
   177192 #define GEN9_RENDER_SURFACE_STATE_AuxiliarySurfaceQPitch_bits  15
   177193 #define GEN8_RENDER_SURFACE_STATE_AuxiliarySurfaceQPitch_bits  15
   177194 
   177195 static inline uint32_t ATTRIBUTE_PURE
   177196 RENDER_SURFACE_STATE_AuxiliarySurfaceQPitch_bits(const struct gen_device_info *devinfo)
   177197 {
   177198    switch (devinfo->gen) {
   177199    case 10: return 15;
   177200    case 9: return 15;
   177201    case 8: return 15;
   177202    case 7:
   177203       if (devinfo->is_haswell) {
   177204          return 0;
   177205       } else {
   177206          return 0;
   177207       }
   177208    case 6: return 0;
   177209    case 5: return 0;
   177210    case 4:
   177211       if (devinfo->is_g4x) {
   177212          return 0;
   177213       } else {
   177214          return 0;
   177215       }
   177216    default:
   177217       unreachable("Invalid hardware generation");
   177218    }
   177219 }
   177220 
   177221 
   177222 
   177223 #define GEN10_RENDER_SURFACE_STATE_AuxiliarySurfaceQPitch_start  208
   177224 #define GEN9_RENDER_SURFACE_STATE_AuxiliarySurfaceQPitch_start  208
   177225 #define GEN8_RENDER_SURFACE_STATE_AuxiliarySurfaceQPitch_start  208
   177226 
   177227 static inline uint32_t ATTRIBUTE_PURE
   177228 RENDER_SURFACE_STATE_AuxiliarySurfaceQPitch_start(const struct gen_device_info *devinfo)
   177229 {
   177230    switch (devinfo->gen) {
   177231    case 10: return 208;
   177232    case 9: return 208;
   177233    case 8: return 208;
   177234    case 7:
   177235       if (devinfo->is_haswell) {
   177236          return 0;
   177237       } else {
   177238          return 0;
   177239       }
   177240    case 6: return 0;
   177241    case 5: return 0;
   177242    case 4:
   177243       if (devinfo->is_g4x) {
   177244          return 0;
   177245       } else {
   177246          return 0;
   177247       }
   177248    default:
   177249       unreachable("Invalid hardware generation");
   177250    }
   177251 }
   177252 
   177253 
   177254 
   177255 /* RENDER_SURFACE_STATE::Auxiliary Table Index for Media Compressed Surface */
   177256 
   177257 
   177258 #define GEN10_RENDER_SURFACE_STATE_AuxiliaryTableIndexforMediaCompressedSurface_bits  11
   177259 #define GEN9_RENDER_SURFACE_STATE_AuxiliaryTableIndexforMediaCompressedSurface_bits  11
   177260 #define GEN8_RENDER_SURFACE_STATE_AuxiliaryTableIndexforMediaCompressedSurface_bits  11
   177261 
   177262 static inline uint32_t ATTRIBUTE_PURE
   177263 RENDER_SURFACE_STATE_AuxiliaryTableIndexforMediaCompressedSurface_bits(const struct gen_device_info *devinfo)
   177264 {
   177265    switch (devinfo->gen) {
   177266    case 10: return 11;
   177267    case 9: return 11;
   177268    case 8: return 11;
   177269    case 7:
   177270       if (devinfo->is_haswell) {
   177271          return 0;
   177272       } else {
   177273          return 0;
   177274       }
   177275    case 6: return 0;
   177276    case 5: return 0;
   177277    case 4:
   177278       if (devinfo->is_g4x) {
   177279          return 0;
   177280       } else {
   177281          return 0;
   177282       }
   177283    default:
   177284       unreachable("Invalid hardware generation");
   177285    }
   177286 }
   177287 
   177288 
   177289 
   177290 #define GEN10_RENDER_SURFACE_STATE_AuxiliaryTableIndexforMediaCompressedSurface_start  341
   177291 #define GEN9_RENDER_SURFACE_STATE_AuxiliaryTableIndexforMediaCompressedSurface_start  341
   177292 #define GEN8_RENDER_SURFACE_STATE_AuxiliaryTableIndexforMediaCompressedSurface_start  341
   177293 
   177294 static inline uint32_t ATTRIBUTE_PURE
   177295 RENDER_SURFACE_STATE_AuxiliaryTableIndexforMediaCompressedSurface_start(const struct gen_device_info *devinfo)
   177296 {
   177297    switch (devinfo->gen) {
   177298    case 10: return 341;
   177299    case 9: return 341;
   177300    case 8: return 341;
   177301    case 7:
   177302       if (devinfo->is_haswell) {
   177303          return 0;
   177304       } else {
   177305          return 0;
   177306       }
   177307    case 6: return 0;
   177308    case 5: return 0;
   177309    case 4:
   177310       if (devinfo->is_g4x) {
   177311          return 0;
   177312       } else {
   177313          return 0;
   177314       }
   177315    default:
   177316       unreachable("Invalid hardware generation");
   177317    }
   177318 }
   177319 
   177320 
   177321 
   177322 /* RENDER_SURFACE_STATE::Base Mip Level */
   177323 
   177324 
   177325 #define GEN10_RENDER_SURFACE_STATE_BaseMipLevel_bits  5
   177326 #define GEN9_RENDER_SURFACE_STATE_BaseMipLevel_bits  5
   177327 #define GEN8_RENDER_SURFACE_STATE_BaseMipLevel_bits  5
   177328 
   177329 static inline uint32_t ATTRIBUTE_PURE
   177330 RENDER_SURFACE_STATE_BaseMipLevel_bits(const struct gen_device_info *devinfo)
   177331 {
   177332    switch (devinfo->gen) {
   177333    case 10: return 5;
   177334    case 9: return 5;
   177335    case 8: return 5;
   177336    case 7:
   177337       if (devinfo->is_haswell) {
   177338          return 0;
   177339       } else {
   177340          return 0;
   177341       }
   177342    case 6: return 0;
   177343    case 5: return 0;
   177344    case 4:
   177345       if (devinfo->is_g4x) {
   177346          return 0;
   177347       } else {
   177348          return 0;
   177349       }
   177350    default:
   177351       unreachable("Invalid hardware generation");
   177352    }
   177353 }
   177354 
   177355 
   177356 
   177357 #define GEN10_RENDER_SURFACE_STATE_BaseMipLevel_start  51
   177358 #define GEN9_RENDER_SURFACE_STATE_BaseMipLevel_start  51
   177359 #define GEN8_RENDER_SURFACE_STATE_BaseMipLevel_start  51
   177360 
   177361 static inline uint32_t ATTRIBUTE_PURE
   177362 RENDER_SURFACE_STATE_BaseMipLevel_start(const struct gen_device_info *devinfo)
   177363 {
   177364    switch (devinfo->gen) {
   177365    case 10: return 51;
   177366    case 9: return 51;
   177367    case 8: return 51;
   177368    case 7:
   177369       if (devinfo->is_haswell) {
   177370          return 0;
   177371       } else {
   177372          return 0;
   177373       }
   177374    case 6: return 0;
   177375    case 5: return 0;
   177376    case 4:
   177377       if (devinfo->is_g4x) {
   177378          return 0;
   177379       } else {
   177380          return 0;
   177381       }
   177382    default:
   177383       unreachable("Invalid hardware generation");
   177384    }
   177385 }
   177386 
   177387 
   177388 
   177389 /* RENDER_SURFACE_STATE::Blue Clear Color */
   177390 
   177391 
   177392 #define GEN10_RENDER_SURFACE_STATE_BlueClearColor_bits  32
   177393 #define GEN9_RENDER_SURFACE_STATE_BlueClearColor_bits  32
   177394 #define GEN8_RENDER_SURFACE_STATE_BlueClearColor_bits  1
   177395 #define GEN75_RENDER_SURFACE_STATE_BlueClearColor_bits  1
   177396 #define GEN7_RENDER_SURFACE_STATE_BlueClearColor_bits  1
   177397 
   177398 static inline uint32_t ATTRIBUTE_PURE
   177399 RENDER_SURFACE_STATE_BlueClearColor_bits(const struct gen_device_info *devinfo)
   177400 {
   177401    switch (devinfo->gen) {
   177402    case 10: return 32;
   177403    case 9: return 32;
   177404    case 8: return 1;
   177405    case 7:
   177406       if (devinfo->is_haswell) {
   177407          return 1;
   177408       } else {
   177409          return 1;
   177410       }
   177411    case 6: return 0;
   177412    case 5: return 0;
   177413    case 4:
   177414       if (devinfo->is_g4x) {
   177415          return 0;
   177416       } else {
   177417          return 0;
   177418       }
   177419    default:
   177420       unreachable("Invalid hardware generation");
   177421    }
   177422 }
   177423 
   177424 
   177425 
   177426 #define GEN10_RENDER_SURFACE_STATE_BlueClearColor_start  448
   177427 #define GEN9_RENDER_SURFACE_STATE_BlueClearColor_start  448
   177428 #define GEN8_RENDER_SURFACE_STATE_BlueClearColor_start  253
   177429 #define GEN75_RENDER_SURFACE_STATE_BlueClearColor_start  253
   177430 #define GEN7_RENDER_SURFACE_STATE_BlueClearColor_start  253
   177431 
   177432 static inline uint32_t ATTRIBUTE_PURE
   177433 RENDER_SURFACE_STATE_BlueClearColor_start(const struct gen_device_info *devinfo)
   177434 {
   177435    switch (devinfo->gen) {
   177436    case 10: return 448;
   177437    case 9: return 448;
   177438    case 8: return 253;
   177439    case 7:
   177440       if (devinfo->is_haswell) {
   177441          return 253;
   177442       } else {
   177443          return 253;
   177444       }
   177445    case 6: return 0;
   177446    case 5: return 0;
   177447    case 4:
   177448       if (devinfo->is_g4x) {
   177449          return 0;
   177450       } else {
   177451          return 0;
   177452       }
   177453    default:
   177454       unreachable("Invalid hardware generation");
   177455    }
   177456 }
   177457 
   177458 
   177459 
   177460 /* RENDER_SURFACE_STATE::Clear Color Address */
   177461 
   177462 
   177463 #define GEN10_RENDER_SURFACE_STATE_ClearColorAddress_bits  26
   177464 
   177465 static inline uint32_t ATTRIBUTE_PURE
   177466 RENDER_SURFACE_STATE_ClearColorAddress_bits(const struct gen_device_info *devinfo)
   177467 {
   177468    switch (devinfo->gen) {
   177469    case 10: return 26;
   177470    case 9: return 0;
   177471    case 8: return 0;
   177472    case 7:
   177473       if (devinfo->is_haswell) {
   177474          return 0;
   177475       } else {
   177476          return 0;
   177477       }
   177478    case 6: return 0;
   177479    case 5: return 0;
   177480    case 4:
   177481       if (devinfo->is_g4x) {
   177482          return 0;
   177483       } else {
   177484          return 0;
   177485       }
   177486    default:
   177487       unreachable("Invalid hardware generation");
   177488    }
   177489 }
   177490 
   177491 
   177492 
   177493 #define GEN10_RENDER_SURFACE_STATE_ClearColorAddress_start  390
   177494 
   177495 static inline uint32_t ATTRIBUTE_PURE
   177496 RENDER_SURFACE_STATE_ClearColorAddress_start(const struct gen_device_info *devinfo)
   177497 {
   177498    switch (devinfo->gen) {
   177499    case 10: return 390;
   177500    case 9: return 0;
   177501    case 8: return 0;
   177502    case 7:
   177503       if (devinfo->is_haswell) {
   177504          return 0;
   177505       } else {
   177506          return 0;
   177507       }
   177508    case 6: return 0;
   177509    case 5: return 0;
   177510    case 4:
   177511       if (devinfo->is_g4x) {
   177512          return 0;
   177513       } else {
   177514          return 0;
   177515       }
   177516    default:
   177517       unreachable("Invalid hardware generation");
   177518    }
   177519 }
   177520 
   177521 
   177522 
   177523 /* RENDER_SURFACE_STATE::Clear Color Address High */
   177524 
   177525 
   177526 #define GEN10_RENDER_SURFACE_STATE_ClearColorAddressHigh_bits  16
   177527 
   177528 static inline uint32_t ATTRIBUTE_PURE
   177529 RENDER_SURFACE_STATE_ClearColorAddressHigh_bits(const struct gen_device_info *devinfo)
   177530 {
   177531    switch (devinfo->gen) {
   177532    case 10: return 16;
   177533    case 9: return 0;
   177534    case 8: return 0;
   177535    case 7:
   177536       if (devinfo->is_haswell) {
   177537          return 0;
   177538       } else {
   177539          return 0;
   177540       }
   177541    case 6: return 0;
   177542    case 5: return 0;
   177543    case 4:
   177544       if (devinfo->is_g4x) {
   177545          return 0;
   177546       } else {
   177547          return 0;
   177548       }
   177549    default:
   177550       unreachable("Invalid hardware generation");
   177551    }
   177552 }
   177553 
   177554 
   177555 
   177556 #define GEN10_RENDER_SURFACE_STATE_ClearColorAddressHigh_start  416
   177557 
   177558 static inline uint32_t ATTRIBUTE_PURE
   177559 RENDER_SURFACE_STATE_ClearColorAddressHigh_start(const struct gen_device_info *devinfo)
   177560 {
   177561    switch (devinfo->gen) {
   177562    case 10: return 416;
   177563    case 9: return 0;
   177564    case 8: return 0;
   177565    case 7:
   177566       if (devinfo->is_haswell) {
   177567          return 0;
   177568       } else {
   177569          return 0;
   177570       }
   177571    case 6: return 0;
   177572    case 5: return 0;
   177573    case 4:
   177574       if (devinfo->is_g4x) {
   177575          return 0;
   177576       } else {
   177577          return 0;
   177578       }
   177579    default:
   177580       unreachable("Invalid hardware generation");
   177581    }
   177582 }
   177583 
   177584 
   177585 
   177586 /* RENDER_SURFACE_STATE::Clear Depth Address High */
   177587 
   177588 
   177589 #define GEN10_RENDER_SURFACE_STATE_ClearDepthAddressHigh_bits  16
   177590 
   177591 static inline uint32_t ATTRIBUTE_PURE
   177592 RENDER_SURFACE_STATE_ClearDepthAddressHigh_bits(const struct gen_device_info *devinfo)
   177593 {
   177594    switch (devinfo->gen) {
   177595    case 10: return 16;
   177596    case 9: return 0;
   177597    case 8: return 0;
   177598    case 7:
   177599       if (devinfo->is_haswell) {
   177600          return 0;
   177601       } else {
   177602          return 0;
   177603       }
   177604    case 6: return 0;
   177605    case 5: return 0;
   177606    case 4:
   177607       if (devinfo->is_g4x) {
   177608          return 0;
   177609       } else {
   177610          return 0;
   177611       }
   177612    default:
   177613       unreachable("Invalid hardware generation");
   177614    }
   177615 }
   177616 
   177617 
   177618 
   177619 #define GEN10_RENDER_SURFACE_STATE_ClearDepthAddressHigh_start  416
   177620 
   177621 static inline uint32_t ATTRIBUTE_PURE
   177622 RENDER_SURFACE_STATE_ClearDepthAddressHigh_start(const struct gen_device_info *devinfo)
   177623 {
   177624    switch (devinfo->gen) {
   177625    case 10: return 416;
   177626    case 9: return 0;
   177627    case 8: return 0;
   177628    case 7:
   177629       if (devinfo->is_haswell) {
   177630          return 0;
   177631       } else {
   177632          return 0;
   177633       }
   177634    case 6: return 0;
   177635    case 5: return 0;
   177636    case 4:
   177637       if (devinfo->is_g4x) {
   177638          return 0;
   177639       } else {
   177640          return 0;
   177641       }
   177642    default:
   177643       unreachable("Invalid hardware generation");
   177644    }
   177645 }
   177646 
   177647 
   177648 
   177649 /* RENDER_SURFACE_STATE::Clear Depth Address Low */
   177650 
   177651 
   177652 #define GEN10_RENDER_SURFACE_STATE_ClearDepthAddressLow_bits  26
   177653 
   177654 static inline uint32_t ATTRIBUTE_PURE
   177655 RENDER_SURFACE_STATE_ClearDepthAddressLow_bits(const struct gen_device_info *devinfo)
   177656 {
   177657    switch (devinfo->gen) {
   177658    case 10: return 26;
   177659    case 9: return 0;
   177660    case 8: return 0;
   177661    case 7:
   177662       if (devinfo->is_haswell) {
   177663          return 0;
   177664       } else {
   177665          return 0;
   177666       }
   177667    case 6: return 0;
   177668    case 5: return 0;
   177669    case 4:
   177670       if (devinfo->is_g4x) {
   177671          return 0;
   177672       } else {
   177673          return 0;
   177674       }
   177675    default:
   177676       unreachable("Invalid hardware generation");
   177677    }
   177678 }
   177679 
   177680 
   177681 
   177682 #define GEN10_RENDER_SURFACE_STATE_ClearDepthAddressLow_start  390
   177683 
   177684 static inline uint32_t ATTRIBUTE_PURE
   177685 RENDER_SURFACE_STATE_ClearDepthAddressLow_start(const struct gen_device_info *devinfo)
   177686 {
   177687    switch (devinfo->gen) {
   177688    case 10: return 390;
   177689    case 9: return 0;
   177690    case 8: return 0;
   177691    case 7:
   177692       if (devinfo->is_haswell) {
   177693          return 0;
   177694       } else {
   177695          return 0;
   177696       }
   177697    case 6: return 0;
   177698    case 5: return 0;
   177699    case 4:
   177700       if (devinfo->is_g4x) {
   177701          return 0;
   177702       } else {
   177703          return 0;
   177704       }
   177705    default:
   177706       unreachable("Invalid hardware generation");
   177707    }
   177708 }
   177709 
   177710 
   177711 
   177712 /* RENDER_SURFACE_STATE::Clear Value Address Enable */
   177713 
   177714 
   177715 #define GEN10_RENDER_SURFACE_STATE_ClearValueAddressEnable_bits  1
   177716 
   177717 static inline uint32_t ATTRIBUTE_PURE
   177718 RENDER_SURFACE_STATE_ClearValueAddressEnable_bits(const struct gen_device_info *devinfo)
   177719 {
   177720    switch (devinfo->gen) {
   177721    case 10: return 1;
   177722    case 9: return 0;
   177723    case 8: return 0;
   177724    case 7:
   177725       if (devinfo->is_haswell) {
   177726          return 0;
   177727       } else {
   177728          return 0;
   177729       }
   177730    case 6: return 0;
   177731    case 5: return 0;
   177732    case 4:
   177733       if (devinfo->is_g4x) {
   177734          return 0;
   177735       } else {
   177736          return 0;
   177737       }
   177738    default:
   177739       unreachable("Invalid hardware generation");
   177740    }
   177741 }
   177742 
   177743 
   177744 
   177745 #define GEN10_RENDER_SURFACE_STATE_ClearValueAddressEnable_start  330
   177746 
   177747 static inline uint32_t ATTRIBUTE_PURE
   177748 RENDER_SURFACE_STATE_ClearValueAddressEnable_start(const struct gen_device_info *devinfo)
   177749 {
   177750    switch (devinfo->gen) {
   177751    case 10: return 330;
   177752    case 9: return 0;
   177753    case 8: return 0;
   177754    case 7:
   177755       if (devinfo->is_haswell) {
   177756          return 0;
   177757       } else {
   177758          return 0;
   177759       }
   177760    case 6: return 0;
   177761    case 5: return 0;
   177762    case 4:
   177763       if (devinfo->is_g4x) {
   177764          return 0;
   177765       } else {
   177766          return 0;
   177767       }
   177768    default:
   177769       unreachable("Invalid hardware generation");
   177770    }
   177771 }
   177772 
   177773 
   177774 
   177775 /* RENDER_SURFACE_STATE::Coherency Type */
   177776 
   177777 
   177778 #define GEN10_RENDER_SURFACE_STATE_CoherencyType_bits  1
   177779 #define GEN9_RENDER_SURFACE_STATE_CoherencyType_bits  1
   177780 #define GEN8_RENDER_SURFACE_STATE_CoherencyType_bits  1
   177781 
   177782 static inline uint32_t ATTRIBUTE_PURE
   177783 RENDER_SURFACE_STATE_CoherencyType_bits(const struct gen_device_info *devinfo)
   177784 {
   177785    switch (devinfo->gen) {
   177786    case 10: return 1;
   177787    case 9: return 1;
   177788    case 8: return 1;
   177789    case 7:
   177790       if (devinfo->is_haswell) {
   177791          return 0;
   177792       } else {
   177793          return 0;
   177794       }
   177795    case 6: return 0;
   177796    case 5: return 0;
   177797    case 4:
   177798       if (devinfo->is_g4x) {
   177799          return 0;
   177800       } else {
   177801          return 0;
   177802       }
   177803    default:
   177804       unreachable("Invalid hardware generation");
   177805    }
   177806 }
   177807 
   177808 
   177809 
   177810 #define GEN10_RENDER_SURFACE_STATE_CoherencyType_start  174
   177811 #define GEN9_RENDER_SURFACE_STATE_CoherencyType_start  174
   177812 #define GEN8_RENDER_SURFACE_STATE_CoherencyType_start  174
   177813 
   177814 static inline uint32_t ATTRIBUTE_PURE
   177815 RENDER_SURFACE_STATE_CoherencyType_start(const struct gen_device_info *devinfo)
   177816 {
   177817    switch (devinfo->gen) {
   177818    case 10: return 174;
   177819    case 9: return 174;
   177820    case 8: return 174;
   177821    case 7:
   177822       if (devinfo->is_haswell) {
   177823          return 0;
   177824       } else {
   177825          return 0;
   177826       }
   177827    case 6: return 0;
   177828    case 5: return 0;
   177829    case 4:
   177830       if (devinfo->is_g4x) {
   177831          return 0;
   177832       } else {
   177833          return 0;
   177834       }
   177835    default:
   177836       unreachable("Invalid hardware generation");
   177837    }
   177838 }
   177839 
   177840 
   177841 
   177842 /* RENDER_SURFACE_STATE::Color Blend Enable */
   177843 
   177844 
   177845 #define GEN5_RENDER_SURFACE_STATE_ColorBlendEnable_bits  1
   177846 #define GEN45_RENDER_SURFACE_STATE_ColorBlendEnable_bits  1
   177847 #define GEN4_RENDER_SURFACE_STATE_ColorBlendEnable_bits  1
   177848 
   177849 static inline uint32_t ATTRIBUTE_PURE
   177850 RENDER_SURFACE_STATE_ColorBlendEnable_bits(const struct gen_device_info *devinfo)
   177851 {
   177852    switch (devinfo->gen) {
   177853    case 10: return 0;
   177854    case 9: return 0;
   177855    case 8: return 0;
   177856    case 7:
   177857       if (devinfo->is_haswell) {
   177858          return 0;
   177859       } else {
   177860          return 0;
   177861       }
   177862    case 6: return 0;
   177863    case 5: return 1;
   177864    case 4:
   177865       if (devinfo->is_g4x) {
   177866          return 1;
   177867       } else {
   177868          return 1;
   177869       }
   177870    default:
   177871       unreachable("Invalid hardware generation");
   177872    }
   177873 }
   177874 
   177875 
   177876 
   177877 #define GEN5_RENDER_SURFACE_STATE_ColorBlendEnable_start  13
   177878 #define GEN45_RENDER_SURFACE_STATE_ColorBlendEnable_start  13
   177879 #define GEN4_RENDER_SURFACE_STATE_ColorBlendEnable_start  13
   177880 
   177881 static inline uint32_t ATTRIBUTE_PURE
   177882 RENDER_SURFACE_STATE_ColorBlendEnable_start(const struct gen_device_info *devinfo)
   177883 {
   177884    switch (devinfo->gen) {
   177885    case 10: return 0;
   177886    case 9: return 0;
   177887    case 8: return 0;
   177888    case 7:
   177889       if (devinfo->is_haswell) {
   177890          return 0;
   177891       } else {
   177892          return 0;
   177893       }
   177894    case 6: return 0;
   177895    case 5: return 13;
   177896    case 4:
   177897       if (devinfo->is_g4x) {
   177898          return 13;
   177899       } else {
   177900          return 13;
   177901       }
   177902    default:
   177903       unreachable("Invalid hardware generation");
   177904    }
   177905 }
   177906 
   177907 
   177908 
   177909 /* RENDER_SURFACE_STATE::Color Buffer Component Write Disables */
   177910 
   177911 
   177912 #define GEN5_RENDER_SURFACE_STATE_ColorBufferComponentWriteDisables_bits  4
   177913 #define GEN45_RENDER_SURFACE_STATE_ColorBufferComponentWriteDisables_bits  4
   177914 #define GEN4_RENDER_SURFACE_STATE_ColorBufferComponentWriteDisables_bits  4
   177915 
   177916 static inline uint32_t ATTRIBUTE_PURE
   177917 RENDER_SURFACE_STATE_ColorBufferComponentWriteDisables_bits(const struct gen_device_info *devinfo)
   177918 {
   177919    switch (devinfo->gen) {
   177920    case 10: return 0;
   177921    case 9: return 0;
   177922    case 8: return 0;
   177923    case 7:
   177924       if (devinfo->is_haswell) {
   177925          return 0;
   177926       } else {
   177927          return 0;
   177928       }
   177929    case 6: return 0;
   177930    case 5: return 4;
   177931    case 4:
   177932       if (devinfo->is_g4x) {
   177933          return 4;
   177934       } else {
   177935          return 4;
   177936       }
   177937    default:
   177938       unreachable("Invalid hardware generation");
   177939    }
   177940 }
   177941 
   177942 
   177943 
   177944 #define GEN5_RENDER_SURFACE_STATE_ColorBufferComponentWriteDisables_start  14
   177945 #define GEN45_RENDER_SURFACE_STATE_ColorBufferComponentWriteDisables_start  14
   177946 #define GEN4_RENDER_SURFACE_STATE_ColorBufferComponentWriteDisables_start  14
   177947 
   177948 static inline uint32_t ATTRIBUTE_PURE
   177949 RENDER_SURFACE_STATE_ColorBufferComponentWriteDisables_start(const struct gen_device_info *devinfo)
   177950 {
   177951    switch (devinfo->gen) {
   177952    case 10: return 0;
   177953    case 9: return 0;
   177954    case 8: return 0;
   177955    case 7:
   177956       if (devinfo->is_haswell) {
   177957          return 0;
   177958       } else {
   177959          return 0;
   177960       }
   177961    case 6: return 0;
   177962    case 5: return 14;
   177963    case 4:
   177964       if (devinfo->is_g4x) {
   177965          return 14;
   177966       } else {
   177967          return 14;
   177968       }
   177969    default:
   177970       unreachable("Invalid hardware generation");
   177971    }
   177972 }
   177973 
   177974 
   177975 
   177976 /* RENDER_SURFACE_STATE::Cube Face Enable - Negative X */
   177977 
   177978 
   177979 #define GEN10_RENDER_SURFACE_STATE_CubeFaceEnableNegativeX_bits  1
   177980 #define GEN9_RENDER_SURFACE_STATE_CubeFaceEnableNegativeX_bits  1
   177981 #define GEN8_RENDER_SURFACE_STATE_CubeFaceEnableNegativeX_bits  1
   177982 #define GEN75_RENDER_SURFACE_STATE_CubeFaceEnableNegativeX_bits  1
   177983 #define GEN7_RENDER_SURFACE_STATE_CubeFaceEnableNegativeX_bits  1
   177984 #define GEN6_RENDER_SURFACE_STATE_CubeFaceEnableNegativeX_bits  1
   177985 #define GEN5_RENDER_SURFACE_STATE_CubeFaceEnableNegativeX_bits  1
   177986 #define GEN45_RENDER_SURFACE_STATE_CubeFaceEnableNegativeX_bits  1
   177987 #define GEN4_RENDER_SURFACE_STATE_CubeFaceEnableNegativeX_bits  1
   177988 
   177989 static inline uint32_t ATTRIBUTE_PURE
   177990 RENDER_SURFACE_STATE_CubeFaceEnableNegativeX_bits(const struct gen_device_info *devinfo)
   177991 {
   177992    switch (devinfo->gen) {
   177993    case 10: return 1;
   177994    case 9: return 1;
   177995    case 8: return 1;
   177996    case 7:
   177997       if (devinfo->is_haswell) {
   177998          return 1;
   177999       } else {
   178000          return 1;
   178001       }
   178002    case 6: return 1;
   178003    case 5: return 1;
   178004    case 4:
   178005       if (devinfo->is_g4x) {
   178006          return 1;
   178007       } else {
   178008          return 1;
   178009       }
   178010    default:
   178011       unreachable("Invalid hardware generation");
   178012    }
   178013 }
   178014 
   178015 
   178016 
   178017 #define GEN10_RENDER_SURFACE_STATE_CubeFaceEnableNegativeX_start  5
   178018 #define GEN9_RENDER_SURFACE_STATE_CubeFaceEnableNegativeX_start  5
   178019 #define GEN8_RENDER_SURFACE_STATE_CubeFaceEnableNegativeX_start  5
   178020 #define GEN75_RENDER_SURFACE_STATE_CubeFaceEnableNegativeX_start  5
   178021 #define GEN7_RENDER_SURFACE_STATE_CubeFaceEnableNegativeX_start  5
   178022 #define GEN6_RENDER_SURFACE_STATE_CubeFaceEnableNegativeX_start  5
   178023 #define GEN5_RENDER_SURFACE_STATE_CubeFaceEnableNegativeX_start  5
   178024 #define GEN45_RENDER_SURFACE_STATE_CubeFaceEnableNegativeX_start  5
   178025 #define GEN4_RENDER_SURFACE_STATE_CubeFaceEnableNegativeX_start  5
   178026 
   178027 static inline uint32_t ATTRIBUTE_PURE
   178028 RENDER_SURFACE_STATE_CubeFaceEnableNegativeX_start(const struct gen_device_info *devinfo)
   178029 {
   178030    switch (devinfo->gen) {
   178031    case 10: return 5;
   178032    case 9: return 5;
   178033    case 8: return 5;
   178034    case 7:
   178035       if (devinfo->is_haswell) {
   178036          return 5;
   178037       } else {
   178038          return 5;
   178039       }
   178040    case 6: return 5;
   178041    case 5: return 5;
   178042    case 4:
   178043       if (devinfo->is_g4x) {
   178044          return 5;
   178045       } else {
   178046          return 5;
   178047       }
   178048    default:
   178049       unreachable("Invalid hardware generation");
   178050    }
   178051 }
   178052 
   178053 
   178054 
   178055 /* RENDER_SURFACE_STATE::Cube Face Enable - Negative Y */
   178056 
   178057 
   178058 #define GEN10_RENDER_SURFACE_STATE_CubeFaceEnableNegativeY_bits  1
   178059 #define GEN9_RENDER_SURFACE_STATE_CubeFaceEnableNegativeY_bits  1
   178060 #define GEN8_RENDER_SURFACE_STATE_CubeFaceEnableNegativeY_bits  1
   178061 #define GEN75_RENDER_SURFACE_STATE_CubeFaceEnableNegativeY_bits  1
   178062 #define GEN7_RENDER_SURFACE_STATE_CubeFaceEnableNegativeY_bits  1
   178063 #define GEN6_RENDER_SURFACE_STATE_CubeFaceEnableNegativeY_bits  1
   178064 #define GEN5_RENDER_SURFACE_STATE_CubeFaceEnableNegativeY_bits  1
   178065 #define GEN45_RENDER_SURFACE_STATE_CubeFaceEnableNegativeY_bits  1
   178066 #define GEN4_RENDER_SURFACE_STATE_CubeFaceEnableNegativeY_bits  1
   178067 
   178068 static inline uint32_t ATTRIBUTE_PURE
   178069 RENDER_SURFACE_STATE_CubeFaceEnableNegativeY_bits(const struct gen_device_info *devinfo)
   178070 {
   178071    switch (devinfo->gen) {
   178072    case 10: return 1;
   178073    case 9: return 1;
   178074    case 8: return 1;
   178075    case 7:
   178076       if (devinfo->is_haswell) {
   178077          return 1;
   178078       } else {
   178079          return 1;
   178080       }
   178081    case 6: return 1;
   178082    case 5: return 1;
   178083    case 4:
   178084       if (devinfo->is_g4x) {
   178085          return 1;
   178086       } else {
   178087          return 1;
   178088       }
   178089    default:
   178090       unreachable("Invalid hardware generation");
   178091    }
   178092 }
   178093 
   178094 
   178095 
   178096 #define GEN10_RENDER_SURFACE_STATE_CubeFaceEnableNegativeY_start  3
   178097 #define GEN9_RENDER_SURFACE_STATE_CubeFaceEnableNegativeY_start  3
   178098 #define GEN8_RENDER_SURFACE_STATE_CubeFaceEnableNegativeY_start  3
   178099 #define GEN75_RENDER_SURFACE_STATE_CubeFaceEnableNegativeY_start  3
   178100 #define GEN7_RENDER_SURFACE_STATE_CubeFaceEnableNegativeY_start  3
   178101 #define GEN6_RENDER_SURFACE_STATE_CubeFaceEnableNegativeY_start  3
   178102 #define GEN5_RENDER_SURFACE_STATE_CubeFaceEnableNegativeY_start  3
   178103 #define GEN45_RENDER_SURFACE_STATE_CubeFaceEnableNegativeY_start  3
   178104 #define GEN4_RENDER_SURFACE_STATE_CubeFaceEnableNegativeY_start  3
   178105 
   178106 static inline uint32_t ATTRIBUTE_PURE
   178107 RENDER_SURFACE_STATE_CubeFaceEnableNegativeY_start(const struct gen_device_info *devinfo)
   178108 {
   178109    switch (devinfo->gen) {
   178110    case 10: return 3;
   178111    case 9: return 3;
   178112    case 8: return 3;
   178113    case 7:
   178114       if (devinfo->is_haswell) {
   178115          return 3;
   178116       } else {
   178117          return 3;
   178118       }
   178119    case 6: return 3;
   178120    case 5: return 3;
   178121    case 4:
   178122       if (devinfo->is_g4x) {
   178123          return 3;
   178124       } else {
   178125          return 3;
   178126       }
   178127    default:
   178128       unreachable("Invalid hardware generation");
   178129    }
   178130 }
   178131 
   178132 
   178133 
   178134 /* RENDER_SURFACE_STATE::Cube Face Enable - Negative Z */
   178135 
   178136 
   178137 #define GEN10_RENDER_SURFACE_STATE_CubeFaceEnableNegativeZ_bits  1
   178138 #define GEN9_RENDER_SURFACE_STATE_CubeFaceEnableNegativeZ_bits  1
   178139 #define GEN8_RENDER_SURFACE_STATE_CubeFaceEnableNegativeZ_bits  1
   178140 #define GEN75_RENDER_SURFACE_STATE_CubeFaceEnableNegativeZ_bits  1
   178141 #define GEN7_RENDER_SURFACE_STATE_CubeFaceEnableNegativeZ_bits  1
   178142 #define GEN6_RENDER_SURFACE_STATE_CubeFaceEnableNegativeZ_bits  1
   178143 #define GEN5_RENDER_SURFACE_STATE_CubeFaceEnableNegativeZ_bits  1
   178144 #define GEN45_RENDER_SURFACE_STATE_CubeFaceEnableNegativeZ_bits  1
   178145 #define GEN4_RENDER_SURFACE_STATE_CubeFaceEnableNegativeZ_bits  1
   178146 
   178147 static inline uint32_t ATTRIBUTE_PURE
   178148 RENDER_SURFACE_STATE_CubeFaceEnableNegativeZ_bits(const struct gen_device_info *devinfo)
   178149 {
   178150    switch (devinfo->gen) {
   178151    case 10: return 1;
   178152    case 9: return 1;
   178153    case 8: return 1;
   178154    case 7:
   178155       if (devinfo->is_haswell) {
   178156          return 1;
   178157       } else {
   178158          return 1;
   178159       }
   178160    case 6: return 1;
   178161    case 5: return 1;
   178162    case 4:
   178163       if (devinfo->is_g4x) {
   178164          return 1;
   178165       } else {
   178166          return 1;
   178167       }
   178168    default:
   178169       unreachable("Invalid hardware generation");
   178170    }
   178171 }
   178172 
   178173 
   178174 
   178175 #define GEN10_RENDER_SURFACE_STATE_CubeFaceEnableNegativeZ_start  1
   178176 #define GEN9_RENDER_SURFACE_STATE_CubeFaceEnableNegativeZ_start  1
   178177 #define GEN8_RENDER_SURFACE_STATE_CubeFaceEnableNegativeZ_start  1
   178178 #define GEN75_RENDER_SURFACE_STATE_CubeFaceEnableNegativeZ_start  1
   178179 #define GEN7_RENDER_SURFACE_STATE_CubeFaceEnableNegativeZ_start  1
   178180 #define GEN6_RENDER_SURFACE_STATE_CubeFaceEnableNegativeZ_start  1
   178181 #define GEN5_RENDER_SURFACE_STATE_CubeFaceEnableNegativeZ_start  1
   178182 #define GEN45_RENDER_SURFACE_STATE_CubeFaceEnableNegativeZ_start  1
   178183 #define GEN4_RENDER_SURFACE_STATE_CubeFaceEnableNegativeZ_start  1
   178184 
   178185 static inline uint32_t ATTRIBUTE_PURE
   178186 RENDER_SURFACE_STATE_CubeFaceEnableNegativeZ_start(const struct gen_device_info *devinfo)
   178187 {
   178188    switch (devinfo->gen) {
   178189    case 10: return 1;
   178190    case 9: return 1;
   178191    case 8: return 1;
   178192    case 7:
   178193       if (devinfo->is_haswell) {
   178194          return 1;
   178195       } else {
   178196          return 1;
   178197       }
   178198    case 6: return 1;
   178199    case 5: return 1;
   178200    case 4:
   178201       if (devinfo->is_g4x) {
   178202          return 1;
   178203       } else {
   178204          return 1;
   178205       }
   178206    default:
   178207       unreachable("Invalid hardware generation");
   178208    }
   178209 }
   178210 
   178211 
   178212 
   178213 /* RENDER_SURFACE_STATE::Cube Face Enable - Positive X */
   178214 
   178215 
   178216 #define GEN10_RENDER_SURFACE_STATE_CubeFaceEnablePositiveX_bits  1
   178217 #define GEN9_RENDER_SURFACE_STATE_CubeFaceEnablePositiveX_bits  1
   178218 #define GEN8_RENDER_SURFACE_STATE_CubeFaceEnablePositiveX_bits  1
   178219 #define GEN75_RENDER_SURFACE_STATE_CubeFaceEnablePositiveX_bits  1
   178220 #define GEN7_RENDER_SURFACE_STATE_CubeFaceEnablePositiveX_bits  1
   178221 #define GEN6_RENDER_SURFACE_STATE_CubeFaceEnablePositiveX_bits  1
   178222 #define GEN5_RENDER_SURFACE_STATE_CubeFaceEnablePositiveX_bits  1
   178223 #define GEN45_RENDER_SURFACE_STATE_CubeFaceEnablePositiveX_bits  1
   178224 #define GEN4_RENDER_SURFACE_STATE_CubeFaceEnablePositiveX_bits  1
   178225 
   178226 static inline uint32_t ATTRIBUTE_PURE
   178227 RENDER_SURFACE_STATE_CubeFaceEnablePositiveX_bits(const struct gen_device_info *devinfo)
   178228 {
   178229    switch (devinfo->gen) {
   178230    case 10: return 1;
   178231    case 9: return 1;
   178232    case 8: return 1;
   178233    case 7:
   178234       if (devinfo->is_haswell) {
   178235          return 1;
   178236       } else {
   178237          return 1;
   178238       }
   178239    case 6: return 1;
   178240    case 5: return 1;
   178241    case 4:
   178242       if (devinfo->is_g4x) {
   178243          return 1;
   178244       } else {
   178245          return 1;
   178246       }
   178247    default:
   178248       unreachable("Invalid hardware generation");
   178249    }
   178250 }
   178251 
   178252 
   178253 
   178254 #define GEN10_RENDER_SURFACE_STATE_CubeFaceEnablePositiveX_start  4
   178255 #define GEN9_RENDER_SURFACE_STATE_CubeFaceEnablePositiveX_start  4
   178256 #define GEN8_RENDER_SURFACE_STATE_CubeFaceEnablePositiveX_start  4
   178257 #define GEN75_RENDER_SURFACE_STATE_CubeFaceEnablePositiveX_start  4
   178258 #define GEN7_RENDER_SURFACE_STATE_CubeFaceEnablePositiveX_start  4
   178259 #define GEN6_RENDER_SURFACE_STATE_CubeFaceEnablePositiveX_start  4
   178260 #define GEN5_RENDER_SURFACE_STATE_CubeFaceEnablePositiveX_start  4
   178261 #define GEN45_RENDER_SURFACE_STATE_CubeFaceEnablePositiveX_start  4
   178262 #define GEN4_RENDER_SURFACE_STATE_CubeFaceEnablePositiveX_start  4
   178263 
   178264 static inline uint32_t ATTRIBUTE_PURE
   178265 RENDER_SURFACE_STATE_CubeFaceEnablePositiveX_start(const struct gen_device_info *devinfo)
   178266 {
   178267    switch (devinfo->gen) {
   178268    case 10: return 4;
   178269    case 9: return 4;
   178270    case 8: return 4;
   178271    case 7:
   178272       if (devinfo->is_haswell) {
   178273          return 4;
   178274       } else {
   178275          return 4;
   178276       }
   178277    case 6: return 4;
   178278    case 5: return 4;
   178279    case 4:
   178280       if (devinfo->is_g4x) {
   178281          return 4;
   178282       } else {
   178283          return 4;
   178284       }
   178285    default:
   178286       unreachable("Invalid hardware generation");
   178287    }
   178288 }
   178289 
   178290 
   178291 
   178292 /* RENDER_SURFACE_STATE::Cube Face Enable - Positive Y */
   178293 
   178294 
   178295 #define GEN10_RENDER_SURFACE_STATE_CubeFaceEnablePositiveY_bits  1
   178296 #define GEN9_RENDER_SURFACE_STATE_CubeFaceEnablePositiveY_bits  1
   178297 #define GEN8_RENDER_SURFACE_STATE_CubeFaceEnablePositiveY_bits  1
   178298 #define GEN75_RENDER_SURFACE_STATE_CubeFaceEnablePositiveY_bits  1
   178299 #define GEN7_RENDER_SURFACE_STATE_CubeFaceEnablePositiveY_bits  1
   178300 #define GEN6_RENDER_SURFACE_STATE_CubeFaceEnablePositiveY_bits  1
   178301 #define GEN5_RENDER_SURFACE_STATE_CubeFaceEnablePositiveY_bits  1
   178302 #define GEN45_RENDER_SURFACE_STATE_CubeFaceEnablePositiveY_bits  1
   178303 #define GEN4_RENDER_SURFACE_STATE_CubeFaceEnablePositiveY_bits  1
   178304 
   178305 static inline uint32_t ATTRIBUTE_PURE
   178306 RENDER_SURFACE_STATE_CubeFaceEnablePositiveY_bits(const struct gen_device_info *devinfo)
   178307 {
   178308    switch (devinfo->gen) {
   178309    case 10: return 1;
   178310    case 9: return 1;
   178311    case 8: return 1;
   178312    case 7:
   178313       if (devinfo->is_haswell) {
   178314          return 1;
   178315       } else {
   178316          return 1;
   178317       }
   178318    case 6: return 1;
   178319    case 5: return 1;
   178320    case 4:
   178321       if (devinfo->is_g4x) {
   178322          return 1;
   178323       } else {
   178324          return 1;
   178325       }
   178326    default:
   178327       unreachable("Invalid hardware generation");
   178328    }
   178329 }
   178330 
   178331 
   178332 
   178333 #define GEN10_RENDER_SURFACE_STATE_CubeFaceEnablePositiveY_start  2
   178334 #define GEN9_RENDER_SURFACE_STATE_CubeFaceEnablePositiveY_start  2
   178335 #define GEN8_RENDER_SURFACE_STATE_CubeFaceEnablePositiveY_start  2
   178336 #define GEN75_RENDER_SURFACE_STATE_CubeFaceEnablePositiveY_start  2
   178337 #define GEN7_RENDER_SURFACE_STATE_CubeFaceEnablePositiveY_start  2
   178338 #define GEN6_RENDER_SURFACE_STATE_CubeFaceEnablePositiveY_start  2
   178339 #define GEN5_RENDER_SURFACE_STATE_CubeFaceEnablePositiveY_start  2
   178340 #define GEN45_RENDER_SURFACE_STATE_CubeFaceEnablePositiveY_start  2
   178341 #define GEN4_RENDER_SURFACE_STATE_CubeFaceEnablePositiveY_start  2
   178342 
   178343 static inline uint32_t ATTRIBUTE_PURE
   178344 RENDER_SURFACE_STATE_CubeFaceEnablePositiveY_start(const struct gen_device_info *devinfo)
   178345 {
   178346    switch (devinfo->gen) {
   178347    case 10: return 2;
   178348    case 9: return 2;
   178349    case 8: return 2;
   178350    case 7:
   178351       if (devinfo->is_haswell) {
   178352          return 2;
   178353       } else {
   178354          return 2;
   178355       }
   178356    case 6: return 2;
   178357    case 5: return 2;
   178358    case 4:
   178359       if (devinfo->is_g4x) {
   178360          return 2;
   178361       } else {
   178362          return 2;
   178363       }
   178364    default:
   178365       unreachable("Invalid hardware generation");
   178366    }
   178367 }
   178368 
   178369 
   178370 
   178371 /* RENDER_SURFACE_STATE::Cube Face Enable - Positive Z */
   178372 
   178373 
   178374 #define GEN10_RENDER_SURFACE_STATE_CubeFaceEnablePositiveZ_bits  1
   178375 #define GEN9_RENDER_SURFACE_STATE_CubeFaceEnablePositiveZ_bits  1
   178376 #define GEN8_RENDER_SURFACE_STATE_CubeFaceEnablePositiveZ_bits  1
   178377 #define GEN75_RENDER_SURFACE_STATE_CubeFaceEnablePositiveZ_bits  1
   178378 #define GEN7_RENDER_SURFACE_STATE_CubeFaceEnablePositiveZ_bits  1
   178379 #define GEN6_RENDER_SURFACE_STATE_CubeFaceEnablePositiveZ_bits  1
   178380 #define GEN5_RENDER_SURFACE_STATE_CubeFaceEnablePositiveZ_bits  1
   178381 #define GEN45_RENDER_SURFACE_STATE_CubeFaceEnablePositiveZ_bits  1
   178382 #define GEN4_RENDER_SURFACE_STATE_CubeFaceEnablePositiveZ_bits  1
   178383 
   178384 static inline uint32_t ATTRIBUTE_PURE
   178385 RENDER_SURFACE_STATE_CubeFaceEnablePositiveZ_bits(const struct gen_device_info *devinfo)
   178386 {
   178387    switch (devinfo->gen) {
   178388    case 10: return 1;
   178389    case 9: return 1;
   178390    case 8: return 1;
   178391    case 7:
   178392       if (devinfo->is_haswell) {
   178393          return 1;
   178394       } else {
   178395          return 1;
   178396       }
   178397    case 6: return 1;
   178398    case 5: return 1;
   178399    case 4:
   178400       if (devinfo->is_g4x) {
   178401          return 1;
   178402       } else {
   178403          return 1;
   178404       }
   178405    default:
   178406       unreachable("Invalid hardware generation");
   178407    }
   178408 }
   178409 
   178410 
   178411 
   178412 #define GEN10_RENDER_SURFACE_STATE_CubeFaceEnablePositiveZ_start  0
   178413 #define GEN9_RENDER_SURFACE_STATE_CubeFaceEnablePositiveZ_start  0
   178414 #define GEN8_RENDER_SURFACE_STATE_CubeFaceEnablePositiveZ_start  0
   178415 #define GEN75_RENDER_SURFACE_STATE_CubeFaceEnablePositiveZ_start  0
   178416 #define GEN7_RENDER_SURFACE_STATE_CubeFaceEnablePositiveZ_start  0
   178417 #define GEN6_RENDER_SURFACE_STATE_CubeFaceEnablePositiveZ_start  0
   178418 #define GEN5_RENDER_SURFACE_STATE_CubeFaceEnablePositiveZ_start  0
   178419 #define GEN45_RENDER_SURFACE_STATE_CubeFaceEnablePositiveZ_start  0
   178420 #define GEN4_RENDER_SURFACE_STATE_CubeFaceEnablePositiveZ_start  0
   178421 
   178422 static inline uint32_t ATTRIBUTE_PURE
   178423 RENDER_SURFACE_STATE_CubeFaceEnablePositiveZ_start(const struct gen_device_info *devinfo)
   178424 {
   178425    switch (devinfo->gen) {
   178426    case 10: return 0;
   178427    case 9: return 0;
   178428    case 8: return 0;
   178429    case 7:
   178430       if (devinfo->is_haswell) {
   178431          return 0;
   178432       } else {
   178433          return 0;
   178434       }
   178435    case 6: return 0;
   178436    case 5: return 0;
   178437    case 4:
   178438       if (devinfo->is_g4x) {
   178439          return 0;
   178440       } else {
   178441          return 0;
   178442       }
   178443    default:
   178444       unreachable("Invalid hardware generation");
   178445    }
   178446 }
   178447 
   178448 
   178449 
   178450 /* RENDER_SURFACE_STATE::Cube Map Corner Mode */
   178451 
   178452 
   178453 #define GEN6_RENDER_SURFACE_STATE_CubeMapCornerMode_bits  1
   178454 #define GEN5_RENDER_SURFACE_STATE_CubeMapCornerMode_bits  1
   178455 
   178456 static inline uint32_t ATTRIBUTE_PURE
   178457 RENDER_SURFACE_STATE_CubeMapCornerMode_bits(const struct gen_device_info *devinfo)
   178458 {
   178459    switch (devinfo->gen) {
   178460    case 10: return 0;
   178461    case 9: return 0;
   178462    case 8: return 0;
   178463    case 7:
   178464       if (devinfo->is_haswell) {
   178465          return 0;
   178466       } else {
   178467          return 0;
   178468       }
   178469    case 6: return 1;
   178470    case 5: return 1;
   178471    case 4:
   178472       if (devinfo->is_g4x) {
   178473          return 0;
   178474       } else {
   178475          return 0;
   178476       }
   178477    default:
   178478       unreachable("Invalid hardware generation");
   178479    }
   178480 }
   178481 
   178482 
   178483 
   178484 #define GEN6_RENDER_SURFACE_STATE_CubeMapCornerMode_start  9
   178485 #define GEN5_RENDER_SURFACE_STATE_CubeMapCornerMode_start  9
   178486 
   178487 static inline uint32_t ATTRIBUTE_PURE
   178488 RENDER_SURFACE_STATE_CubeMapCornerMode_start(const struct gen_device_info *devinfo)
   178489 {
   178490    switch (devinfo->gen) {
   178491    case 10: return 0;
   178492    case 9: return 0;
   178493    case 8: return 0;
   178494    case 7:
   178495       if (devinfo->is_haswell) {
   178496          return 0;
   178497       } else {
   178498          return 0;
   178499       }
   178500    case 6: return 9;
   178501    case 5: return 9;
   178502    case 4:
   178503       if (devinfo->is_g4x) {
   178504          return 0;
   178505       } else {
   178506          return 0;
   178507       }
   178508    default:
   178509       unreachable("Invalid hardware generation");
   178510    }
   178511 }
   178512 
   178513 
   178514 
   178515 /* RENDER_SURFACE_STATE::Data Return Format */
   178516 
   178517 
   178518 #define GEN6_RENDER_SURFACE_STATE_DataReturnFormat_bits  1
   178519 #define GEN5_RENDER_SURFACE_STATE_DataReturnFormat_bits  1
   178520 #define GEN45_RENDER_SURFACE_STATE_DataReturnFormat_bits  1
   178521 #define GEN4_RENDER_SURFACE_STATE_DataReturnFormat_bits  1
   178522 
   178523 static inline uint32_t ATTRIBUTE_PURE
   178524 RENDER_SURFACE_STATE_DataReturnFormat_bits(const struct gen_device_info *devinfo)
   178525 {
   178526    switch (devinfo->gen) {
   178527    case 10: return 0;
   178528    case 9: return 0;
   178529    case 8: return 0;
   178530    case 7:
   178531       if (devinfo->is_haswell) {
   178532          return 0;
   178533       } else {
   178534          return 0;
   178535       }
   178536    case 6: return 1;
   178537    case 5: return 1;
   178538    case 4:
   178539       if (devinfo->is_g4x) {
   178540          return 1;
   178541       } else {
   178542          return 1;
   178543       }
   178544    default:
   178545       unreachable("Invalid hardware generation");
   178546    }
   178547 }
   178548 
   178549 
   178550 
   178551 #define GEN6_RENDER_SURFACE_STATE_DataReturnFormat_start  27
   178552 #define GEN5_RENDER_SURFACE_STATE_DataReturnFormat_start  27
   178553 #define GEN45_RENDER_SURFACE_STATE_DataReturnFormat_start  27
   178554 #define GEN4_RENDER_SURFACE_STATE_DataReturnFormat_start  27
   178555 
   178556 static inline uint32_t ATTRIBUTE_PURE
   178557 RENDER_SURFACE_STATE_DataReturnFormat_start(const struct gen_device_info *devinfo)
   178558 {
   178559    switch (devinfo->gen) {
   178560    case 10: return 0;
   178561    case 9: return 0;
   178562    case 8: return 0;
   178563    case 7:
   178564       if (devinfo->is_haswell) {
   178565          return 0;
   178566       } else {
   178567          return 0;
   178568       }
   178569    case 6: return 27;
   178570    case 5: return 27;
   178571    case 4:
   178572       if (devinfo->is_g4x) {
   178573          return 27;
   178574       } else {
   178575          return 27;
   178576       }
   178577    default:
   178578       unreachable("Invalid hardware generation");
   178579    }
   178580 }
   178581 
   178582 
   178583 
   178584 /* RENDER_SURFACE_STATE::Depth */
   178585 
   178586 
   178587 #define GEN10_RENDER_SURFACE_STATE_Depth_bits  11
   178588 #define GEN9_RENDER_SURFACE_STATE_Depth_bits  11
   178589 #define GEN8_RENDER_SURFACE_STATE_Depth_bits  11
   178590 #define GEN75_RENDER_SURFACE_STATE_Depth_bits  11
   178591 #define GEN7_RENDER_SURFACE_STATE_Depth_bits  11
   178592 #define GEN6_RENDER_SURFACE_STATE_Depth_bits  11
   178593 #define GEN5_RENDER_SURFACE_STATE_Depth_bits  11
   178594 #define GEN45_RENDER_SURFACE_STATE_Depth_bits  11
   178595 #define GEN4_RENDER_SURFACE_STATE_Depth_bits  11
   178596 
   178597 static inline uint32_t ATTRIBUTE_PURE
   178598 RENDER_SURFACE_STATE_Depth_bits(const struct gen_device_info *devinfo)
   178599 {
   178600    switch (devinfo->gen) {
   178601    case 10: return 11;
   178602    case 9: return 11;
   178603    case 8: return 11;
   178604    case 7:
   178605       if (devinfo->is_haswell) {
   178606          return 11;
   178607       } else {
   178608          return 11;
   178609       }
   178610    case 6: return 11;
   178611    case 5: return 11;
   178612    case 4:
   178613       if (devinfo->is_g4x) {
   178614          return 11;
   178615       } else {
   178616          return 11;
   178617       }
   178618    default:
   178619       unreachable("Invalid hardware generation");
   178620    }
   178621 }
   178622 
   178623 
   178624 
   178625 #define GEN10_RENDER_SURFACE_STATE_Depth_start  117
   178626 #define GEN9_RENDER_SURFACE_STATE_Depth_start  117
   178627 #define GEN8_RENDER_SURFACE_STATE_Depth_start  117
   178628 #define GEN75_RENDER_SURFACE_STATE_Depth_start  117
   178629 #define GEN7_RENDER_SURFACE_STATE_Depth_start  117
   178630 #define GEN6_RENDER_SURFACE_STATE_Depth_start  117
   178631 #define GEN5_RENDER_SURFACE_STATE_Depth_start  117
   178632 #define GEN45_RENDER_SURFACE_STATE_Depth_start  117
   178633 #define GEN4_RENDER_SURFACE_STATE_Depth_start  117
   178634 
   178635 static inline uint32_t ATTRIBUTE_PURE
   178636 RENDER_SURFACE_STATE_Depth_start(const struct gen_device_info *devinfo)
   178637 {
   178638    switch (devinfo->gen) {
   178639    case 10: return 117;
   178640    case 9: return 117;
   178641    case 8: return 117;
   178642    case 7:
   178643       if (devinfo->is_haswell) {
   178644          return 117;
   178645       } else {
   178646          return 117;
   178647       }
   178648    case 6: return 117;
   178649    case 5: return 117;
   178650    case 4:
   178651       if (devinfo->is_g4x) {
   178652          return 117;
   178653       } else {
   178654          return 117;
   178655       }
   178656    default:
   178657       unreachable("Invalid hardware generation");
   178658    }
   178659 }
   178660 
   178661 
   178662 
   178663 /* RENDER_SURFACE_STATE::EWA Disable For Cube */
   178664 
   178665 
   178666 #define GEN10_RENDER_SURFACE_STATE_EWADisableForCube_bits  1
   178667 #define GEN9_RENDER_SURFACE_STATE_EWADisableForCube_bits  1
   178668 #define GEN8_RENDER_SURFACE_STATE_EWADisableForCube_bits  1
   178669 
   178670 static inline uint32_t ATTRIBUTE_PURE
   178671 RENDER_SURFACE_STATE_EWADisableForCube_bits(const struct gen_device_info *devinfo)
   178672 {
   178673    switch (devinfo->gen) {
   178674    case 10: return 1;
   178675    case 9: return 1;
   178676    case 8: return 1;
   178677    case 7:
   178678       if (devinfo->is_haswell) {
   178679          return 0;
   178680       } else {
   178681          return 0;
   178682       }
   178683    case 6: return 0;
   178684    case 5: return 0;
   178685    case 4:
   178686       if (devinfo->is_g4x) {
   178687          return 0;
   178688       } else {
   178689          return 0;
   178690       }
   178691    default:
   178692       unreachable("Invalid hardware generation");
   178693    }
   178694 }
   178695 
   178696 
   178697 
   178698 #define GEN10_RENDER_SURFACE_STATE_EWADisableForCube_start  180
   178699 #define GEN9_RENDER_SURFACE_STATE_EWADisableForCube_start  180
   178700 #define GEN8_RENDER_SURFACE_STATE_EWADisableForCube_start  180
   178701 
   178702 static inline uint32_t ATTRIBUTE_PURE
   178703 RENDER_SURFACE_STATE_EWADisableForCube_start(const struct gen_device_info *devinfo)
   178704 {
   178705    switch (devinfo->gen) {
   178706    case 10: return 180;
   178707    case 9: return 180;
   178708    case 8: return 180;
   178709    case 7:
   178710       if (devinfo->is_haswell) {
   178711          return 0;
   178712       } else {
   178713          return 0;
   178714       }
   178715    case 6: return 0;
   178716    case 5: return 0;
   178717    case 4:
   178718       if (devinfo->is_g4x) {
   178719          return 0;
   178720       } else {
   178721          return 0;
   178722       }
   178723    default:
   178724       unreachable("Invalid hardware generation");
   178725    }
   178726 }
   178727 
   178728 
   178729 
   178730 /* RENDER_SURFACE_STATE::Force Non-Comparison Reduction Type */
   178731 
   178732 
   178733 #define GEN10_RENDER_SURFACE_STATE_ForceNonComparisonReductionType_bits  1
   178734 
   178735 static inline uint32_t ATTRIBUTE_PURE
   178736 RENDER_SURFACE_STATE_ForceNonComparisonReductionType_bits(const struct gen_device_info *devinfo)
   178737 {
   178738    switch (devinfo->gen) {
   178739    case 10: return 1;
   178740    case 9: return 0;
   178741    case 8: return 0;
   178742    case 7:
   178743       if (devinfo->is_haswell) {
   178744          return 0;
   178745       } else {
   178746          return 0;
   178747       }
   178748    case 6: return 0;
   178749    case 5: return 0;
   178750    case 4:
   178751       if (devinfo->is_g4x) {
   178752          return 0;
   178753       } else {
   178754          return 0;
   178755       }
   178756    default:
   178757       unreachable("Invalid hardware generation");
   178758    }
   178759 }
   178760 
   178761 
   178762 
   178763 #define GEN10_RENDER_SURFACE_STATE_ForceNonComparisonReductionType_start  159
   178764 
   178765 static inline uint32_t ATTRIBUTE_PURE
   178766 RENDER_SURFACE_STATE_ForceNonComparisonReductionType_start(const struct gen_device_info *devinfo)
   178767 {
   178768    switch (devinfo->gen) {
   178769    case 10: return 159;
   178770    case 9: return 0;
   178771    case 8: return 0;
   178772    case 7:
   178773       if (devinfo->is_haswell) {
   178774          return 0;
   178775       } else {
   178776          return 0;
   178777       }
   178778    case 6: return 0;
   178779    case 5: return 0;
   178780    case 4:
   178781       if (devinfo->is_g4x) {
   178782          return 0;
   178783       } else {
   178784          return 0;
   178785       }
   178786    default:
   178787       unreachable("Invalid hardware generation");
   178788    }
   178789 }
   178790 
   178791 
   178792 
   178793 /* RENDER_SURFACE_STATE::Green Clear Color */
   178794 
   178795 
   178796 #define GEN10_RENDER_SURFACE_STATE_GreenClearColor_bits  32
   178797 #define GEN9_RENDER_SURFACE_STATE_GreenClearColor_bits  32
   178798 #define GEN8_RENDER_SURFACE_STATE_GreenClearColor_bits  1
   178799 #define GEN75_RENDER_SURFACE_STATE_GreenClearColor_bits  1
   178800 #define GEN7_RENDER_SURFACE_STATE_GreenClearColor_bits  1
   178801 
   178802 static inline uint32_t ATTRIBUTE_PURE
   178803 RENDER_SURFACE_STATE_GreenClearColor_bits(const struct gen_device_info *devinfo)
   178804 {
   178805    switch (devinfo->gen) {
   178806    case 10: return 32;
   178807    case 9: return 32;
   178808    case 8: return 1;
   178809    case 7:
   178810       if (devinfo->is_haswell) {
   178811          return 1;
   178812       } else {
   178813          return 1;
   178814       }
   178815    case 6: return 0;
   178816    case 5: return 0;
   178817    case 4:
   178818       if (devinfo->is_g4x) {
   178819          return 0;
   178820       } else {
   178821          return 0;
   178822       }
   178823    default:
   178824       unreachable("Invalid hardware generation");
   178825    }
   178826 }
   178827 
   178828 
   178829 
   178830 #define GEN10_RENDER_SURFACE_STATE_GreenClearColor_start  416
   178831 #define GEN9_RENDER_SURFACE_STATE_GreenClearColor_start  416
   178832 #define GEN8_RENDER_SURFACE_STATE_GreenClearColor_start  254
   178833 #define GEN75_RENDER_SURFACE_STATE_GreenClearColor_start  254
   178834 #define GEN7_RENDER_SURFACE_STATE_GreenClearColor_start  254
   178835 
   178836 static inline uint32_t ATTRIBUTE_PURE
   178837 RENDER_SURFACE_STATE_GreenClearColor_start(const struct gen_device_info *devinfo)
   178838 {
   178839    switch (devinfo->gen) {
   178840    case 10: return 416;
   178841    case 9: return 416;
   178842    case 8: return 254;
   178843    case 7:
   178844       if (devinfo->is_haswell) {
   178845          return 254;
   178846       } else {
   178847          return 254;
   178848       }
   178849    case 6: return 0;
   178850    case 5: return 0;
   178851    case 4:
   178852       if (devinfo->is_g4x) {
   178853          return 0;
   178854       } else {
   178855          return 0;
   178856       }
   178857    default:
   178858       unreachable("Invalid hardware generation");
   178859    }
   178860 }
   178861 
   178862 
   178863 
   178864 /* RENDER_SURFACE_STATE::Height */
   178865 
   178866 
   178867 #define GEN10_RENDER_SURFACE_STATE_Height_bits  14
   178868 #define GEN9_RENDER_SURFACE_STATE_Height_bits  14
   178869 #define GEN8_RENDER_SURFACE_STATE_Height_bits  14
   178870 #define GEN75_RENDER_SURFACE_STATE_Height_bits  14
   178871 #define GEN7_RENDER_SURFACE_STATE_Height_bits  14
   178872 #define GEN6_RENDER_SURFACE_STATE_Height_bits  13
   178873 #define GEN5_RENDER_SURFACE_STATE_Height_bits  13
   178874 #define GEN45_RENDER_SURFACE_STATE_Height_bits  13
   178875 #define GEN4_RENDER_SURFACE_STATE_Height_bits  13
   178876 
   178877 static inline uint32_t ATTRIBUTE_PURE
   178878 RENDER_SURFACE_STATE_Height_bits(const struct gen_device_info *devinfo)
   178879 {
   178880    switch (devinfo->gen) {
   178881    case 10: return 14;
   178882    case 9: return 14;
   178883    case 8: return 14;
   178884    case 7:
   178885       if (devinfo->is_haswell) {
   178886          return 14;
   178887       } else {
   178888          return 14;
   178889       }
   178890    case 6: return 13;
   178891    case 5: return 13;
   178892    case 4:
   178893       if (devinfo->is_g4x) {
   178894          return 13;
   178895       } else {
   178896          return 13;
   178897       }
   178898    default:
   178899       unreachable("Invalid hardware generation");
   178900    }
   178901 }
   178902 
   178903 
   178904 
   178905 #define GEN10_RENDER_SURFACE_STATE_Height_start  80
   178906 #define GEN9_RENDER_SURFACE_STATE_Height_start  80
   178907 #define GEN8_RENDER_SURFACE_STATE_Height_start  80
   178908 #define GEN75_RENDER_SURFACE_STATE_Height_start  80
   178909 #define GEN7_RENDER_SURFACE_STATE_Height_start  80
   178910 #define GEN6_RENDER_SURFACE_STATE_Height_start  83
   178911 #define GEN5_RENDER_SURFACE_STATE_Height_start  83
   178912 #define GEN45_RENDER_SURFACE_STATE_Height_start  83
   178913 #define GEN4_RENDER_SURFACE_STATE_Height_start  83
   178914 
   178915 static inline uint32_t ATTRIBUTE_PURE
   178916 RENDER_SURFACE_STATE_Height_start(const struct gen_device_info *devinfo)
   178917 {
   178918    switch (devinfo->gen) {
   178919    case 10: return 80;
   178920    case 9: return 80;
   178921    case 8: return 80;
   178922    case 7:
   178923       if (devinfo->is_haswell) {
   178924          return 80;
   178925       } else {
   178926          return 80;
   178927       }
   178928    case 6: return 83;
   178929    case 5: return 83;
   178930    case 4:
   178931       if (devinfo->is_g4x) {
   178932          return 83;
   178933       } else {
   178934          return 83;
   178935       }
   178936    default:
   178937       unreachable("Invalid hardware generation");
   178938    }
   178939 }
   178940 
   178941 
   178942 
   178943 /* RENDER_SURFACE_STATE::Hierarchical Depth Clear Value */
   178944 
   178945 
   178946 #define GEN9_RENDER_SURFACE_STATE_HierarchicalDepthClearValue_bits  32
   178947 
   178948 static inline uint32_t ATTRIBUTE_PURE
   178949 RENDER_SURFACE_STATE_HierarchicalDepthClearValue_bits(const struct gen_device_info *devinfo)
   178950 {
   178951    switch (devinfo->gen) {
   178952    case 10: return 0;
   178953    case 9: return 32;
   178954    case 8: return 0;
   178955    case 7:
   178956       if (devinfo->is_haswell) {
   178957          return 0;
   178958       } else {
   178959          return 0;
   178960       }
   178961    case 6: return 0;
   178962    case 5: return 0;
   178963    case 4:
   178964       if (devinfo->is_g4x) {
   178965          return 0;
   178966       } else {
   178967          return 0;
   178968       }
   178969    default:
   178970       unreachable("Invalid hardware generation");
   178971    }
   178972 }
   178973 
   178974 
   178975 
   178976 #define GEN9_RENDER_SURFACE_STATE_HierarchicalDepthClearValue_start  384
   178977 
   178978 static inline uint32_t ATTRIBUTE_PURE
   178979 RENDER_SURFACE_STATE_HierarchicalDepthClearValue_start(const struct gen_device_info *devinfo)
   178980 {
   178981    switch (devinfo->gen) {
   178982    case 10: return 0;
   178983    case 9: return 384;
   178984    case 8: return 0;
   178985    case 7:
   178986       if (devinfo->is_haswell) {
   178987          return 0;
   178988       } else {
   178989          return 0;
   178990       }
   178991    case 6: return 0;
   178992    case 5: return 0;
   178993    case 4:
   178994       if (devinfo->is_g4x) {
   178995          return 0;
   178996       } else {
   178997          return 0;
   178998       }
   178999    default:
   179000       unreachable("Invalid hardware generation");
   179001    }
   179002 }
   179003 
   179004 
   179005 
   179006 /* RENDER_SURFACE_STATE::Integer Surface Format */
   179007 
   179008 
   179009 #define GEN75_RENDER_SURFACE_STATE_IntegerSurfaceFormat_bits  3
   179010 
   179011 static inline uint32_t ATTRIBUTE_PURE
   179012 RENDER_SURFACE_STATE_IntegerSurfaceFormat_bits(const struct gen_device_info *devinfo)
   179013 {
   179014    switch (devinfo->gen) {
   179015    case 10: return 0;
   179016    case 9: return 0;
   179017    case 8: return 0;
   179018    case 7:
   179019       if (devinfo->is_haswell) {
   179020          return 3;
   179021       } else {
   179022          return 0;
   179023       }
   179024    case 6: return 0;
   179025    case 5: return 0;
   179026    case 4:
   179027       if (devinfo->is_g4x) {
   179028          return 0;
   179029       } else {
   179030          return 0;
   179031       }
   179032    default:
   179033       unreachable("Invalid hardware generation");
   179034    }
   179035 }
   179036 
   179037 
   179038 
   179039 #define GEN75_RENDER_SURFACE_STATE_IntegerSurfaceFormat_start  114
   179040 
   179041 static inline uint32_t ATTRIBUTE_PURE
   179042 RENDER_SURFACE_STATE_IntegerSurfaceFormat_start(const struct gen_device_info *devinfo)
   179043 {
   179044    switch (devinfo->gen) {
   179045    case 10: return 0;
   179046    case 9: return 0;
   179047    case 8: return 0;
   179048    case 7:
   179049       if (devinfo->is_haswell) {
   179050          return 114;
   179051       } else {
   179052          return 0;
   179053       }
   179054    case 6: return 0;
   179055    case 5: return 0;
   179056    case 4:
   179057       if (devinfo->is_g4x) {
   179058          return 0;
   179059       } else {
   179060          return 0;
   179061       }
   179062    default:
   179063       unreachable("Invalid hardware generation");
   179064    }
   179065 }
   179066 
   179067 
   179068 
   179069 /* RENDER_SURFACE_STATE::MCS Enable */
   179070 
   179071 
   179072 #define GEN75_RENDER_SURFACE_STATE_MCSEnable_bits  1
   179073 #define GEN7_RENDER_SURFACE_STATE_MCSEnable_bits  1
   179074 
   179075 static inline uint32_t ATTRIBUTE_PURE
   179076 RENDER_SURFACE_STATE_MCSEnable_bits(const struct gen_device_info *devinfo)
   179077 {
   179078    switch (devinfo->gen) {
   179079    case 10: return 0;
   179080    case 9: return 0;
   179081    case 8: return 0;
   179082    case 7:
   179083       if (devinfo->is_haswell) {
   179084          return 1;
   179085       } else {
   179086          return 1;
   179087       }
   179088    case 6: return 0;
   179089    case 5: return 0;
   179090    case 4:
   179091       if (devinfo->is_g4x) {
   179092          return 0;
   179093       } else {
   179094          return 0;
   179095       }
   179096    default:
   179097       unreachable("Invalid hardware generation");
   179098    }
   179099 }
   179100 
   179101 
   179102 
   179103 #define GEN75_RENDER_SURFACE_STATE_MCSEnable_start  192
   179104 #define GEN7_RENDER_SURFACE_STATE_MCSEnable_start  192
   179105 
   179106 static inline uint32_t ATTRIBUTE_PURE
   179107 RENDER_SURFACE_STATE_MCSEnable_start(const struct gen_device_info *devinfo)
   179108 {
   179109    switch (devinfo->gen) {
   179110    case 10: return 0;
   179111    case 9: return 0;
   179112    case 8: return 0;
   179113    case 7:
   179114       if (devinfo->is_haswell) {
   179115          return 192;
   179116       } else {
   179117          return 192;
   179118       }
   179119    case 6: return 0;
   179120    case 5: return 0;
   179121    case 4:
   179122       if (devinfo->is_g4x) {
   179123          return 0;
   179124       } else {
   179125          return 0;
   179126       }
   179127    default:
   179128       unreachable("Invalid hardware generation");
   179129    }
   179130 }
   179131 
   179132 
   179133 
   179134 /* RENDER_SURFACE_STATE::MIP Count / LOD */
   179135 
   179136 
   179137 #define GEN10_RENDER_SURFACE_STATE_MIPCountLOD_bits  4
   179138 #define GEN9_RENDER_SURFACE_STATE_MIPCountLOD_bits  4
   179139 #define GEN8_RENDER_SURFACE_STATE_MIPCountLOD_bits  4
   179140 #define GEN75_RENDER_SURFACE_STATE_MIPCountLOD_bits  4
   179141 #define GEN7_RENDER_SURFACE_STATE_MIPCountLOD_bits  4
   179142 #define GEN6_RENDER_SURFACE_STATE_MIPCountLOD_bits  4
   179143 #define GEN5_RENDER_SURFACE_STATE_MIPCountLOD_bits  4
   179144 #define GEN45_RENDER_SURFACE_STATE_MIPCountLOD_bits  4
   179145 #define GEN4_RENDER_SURFACE_STATE_MIPCountLOD_bits  4
   179146 
   179147 static inline uint32_t ATTRIBUTE_PURE
   179148 RENDER_SURFACE_STATE_MIPCountLOD_bits(const struct gen_device_info *devinfo)
   179149 {
   179150    switch (devinfo->gen) {
   179151    case 10: return 4;
   179152    case 9: return 4;
   179153    case 8: return 4;
   179154    case 7:
   179155       if (devinfo->is_haswell) {
   179156          return 4;
   179157       } else {
   179158          return 4;
   179159       }
   179160    case 6: return 4;
   179161    case 5: return 4;
   179162    case 4:
   179163       if (devinfo->is_g4x) {
   179164          return 4;
   179165       } else {
   179166          return 4;
   179167       }
   179168    default:
   179169       unreachable("Invalid hardware generation");
   179170    }
   179171 }
   179172 
   179173 
   179174 
   179175 #define GEN10_RENDER_SURFACE_STATE_MIPCountLOD_start  160
   179176 #define GEN9_RENDER_SURFACE_STATE_MIPCountLOD_start  160
   179177 #define GEN8_RENDER_SURFACE_STATE_MIPCountLOD_start  160
   179178 #define GEN75_RENDER_SURFACE_STATE_MIPCountLOD_start  160
   179179 #define GEN7_RENDER_SURFACE_STATE_MIPCountLOD_start  160
   179180 #define GEN6_RENDER_SURFACE_STATE_MIPCountLOD_start  66
   179181 #define GEN5_RENDER_SURFACE_STATE_MIPCountLOD_start  66
   179182 #define GEN45_RENDER_SURFACE_STATE_MIPCountLOD_start  66
   179183 #define GEN4_RENDER_SURFACE_STATE_MIPCountLOD_start  66
   179184 
   179185 static inline uint32_t ATTRIBUTE_PURE
   179186 RENDER_SURFACE_STATE_MIPCountLOD_start(const struct gen_device_info *devinfo)
   179187 {
   179188    switch (devinfo->gen) {
   179189    case 10: return 160;
   179190    case 9: return 160;
   179191    case 8: return 160;
   179192    case 7:
   179193       if (devinfo->is_haswell) {
   179194          return 160;
   179195       } else {
   179196          return 160;
   179197       }
   179198    case 6: return 66;
   179199    case 5: return 66;
   179200    case 4:
   179201       if (devinfo->is_g4x) {
   179202          return 66;
   179203       } else {
   179204          return 66;
   179205       }
   179206    default:
   179207       unreachable("Invalid hardware generation");
   179208    }
   179209 }
   179210 
   179211 
   179212 
   179213 /* RENDER_SURFACE_STATE::MIP Map Layout Mode */
   179214 
   179215 
   179216 #define GEN6_RENDER_SURFACE_STATE_MIPMapLayoutMode_bits  1
   179217 #define GEN5_RENDER_SURFACE_STATE_MIPMapLayoutMode_bits  1
   179218 #define GEN45_RENDER_SURFACE_STATE_MIPMapLayoutMode_bits  1
   179219 #define GEN4_RENDER_SURFACE_STATE_MIPMapLayoutMode_bits  1
   179220 
   179221 static inline uint32_t ATTRIBUTE_PURE
   179222 RENDER_SURFACE_STATE_MIPMapLayoutMode_bits(const struct gen_device_info *devinfo)
   179223 {
   179224    switch (devinfo->gen) {
   179225    case 10: return 0;
   179226    case 9: return 0;
   179227    case 8: return 0;
   179228    case 7:
   179229       if (devinfo->is_haswell) {
   179230          return 0;
   179231       } else {
   179232          return 0;
   179233       }
   179234    case 6: return 1;
   179235    case 5: return 1;
   179236    case 4:
   179237       if (devinfo->is_g4x) {
   179238          return 1;
   179239       } else {
   179240          return 1;
   179241       }
   179242    default:
   179243       unreachable("Invalid hardware generation");
   179244    }
   179245 }
   179246 
   179247 
   179248 
   179249 #define GEN6_RENDER_SURFACE_STATE_MIPMapLayoutMode_start  10
   179250 #define GEN5_RENDER_SURFACE_STATE_MIPMapLayoutMode_start  10
   179251 #define GEN45_RENDER_SURFACE_STATE_MIPMapLayoutMode_start  10
   179252 #define GEN4_RENDER_SURFACE_STATE_MIPMapLayoutMode_start  10
   179253 
   179254 static inline uint32_t ATTRIBUTE_PURE
   179255 RENDER_SURFACE_STATE_MIPMapLayoutMode_start(const struct gen_device_info *devinfo)
   179256 {
   179257    switch (devinfo->gen) {
   179258    case 10: return 0;
   179259    case 9: return 0;
   179260    case 8: return 0;
   179261    case 7:
   179262       if (devinfo->is_haswell) {
   179263          return 0;
   179264       } else {
   179265          return 0;
   179266       }
   179267    case 6: return 10;
   179268    case 5: return 10;
   179269    case 4:
   179270       if (devinfo->is_g4x) {
   179271          return 10;
   179272       } else {
   179273          return 10;
   179274       }
   179275    default:
   179276       unreachable("Invalid hardware generation");
   179277    }
   179278 }
   179279 
   179280 
   179281 
   179282 /* RENDER_SURFACE_STATE::MOCS */
   179283 
   179284 
   179285 #define GEN10_RENDER_SURFACE_STATE_MOCS_bits  7
   179286 #define GEN9_RENDER_SURFACE_STATE_MOCS_bits  7
   179287 #define GEN8_RENDER_SURFACE_STATE_MOCS_bits  7
   179288 #define GEN75_RENDER_SURFACE_STATE_MOCS_bits  4
   179289 #define GEN7_RENDER_SURFACE_STATE_MOCS_bits  4
   179290 #define GEN6_RENDER_SURFACE_STATE_MOCS_bits  4
   179291 
   179292 static inline uint32_t ATTRIBUTE_PURE
   179293 RENDER_SURFACE_STATE_MOCS_bits(const struct gen_device_info *devinfo)
   179294 {
   179295    switch (devinfo->gen) {
   179296    case 10: return 7;
   179297    case 9: return 7;
   179298    case 8: return 7;
   179299    case 7:
   179300       if (devinfo->is_haswell) {
   179301          return 4;
   179302       } else {
   179303          return 4;
   179304       }
   179305    case 6: return 4;
   179306    case 5: return 0;
   179307    case 4:
   179308       if (devinfo->is_g4x) {
   179309          return 0;
   179310       } else {
   179311          return 0;
   179312       }
   179313    default:
   179314       unreachable("Invalid hardware generation");
   179315    }
   179316 }
   179317 
   179318 
   179319 
   179320 #define GEN10_RENDER_SURFACE_STATE_MOCS_start  56
   179321 #define GEN9_RENDER_SURFACE_STATE_MOCS_start  56
   179322 #define GEN8_RENDER_SURFACE_STATE_MOCS_start  56
   179323 #define GEN75_RENDER_SURFACE_STATE_MOCS_start  176
   179324 #define GEN7_RENDER_SURFACE_STATE_MOCS_start  176
   179325 #define GEN6_RENDER_SURFACE_STATE_MOCS_start  176
   179326 
   179327 static inline uint32_t ATTRIBUTE_PURE
   179328 RENDER_SURFACE_STATE_MOCS_start(const struct gen_device_info *devinfo)
   179329 {
   179330    switch (devinfo->gen) {
   179331    case 10: return 56;
   179332    case 9: return 56;
   179333    case 8: return 56;
   179334    case 7:
   179335       if (devinfo->is_haswell) {
   179336          return 176;
   179337       } else {
   179338          return 176;
   179339       }
   179340    case 6: return 176;
   179341    case 5: return 0;
   179342    case 4:
   179343       if (devinfo->is_g4x) {
   179344          return 0;
   179345       } else {
   179346          return 0;
   179347       }
   179348    default:
   179349       unreachable("Invalid hardware generation");
   179350    }
   179351 }
   179352 
   179353 
   179354 
   179355 /* RENDER_SURFACE_STATE::Media Boundary Pixel Mode */
   179356 
   179357 
   179358 #define GEN10_RENDER_SURFACE_STATE_MediaBoundaryPixelMode_bits  2
   179359 #define GEN9_RENDER_SURFACE_STATE_MediaBoundaryPixelMode_bits  2
   179360 #define GEN8_RENDER_SURFACE_STATE_MediaBoundaryPixelMode_bits  2
   179361 #define GEN75_RENDER_SURFACE_STATE_MediaBoundaryPixelMode_bits  2
   179362 #define GEN7_RENDER_SURFACE_STATE_MediaBoundaryPixelMode_bits  2
   179363 #define GEN6_RENDER_SURFACE_STATE_MediaBoundaryPixelMode_bits  2
   179364 #define GEN5_RENDER_SURFACE_STATE_MediaBoundaryPixelMode_bits  2
   179365 #define GEN45_RENDER_SURFACE_STATE_MediaBoundaryPixelMode_bits  2
   179366 #define GEN4_RENDER_SURFACE_STATE_MediaBoundaryPixelMode_bits  2
   179367 
   179368 static inline uint32_t ATTRIBUTE_PURE
   179369 RENDER_SURFACE_STATE_MediaBoundaryPixelMode_bits(const struct gen_device_info *devinfo)
   179370 {
   179371    switch (devinfo->gen) {
   179372    case 10: return 2;
   179373    case 9: return 2;
   179374    case 8: return 2;
   179375    case 7:
   179376       if (devinfo->is_haswell) {
   179377          return 2;
   179378       } else {
   179379          return 2;
   179380       }
   179381    case 6: return 2;
   179382    case 5: return 2;
   179383    case 4:
   179384       if (devinfo->is_g4x) {
   179385          return 2;
   179386       } else {
   179387          return 2;
   179388       }
   179389    default:
   179390       unreachable("Invalid hardware generation");
   179391    }
   179392 }
   179393 
   179394 
   179395 
   179396 #define GEN10_RENDER_SURFACE_STATE_MediaBoundaryPixelMode_start  6
   179397 #define GEN9_RENDER_SURFACE_STATE_MediaBoundaryPixelMode_start  6
   179398 #define GEN8_RENDER_SURFACE_STATE_MediaBoundaryPixelMode_start  6
   179399 #define GEN75_RENDER_SURFACE_STATE_MediaBoundaryPixelMode_start  6
   179400 #define GEN7_RENDER_SURFACE_STATE_MediaBoundaryPixelMode_start  6
   179401 #define GEN6_RENDER_SURFACE_STATE_MediaBoundaryPixelMode_start  6
   179402 #define GEN5_RENDER_SURFACE_STATE_MediaBoundaryPixelMode_start  6
   179403 #define GEN45_RENDER_SURFACE_STATE_MediaBoundaryPixelMode_start  6
   179404 #define GEN4_RENDER_SURFACE_STATE_MediaBoundaryPixelMode_start  6
   179405 
   179406 static inline uint32_t ATTRIBUTE_PURE
   179407 RENDER_SURFACE_STATE_MediaBoundaryPixelMode_start(const struct gen_device_info *devinfo)
   179408 {
   179409    switch (devinfo->gen) {
   179410    case 10: return 6;
   179411    case 9: return 6;
   179412    case 8: return 6;
   179413    case 7:
   179414       if (devinfo->is_haswell) {
   179415          return 6;
   179416       } else {
   179417          return 6;
   179418       }
   179419    case 6: return 6;
   179420    case 5: return 6;
   179421    case 4:
   179422       if (devinfo->is_g4x) {
   179423          return 6;
   179424       } else {
   179425          return 6;
   179426       }
   179427    default:
   179428       unreachable("Invalid hardware generation");
   179429    }
   179430 }
   179431 
   179432 
   179433 
   179434 /* RENDER_SURFACE_STATE::Memory Compression Enable */
   179435 
   179436 
   179437 #define GEN10_RENDER_SURFACE_STATE_MemoryCompressionEnable_bits  1
   179438 #define GEN9_RENDER_SURFACE_STATE_MemoryCompressionEnable_bits  1
   179439 
   179440 static inline uint32_t ATTRIBUTE_PURE
   179441 RENDER_SURFACE_STATE_MemoryCompressionEnable_bits(const struct gen_device_info *devinfo)
   179442 {
   179443    switch (devinfo->gen) {
   179444    case 10: return 1;
   179445    case 9: return 1;
   179446    case 8: return 0;
   179447    case 7:
   179448       if (devinfo->is_haswell) {
   179449          return 0;
   179450       } else {
   179451          return 0;
   179452       }
   179453    case 6: return 0;
   179454    case 5: return 0;
   179455    case 4:
   179456       if (devinfo->is_g4x) {
   179457          return 0;
   179458       } else {
   179459          return 0;
   179460       }
   179461    default:
   179462       unreachable("Invalid hardware generation");
   179463    }
   179464 }
   179465 
   179466 
   179467 
   179468 #define GEN10_RENDER_SURFACE_STATE_MemoryCompressionEnable_start  254
   179469 #define GEN9_RENDER_SURFACE_STATE_MemoryCompressionEnable_start  254
   179470 
   179471 static inline uint32_t ATTRIBUTE_PURE
   179472 RENDER_SURFACE_STATE_MemoryCompressionEnable_start(const struct gen_device_info *devinfo)
   179473 {
   179474    switch (devinfo->gen) {
   179475    case 10: return 254;
   179476    case 9: return 254;
   179477    case 8: return 0;
   179478    case 7:
   179479       if (devinfo->is_haswell) {
   179480          return 0;
   179481       } else {
   179482          return 0;
   179483       }
   179484    case 6: return 0;
   179485    case 5: return 0;
   179486    case 4:
   179487       if (devinfo->is_g4x) {
   179488          return 0;
   179489       } else {
   179490          return 0;
   179491       }
   179492    default:
   179493       unreachable("Invalid hardware generation");
   179494    }
   179495 }
   179496 
   179497 
   179498 
   179499 /* RENDER_SURFACE_STATE::Memory Compression Mode */
   179500 
   179501 
   179502 #define GEN10_RENDER_SURFACE_STATE_MemoryCompressionMode_bits  1
   179503 #define GEN9_RENDER_SURFACE_STATE_MemoryCompressionMode_bits  1
   179504 
   179505 static inline uint32_t ATTRIBUTE_PURE
   179506 RENDER_SURFACE_STATE_MemoryCompressionMode_bits(const struct gen_device_info *devinfo)
   179507 {
   179508    switch (devinfo->gen) {
   179509    case 10: return 1;
   179510    case 9: return 1;
   179511    case 8: return 0;
   179512    case 7:
   179513       if (devinfo->is_haswell) {
   179514          return 0;
   179515       } else {
   179516          return 0;
   179517       }
   179518    case 6: return 0;
   179519    case 5: return 0;
   179520    case 4:
   179521       if (devinfo->is_g4x) {
   179522          return 0;
   179523       } else {
   179524          return 0;
   179525       }
   179526    default:
   179527       unreachable("Invalid hardware generation");
   179528    }
   179529 }
   179530 
   179531 
   179532 
   179533 #define GEN10_RENDER_SURFACE_STATE_MemoryCompressionMode_start  255
   179534 #define GEN9_RENDER_SURFACE_STATE_MemoryCompressionMode_start  255
   179535 
   179536 static inline uint32_t ATTRIBUTE_PURE
   179537 RENDER_SURFACE_STATE_MemoryCompressionMode_start(const struct gen_device_info *devinfo)
   179538 {
   179539    switch (devinfo->gen) {
   179540    case 10: return 255;
   179541    case 9: return 255;
   179542    case 8: return 0;
   179543    case 7:
   179544       if (devinfo->is_haswell) {
   179545          return 0;
   179546       } else {
   179547          return 0;
   179548       }
   179549    case 6: return 0;
   179550    case 5: return 0;
   179551    case 4:
   179552       if (devinfo->is_g4x) {
   179553          return 0;
   179554       } else {
   179555          return 0;
   179556       }
   179557    default:
   179558       unreachable("Invalid hardware generation");
   179559    }
   179560 }
   179561 
   179562 
   179563 
   179564 /* RENDER_SURFACE_STATE::Memory Object Control State */
   179565 
   179566 
   179567 #define GEN10_RENDER_SURFACE_STATE_MemoryObjectControlState_bits  7
   179568 #define GEN9_RENDER_SURFACE_STATE_MemoryObjectControlState_bits  7
   179569 #define GEN8_RENDER_SURFACE_STATE_MemoryObjectControlState_bits  7
   179570 
   179571 static inline uint32_t ATTRIBUTE_PURE
   179572 RENDER_SURFACE_STATE_MemoryObjectControlState_bits(const struct gen_device_info *devinfo)
   179573 {
   179574    switch (devinfo->gen) {
   179575    case 10: return 7;
   179576    case 9: return 7;
   179577    case 8: return 7;
   179578    case 7:
   179579       if (devinfo->is_haswell) {
   179580          return 0;
   179581       } else {
   179582          return 0;
   179583       }
   179584    case 6: return 0;
   179585    case 5: return 0;
   179586    case 4:
   179587       if (devinfo->is_g4x) {
   179588          return 0;
   179589       } else {
   179590          return 0;
   179591       }
   179592    default:
   179593       unreachable("Invalid hardware generation");
   179594    }
   179595 }
   179596 
   179597 
   179598 
   179599 #define GEN10_RENDER_SURFACE_STATE_MemoryObjectControlState_start  56
   179600 #define GEN9_RENDER_SURFACE_STATE_MemoryObjectControlState_start  56
   179601 #define GEN8_RENDER_SURFACE_STATE_MemoryObjectControlState_start  56
   179602 
   179603 static inline uint32_t ATTRIBUTE_PURE
   179604 RENDER_SURFACE_STATE_MemoryObjectControlState_start(const struct gen_device_info *devinfo)
   179605 {
   179606    switch (devinfo->gen) {
   179607    case 10: return 56;
   179608    case 9: return 56;
   179609    case 8: return 56;
   179610    case 7:
   179611       if (devinfo->is_haswell) {
   179612          return 0;
   179613       } else {
   179614          return 0;
   179615       }
   179616    case 6: return 0;
   179617    case 5: return 0;
   179618    case 4:
   179619       if (devinfo->is_g4x) {
   179620          return 0;
   179621       } else {
   179622          return 0;
   179623       }
   179624    default:
   179625       unreachable("Invalid hardware generation");
   179626    }
   179627 }
   179628 
   179629 
   179630 
   179631 /* RENDER_SURFACE_STATE::Minimum Array Element */
   179632 
   179633 
   179634 #define GEN10_RENDER_SURFACE_STATE_MinimumArrayElement_bits  11
   179635 #define GEN9_RENDER_SURFACE_STATE_MinimumArrayElement_bits  11
   179636 #define GEN8_RENDER_SURFACE_STATE_MinimumArrayElement_bits  11
   179637 #define GEN75_RENDER_SURFACE_STATE_MinimumArrayElement_bits  11
   179638 #define GEN7_RENDER_SURFACE_STATE_MinimumArrayElement_bits  11
   179639 #define GEN6_RENDER_SURFACE_STATE_MinimumArrayElement_bits  11
   179640 #define GEN5_RENDER_SURFACE_STATE_MinimumArrayElement_bits  11
   179641 #define GEN45_RENDER_SURFACE_STATE_MinimumArrayElement_bits  11
   179642 #define GEN4_RENDER_SURFACE_STATE_MinimumArrayElement_bits  11
   179643 
   179644 static inline uint32_t ATTRIBUTE_PURE
   179645 RENDER_SURFACE_STATE_MinimumArrayElement_bits(const struct gen_device_info *devinfo)
   179646 {
   179647    switch (devinfo->gen) {
   179648    case 10: return 11;
   179649    case 9: return 11;
   179650    case 8: return 11;
   179651    case 7:
   179652       if (devinfo->is_haswell) {
   179653          return 11;
   179654       } else {
   179655          return 11;
   179656       }
   179657    case 6: return 11;
   179658    case 5: return 11;
   179659    case 4:
   179660       if (devinfo->is_g4x) {
   179661          return 11;
   179662       } else {
   179663          return 11;
   179664       }
   179665    default:
   179666       unreachable("Invalid hardware generation");
   179667    }
   179668 }
   179669 
   179670 
   179671 
   179672 #define GEN10_RENDER_SURFACE_STATE_MinimumArrayElement_start  146
   179673 #define GEN9_RENDER_SURFACE_STATE_MinimumArrayElement_start  146
   179674 #define GEN8_RENDER_SURFACE_STATE_MinimumArrayElement_start  146
   179675 #define GEN75_RENDER_SURFACE_STATE_MinimumArrayElement_start  146
   179676 #define GEN7_RENDER_SURFACE_STATE_MinimumArrayElement_start  146
   179677 #define GEN6_RENDER_SURFACE_STATE_MinimumArrayElement_start  145
   179678 #define GEN5_RENDER_SURFACE_STATE_MinimumArrayElement_start  145
   179679 #define GEN45_RENDER_SURFACE_STATE_MinimumArrayElement_start  145
   179680 #define GEN4_RENDER_SURFACE_STATE_MinimumArrayElement_start  145
   179681 
   179682 static inline uint32_t ATTRIBUTE_PURE
   179683 RENDER_SURFACE_STATE_MinimumArrayElement_start(const struct gen_device_info *devinfo)
   179684 {
   179685    switch (devinfo->gen) {
   179686    case 10: return 146;
   179687    case 9: return 146;
   179688    case 8: return 146;
   179689    case 7:
   179690       if (devinfo->is_haswell) {
   179691          return 146;
   179692       } else {
   179693          return 146;
   179694       }
   179695    case 6: return 145;
   179696    case 5: return 145;
   179697    case 4:
   179698       if (devinfo->is_g4x) {
   179699          return 145;
   179700       } else {
   179701          return 145;
   179702       }
   179703    default:
   179704       unreachable("Invalid hardware generation");
   179705    }
   179706 }
   179707 
   179708 
   179709 
   179710 /* RENDER_SURFACE_STATE::Mip Tail Start LOD */
   179711 
   179712 
   179713 #define GEN10_RENDER_SURFACE_STATE_MipTailStartLOD_bits  4
   179714 #define GEN9_RENDER_SURFACE_STATE_MipTailStartLOD_bits  4
   179715 
   179716 static inline uint32_t ATTRIBUTE_PURE
   179717 RENDER_SURFACE_STATE_MipTailStartLOD_bits(const struct gen_device_info *devinfo)
   179718 {
   179719    switch (devinfo->gen) {
   179720    case 10: return 4;
   179721    case 9: return 4;
   179722    case 8: return 0;
   179723    case 7:
   179724       if (devinfo->is_haswell) {
   179725          return 0;
   179726       } else {
   179727          return 0;
   179728       }
   179729    case 6: return 0;
   179730    case 5: return 0;
   179731    case 4:
   179732       if (devinfo->is_g4x) {
   179733          return 0;
   179734       } else {
   179735          return 0;
   179736       }
   179737    default:
   179738       unreachable("Invalid hardware generation");
   179739    }
   179740 }
   179741 
   179742 
   179743 
   179744 #define GEN10_RENDER_SURFACE_STATE_MipTailStartLOD_start  168
   179745 #define GEN9_RENDER_SURFACE_STATE_MipTailStartLOD_start  168
   179746 
   179747 static inline uint32_t ATTRIBUTE_PURE
   179748 RENDER_SURFACE_STATE_MipTailStartLOD_start(const struct gen_device_info *devinfo)
   179749 {
   179750    switch (devinfo->gen) {
   179751    case 10: return 168;
   179752    case 9: return 168;
   179753    case 8: return 0;
   179754    case 7:
   179755       if (devinfo->is_haswell) {
   179756          return 0;
   179757       } else {
   179758          return 0;
   179759       }
   179760    case 6: return 0;
   179761    case 5: return 0;
   179762    case 4:
   179763       if (devinfo->is_g4x) {
   179764          return 0;
   179765       } else {
   179766          return 0;
   179767       }
   179768    default:
   179769       unreachable("Invalid hardware generation");
   179770    }
   179771 }
   179772 
   179773 
   179774 
   179775 /* RENDER_SURFACE_STATE::Multisample Position Palette Index */
   179776 
   179777 
   179778 #define GEN10_RENDER_SURFACE_STATE_MultisamplePositionPaletteIndex_bits  3
   179779 #define GEN9_RENDER_SURFACE_STATE_MultisamplePositionPaletteIndex_bits  3
   179780 #define GEN8_RENDER_SURFACE_STATE_MultisamplePositionPaletteIndex_bits  3
   179781 #define GEN75_RENDER_SURFACE_STATE_MultisamplePositionPaletteIndex_bits  3
   179782 #define GEN7_RENDER_SURFACE_STATE_MultisamplePositionPaletteIndex_bits  3
   179783 #define GEN6_RENDER_SURFACE_STATE_MultisamplePositionPaletteIndex_bits  3
   179784 
   179785 static inline uint32_t ATTRIBUTE_PURE
   179786 RENDER_SURFACE_STATE_MultisamplePositionPaletteIndex_bits(const struct gen_device_info *devinfo)
   179787 {
   179788    switch (devinfo->gen) {
   179789    case 10: return 3;
   179790    case 9: return 3;
   179791    case 8: return 3;
   179792    case 7:
   179793       if (devinfo->is_haswell) {
   179794          return 3;
   179795       } else {
   179796          return 3;
   179797       }
   179798    case 6: return 3;
   179799    case 5: return 0;
   179800    case 4:
   179801       if (devinfo->is_g4x) {
   179802          return 0;
   179803       } else {
   179804          return 0;
   179805       }
   179806    default:
   179807       unreachable("Invalid hardware generation");
   179808    }
   179809 }
   179810 
   179811 
   179812 
   179813 #define GEN10_RENDER_SURFACE_STATE_MultisamplePositionPaletteIndex_start  128
   179814 #define GEN9_RENDER_SURFACE_STATE_MultisamplePositionPaletteIndex_start  128
   179815 #define GEN8_RENDER_SURFACE_STATE_MultisamplePositionPaletteIndex_start  128
   179816 #define GEN75_RENDER_SURFACE_STATE_MultisamplePositionPaletteIndex_start  128
   179817 #define GEN7_RENDER_SURFACE_STATE_MultisamplePositionPaletteIndex_start  128
   179818 #define GEN6_RENDER_SURFACE_STATE_MultisamplePositionPaletteIndex_start  128
   179819 
   179820 static inline uint32_t ATTRIBUTE_PURE
   179821 RENDER_SURFACE_STATE_MultisamplePositionPaletteIndex_start(const struct gen_device_info *devinfo)
   179822 {
   179823    switch (devinfo->gen) {
   179824    case 10: return 128;
   179825    case 9: return 128;
   179826    case 8: return 128;
   179827    case 7:
   179828       if (devinfo->is_haswell) {
   179829          return 128;
   179830       } else {
   179831          return 128;
   179832       }
   179833    case 6: return 128;
   179834    case 5: return 0;
   179835    case 4:
   179836       if (devinfo->is_g4x) {
   179837          return 0;
   179838       } else {
   179839          return 0;
   179840       }
   179841    default:
   179842       unreachable("Invalid hardware generation");
   179843    }
   179844 }
   179845 
   179846 
   179847 
   179848 /* RENDER_SURFACE_STATE::Multisampled Surface Storage Format */
   179849 
   179850 
   179851 #define GEN10_RENDER_SURFACE_STATE_MultisampledSurfaceStorageFormat_bits  1
   179852 #define GEN9_RENDER_SURFACE_STATE_MultisampledSurfaceStorageFormat_bits  1
   179853 #define GEN8_RENDER_SURFACE_STATE_MultisampledSurfaceStorageFormat_bits  1
   179854 #define GEN75_RENDER_SURFACE_STATE_MultisampledSurfaceStorageFormat_bits  1
   179855 #define GEN7_RENDER_SURFACE_STATE_MultisampledSurfaceStorageFormat_bits  1
   179856 
   179857 static inline uint32_t ATTRIBUTE_PURE
   179858 RENDER_SURFACE_STATE_MultisampledSurfaceStorageFormat_bits(const struct gen_device_info *devinfo)
   179859 {
   179860    switch (devinfo->gen) {
   179861    case 10: return 1;
   179862    case 9: return 1;
   179863    case 8: return 1;
   179864    case 7:
   179865       if (devinfo->is_haswell) {
   179866          return 1;
   179867       } else {
   179868          return 1;
   179869       }
   179870    case 6: return 0;
   179871    case 5: return 0;
   179872    case 4:
   179873       if (devinfo->is_g4x) {
   179874          return 0;
   179875       } else {
   179876          return 0;
   179877       }
   179878    default:
   179879       unreachable("Invalid hardware generation");
   179880    }
   179881 }
   179882 
   179883 
   179884 
   179885 #define GEN10_RENDER_SURFACE_STATE_MultisampledSurfaceStorageFormat_start  134
   179886 #define GEN9_RENDER_SURFACE_STATE_MultisampledSurfaceStorageFormat_start  134
   179887 #define GEN8_RENDER_SURFACE_STATE_MultisampledSurfaceStorageFormat_start  134
   179888 #define GEN75_RENDER_SURFACE_STATE_MultisampledSurfaceStorageFormat_start  134
   179889 #define GEN7_RENDER_SURFACE_STATE_MultisampledSurfaceStorageFormat_start  134
   179890 
   179891 static inline uint32_t ATTRIBUTE_PURE
   179892 RENDER_SURFACE_STATE_MultisampledSurfaceStorageFormat_start(const struct gen_device_info *devinfo)
   179893 {
   179894    switch (devinfo->gen) {
   179895    case 10: return 134;
   179896    case 9: return 134;
   179897    case 8: return 134;
   179898    case 7:
   179899       if (devinfo->is_haswell) {
   179900          return 134;
   179901       } else {
   179902          return 134;
   179903       }
   179904    case 6: return 0;
   179905    case 5: return 0;
   179906    case 4:
   179907       if (devinfo->is_g4x) {
   179908          return 0;
   179909       } else {
   179910          return 0;
   179911       }
   179912    default:
   179913       unreachable("Invalid hardware generation");
   179914    }
   179915 }
   179916 
   179917 
   179918 
   179919 /* RENDER_SURFACE_STATE::Number of Multisamples */
   179920 
   179921 
   179922 #define GEN10_RENDER_SURFACE_STATE_NumberofMultisamples_bits  3
   179923 #define GEN9_RENDER_SURFACE_STATE_NumberofMultisamples_bits  3
   179924 #define GEN8_RENDER_SURFACE_STATE_NumberofMultisamples_bits  3
   179925 #define GEN75_RENDER_SURFACE_STATE_NumberofMultisamples_bits  3
   179926 #define GEN7_RENDER_SURFACE_STATE_NumberofMultisamples_bits  3
   179927 #define GEN6_RENDER_SURFACE_STATE_NumberofMultisamples_bits  3
   179928 
   179929 static inline uint32_t ATTRIBUTE_PURE
   179930 RENDER_SURFACE_STATE_NumberofMultisamples_bits(const struct gen_device_info *devinfo)
   179931 {
   179932    switch (devinfo->gen) {
   179933    case 10: return 3;
   179934    case 9: return 3;
   179935    case 8: return 3;
   179936    case 7:
   179937       if (devinfo->is_haswell) {
   179938          return 3;
   179939       } else {
   179940          return 3;
   179941       }
   179942    case 6: return 3;
   179943    case 5: return 0;
   179944    case 4:
   179945       if (devinfo->is_g4x) {
   179946          return 0;
   179947       } else {
   179948          return 0;
   179949       }
   179950    default:
   179951       unreachable("Invalid hardware generation");
   179952    }
   179953 }
   179954 
   179955 
   179956 
   179957 #define GEN10_RENDER_SURFACE_STATE_NumberofMultisamples_start  131
   179958 #define GEN9_RENDER_SURFACE_STATE_NumberofMultisamples_start  131
   179959 #define GEN8_RENDER_SURFACE_STATE_NumberofMultisamples_start  131
   179960 #define GEN75_RENDER_SURFACE_STATE_NumberofMultisamples_start  131
   179961 #define GEN7_RENDER_SURFACE_STATE_NumberofMultisamples_start  131
   179962 #define GEN6_RENDER_SURFACE_STATE_NumberofMultisamples_start  132
   179963 
   179964 static inline uint32_t ATTRIBUTE_PURE
   179965 RENDER_SURFACE_STATE_NumberofMultisamples_start(const struct gen_device_info *devinfo)
   179966 {
   179967    switch (devinfo->gen) {
   179968    case 10: return 131;
   179969    case 9: return 131;
   179970    case 8: return 131;
   179971    case 7:
   179972       if (devinfo->is_haswell) {
   179973          return 131;
   179974       } else {
   179975          return 131;
   179976       }
   179977    case 6: return 132;
   179978    case 5: return 0;
   179979    case 4:
   179980       if (devinfo->is_g4x) {
   179981          return 0;
   179982       } else {
   179983          return 0;
   179984       }
   179985    default:
   179986       unreachable("Invalid hardware generation");
   179987    }
   179988 }
   179989 
   179990 
   179991 
   179992 /* RENDER_SURFACE_STATE::Quilt Height */
   179993 
   179994 
   179995 #define GEN10_RENDER_SURFACE_STATE_QuiltHeight_bits  5
   179996 #define GEN9_RENDER_SURFACE_STATE_QuiltHeight_bits  5
   179997 
   179998 static inline uint32_t ATTRIBUTE_PURE
   179999 RENDER_SURFACE_STATE_QuiltHeight_bits(const struct gen_device_info *devinfo)
   180000 {
   180001    switch (devinfo->gen) {
   180002    case 10: return 5;
   180003    case 9: return 5;
   180004    case 8: return 0;
   180005    case 7:
   180006       if (devinfo->is_haswell) {
   180007          return 0;
   180008       } else {
   180009          return 0;
   180010       }
   180011    case 6: return 0;
   180012    case 5: return 0;
   180013    case 4:
   180014       if (devinfo->is_g4x) {
   180015          return 0;
   180016       } else {
   180017          return 0;
   180018       }
   180019    default:
   180020       unreachable("Invalid hardware generation");
   180021    }
   180022 }
   180023 
   180024 
   180025 
   180026 #define GEN10_RENDER_SURFACE_STATE_QuiltHeight_start  325
   180027 #define GEN9_RENDER_SURFACE_STATE_QuiltHeight_start  325
   180028 
   180029 static inline uint32_t ATTRIBUTE_PURE
   180030 RENDER_SURFACE_STATE_QuiltHeight_start(const struct gen_device_info *devinfo)
   180031 {
   180032    switch (devinfo->gen) {
   180033    case 10: return 325;
   180034    case 9: return 325;
   180035    case 8: return 0;
   180036    case 7:
   180037       if (devinfo->is_haswell) {
   180038          return 0;
   180039       } else {
   180040          return 0;
   180041       }
   180042    case 6: return 0;
   180043    case 5: return 0;
   180044    case 4:
   180045       if (devinfo->is_g4x) {
   180046          return 0;
   180047       } else {
   180048          return 0;
   180049       }
   180050    default:
   180051       unreachable("Invalid hardware generation");
   180052    }
   180053 }
   180054 
   180055 
   180056 
   180057 /* RENDER_SURFACE_STATE::Quilt Width */
   180058 
   180059 
   180060 #define GEN10_RENDER_SURFACE_STATE_QuiltWidth_bits  5
   180061 #define GEN9_RENDER_SURFACE_STATE_QuiltWidth_bits  5
   180062 
   180063 static inline uint32_t ATTRIBUTE_PURE
   180064 RENDER_SURFACE_STATE_QuiltWidth_bits(const struct gen_device_info *devinfo)
   180065 {
   180066    switch (devinfo->gen) {
   180067    case 10: return 5;
   180068    case 9: return 5;
   180069    case 8: return 0;
   180070    case 7:
   180071       if (devinfo->is_haswell) {
   180072          return 0;
   180073       } else {
   180074          return 0;
   180075       }
   180076    case 6: return 0;
   180077    case 5: return 0;
   180078    case 4:
   180079       if (devinfo->is_g4x) {
   180080          return 0;
   180081       } else {
   180082          return 0;
   180083       }
   180084    default:
   180085       unreachable("Invalid hardware generation");
   180086    }
   180087 }
   180088 
   180089 
   180090 
   180091 #define GEN10_RENDER_SURFACE_STATE_QuiltWidth_start  320
   180092 #define GEN9_RENDER_SURFACE_STATE_QuiltWidth_start  320
   180093 
   180094 static inline uint32_t ATTRIBUTE_PURE
   180095 RENDER_SURFACE_STATE_QuiltWidth_start(const struct gen_device_info *devinfo)
   180096 {
   180097    switch (devinfo->gen) {
   180098    case 10: return 320;
   180099    case 9: return 320;
   180100    case 8: return 0;
   180101    case 7:
   180102       if (devinfo->is_haswell) {
   180103          return 0;
   180104       } else {
   180105          return 0;
   180106       }
   180107    case 6: return 0;
   180108    case 5: return 0;
   180109    case 4:
   180110       if (devinfo->is_g4x) {
   180111          return 0;
   180112       } else {
   180113          return 0;
   180114       }
   180115    default:
   180116       unreachable("Invalid hardware generation");
   180117    }
   180118 }
   180119 
   180120 
   180121 
   180122 /* RENDER_SURFACE_STATE::Red Clear Color */
   180123 
   180124 
   180125 #define GEN10_RENDER_SURFACE_STATE_RedClearColor_bits  32
   180126 #define GEN9_RENDER_SURFACE_STATE_RedClearColor_bits  32
   180127 #define GEN8_RENDER_SURFACE_STATE_RedClearColor_bits  1
   180128 #define GEN75_RENDER_SURFACE_STATE_RedClearColor_bits  1
   180129 #define GEN7_RENDER_SURFACE_STATE_RedClearColor_bits  1
   180130 
   180131 static inline uint32_t ATTRIBUTE_PURE
   180132 RENDER_SURFACE_STATE_RedClearColor_bits(const struct gen_device_info *devinfo)
   180133 {
   180134    switch (devinfo->gen) {
   180135    case 10: return 32;
   180136    case 9: return 32;
   180137    case 8: return 1;
   180138    case 7:
   180139       if (devinfo->is_haswell) {
   180140          return 1;
   180141       } else {
   180142          return 1;
   180143       }
   180144    case 6: return 0;
   180145    case 5: return 0;
   180146    case 4:
   180147       if (devinfo->is_g4x) {
   180148          return 0;
   180149       } else {
   180150          return 0;
   180151       }
   180152    default:
   180153       unreachable("Invalid hardware generation");
   180154    }
   180155 }
   180156 
   180157 
   180158 
   180159 #define GEN10_RENDER_SURFACE_STATE_RedClearColor_start  384
   180160 #define GEN9_RENDER_SURFACE_STATE_RedClearColor_start  384
   180161 #define GEN8_RENDER_SURFACE_STATE_RedClearColor_start  255
   180162 #define GEN75_RENDER_SURFACE_STATE_RedClearColor_start  255
   180163 #define GEN7_RENDER_SURFACE_STATE_RedClearColor_start  255
   180164 
   180165 static inline uint32_t ATTRIBUTE_PURE
   180166 RENDER_SURFACE_STATE_RedClearColor_start(const struct gen_device_info *devinfo)
   180167 {
   180168    switch (devinfo->gen) {
   180169    case 10: return 384;
   180170    case 9: return 384;
   180171    case 8: return 255;
   180172    case 7:
   180173       if (devinfo->is_haswell) {
   180174          return 255;
   180175       } else {
   180176          return 255;
   180177       }
   180178    case 6: return 0;
   180179    case 5: return 0;
   180180    case 4:
   180181       if (devinfo->is_g4x) {
   180182          return 0;
   180183       } else {
   180184          return 0;
   180185       }
   180186    default:
   180187       unreachable("Invalid hardware generation");
   180188    }
   180189 }
   180190 
   180191 
   180192 
   180193 /* RENDER_SURFACE_STATE::Render Cache Read Write Mode */
   180194 
   180195 
   180196 #define GEN10_RENDER_SURFACE_STATE_RenderCacheReadWriteMode_bits  1
   180197 #define GEN9_RENDER_SURFACE_STATE_RenderCacheReadWriteMode_bits  1
   180198 #define GEN8_RENDER_SURFACE_STATE_RenderCacheReadWriteMode_bits  1
   180199 #define GEN75_RENDER_SURFACE_STATE_RenderCacheReadWriteMode_bits  1
   180200 #define GEN7_RENDER_SURFACE_STATE_RenderCacheReadWriteMode_bits  1
   180201 #define GEN6_RENDER_SURFACE_STATE_RenderCacheReadWriteMode_bits  1
   180202 #define GEN5_RENDER_SURFACE_STATE_RenderCacheReadWriteMode_bits  1
   180203 #define GEN45_RENDER_SURFACE_STATE_RenderCacheReadWriteMode_bits  1
   180204 #define GEN4_RENDER_SURFACE_STATE_RenderCacheReadWriteMode_bits  1
   180205 
   180206 static inline uint32_t ATTRIBUTE_PURE
   180207 RENDER_SURFACE_STATE_RenderCacheReadWriteMode_bits(const struct gen_device_info *devinfo)
   180208 {
   180209    switch (devinfo->gen) {
   180210    case 10: return 1;
   180211    case 9: return 1;
   180212    case 8: return 1;
   180213    case 7:
   180214       if (devinfo->is_haswell) {
   180215          return 1;
   180216       } else {
   180217          return 1;
   180218       }
   180219    case 6: return 1;
   180220    case 5: return 1;
   180221    case 4:
   180222       if (devinfo->is_g4x) {
   180223          return 1;
   180224       } else {
   180225          return 1;
   180226       }
   180227    default:
   180228       unreachable("Invalid hardware generation");
   180229    }
   180230 }
   180231 
   180232 
   180233 
   180234 #define GEN10_RENDER_SURFACE_STATE_RenderCacheReadWriteMode_start  8
   180235 #define GEN9_RENDER_SURFACE_STATE_RenderCacheReadWriteMode_start  8
   180236 #define GEN8_RENDER_SURFACE_STATE_RenderCacheReadWriteMode_start  8
   180237 #define GEN75_RENDER_SURFACE_STATE_RenderCacheReadWriteMode_start  8
   180238 #define GEN7_RENDER_SURFACE_STATE_RenderCacheReadWriteMode_start  8
   180239 #define GEN6_RENDER_SURFACE_STATE_RenderCacheReadWriteMode_start  8
   180240 #define GEN5_RENDER_SURFACE_STATE_RenderCacheReadWriteMode_start  8
   180241 #define GEN45_RENDER_SURFACE_STATE_RenderCacheReadWriteMode_start  8
   180242 #define GEN4_RENDER_SURFACE_STATE_RenderCacheReadWriteMode_start  8
   180243 
   180244 static inline uint32_t ATTRIBUTE_PURE
   180245 RENDER_SURFACE_STATE_RenderCacheReadWriteMode_start(const struct gen_device_info *devinfo)
   180246 {
   180247    switch (devinfo->gen) {
   180248    case 10: return 8;
   180249    case 9: return 8;
   180250    case 8: return 8;
   180251    case 7:
   180252       if (devinfo->is_haswell) {
   180253          return 8;
   180254       } else {
   180255          return 8;
   180256       }
   180257    case 6: return 8;
   180258    case 5: return 8;
   180259    case 4:
   180260       if (devinfo->is_g4x) {
   180261          return 8;
   180262       } else {
   180263          return 8;
   180264       }
   180265    default:
   180266       unreachable("Invalid hardware generation");
   180267    }
   180268 }
   180269 
   180270 
   180271 
   180272 /* RENDER_SURFACE_STATE::Render Target And Sample Unorm Rotation */
   180273 
   180274 
   180275 #define GEN10_RENDER_SURFACE_STATE_RenderTargetAndSampleUnormRotation_bits  2
   180276 #define GEN9_RENDER_SURFACE_STATE_RenderTargetAndSampleUnormRotation_bits  2
   180277 #define GEN8_RENDER_SURFACE_STATE_RenderTargetAndSampleUnormRotation_bits  2
   180278 
   180279 static inline uint32_t ATTRIBUTE_PURE
   180280 RENDER_SURFACE_STATE_RenderTargetAndSampleUnormRotation_bits(const struct gen_device_info *devinfo)
   180281 {
   180282    switch (devinfo->gen) {
   180283    case 10: return 2;
   180284    case 9: return 2;
   180285    case 8: return 2;
   180286    case 7:
   180287       if (devinfo->is_haswell) {
   180288          return 0;
   180289       } else {
   180290          return 0;
   180291       }
   180292    case 6: return 0;
   180293    case 5: return 0;
   180294    case 4:
   180295       if (devinfo->is_g4x) {
   180296          return 0;
   180297       } else {
   180298          return 0;
   180299       }
   180300    default:
   180301       unreachable("Invalid hardware generation");
   180302    }
   180303 }
   180304 
   180305 
   180306 
   180307 #define GEN10_RENDER_SURFACE_STATE_RenderTargetAndSampleUnormRotation_start  157
   180308 #define GEN9_RENDER_SURFACE_STATE_RenderTargetAndSampleUnormRotation_start  157
   180309 #define GEN8_RENDER_SURFACE_STATE_RenderTargetAndSampleUnormRotation_start  157
   180310 
   180311 static inline uint32_t ATTRIBUTE_PURE
   180312 RENDER_SURFACE_STATE_RenderTargetAndSampleUnormRotation_start(const struct gen_device_info *devinfo)
   180313 {
   180314    switch (devinfo->gen) {
   180315    case 10: return 157;
   180316    case 9: return 157;
   180317    case 8: return 157;
   180318    case 7:
   180319       if (devinfo->is_haswell) {
   180320          return 0;
   180321       } else {
   180322          return 0;
   180323       }
   180324    case 6: return 0;
   180325    case 5: return 0;
   180326    case 4:
   180327       if (devinfo->is_g4x) {
   180328          return 0;
   180329       } else {
   180330          return 0;
   180331       }
   180332    default:
   180333       unreachable("Invalid hardware generation");
   180334    }
   180335 }
   180336 
   180337 
   180338 
   180339 /* RENDER_SURFACE_STATE::Render Target Rotation */
   180340 
   180341 
   180342 #define GEN75_RENDER_SURFACE_STATE_RenderTargetRotation_bits  2
   180343 #define GEN7_RENDER_SURFACE_STATE_RenderTargetRotation_bits  2
   180344 #define GEN6_RENDER_SURFACE_STATE_RenderTargetRotation_bits  2
   180345 #define GEN5_RENDER_SURFACE_STATE_RenderTargetRotation_bits  2
   180346 
   180347 static inline uint32_t ATTRIBUTE_PURE
   180348 RENDER_SURFACE_STATE_RenderTargetRotation_bits(const struct gen_device_info *devinfo)
   180349 {
   180350    switch (devinfo->gen) {
   180351    case 10: return 0;
   180352    case 9: return 0;
   180353    case 8: return 0;
   180354    case 7:
   180355       if (devinfo->is_haswell) {
   180356          return 2;
   180357       } else {
   180358          return 2;
   180359       }
   180360    case 6: return 2;
   180361    case 5: return 2;
   180362    case 4:
   180363       if (devinfo->is_g4x) {
   180364          return 0;
   180365       } else {
   180366          return 0;
   180367       }
   180368    default:
   180369       unreachable("Invalid hardware generation");
   180370    }
   180371 }
   180372 
   180373 
   180374 
   180375 #define GEN75_RENDER_SURFACE_STATE_RenderTargetRotation_start  157
   180376 #define GEN7_RENDER_SURFACE_STATE_RenderTargetRotation_start  157
   180377 #define GEN6_RENDER_SURFACE_STATE_RenderTargetRotation_start  64
   180378 #define GEN5_RENDER_SURFACE_STATE_RenderTargetRotation_start  64
   180379 
   180380 static inline uint32_t ATTRIBUTE_PURE
   180381 RENDER_SURFACE_STATE_RenderTargetRotation_start(const struct gen_device_info *devinfo)
   180382 {
   180383    switch (devinfo->gen) {
   180384    case 10: return 0;
   180385    case 9: return 0;
   180386    case 8: return 0;
   180387    case 7:
   180388       if (devinfo->is_haswell) {
   180389          return 157;
   180390       } else {
   180391          return 157;
   180392       }
   180393    case 6: return 64;
   180394    case 5: return 64;
   180395    case 4:
   180396       if (devinfo->is_g4x) {
   180397          return 0;
   180398       } else {
   180399          return 0;
   180400       }
   180401    default:
   180402       unreachable("Invalid hardware generation");
   180403    }
   180404 }
   180405 
   180406 
   180407 
   180408 /* RENDER_SURFACE_STATE::Render Target View Extent */
   180409 
   180410 
   180411 #define GEN10_RENDER_SURFACE_STATE_RenderTargetViewExtent_bits  11
   180412 #define GEN9_RENDER_SURFACE_STATE_RenderTargetViewExtent_bits  11
   180413 #define GEN8_RENDER_SURFACE_STATE_RenderTargetViewExtent_bits  11
   180414 #define GEN75_RENDER_SURFACE_STATE_RenderTargetViewExtent_bits  11
   180415 #define GEN7_RENDER_SURFACE_STATE_RenderTargetViewExtent_bits  11
   180416 #define GEN6_RENDER_SURFACE_STATE_RenderTargetViewExtent_bits  9
   180417 #define GEN5_RENDER_SURFACE_STATE_RenderTargetViewExtent_bits  9
   180418 #define GEN45_RENDER_SURFACE_STATE_RenderTargetViewExtent_bits  9
   180419 #define GEN4_RENDER_SURFACE_STATE_RenderTargetViewExtent_bits  9
   180420 
   180421 static inline uint32_t ATTRIBUTE_PURE
   180422 RENDER_SURFACE_STATE_RenderTargetViewExtent_bits(const struct gen_device_info *devinfo)
   180423 {
   180424    switch (devinfo->gen) {
   180425    case 10: return 11;
   180426    case 9: return 11;
   180427    case 8: return 11;
   180428    case 7:
   180429       if (devinfo->is_haswell) {
   180430          return 11;
   180431       } else {
   180432          return 11;
   180433       }
   180434    case 6: return 9;
   180435    case 5: return 9;
   180436    case 4:
   180437       if (devinfo->is_g4x) {
   180438          return 9;
   180439       } else {
   180440          return 9;
   180441       }
   180442    default:
   180443       unreachable("Invalid hardware generation");
   180444    }
   180445 }
   180446 
   180447 
   180448 
   180449 #define GEN10_RENDER_SURFACE_STATE_RenderTargetViewExtent_start  135
   180450 #define GEN9_RENDER_SURFACE_STATE_RenderTargetViewExtent_start  135
   180451 #define GEN8_RENDER_SURFACE_STATE_RenderTargetViewExtent_start  135
   180452 #define GEN75_RENDER_SURFACE_STATE_RenderTargetViewExtent_start  135
   180453 #define GEN7_RENDER_SURFACE_STATE_RenderTargetViewExtent_start  135
   180454 #define GEN6_RENDER_SURFACE_STATE_RenderTargetViewExtent_start  136
   180455 #define GEN5_RENDER_SURFACE_STATE_RenderTargetViewExtent_start  136
   180456 #define GEN45_RENDER_SURFACE_STATE_RenderTargetViewExtent_start  136
   180457 #define GEN4_RENDER_SURFACE_STATE_RenderTargetViewExtent_start  136
   180458 
   180459 static inline uint32_t ATTRIBUTE_PURE
   180460 RENDER_SURFACE_STATE_RenderTargetViewExtent_start(const struct gen_device_info *devinfo)
   180461 {
   180462    switch (devinfo->gen) {
   180463    case 10: return 135;
   180464    case 9: return 135;
   180465    case 8: return 135;
   180466    case 7:
   180467       if (devinfo->is_haswell) {
   180468          return 135;
   180469       } else {
   180470          return 135;
   180471       }
   180472    case 6: return 136;
   180473    case 5: return 136;
   180474    case 4:
   180475       if (devinfo->is_g4x) {
   180476          return 136;
   180477       } else {
   180478          return 136;
   180479       }
   180480    default:
   180481       unreachable("Invalid hardware generation");
   180482    }
   180483 }
   180484 
   180485 
   180486 
   180487 /* RENDER_SURFACE_STATE::Reserved: MBZ */
   180488 
   180489 
   180490 #define GEN75_RENDER_SURFACE_STATE_ReservedMBZ_bits  2
   180491 #define GEN7_RENDER_SURFACE_STATE_ReservedMBZ_bits  2
   180492 
   180493 static inline uint32_t ATTRIBUTE_PURE
   180494 RENDER_SURFACE_STATE_ReservedMBZ_bits(const struct gen_device_info *devinfo)
   180495 {
   180496    switch (devinfo->gen) {
   180497    case 10: return 0;
   180498    case 9: return 0;
   180499    case 8: return 0;
   180500    case 7:
   180501       if (devinfo->is_haswell) {
   180502          return 2;
   180503       } else {
   180504          return 2;
   180505       }
   180506    case 6: return 0;
   180507    case 5: return 0;
   180508    case 4:
   180509       if (devinfo->is_g4x) {
   180510          return 0;
   180511       } else {
   180512          return 0;
   180513       }
   180514    default:
   180515       unreachable("Invalid hardware generation");
   180516    }
   180517 }
   180518 
   180519 
   180520 
   180521 #define GEN75_RENDER_SURFACE_STATE_ReservedMBZ_start  222
   180522 #define GEN7_RENDER_SURFACE_STATE_ReservedMBZ_start  222
   180523 
   180524 static inline uint32_t ATTRIBUTE_PURE
   180525 RENDER_SURFACE_STATE_ReservedMBZ_start(const struct gen_device_info *devinfo)
   180526 {
   180527    switch (devinfo->gen) {
   180528    case 10: return 0;
   180529    case 9: return 0;
   180530    case 8: return 0;
   180531    case 7:
   180532       if (devinfo->is_haswell) {
   180533          return 222;
   180534       } else {
   180535          return 222;
   180536       }
   180537    case 6: return 0;
   180538    case 5: return 0;
   180539    case 4:
   180540       if (devinfo->is_g4x) {
   180541          return 0;
   180542       } else {
   180543          return 0;
   180544       }
   180545    default:
   180546       unreachable("Invalid hardware generation");
   180547    }
   180548 }
   180549 
   180550 
   180551 
   180552 /* RENDER_SURFACE_STATE::Resource Min LOD */
   180553 
   180554 
   180555 #define GEN10_RENDER_SURFACE_STATE_ResourceMinLOD_bits  12
   180556 #define GEN9_RENDER_SURFACE_STATE_ResourceMinLOD_bits  12
   180557 #define GEN8_RENDER_SURFACE_STATE_ResourceMinLOD_bits  12
   180558 #define GEN75_RENDER_SURFACE_STATE_ResourceMinLOD_bits  12
   180559 #define GEN7_RENDER_SURFACE_STATE_ResourceMinLOD_bits  12
   180560 
   180561 static inline uint32_t ATTRIBUTE_PURE
   180562 RENDER_SURFACE_STATE_ResourceMinLOD_bits(const struct gen_device_info *devinfo)
   180563 {
   180564    switch (devinfo->gen) {
   180565    case 10: return 12;
   180566    case 9: return 12;
   180567    case 8: return 12;
   180568    case 7:
   180569       if (devinfo->is_haswell) {
   180570          return 12;
   180571       } else {
   180572          return 12;
   180573       }
   180574    case 6: return 0;
   180575    case 5: return 0;
   180576    case 4:
   180577       if (devinfo->is_g4x) {
   180578          return 0;
   180579       } else {
   180580          return 0;
   180581       }
   180582    default:
   180583       unreachable("Invalid hardware generation");
   180584    }
   180585 }
   180586 
   180587 
   180588 
   180589 #define GEN10_RENDER_SURFACE_STATE_ResourceMinLOD_start  224
   180590 #define GEN9_RENDER_SURFACE_STATE_ResourceMinLOD_start  224
   180591 #define GEN8_RENDER_SURFACE_STATE_ResourceMinLOD_start  224
   180592 #define GEN75_RENDER_SURFACE_STATE_ResourceMinLOD_start  224
   180593 #define GEN7_RENDER_SURFACE_STATE_ResourceMinLOD_start  224
   180594 
   180595 static inline uint32_t ATTRIBUTE_PURE
   180596 RENDER_SURFACE_STATE_ResourceMinLOD_start(const struct gen_device_info *devinfo)
   180597 {
   180598    switch (devinfo->gen) {
   180599    case 10: return 224;
   180600    case 9: return 224;
   180601    case 8: return 224;
   180602    case 7:
   180603       if (devinfo->is_haswell) {
   180604          return 224;
   180605       } else {
   180606          return 224;
   180607       }
   180608    case 6: return 0;
   180609    case 5: return 0;
   180610    case 4:
   180611       if (devinfo->is_g4x) {
   180612          return 0;
   180613       } else {
   180614          return 0;
   180615       }
   180616    default:
   180617       unreachable("Invalid hardware generation");
   180618    }
   180619 }
   180620 
   180621 
   180622 
   180623 /* RENDER_SURFACE_STATE::Sampler L2 Bypass Mode Disable */
   180624 
   180625 
   180626 #define GEN10_RENDER_SURFACE_STATE_SamplerL2BypassModeDisable_bits  1
   180627 #define GEN9_RENDER_SURFACE_STATE_SamplerL2BypassModeDisable_bits  1
   180628 #define GEN8_RENDER_SURFACE_STATE_SamplerL2BypassModeDisable_bits  1
   180629 
   180630 static inline uint32_t ATTRIBUTE_PURE
   180631 RENDER_SURFACE_STATE_SamplerL2BypassModeDisable_bits(const struct gen_device_info *devinfo)
   180632 {
   180633    switch (devinfo->gen) {
   180634    case 10: return 1;
   180635    case 9: return 1;
   180636    case 8: return 1;
   180637    case 7:
   180638       if (devinfo->is_haswell) {
   180639          return 0;
   180640       } else {
   180641          return 0;
   180642       }
   180643    case 6: return 0;
   180644    case 5: return 0;
   180645    case 4:
   180646       if (devinfo->is_g4x) {
   180647          return 0;
   180648       } else {
   180649          return 0;
   180650       }
   180651    default:
   180652       unreachable("Invalid hardware generation");
   180653    }
   180654 }
   180655 
   180656 
   180657 
   180658 #define GEN10_RENDER_SURFACE_STATE_SamplerL2BypassModeDisable_start  9
   180659 #define GEN9_RENDER_SURFACE_STATE_SamplerL2BypassModeDisable_start  9
   180660 #define GEN8_RENDER_SURFACE_STATE_SamplerL2BypassModeDisable_start  9
   180661 
   180662 static inline uint32_t ATTRIBUTE_PURE
   180663 RENDER_SURFACE_STATE_SamplerL2BypassModeDisable_start(const struct gen_device_info *devinfo)
   180664 {
   180665    switch (devinfo->gen) {
   180666    case 10: return 9;
   180667    case 9: return 9;
   180668    case 8: return 9;
   180669    case 7:
   180670       if (devinfo->is_haswell) {
   180671          return 0;
   180672       } else {
   180673          return 0;
   180674       }
   180675    case 6: return 0;
   180676    case 5: return 0;
   180677    case 4:
   180678       if (devinfo->is_g4x) {
   180679          return 0;
   180680       } else {
   180681          return 0;
   180682       }
   180683    default:
   180684       unreachable("Invalid hardware generation");
   180685    }
   180686 }
   180687 
   180688 
   180689 
   180690 /* RENDER_SURFACE_STATE::Separate UV Plane Enable */
   180691 
   180692 
   180693 #define GEN10_RENDER_SURFACE_STATE_SeparateUVPlaneEnable_bits  1
   180694 #define GEN9_RENDER_SURFACE_STATE_SeparateUVPlaneEnable_bits  1
   180695 #define GEN8_RENDER_SURFACE_STATE_SeparateUVPlaneEnable_bits  1
   180696 
   180697 static inline uint32_t ATTRIBUTE_PURE
   180698 RENDER_SURFACE_STATE_SeparateUVPlaneEnable_bits(const struct gen_device_info *devinfo)
   180699 {
   180700    switch (devinfo->gen) {
   180701    case 10: return 1;
   180702    case 9: return 1;
   180703    case 8: return 1;
   180704    case 7:
   180705       if (devinfo->is_haswell) {
   180706          return 0;
   180707       } else {
   180708          return 0;
   180709       }
   180710    case 6: return 0;
   180711    case 5: return 0;
   180712    case 4:
   180713       if (devinfo->is_g4x) {
   180714          return 0;
   180715       } else {
   180716          return 0;
   180717       }
   180718    default:
   180719       unreachable("Invalid hardware generation");
   180720    }
   180721 }
   180722 
   180723 
   180724 
   180725 #define GEN10_RENDER_SURFACE_STATE_SeparateUVPlaneEnable_start  223
   180726 #define GEN9_RENDER_SURFACE_STATE_SeparateUVPlaneEnable_start  223
   180727 #define GEN8_RENDER_SURFACE_STATE_SeparateUVPlaneEnable_start  223
   180728 
   180729 static inline uint32_t ATTRIBUTE_PURE
   180730 RENDER_SURFACE_STATE_SeparateUVPlaneEnable_start(const struct gen_device_info *devinfo)
   180731 {
   180732    switch (devinfo->gen) {
   180733    case 10: return 223;
   180734    case 9: return 223;
   180735    case 8: return 223;
   180736    case 7:
   180737       if (devinfo->is_haswell) {
   180738          return 0;
   180739       } else {
   180740          return 0;
   180741       }
   180742    case 6: return 0;
   180743    case 5: return 0;
   180744    case 4:
   180745       if (devinfo->is_g4x) {
   180746          return 0;
   180747       } else {
   180748          return 0;
   180749       }
   180750    default:
   180751       unreachable("Invalid hardware generation");
   180752    }
   180753 }
   180754 
   180755 
   180756 
   180757 /* RENDER_SURFACE_STATE::Shader Channel Select Alpha */
   180758 
   180759 
   180760 #define GEN10_RENDER_SURFACE_STATE_ShaderChannelSelectAlpha_bits  3
   180761 #define GEN9_RENDER_SURFACE_STATE_ShaderChannelSelectAlpha_bits  3
   180762 #define GEN8_RENDER_SURFACE_STATE_ShaderChannelSelectAlpha_bits  3
   180763 #define GEN75_RENDER_SURFACE_STATE_ShaderChannelSelectAlpha_bits  3
   180764 
   180765 static inline uint32_t ATTRIBUTE_PURE
   180766 RENDER_SURFACE_STATE_ShaderChannelSelectAlpha_bits(const struct gen_device_info *devinfo)
   180767 {
   180768    switch (devinfo->gen) {
   180769    case 10: return 3;
   180770    case 9: return 3;
   180771    case 8: return 3;
   180772    case 7:
   180773       if (devinfo->is_haswell) {
   180774          return 3;
   180775       } else {
   180776          return 0;
   180777       }
   180778    case 6: return 0;
   180779    case 5: return 0;
   180780    case 4:
   180781       if (devinfo->is_g4x) {
   180782          return 0;
   180783       } else {
   180784          return 0;
   180785       }
   180786    default:
   180787       unreachable("Invalid hardware generation");
   180788    }
   180789 }
   180790 
   180791 
   180792 
   180793 #define GEN10_RENDER_SURFACE_STATE_ShaderChannelSelectAlpha_start  240
   180794 #define GEN9_RENDER_SURFACE_STATE_ShaderChannelSelectAlpha_start  240
   180795 #define GEN8_RENDER_SURFACE_STATE_ShaderChannelSelectAlpha_start  240
   180796 #define GEN75_RENDER_SURFACE_STATE_ShaderChannelSelectAlpha_start  240
   180797 
   180798 static inline uint32_t ATTRIBUTE_PURE
   180799 RENDER_SURFACE_STATE_ShaderChannelSelectAlpha_start(const struct gen_device_info *devinfo)
   180800 {
   180801    switch (devinfo->gen) {
   180802    case 10: return 240;
   180803    case 9: return 240;
   180804    case 8: return 240;
   180805    case 7:
   180806       if (devinfo->is_haswell) {
   180807          return 240;
   180808       } else {
   180809          return 0;
   180810       }
   180811    case 6: return 0;
   180812    case 5: return 0;
   180813    case 4:
   180814       if (devinfo->is_g4x) {
   180815          return 0;
   180816       } else {
   180817          return 0;
   180818       }
   180819    default:
   180820       unreachable("Invalid hardware generation");
   180821    }
   180822 }
   180823 
   180824 
   180825 
   180826 /* RENDER_SURFACE_STATE::Shader Channel Select Blue */
   180827 
   180828 
   180829 #define GEN10_RENDER_SURFACE_STATE_ShaderChannelSelectBlue_bits  3
   180830 #define GEN9_RENDER_SURFACE_STATE_ShaderChannelSelectBlue_bits  3
   180831 #define GEN8_RENDER_SURFACE_STATE_ShaderChannelSelectBlue_bits  3
   180832 #define GEN75_RENDER_SURFACE_STATE_ShaderChannelSelectBlue_bits  3
   180833 
   180834 static inline uint32_t ATTRIBUTE_PURE
   180835 RENDER_SURFACE_STATE_ShaderChannelSelectBlue_bits(const struct gen_device_info *devinfo)
   180836 {
   180837    switch (devinfo->gen) {
   180838    case 10: return 3;
   180839    case 9: return 3;
   180840    case 8: return 3;
   180841    case 7:
   180842       if (devinfo->is_haswell) {
   180843          return 3;
   180844       } else {
   180845          return 0;
   180846       }
   180847    case 6: return 0;
   180848    case 5: return 0;
   180849    case 4:
   180850       if (devinfo->is_g4x) {
   180851          return 0;
   180852       } else {
   180853          return 0;
   180854       }
   180855    default:
   180856       unreachable("Invalid hardware generation");
   180857    }
   180858 }
   180859 
   180860 
   180861 
   180862 #define GEN10_RENDER_SURFACE_STATE_ShaderChannelSelectBlue_start  243
   180863 #define GEN9_RENDER_SURFACE_STATE_ShaderChannelSelectBlue_start  243
   180864 #define GEN8_RENDER_SURFACE_STATE_ShaderChannelSelectBlue_start  243
   180865 #define GEN75_RENDER_SURFACE_STATE_ShaderChannelSelectBlue_start  243
   180866 
   180867 static inline uint32_t ATTRIBUTE_PURE
   180868 RENDER_SURFACE_STATE_ShaderChannelSelectBlue_start(const struct gen_device_info *devinfo)
   180869 {
   180870    switch (devinfo->gen) {
   180871    case 10: return 243;
   180872    case 9: return 243;
   180873    case 8: return 243;
   180874    case 7:
   180875       if (devinfo->is_haswell) {
   180876          return 243;
   180877       } else {
   180878          return 0;
   180879       }
   180880    case 6: return 0;
   180881    case 5: return 0;
   180882    case 4:
   180883       if (devinfo->is_g4x) {
   180884          return 0;
   180885       } else {
   180886          return 0;
   180887       }
   180888    default:
   180889       unreachable("Invalid hardware generation");
   180890    }
   180891 }
   180892 
   180893 
   180894 
   180895 /* RENDER_SURFACE_STATE::Shader Channel Select Green */
   180896 
   180897 
   180898 #define GEN10_RENDER_SURFACE_STATE_ShaderChannelSelectGreen_bits  3
   180899 #define GEN9_RENDER_SURFACE_STATE_ShaderChannelSelectGreen_bits  3
   180900 #define GEN8_RENDER_SURFACE_STATE_ShaderChannelSelectGreen_bits  3
   180901 #define GEN75_RENDER_SURFACE_STATE_ShaderChannelSelectGreen_bits  3
   180902 
   180903 static inline uint32_t ATTRIBUTE_PURE
   180904 RENDER_SURFACE_STATE_ShaderChannelSelectGreen_bits(const struct gen_device_info *devinfo)
   180905 {
   180906    switch (devinfo->gen) {
   180907    case 10: return 3;
   180908    case 9: return 3;
   180909    case 8: return 3;
   180910    case 7:
   180911       if (devinfo->is_haswell) {
   180912          return 3;
   180913       } else {
   180914          return 0;
   180915       }
   180916    case 6: return 0;
   180917    case 5: return 0;
   180918    case 4:
   180919       if (devinfo->is_g4x) {
   180920          return 0;
   180921       } else {
   180922          return 0;
   180923       }
   180924    default:
   180925       unreachable("Invalid hardware generation");
   180926    }
   180927 }
   180928 
   180929 
   180930 
   180931 #define GEN10_RENDER_SURFACE_STATE_ShaderChannelSelectGreen_start  246
   180932 #define GEN9_RENDER_SURFACE_STATE_ShaderChannelSelectGreen_start  246
   180933 #define GEN8_RENDER_SURFACE_STATE_ShaderChannelSelectGreen_start  246
   180934 #define GEN75_RENDER_SURFACE_STATE_ShaderChannelSelectGreen_start  246
   180935 
   180936 static inline uint32_t ATTRIBUTE_PURE
   180937 RENDER_SURFACE_STATE_ShaderChannelSelectGreen_start(const struct gen_device_info *devinfo)
   180938 {
   180939    switch (devinfo->gen) {
   180940    case 10: return 246;
   180941    case 9: return 246;
   180942    case 8: return 246;
   180943    case 7:
   180944       if (devinfo->is_haswell) {
   180945          return 246;
   180946       } else {
   180947          return 0;
   180948       }
   180949    case 6: return 0;
   180950    case 5: return 0;
   180951    case 4:
   180952       if (devinfo->is_g4x) {
   180953          return 0;
   180954       } else {
   180955          return 0;
   180956       }
   180957    default:
   180958       unreachable("Invalid hardware generation");
   180959    }
   180960 }
   180961 
   180962 
   180963 
   180964 /* RENDER_SURFACE_STATE::Shader Channel Select Red */
   180965 
   180966 
   180967 #define GEN10_RENDER_SURFACE_STATE_ShaderChannelSelectRed_bits  3
   180968 #define GEN9_RENDER_SURFACE_STATE_ShaderChannelSelectRed_bits  3
   180969 #define GEN8_RENDER_SURFACE_STATE_ShaderChannelSelectRed_bits  3
   180970 #define GEN75_RENDER_SURFACE_STATE_ShaderChannelSelectRed_bits  3
   180971 
   180972 static inline uint32_t ATTRIBUTE_PURE
   180973 RENDER_SURFACE_STATE_ShaderChannelSelectRed_bits(const struct gen_device_info *devinfo)
   180974 {
   180975    switch (devinfo->gen) {
   180976    case 10: return 3;
   180977    case 9: return 3;
   180978    case 8: return 3;
   180979    case 7:
   180980       if (devinfo->is_haswell) {
   180981          return 3;
   180982       } else {
   180983          return 0;
   180984       }
   180985    case 6: return 0;
   180986    case 5: return 0;
   180987    case 4:
   180988       if (devinfo->is_g4x) {
   180989          return 0;
   180990       } else {
   180991          return 0;
   180992       }
   180993    default:
   180994       unreachable("Invalid hardware generation");
   180995    }
   180996 }
   180997 
   180998 
   180999 
   181000 #define GEN10_RENDER_SURFACE_STATE_ShaderChannelSelectRed_start  249
   181001 #define GEN9_RENDER_SURFACE_STATE_ShaderChannelSelectRed_start  249
   181002 #define GEN8_RENDER_SURFACE_STATE_ShaderChannelSelectRed_start  249
   181003 #define GEN75_RENDER_SURFACE_STATE_ShaderChannelSelectRed_start  249
   181004 
   181005 static inline uint32_t ATTRIBUTE_PURE
   181006 RENDER_SURFACE_STATE_ShaderChannelSelectRed_start(const struct gen_device_info *devinfo)
   181007 {
   181008    switch (devinfo->gen) {
   181009    case 10: return 249;
   181010    case 9: return 249;
   181011    case 8: return 249;
   181012    case 7:
   181013       if (devinfo->is_haswell) {
   181014          return 249;
   181015       } else {
   181016          return 0;
   181017       }
   181018    case 6: return 0;
   181019    case 5: return 0;
   181020    case 4:
   181021       if (devinfo->is_g4x) {
   181022          return 0;
   181023       } else {
   181024          return 0;
   181025       }
   181026    default:
   181027       unreachable("Invalid hardware generation");
   181028    }
   181029 }
   181030 
   181031 
   181032 
   181033 /* RENDER_SURFACE_STATE::Strbuf Minimum Array Element */
   181034 
   181035 
   181036 #define GEN75_RENDER_SURFACE_STATE_StrbufMinimumArrayElement_bits  27
   181037 #define GEN7_RENDER_SURFACE_STATE_StrbufMinimumArrayElement_bits  27
   181038 
   181039 static inline uint32_t ATTRIBUTE_PURE
   181040 RENDER_SURFACE_STATE_StrbufMinimumArrayElement_bits(const struct gen_device_info *devinfo)
   181041 {
   181042    switch (devinfo->gen) {
   181043    case 10: return 0;
   181044    case 9: return 0;
   181045    case 8: return 0;
   181046    case 7:
   181047       if (devinfo->is_haswell) {
   181048          return 27;
   181049       } else {
   181050          return 27;
   181051       }
   181052    case 6: return 0;
   181053    case 5: return 0;
   181054    case 4:
   181055       if (devinfo->is_g4x) {
   181056          return 0;
   181057       } else {
   181058          return 0;
   181059       }
   181060    default:
   181061       unreachable("Invalid hardware generation");
   181062    }
   181063 }
   181064 
   181065 
   181066 
   181067 #define GEN75_RENDER_SURFACE_STATE_StrbufMinimumArrayElement_start  128
   181068 #define GEN7_RENDER_SURFACE_STATE_StrbufMinimumArrayElement_start  128
   181069 
   181070 static inline uint32_t ATTRIBUTE_PURE
   181071 RENDER_SURFACE_STATE_StrbufMinimumArrayElement_start(const struct gen_device_info *devinfo)
   181072 {
   181073    switch (devinfo->gen) {
   181074    case 10: return 0;
   181075    case 9: return 0;
   181076    case 8: return 0;
   181077    case 7:
   181078       if (devinfo->is_haswell) {
   181079          return 128;
   181080       } else {
   181081          return 128;
   181082       }
   181083    case 6: return 0;
   181084    case 5: return 0;
   181085    case 4:
   181086       if (devinfo->is_g4x) {
   181087          return 0;
   181088       } else {
   181089          return 0;
   181090       }
   181091    default:
   181092       unreachable("Invalid hardware generation");
   181093    }
   181094 }
   181095 
   181096 
   181097 
   181098 /* RENDER_SURFACE_STATE::Surface Array */
   181099 
   181100 
   181101 #define GEN10_RENDER_SURFACE_STATE_SurfaceArray_bits  1
   181102 #define GEN9_RENDER_SURFACE_STATE_SurfaceArray_bits  1
   181103 #define GEN8_RENDER_SURFACE_STATE_SurfaceArray_bits  1
   181104 #define GEN75_RENDER_SURFACE_STATE_SurfaceArray_bits  1
   181105 #define GEN7_RENDER_SURFACE_STATE_SurfaceArray_bits  1
   181106 
   181107 static inline uint32_t ATTRIBUTE_PURE
   181108 RENDER_SURFACE_STATE_SurfaceArray_bits(const struct gen_device_info *devinfo)
   181109 {
   181110    switch (devinfo->gen) {
   181111    case 10: return 1;
   181112    case 9: return 1;
   181113    case 8: return 1;
   181114    case 7:
   181115       if (devinfo->is_haswell) {
   181116          return 1;
   181117       } else {
   181118          return 1;
   181119       }
   181120    case 6: return 0;
   181121    case 5: return 0;
   181122    case 4:
   181123       if (devinfo->is_g4x) {
   181124          return 0;
   181125       } else {
   181126          return 0;
   181127       }
   181128    default:
   181129       unreachable("Invalid hardware generation");
   181130    }
   181131 }
   181132 
   181133 
   181134 
   181135 #define GEN10_RENDER_SURFACE_STATE_SurfaceArray_start  28
   181136 #define GEN9_RENDER_SURFACE_STATE_SurfaceArray_start  28
   181137 #define GEN8_RENDER_SURFACE_STATE_SurfaceArray_start  28
   181138 #define GEN75_RENDER_SURFACE_STATE_SurfaceArray_start  28
   181139 #define GEN7_RENDER_SURFACE_STATE_SurfaceArray_start  28
   181140 
   181141 static inline uint32_t ATTRIBUTE_PURE
   181142 RENDER_SURFACE_STATE_SurfaceArray_start(const struct gen_device_info *devinfo)
   181143 {
   181144    switch (devinfo->gen) {
   181145    case 10: return 28;
   181146    case 9: return 28;
   181147    case 8: return 28;
   181148    case 7:
   181149       if (devinfo->is_haswell) {
   181150          return 28;
   181151       } else {
   181152          return 28;
   181153       }
   181154    case 6: return 0;
   181155    case 5: return 0;
   181156    case 4:
   181157       if (devinfo->is_g4x) {
   181158          return 0;
   181159       } else {
   181160          return 0;
   181161       }
   181162    default:
   181163       unreachable("Invalid hardware generation");
   181164    }
   181165 }
   181166 
   181167 
   181168 
   181169 /* RENDER_SURFACE_STATE::Surface Array Spacing */
   181170 
   181171 
   181172 #define GEN75_RENDER_SURFACE_STATE_SurfaceArraySpacing_bits  1
   181173 #define GEN7_RENDER_SURFACE_STATE_SurfaceArraySpacing_bits  1
   181174 
   181175 static inline uint32_t ATTRIBUTE_PURE
   181176 RENDER_SURFACE_STATE_SurfaceArraySpacing_bits(const struct gen_device_info *devinfo)
   181177 {
   181178    switch (devinfo->gen) {
   181179    case 10: return 0;
   181180    case 9: return 0;
   181181    case 8: return 0;
   181182    case 7:
   181183       if (devinfo->is_haswell) {
   181184          return 1;
   181185       } else {
   181186          return 1;
   181187       }
   181188    case 6: return 0;
   181189    case 5: return 0;
   181190    case 4:
   181191       if (devinfo->is_g4x) {
   181192          return 0;
   181193       } else {
   181194          return 0;
   181195       }
   181196    default:
   181197       unreachable("Invalid hardware generation");
   181198    }
   181199 }
   181200 
   181201 
   181202 
   181203 #define GEN75_RENDER_SURFACE_STATE_SurfaceArraySpacing_start  10
   181204 #define GEN7_RENDER_SURFACE_STATE_SurfaceArraySpacing_start  10
   181205 
   181206 static inline uint32_t ATTRIBUTE_PURE
   181207 RENDER_SURFACE_STATE_SurfaceArraySpacing_start(const struct gen_device_info *devinfo)
   181208 {
   181209    switch (devinfo->gen) {
   181210    case 10: return 0;
   181211    case 9: return 0;
   181212    case 8: return 0;
   181213    case 7:
   181214       if (devinfo->is_haswell) {
   181215          return 10;
   181216       } else {
   181217          return 10;
   181218       }
   181219    case 6: return 0;
   181220    case 5: return 0;
   181221    case 4:
   181222       if (devinfo->is_g4x) {
   181223          return 0;
   181224       } else {
   181225          return 0;
   181226       }
   181227    default:
   181228       unreachable("Invalid hardware generation");
   181229    }
   181230 }
   181231 
   181232 
   181233 
   181234 /* RENDER_SURFACE_STATE::Surface Base Address */
   181235 
   181236 
   181237 #define GEN10_RENDER_SURFACE_STATE_SurfaceBaseAddress_bits  64
   181238 #define GEN9_RENDER_SURFACE_STATE_SurfaceBaseAddress_bits  64
   181239 #define GEN8_RENDER_SURFACE_STATE_SurfaceBaseAddress_bits  64
   181240 #define GEN75_RENDER_SURFACE_STATE_SurfaceBaseAddress_bits  32
   181241 #define GEN7_RENDER_SURFACE_STATE_SurfaceBaseAddress_bits  32
   181242 #define GEN6_RENDER_SURFACE_STATE_SurfaceBaseAddress_bits  32
   181243 #define GEN5_RENDER_SURFACE_STATE_SurfaceBaseAddress_bits  32
   181244 #define GEN45_RENDER_SURFACE_STATE_SurfaceBaseAddress_bits  32
   181245 #define GEN4_RENDER_SURFACE_STATE_SurfaceBaseAddress_bits  32
   181246 
   181247 static inline uint32_t ATTRIBUTE_PURE
   181248 RENDER_SURFACE_STATE_SurfaceBaseAddress_bits(const struct gen_device_info *devinfo)
   181249 {
   181250    switch (devinfo->gen) {
   181251    case 10: return 64;
   181252    case 9: return 64;
   181253    case 8: return 64;
   181254    case 7:
   181255       if (devinfo->is_haswell) {
   181256          return 32;
   181257       } else {
   181258          return 32;
   181259       }
   181260    case 6: return 32;
   181261    case 5: return 32;
   181262    case 4:
   181263       if (devinfo->is_g4x) {
   181264          return 32;
   181265       } else {
   181266          return 32;
   181267       }
   181268    default:
   181269       unreachable("Invalid hardware generation");
   181270    }
   181271 }
   181272 
   181273 
   181274 
   181275 #define GEN10_RENDER_SURFACE_STATE_SurfaceBaseAddress_start  256
   181276 #define GEN9_RENDER_SURFACE_STATE_SurfaceBaseAddress_start  256
   181277 #define GEN8_RENDER_SURFACE_STATE_SurfaceBaseAddress_start  256
   181278 #define GEN75_RENDER_SURFACE_STATE_SurfaceBaseAddress_start  32
   181279 #define GEN7_RENDER_SURFACE_STATE_SurfaceBaseAddress_start  32
   181280 #define GEN6_RENDER_SURFACE_STATE_SurfaceBaseAddress_start  32
   181281 #define GEN5_RENDER_SURFACE_STATE_SurfaceBaseAddress_start  32
   181282 #define GEN45_RENDER_SURFACE_STATE_SurfaceBaseAddress_start  32
   181283 #define GEN4_RENDER_SURFACE_STATE_SurfaceBaseAddress_start  32
   181284 
   181285 static inline uint32_t ATTRIBUTE_PURE
   181286 RENDER_SURFACE_STATE_SurfaceBaseAddress_start(const struct gen_device_info *devinfo)
   181287 {
   181288    switch (devinfo->gen) {
   181289    case 10: return 256;
   181290    case 9: return 256;
   181291    case 8: return 256;
   181292    case 7:
   181293       if (devinfo->is_haswell) {
   181294          return 32;
   181295       } else {
   181296          return 32;
   181297       }
   181298    case 6: return 32;
   181299    case 5: return 32;
   181300    case 4:
   181301       if (devinfo->is_g4x) {
   181302          return 32;
   181303       } else {
   181304          return 32;
   181305       }
   181306    default:
   181307       unreachable("Invalid hardware generation");
   181308    }
   181309 }
   181310 
   181311 
   181312 
   181313 /* RENDER_SURFACE_STATE::Surface Format */
   181314 
   181315 
   181316 #define GEN10_RENDER_SURFACE_STATE_SurfaceFormat_bits  10
   181317 #define GEN9_RENDER_SURFACE_STATE_SurfaceFormat_bits  10
   181318 #define GEN8_RENDER_SURFACE_STATE_SurfaceFormat_bits  9
   181319 #define GEN75_RENDER_SURFACE_STATE_SurfaceFormat_bits  9
   181320 #define GEN7_RENDER_SURFACE_STATE_SurfaceFormat_bits  9
   181321 #define GEN6_RENDER_SURFACE_STATE_SurfaceFormat_bits  9
   181322 #define GEN5_RENDER_SURFACE_STATE_SurfaceFormat_bits  9
   181323 #define GEN45_RENDER_SURFACE_STATE_SurfaceFormat_bits  9
   181324 #define GEN4_RENDER_SURFACE_STATE_SurfaceFormat_bits  9
   181325 
   181326 static inline uint32_t ATTRIBUTE_PURE
   181327 RENDER_SURFACE_STATE_SurfaceFormat_bits(const struct gen_device_info *devinfo)
   181328 {
   181329    switch (devinfo->gen) {
   181330    case 10: return 10;
   181331    case 9: return 10;
   181332    case 8: return 9;
   181333    case 7:
   181334       if (devinfo->is_haswell) {
   181335          return 9;
   181336       } else {
   181337          return 9;
   181338       }
   181339    case 6: return 9;
   181340    case 5: return 9;
   181341    case 4:
   181342       if (devinfo->is_g4x) {
   181343          return 9;
   181344       } else {
   181345          return 9;
   181346       }
   181347    default:
   181348       unreachable("Invalid hardware generation");
   181349    }
   181350 }
   181351 
   181352 
   181353 
   181354 #define GEN10_RENDER_SURFACE_STATE_SurfaceFormat_start  18
   181355 #define GEN9_RENDER_SURFACE_STATE_SurfaceFormat_start  18
   181356 #define GEN8_RENDER_SURFACE_STATE_SurfaceFormat_start  18
   181357 #define GEN75_RENDER_SURFACE_STATE_SurfaceFormat_start  18
   181358 #define GEN7_RENDER_SURFACE_STATE_SurfaceFormat_start  18
   181359 #define GEN6_RENDER_SURFACE_STATE_SurfaceFormat_start  18
   181360 #define GEN5_RENDER_SURFACE_STATE_SurfaceFormat_start  18
   181361 #define GEN45_RENDER_SURFACE_STATE_SurfaceFormat_start  18
   181362 #define GEN4_RENDER_SURFACE_STATE_SurfaceFormat_start  18
   181363 
   181364 static inline uint32_t ATTRIBUTE_PURE
   181365 RENDER_SURFACE_STATE_SurfaceFormat_start(const struct gen_device_info *devinfo)
   181366 {
   181367    switch (devinfo->gen) {
   181368    case 10: return 18;
   181369    case 9: return 18;
   181370    case 8: return 18;
   181371    case 7:
   181372       if (devinfo->is_haswell) {
   181373          return 18;
   181374       } else {
   181375          return 18;
   181376       }
   181377    case 6: return 18;
   181378    case 5: return 18;
   181379    case 4:
   181380       if (devinfo->is_g4x) {
   181381          return 18;
   181382       } else {
   181383          return 18;
   181384       }
   181385    default:
   181386       unreachable("Invalid hardware generation");
   181387    }
   181388 }
   181389 
   181390 
   181391 
   181392 /* RENDER_SURFACE_STATE::Surface Horizontal Alignment */
   181393 
   181394 
   181395 #define GEN10_RENDER_SURFACE_STATE_SurfaceHorizontalAlignment_bits  2
   181396 #define GEN9_RENDER_SURFACE_STATE_SurfaceHorizontalAlignment_bits  2
   181397 #define GEN8_RENDER_SURFACE_STATE_SurfaceHorizontalAlignment_bits  2
   181398 #define GEN75_RENDER_SURFACE_STATE_SurfaceHorizontalAlignment_bits  1
   181399 #define GEN7_RENDER_SURFACE_STATE_SurfaceHorizontalAlignment_bits  1
   181400 
   181401 static inline uint32_t ATTRIBUTE_PURE
   181402 RENDER_SURFACE_STATE_SurfaceHorizontalAlignment_bits(const struct gen_device_info *devinfo)
   181403 {
   181404    switch (devinfo->gen) {
   181405    case 10: return 2;
   181406    case 9: return 2;
   181407    case 8: return 2;
   181408    case 7:
   181409       if (devinfo->is_haswell) {
   181410          return 1;
   181411       } else {
   181412          return 1;
   181413       }
   181414    case 6: return 0;
   181415    case 5: return 0;
   181416    case 4:
   181417       if (devinfo->is_g4x) {
   181418          return 0;
   181419       } else {
   181420          return 0;
   181421       }
   181422    default:
   181423       unreachable("Invalid hardware generation");
   181424    }
   181425 }
   181426 
   181427 
   181428 
   181429 #define GEN10_RENDER_SURFACE_STATE_SurfaceHorizontalAlignment_start  14
   181430 #define GEN9_RENDER_SURFACE_STATE_SurfaceHorizontalAlignment_start  14
   181431 #define GEN8_RENDER_SURFACE_STATE_SurfaceHorizontalAlignment_start  14
   181432 #define GEN75_RENDER_SURFACE_STATE_SurfaceHorizontalAlignment_start  15
   181433 #define GEN7_RENDER_SURFACE_STATE_SurfaceHorizontalAlignment_start  15
   181434 
   181435 static inline uint32_t ATTRIBUTE_PURE
   181436 RENDER_SURFACE_STATE_SurfaceHorizontalAlignment_start(const struct gen_device_info *devinfo)
   181437 {
   181438    switch (devinfo->gen) {
   181439    case 10: return 14;
   181440    case 9: return 14;
   181441    case 8: return 14;
   181442    case 7:
   181443       if (devinfo->is_haswell) {
   181444          return 15;
   181445       } else {
   181446          return 15;
   181447       }
   181448    case 6: return 0;
   181449    case 5: return 0;
   181450    case 4:
   181451       if (devinfo->is_g4x) {
   181452          return 0;
   181453       } else {
   181454          return 0;
   181455       }
   181456    default:
   181457       unreachable("Invalid hardware generation");
   181458    }
   181459 }
   181460 
   181461 
   181462 
   181463 /* RENDER_SURFACE_STATE::Surface Min LOD */
   181464 
   181465 
   181466 #define GEN10_RENDER_SURFACE_STATE_SurfaceMinLOD_bits  4
   181467 #define GEN9_RENDER_SURFACE_STATE_SurfaceMinLOD_bits  4
   181468 #define GEN8_RENDER_SURFACE_STATE_SurfaceMinLOD_bits  4
   181469 #define GEN75_RENDER_SURFACE_STATE_SurfaceMinLOD_bits  4
   181470 #define GEN7_RENDER_SURFACE_STATE_SurfaceMinLOD_bits  4
   181471 #define GEN6_RENDER_SURFACE_STATE_SurfaceMinLOD_bits  4
   181472 #define GEN5_RENDER_SURFACE_STATE_SurfaceMinLOD_bits  4
   181473 #define GEN45_RENDER_SURFACE_STATE_SurfaceMinLOD_bits  4
   181474 #define GEN4_RENDER_SURFACE_STATE_SurfaceMinLOD_bits  4
   181475 
   181476 static inline uint32_t ATTRIBUTE_PURE
   181477 RENDER_SURFACE_STATE_SurfaceMinLOD_bits(const struct gen_device_info *devinfo)
   181478 {
   181479    switch (devinfo->gen) {
   181480    case 10: return 4;
   181481    case 9: return 4;
   181482    case 8: return 4;
   181483    case 7:
   181484       if (devinfo->is_haswell) {
   181485          return 4;
   181486       } else {
   181487          return 4;
   181488       }
   181489    case 6: return 4;
   181490    case 5: return 4;
   181491    case 4:
   181492       if (devinfo->is_g4x) {
   181493          return 4;
   181494       } else {
   181495          return 4;
   181496       }
   181497    default:
   181498       unreachable("Invalid hardware generation");
   181499    }
   181500 }
   181501 
   181502 
   181503 
   181504 #define GEN10_RENDER_SURFACE_STATE_SurfaceMinLOD_start  164
   181505 #define GEN9_RENDER_SURFACE_STATE_SurfaceMinLOD_start  164
   181506 #define GEN8_RENDER_SURFACE_STATE_SurfaceMinLOD_start  164
   181507 #define GEN75_RENDER_SURFACE_STATE_SurfaceMinLOD_start  164
   181508 #define GEN7_RENDER_SURFACE_STATE_SurfaceMinLOD_start  164
   181509 #define GEN6_RENDER_SURFACE_STATE_SurfaceMinLOD_start  156
   181510 #define GEN5_RENDER_SURFACE_STATE_SurfaceMinLOD_start  156
   181511 #define GEN45_RENDER_SURFACE_STATE_SurfaceMinLOD_start  156
   181512 #define GEN4_RENDER_SURFACE_STATE_SurfaceMinLOD_start  156
   181513 
   181514 static inline uint32_t ATTRIBUTE_PURE
   181515 RENDER_SURFACE_STATE_SurfaceMinLOD_start(const struct gen_device_info *devinfo)
   181516 {
   181517    switch (devinfo->gen) {
   181518    case 10: return 164;
   181519    case 9: return 164;
   181520    case 8: return 164;
   181521    case 7:
   181522       if (devinfo->is_haswell) {
   181523          return 164;
   181524       } else {
   181525          return 164;
   181526       }
   181527    case 6: return 156;
   181528    case 5: return 156;
   181529    case 4:
   181530       if (devinfo->is_g4x) {
   181531          return 156;
   181532       } else {
   181533          return 156;
   181534       }
   181535    default:
   181536       unreachable("Invalid hardware generation");
   181537    }
   181538 }
   181539 
   181540 
   181541 
   181542 /* RENDER_SURFACE_STATE::Surface Object Control State */
   181543 
   181544 
   181545 #define GEN75_RENDER_SURFACE_STATE_SurfaceObjectControlState_bits  4
   181546 #define GEN7_RENDER_SURFACE_STATE_SurfaceObjectControlState_bits  4
   181547 #define GEN6_RENDER_SURFACE_STATE_SurfaceObjectControlState_bits  4
   181548 
   181549 static inline uint32_t ATTRIBUTE_PURE
   181550 RENDER_SURFACE_STATE_SurfaceObjectControlState_bits(const struct gen_device_info *devinfo)
   181551 {
   181552    switch (devinfo->gen) {
   181553    case 10: return 0;
   181554    case 9: return 0;
   181555    case 8: return 0;
   181556    case 7:
   181557       if (devinfo->is_haswell) {
   181558          return 4;
   181559       } else {
   181560          return 4;
   181561       }
   181562    case 6: return 4;
   181563    case 5: return 0;
   181564    case 4:
   181565       if (devinfo->is_g4x) {
   181566          return 0;
   181567       } else {
   181568          return 0;
   181569       }
   181570    default:
   181571       unreachable("Invalid hardware generation");
   181572    }
   181573 }
   181574 
   181575 
   181576 
   181577 #define GEN75_RENDER_SURFACE_STATE_SurfaceObjectControlState_start  176
   181578 #define GEN7_RENDER_SURFACE_STATE_SurfaceObjectControlState_start  176
   181579 #define GEN6_RENDER_SURFACE_STATE_SurfaceObjectControlState_start  176
   181580 
   181581 static inline uint32_t ATTRIBUTE_PURE
   181582 RENDER_SURFACE_STATE_SurfaceObjectControlState_start(const struct gen_device_info *devinfo)
   181583 {
   181584    switch (devinfo->gen) {
   181585    case 10: return 0;
   181586    case 9: return 0;
   181587    case 8: return 0;
   181588    case 7:
   181589       if (devinfo->is_haswell) {
   181590          return 176;
   181591       } else {
   181592          return 176;
   181593       }
   181594    case 6: return 176;
   181595    case 5: return 0;
   181596    case 4:
   181597       if (devinfo->is_g4x) {
   181598          return 0;
   181599       } else {
   181600          return 0;
   181601       }
   181602    default:
   181603       unreachable("Invalid hardware generation");
   181604    }
   181605 }
   181606 
   181607 
   181608 
   181609 /* RENDER_SURFACE_STATE::Surface Pitch */
   181610 
   181611 
   181612 #define GEN10_RENDER_SURFACE_STATE_SurfacePitch_bits  18
   181613 #define GEN9_RENDER_SURFACE_STATE_SurfacePitch_bits  18
   181614 #define GEN8_RENDER_SURFACE_STATE_SurfacePitch_bits  18
   181615 #define GEN75_RENDER_SURFACE_STATE_SurfacePitch_bits  18
   181616 #define GEN7_RENDER_SURFACE_STATE_SurfacePitch_bits  18
   181617 #define GEN6_RENDER_SURFACE_STATE_SurfacePitch_bits  17
   181618 #define GEN5_RENDER_SURFACE_STATE_SurfacePitch_bits  17
   181619 #define GEN45_RENDER_SURFACE_STATE_SurfacePitch_bits  17
   181620 #define GEN4_RENDER_SURFACE_STATE_SurfacePitch_bits  17
   181621 
   181622 static inline uint32_t ATTRIBUTE_PURE
   181623 RENDER_SURFACE_STATE_SurfacePitch_bits(const struct gen_device_info *devinfo)
   181624 {
   181625    switch (devinfo->gen) {
   181626    case 10: return 18;
   181627    case 9: return 18;
   181628    case 8: return 18;
   181629    case 7:
   181630       if (devinfo->is_haswell) {
   181631          return 18;
   181632       } else {
   181633          return 18;
   181634       }
   181635    case 6: return 17;
   181636    case 5: return 17;
   181637    case 4:
   181638       if (devinfo->is_g4x) {
   181639          return 17;
   181640       } else {
   181641          return 17;
   181642       }
   181643    default:
   181644       unreachable("Invalid hardware generation");
   181645    }
   181646 }
   181647 
   181648 
   181649 
   181650 #define GEN10_RENDER_SURFACE_STATE_SurfacePitch_start  96
   181651 #define GEN9_RENDER_SURFACE_STATE_SurfacePitch_start  96
   181652 #define GEN8_RENDER_SURFACE_STATE_SurfacePitch_start  96
   181653 #define GEN75_RENDER_SURFACE_STATE_SurfacePitch_start  96
   181654 #define GEN7_RENDER_SURFACE_STATE_SurfacePitch_start  96
   181655 #define GEN6_RENDER_SURFACE_STATE_SurfacePitch_start  99
   181656 #define GEN5_RENDER_SURFACE_STATE_SurfacePitch_start  99
   181657 #define GEN45_RENDER_SURFACE_STATE_SurfacePitch_start  99
   181658 #define GEN4_RENDER_SURFACE_STATE_SurfacePitch_start  99
   181659 
   181660 static inline uint32_t ATTRIBUTE_PURE
   181661 RENDER_SURFACE_STATE_SurfacePitch_start(const struct gen_device_info *devinfo)
   181662 {
   181663    switch (devinfo->gen) {
   181664    case 10: return 96;
   181665    case 9: return 96;
   181666    case 8: return 96;
   181667    case 7:
   181668       if (devinfo->is_haswell) {
   181669          return 96;
   181670       } else {
   181671          return 96;
   181672       }
   181673    case 6: return 99;
   181674    case 5: return 99;
   181675    case 4:
   181676       if (devinfo->is_g4x) {
   181677          return 99;
   181678       } else {
   181679          return 99;
   181680       }
   181681    default:
   181682       unreachable("Invalid hardware generation");
   181683    }
   181684 }
   181685 
   181686 
   181687 
   181688 /* RENDER_SURFACE_STATE::Surface QPitch */
   181689 
   181690 
   181691 #define GEN10_RENDER_SURFACE_STATE_SurfaceQPitch_bits  15
   181692 #define GEN9_RENDER_SURFACE_STATE_SurfaceQPitch_bits  15
   181693 #define GEN8_RENDER_SURFACE_STATE_SurfaceQPitch_bits  15
   181694 
   181695 static inline uint32_t ATTRIBUTE_PURE
   181696 RENDER_SURFACE_STATE_SurfaceQPitch_bits(const struct gen_device_info *devinfo)
   181697 {
   181698    switch (devinfo->gen) {
   181699    case 10: return 15;
   181700    case 9: return 15;
   181701    case 8: return 15;
   181702    case 7:
   181703       if (devinfo->is_haswell) {
   181704          return 0;
   181705       } else {
   181706          return 0;
   181707       }
   181708    case 6: return 0;
   181709    case 5: return 0;
   181710    case 4:
   181711       if (devinfo->is_g4x) {
   181712          return 0;
   181713       } else {
   181714          return 0;
   181715       }
   181716    default:
   181717       unreachable("Invalid hardware generation");
   181718    }
   181719 }
   181720 
   181721 
   181722 
   181723 #define GEN10_RENDER_SURFACE_STATE_SurfaceQPitch_start  32
   181724 #define GEN9_RENDER_SURFACE_STATE_SurfaceQPitch_start  32
   181725 #define GEN8_RENDER_SURFACE_STATE_SurfaceQPitch_start  32
   181726 
   181727 static inline uint32_t ATTRIBUTE_PURE
   181728 RENDER_SURFACE_STATE_SurfaceQPitch_start(const struct gen_device_info *devinfo)
   181729 {
   181730    switch (devinfo->gen) {
   181731    case 10: return 32;
   181732    case 9: return 32;
   181733    case 8: return 32;
   181734    case 7:
   181735       if (devinfo->is_haswell) {
   181736          return 0;
   181737       } else {
   181738          return 0;
   181739       }
   181740    case 6: return 0;
   181741    case 5: return 0;
   181742    case 4:
   181743       if (devinfo->is_g4x) {
   181744          return 0;
   181745       } else {
   181746          return 0;
   181747       }
   181748    default:
   181749       unreachable("Invalid hardware generation");
   181750    }
   181751 }
   181752 
   181753 
   181754 
   181755 /* RENDER_SURFACE_STATE::Surface Type */
   181756 
   181757 
   181758 #define GEN10_RENDER_SURFACE_STATE_SurfaceType_bits  3
   181759 #define GEN9_RENDER_SURFACE_STATE_SurfaceType_bits  3
   181760 #define GEN8_RENDER_SURFACE_STATE_SurfaceType_bits  3
   181761 #define GEN75_RENDER_SURFACE_STATE_SurfaceType_bits  3
   181762 #define GEN7_RENDER_SURFACE_STATE_SurfaceType_bits  3
   181763 #define GEN6_RENDER_SURFACE_STATE_SurfaceType_bits  3
   181764 #define GEN5_RENDER_SURFACE_STATE_SurfaceType_bits  3
   181765 #define GEN45_RENDER_SURFACE_STATE_SurfaceType_bits  3
   181766 #define GEN4_RENDER_SURFACE_STATE_SurfaceType_bits  3
   181767 
   181768 static inline uint32_t ATTRIBUTE_PURE
   181769 RENDER_SURFACE_STATE_SurfaceType_bits(const struct gen_device_info *devinfo)
   181770 {
   181771    switch (devinfo->gen) {
   181772    case 10: return 3;
   181773    case 9: return 3;
   181774    case 8: return 3;
   181775    case 7:
   181776       if (devinfo->is_haswell) {
   181777          return 3;
   181778       } else {
   181779          return 3;
   181780       }
   181781    case 6: return 3;
   181782    case 5: return 3;
   181783    case 4:
   181784       if (devinfo->is_g4x) {
   181785          return 3;
   181786       } else {
   181787          return 3;
   181788       }
   181789    default:
   181790       unreachable("Invalid hardware generation");
   181791    }
   181792 }
   181793 
   181794 
   181795 
   181796 #define GEN10_RENDER_SURFACE_STATE_SurfaceType_start  29
   181797 #define GEN9_RENDER_SURFACE_STATE_SurfaceType_start  29
   181798 #define GEN8_RENDER_SURFACE_STATE_SurfaceType_start  29
   181799 #define GEN75_RENDER_SURFACE_STATE_SurfaceType_start  29
   181800 #define GEN7_RENDER_SURFACE_STATE_SurfaceType_start  29
   181801 #define GEN6_RENDER_SURFACE_STATE_SurfaceType_start  29
   181802 #define GEN5_RENDER_SURFACE_STATE_SurfaceType_start  29
   181803 #define GEN45_RENDER_SURFACE_STATE_SurfaceType_start  29
   181804 #define GEN4_RENDER_SURFACE_STATE_SurfaceType_start  29
   181805 
   181806 static inline uint32_t ATTRIBUTE_PURE
   181807 RENDER_SURFACE_STATE_SurfaceType_start(const struct gen_device_info *devinfo)
   181808 {
   181809    switch (devinfo->gen) {
   181810    case 10: return 29;
   181811    case 9: return 29;
   181812    case 8: return 29;
   181813    case 7:
   181814       if (devinfo->is_haswell) {
   181815          return 29;
   181816       } else {
   181817          return 29;
   181818       }
   181819    case 6: return 29;
   181820    case 5: return 29;
   181821    case 4:
   181822       if (devinfo->is_g4x) {
   181823          return 29;
   181824       } else {
   181825          return 29;
   181826       }
   181827    default:
   181828       unreachable("Invalid hardware generation");
   181829    }
   181830 }
   181831 
   181832 
   181833 
   181834 /* RENDER_SURFACE_STATE::Surface Vertical Alignment */
   181835 
   181836 
   181837 #define GEN10_RENDER_SURFACE_STATE_SurfaceVerticalAlignment_bits  2
   181838 #define GEN9_RENDER_SURFACE_STATE_SurfaceVerticalAlignment_bits  2
   181839 #define GEN8_RENDER_SURFACE_STATE_SurfaceVerticalAlignment_bits  2
   181840 #define GEN75_RENDER_SURFACE_STATE_SurfaceVerticalAlignment_bits  2
   181841 #define GEN7_RENDER_SURFACE_STATE_SurfaceVerticalAlignment_bits  2
   181842 #define GEN6_RENDER_SURFACE_STATE_SurfaceVerticalAlignment_bits  1
   181843 
   181844 static inline uint32_t ATTRIBUTE_PURE
   181845 RENDER_SURFACE_STATE_SurfaceVerticalAlignment_bits(const struct gen_device_info *devinfo)
   181846 {
   181847    switch (devinfo->gen) {
   181848    case 10: return 2;
   181849    case 9: return 2;
   181850    case 8: return 2;
   181851    case 7:
   181852       if (devinfo->is_haswell) {
   181853          return 2;
   181854       } else {
   181855          return 2;
   181856       }
   181857    case 6: return 1;
   181858    case 5: return 0;
   181859    case 4:
   181860       if (devinfo->is_g4x) {
   181861          return 0;
   181862       } else {
   181863          return 0;
   181864       }
   181865    default:
   181866       unreachable("Invalid hardware generation");
   181867    }
   181868 }
   181869 
   181870 
   181871 
   181872 #define GEN10_RENDER_SURFACE_STATE_SurfaceVerticalAlignment_start  16
   181873 #define GEN9_RENDER_SURFACE_STATE_SurfaceVerticalAlignment_start  16
   181874 #define GEN8_RENDER_SURFACE_STATE_SurfaceVerticalAlignment_start  16
   181875 #define GEN75_RENDER_SURFACE_STATE_SurfaceVerticalAlignment_start  16
   181876 #define GEN7_RENDER_SURFACE_STATE_SurfaceVerticalAlignment_start  16
   181877 #define GEN6_RENDER_SURFACE_STATE_SurfaceVerticalAlignment_start  184
   181878 
   181879 static inline uint32_t ATTRIBUTE_PURE
   181880 RENDER_SURFACE_STATE_SurfaceVerticalAlignment_start(const struct gen_device_info *devinfo)
   181881 {
   181882    switch (devinfo->gen) {
   181883    case 10: return 16;
   181884    case 9: return 16;
   181885    case 8: return 16;
   181886    case 7:
   181887       if (devinfo->is_haswell) {
   181888          return 16;
   181889       } else {
   181890          return 16;
   181891       }
   181892    case 6: return 184;
   181893    case 5: return 0;
   181894    case 4:
   181895       if (devinfo->is_g4x) {
   181896          return 0;
   181897       } else {
   181898          return 0;
   181899       }
   181900    default:
   181901       unreachable("Invalid hardware generation");
   181902    }
   181903 }
   181904 
   181905 
   181906 
   181907 /* RENDER_SURFACE_STATE::Tile Address Mapping Mode */
   181908 
   181909 
   181910 #define GEN10_RENDER_SURFACE_STATE_TileAddressMappingMode_bits  1
   181911 
   181912 static inline uint32_t ATTRIBUTE_PURE
   181913 RENDER_SURFACE_STATE_TileAddressMappingMode_bits(const struct gen_device_info *devinfo)
   181914 {
   181915    switch (devinfo->gen) {
   181916    case 10: return 1;
   181917    case 9: return 0;
   181918    case 8: return 0;
   181919    case 7:
   181920       if (devinfo->is_haswell) {
   181921          return 0;
   181922       } else {
   181923          return 0;
   181924       }
   181925    case 6: return 0;
   181926    case 5: return 0;
   181927    case 4:
   181928       if (devinfo->is_g4x) {
   181929          return 0;
   181930       } else {
   181931          return 0;
   181932       }
   181933    default:
   181934       unreachable("Invalid hardware generation");
   181935    }
   181936 }
   181937 
   181938 
   181939 
   181940 #define GEN10_RENDER_SURFACE_STATE_TileAddressMappingMode_start  116
   181941 
   181942 static inline uint32_t ATTRIBUTE_PURE
   181943 RENDER_SURFACE_STATE_TileAddressMappingMode_start(const struct gen_device_info *devinfo)
   181944 {
   181945    switch (devinfo->gen) {
   181946    case 10: return 116;
   181947    case 9: return 0;
   181948    case 8: return 0;
   181949    case 7:
   181950       if (devinfo->is_haswell) {
   181951          return 0;
   181952       } else {
   181953          return 0;
   181954       }
   181955    case 6: return 0;
   181956    case 5: return 0;
   181957    case 4:
   181958       if (devinfo->is_g4x) {
   181959          return 0;
   181960       } else {
   181961          return 0;
   181962       }
   181963    default:
   181964       unreachable("Invalid hardware generation");
   181965    }
   181966 }
   181967 
   181968 
   181969 
   181970 /* RENDER_SURFACE_STATE::Tile Mode */
   181971 
   181972 
   181973 #define GEN10_RENDER_SURFACE_STATE_TileMode_bits  2
   181974 #define GEN9_RENDER_SURFACE_STATE_TileMode_bits  2
   181975 #define GEN8_RENDER_SURFACE_STATE_TileMode_bits  2
   181976 
   181977 static inline uint32_t ATTRIBUTE_PURE
   181978 RENDER_SURFACE_STATE_TileMode_bits(const struct gen_device_info *devinfo)
   181979 {
   181980    switch (devinfo->gen) {
   181981    case 10: return 2;
   181982    case 9: return 2;
   181983    case 8: return 2;
   181984    case 7:
   181985       if (devinfo->is_haswell) {
   181986          return 0;
   181987       } else {
   181988          return 0;
   181989       }
   181990    case 6: return 0;
   181991    case 5: return 0;
   181992    case 4:
   181993       if (devinfo->is_g4x) {
   181994          return 0;
   181995       } else {
   181996          return 0;
   181997       }
   181998    default:
   181999       unreachable("Invalid hardware generation");
   182000    }
   182001 }
   182002 
   182003 
   182004 
   182005 #define GEN10_RENDER_SURFACE_STATE_TileMode_start  12
   182006 #define GEN9_RENDER_SURFACE_STATE_TileMode_start  12
   182007 #define GEN8_RENDER_SURFACE_STATE_TileMode_start  12
   182008 
   182009 static inline uint32_t ATTRIBUTE_PURE
   182010 RENDER_SURFACE_STATE_TileMode_start(const struct gen_device_info *devinfo)
   182011 {
   182012    switch (devinfo->gen) {
   182013    case 10: return 12;
   182014    case 9: return 12;
   182015    case 8: return 12;
   182016    case 7:
   182017       if (devinfo->is_haswell) {
   182018          return 0;
   182019       } else {
   182020          return 0;
   182021       }
   182022    case 6: return 0;
   182023    case 5: return 0;
   182024    case 4:
   182025       if (devinfo->is_g4x) {
   182026          return 0;
   182027       } else {
   182028          return 0;
   182029       }
   182030    default:
   182031       unreachable("Invalid hardware generation");
   182032    }
   182033 }
   182034 
   182035 
   182036 
   182037 /* RENDER_SURFACE_STATE::Tile Walk */
   182038 
   182039 
   182040 #define GEN75_RENDER_SURFACE_STATE_TileWalk_bits  1
   182041 #define GEN7_RENDER_SURFACE_STATE_TileWalk_bits  1
   182042 #define GEN6_RENDER_SURFACE_STATE_TileWalk_bits  1
   182043 #define GEN5_RENDER_SURFACE_STATE_TileWalk_bits  1
   182044 #define GEN45_RENDER_SURFACE_STATE_TileWalk_bits  1
   182045 #define GEN4_RENDER_SURFACE_STATE_TileWalk_bits  1
   182046 
   182047 static inline uint32_t ATTRIBUTE_PURE
   182048 RENDER_SURFACE_STATE_TileWalk_bits(const struct gen_device_info *devinfo)
   182049 {
   182050    switch (devinfo->gen) {
   182051    case 10: return 0;
   182052    case 9: return 0;
   182053    case 8: return 0;
   182054    case 7:
   182055       if (devinfo->is_haswell) {
   182056          return 1;
   182057       } else {
   182058          return 1;
   182059       }
   182060    case 6: return 1;
   182061    case 5: return 1;
   182062    case 4:
   182063       if (devinfo->is_g4x) {
   182064          return 1;
   182065       } else {
   182066          return 1;
   182067       }
   182068    default:
   182069       unreachable("Invalid hardware generation");
   182070    }
   182071 }
   182072 
   182073 
   182074 
   182075 #define GEN75_RENDER_SURFACE_STATE_TileWalk_start  13
   182076 #define GEN7_RENDER_SURFACE_STATE_TileWalk_start  13
   182077 #define GEN6_RENDER_SURFACE_STATE_TileWalk_start  96
   182078 #define GEN5_RENDER_SURFACE_STATE_TileWalk_start  96
   182079 #define GEN45_RENDER_SURFACE_STATE_TileWalk_start  96
   182080 #define GEN4_RENDER_SURFACE_STATE_TileWalk_start  96
   182081 
   182082 static inline uint32_t ATTRIBUTE_PURE
   182083 RENDER_SURFACE_STATE_TileWalk_start(const struct gen_device_info *devinfo)
   182084 {
   182085    switch (devinfo->gen) {
   182086    case 10: return 0;
   182087    case 9: return 0;
   182088    case 8: return 0;
   182089    case 7:
   182090       if (devinfo->is_haswell) {
   182091          return 13;
   182092       } else {
   182093          return 13;
   182094       }
   182095    case 6: return 96;
   182096    case 5: return 96;
   182097    case 4:
   182098       if (devinfo->is_g4x) {
   182099          return 96;
   182100       } else {
   182101          return 96;
   182102       }
   182103    default:
   182104       unreachable("Invalid hardware generation");
   182105    }
   182106 }
   182107 
   182108 
   182109 
   182110 /* RENDER_SURFACE_STATE::Tiled Resource Mode */
   182111 
   182112 
   182113 #define GEN10_RENDER_SURFACE_STATE_TiledResourceMode_bits  2
   182114 #define GEN9_RENDER_SURFACE_STATE_TiledResourceMode_bits  2
   182115 
   182116 static inline uint32_t ATTRIBUTE_PURE
   182117 RENDER_SURFACE_STATE_TiledResourceMode_bits(const struct gen_device_info *devinfo)
   182118 {
   182119    switch (devinfo->gen) {
   182120    case 10: return 2;
   182121    case 9: return 2;
   182122    case 8: return 0;
   182123    case 7:
   182124       if (devinfo->is_haswell) {
   182125          return 0;
   182126       } else {
   182127          return 0;
   182128       }
   182129    case 6: return 0;
   182130    case 5: return 0;
   182131    case 4:
   182132       if (devinfo->is_g4x) {
   182133          return 0;
   182134       } else {
   182135          return 0;
   182136       }
   182137    default:
   182138       unreachable("Invalid hardware generation");
   182139    }
   182140 }
   182141 
   182142 
   182143 
   182144 #define GEN10_RENDER_SURFACE_STATE_TiledResourceMode_start  178
   182145 #define GEN9_RENDER_SURFACE_STATE_TiledResourceMode_start  178
   182146 
   182147 static inline uint32_t ATTRIBUTE_PURE
   182148 RENDER_SURFACE_STATE_TiledResourceMode_start(const struct gen_device_info *devinfo)
   182149 {
   182150    switch (devinfo->gen) {
   182151    case 10: return 178;
   182152    case 9: return 178;
   182153    case 8: return 0;
   182154    case 7:
   182155       if (devinfo->is_haswell) {
   182156          return 0;
   182157       } else {
   182158          return 0;
   182159       }
   182160    case 6: return 0;
   182161    case 5: return 0;
   182162    case 4:
   182163       if (devinfo->is_g4x) {
   182164          return 0;
   182165       } else {
   182166          return 0;
   182167       }
   182168    default:
   182169       unreachable("Invalid hardware generation");
   182170    }
   182171 }
   182172 
   182173 
   182174 
   182175 /* RENDER_SURFACE_STATE::Tiled Surface */
   182176 
   182177 
   182178 #define GEN75_RENDER_SURFACE_STATE_TiledSurface_bits  1
   182179 #define GEN7_RENDER_SURFACE_STATE_TiledSurface_bits  1
   182180 #define GEN6_RENDER_SURFACE_STATE_TiledSurface_bits  1
   182181 #define GEN5_RENDER_SURFACE_STATE_TiledSurface_bits  1
   182182 #define GEN45_RENDER_SURFACE_STATE_TiledSurface_bits  1
   182183 #define GEN4_RENDER_SURFACE_STATE_TiledSurface_bits  1
   182184 
   182185 static inline uint32_t ATTRIBUTE_PURE
   182186 RENDER_SURFACE_STATE_TiledSurface_bits(const struct gen_device_info *devinfo)
   182187 {
   182188    switch (devinfo->gen) {
   182189    case 10: return 0;
   182190    case 9: return 0;
   182191    case 8: return 0;
   182192    case 7:
   182193       if (devinfo->is_haswell) {
   182194          return 1;
   182195       } else {
   182196          return 1;
   182197       }
   182198    case 6: return 1;
   182199    case 5: return 1;
   182200    case 4:
   182201       if (devinfo->is_g4x) {
   182202          return 1;
   182203       } else {
   182204          return 1;
   182205       }
   182206    default:
   182207       unreachable("Invalid hardware generation");
   182208    }
   182209 }
   182210 
   182211 
   182212 
   182213 #define GEN75_RENDER_SURFACE_STATE_TiledSurface_start  14
   182214 #define GEN7_RENDER_SURFACE_STATE_TiledSurface_start  14
   182215 #define GEN6_RENDER_SURFACE_STATE_TiledSurface_start  97
   182216 #define GEN5_RENDER_SURFACE_STATE_TiledSurface_start  97
   182217 #define GEN45_RENDER_SURFACE_STATE_TiledSurface_start  97
   182218 #define GEN4_RENDER_SURFACE_STATE_TiledSurface_start  97
   182219 
   182220 static inline uint32_t ATTRIBUTE_PURE
   182221 RENDER_SURFACE_STATE_TiledSurface_start(const struct gen_device_info *devinfo)
   182222 {
   182223    switch (devinfo->gen) {
   182224    case 10: return 0;
   182225    case 9: return 0;
   182226    case 8: return 0;
   182227    case 7:
   182228       if (devinfo->is_haswell) {
   182229          return 14;
   182230       } else {
   182231          return 14;
   182232       }
   182233    case 6: return 97;
   182234    case 5: return 97;
   182235    case 4:
   182236       if (devinfo->is_g4x) {
   182237          return 97;
   182238       } else {
   182239          return 97;
   182240       }
   182241    default:
   182242       unreachable("Invalid hardware generation");
   182243    }
   182244 }
   182245 
   182246 
   182247 
   182248 /* RENDER_SURFACE_STATE::Vertical Line Stride */
   182249 
   182250 
   182251 #define GEN10_RENDER_SURFACE_STATE_VerticalLineStride_bits  1
   182252 #define GEN9_RENDER_SURFACE_STATE_VerticalLineStride_bits  1
   182253 #define GEN8_RENDER_SURFACE_STATE_VerticalLineStride_bits  1
   182254 #define GEN75_RENDER_SURFACE_STATE_VerticalLineStride_bits  1
   182255 #define GEN7_RENDER_SURFACE_STATE_VerticalLineStride_bits  1
   182256 #define GEN6_RENDER_SURFACE_STATE_VerticalLineStride_bits  1
   182257 #define GEN5_RENDER_SURFACE_STATE_VerticalLineStride_bits  1
   182258 #define GEN45_RENDER_SURFACE_STATE_VerticalLineStride_bits  1
   182259 #define GEN4_RENDER_SURFACE_STATE_VerticalLineStride_bits  1
   182260 
   182261 static inline uint32_t ATTRIBUTE_PURE
   182262 RENDER_SURFACE_STATE_VerticalLineStride_bits(const struct gen_device_info *devinfo)
   182263 {
   182264    switch (devinfo->gen) {
   182265    case 10: return 1;
   182266    case 9: return 1;
   182267    case 8: return 1;
   182268    case 7:
   182269       if (devinfo->is_haswell) {
   182270          return 1;
   182271       } else {
   182272          return 1;
   182273       }
   182274    case 6: return 1;
   182275    case 5: return 1;
   182276    case 4:
   182277       if (devinfo->is_g4x) {
   182278          return 1;
   182279       } else {
   182280          return 1;
   182281       }
   182282    default:
   182283       unreachable("Invalid hardware generation");
   182284    }
   182285 }
   182286 
   182287 
   182288 
   182289 #define GEN10_RENDER_SURFACE_STATE_VerticalLineStride_start  11
   182290 #define GEN9_RENDER_SURFACE_STATE_VerticalLineStride_start  11
   182291 #define GEN8_RENDER_SURFACE_STATE_VerticalLineStride_start  11
   182292 #define GEN75_RENDER_SURFACE_STATE_VerticalLineStride_start  12
   182293 #define GEN7_RENDER_SURFACE_STATE_VerticalLineStride_start  12
   182294 #define GEN6_RENDER_SURFACE_STATE_VerticalLineStride_start  12
   182295 #define GEN5_RENDER_SURFACE_STATE_VerticalLineStride_start  12
   182296 #define GEN45_RENDER_SURFACE_STATE_VerticalLineStride_start  12
   182297 #define GEN4_RENDER_SURFACE_STATE_VerticalLineStride_start  12
   182298 
   182299 static inline uint32_t ATTRIBUTE_PURE
   182300 RENDER_SURFACE_STATE_VerticalLineStride_start(const struct gen_device_info *devinfo)
   182301 {
   182302    switch (devinfo->gen) {
   182303    case 10: return 11;
   182304    case 9: return 11;
   182305    case 8: return 11;
   182306    case 7:
   182307       if (devinfo->is_haswell) {
   182308          return 12;
   182309       } else {
   182310          return 12;
   182311       }
   182312    case 6: return 12;
   182313    case 5: return 12;
   182314    case 4:
   182315       if (devinfo->is_g4x) {
   182316          return 12;
   182317       } else {
   182318          return 12;
   182319       }
   182320    default:
   182321       unreachable("Invalid hardware generation");
   182322    }
   182323 }
   182324 
   182325 
   182326 
   182327 /* RENDER_SURFACE_STATE::Vertical Line Stride Offset */
   182328 
   182329 
   182330 #define GEN10_RENDER_SURFACE_STATE_VerticalLineStrideOffset_bits  1
   182331 #define GEN9_RENDER_SURFACE_STATE_VerticalLineStrideOffset_bits  1
   182332 #define GEN8_RENDER_SURFACE_STATE_VerticalLineStrideOffset_bits  1
   182333 #define GEN75_RENDER_SURFACE_STATE_VerticalLineStrideOffset_bits  1
   182334 #define GEN7_RENDER_SURFACE_STATE_VerticalLineStrideOffset_bits  1
   182335 #define GEN6_RENDER_SURFACE_STATE_VerticalLineStrideOffset_bits  1
   182336 #define GEN5_RENDER_SURFACE_STATE_VerticalLineStrideOffset_bits  1
   182337 #define GEN45_RENDER_SURFACE_STATE_VerticalLineStrideOffset_bits  1
   182338 #define GEN4_RENDER_SURFACE_STATE_VerticalLineStrideOffset_bits  1
   182339 
   182340 static inline uint32_t ATTRIBUTE_PURE
   182341 RENDER_SURFACE_STATE_VerticalLineStrideOffset_bits(const struct gen_device_info *devinfo)
   182342 {
   182343    switch (devinfo->gen) {
   182344    case 10: return 1;
   182345    case 9: return 1;
   182346    case 8: return 1;
   182347    case 7:
   182348       if (devinfo->is_haswell) {
   182349          return 1;
   182350       } else {
   182351          return 1;
   182352       }
   182353    case 6: return 1;
   182354    case 5: return 1;
   182355    case 4:
   182356       if (devinfo->is_g4x) {
   182357          return 1;
   182358       } else {
   182359          return 1;
   182360       }
   182361    default:
   182362       unreachable("Invalid hardware generation");
   182363    }
   182364 }
   182365 
   182366 
   182367 
   182368 #define GEN10_RENDER_SURFACE_STATE_VerticalLineStrideOffset_start  10
   182369 #define GEN9_RENDER_SURFACE_STATE_VerticalLineStrideOffset_start  10
   182370 #define GEN8_RENDER_SURFACE_STATE_VerticalLineStrideOffset_start  10
   182371 #define GEN75_RENDER_SURFACE_STATE_VerticalLineStrideOffset_start  11
   182372 #define GEN7_RENDER_SURFACE_STATE_VerticalLineStrideOffset_start  11
   182373 #define GEN6_RENDER_SURFACE_STATE_VerticalLineStrideOffset_start  11
   182374 #define GEN5_RENDER_SURFACE_STATE_VerticalLineStrideOffset_start  11
   182375 #define GEN45_RENDER_SURFACE_STATE_VerticalLineStrideOffset_start  11
   182376 #define GEN4_RENDER_SURFACE_STATE_VerticalLineStrideOffset_start  11
   182377 
   182378 static inline uint32_t ATTRIBUTE_PURE
   182379 RENDER_SURFACE_STATE_VerticalLineStrideOffset_start(const struct gen_device_info *devinfo)
   182380 {
   182381    switch (devinfo->gen) {
   182382    case 10: return 10;
   182383    case 9: return 10;
   182384    case 8: return 10;
   182385    case 7:
   182386       if (devinfo->is_haswell) {
   182387          return 11;
   182388       } else {
   182389          return 11;
   182390       }
   182391    case 6: return 11;
   182392    case 5: return 11;
   182393    case 4:
   182394       if (devinfo->is_g4x) {
   182395          return 11;
   182396       } else {
   182397          return 11;
   182398       }
   182399    default:
   182400       unreachable("Invalid hardware generation");
   182401    }
   182402 }
   182403 
   182404 
   182405 
   182406 /* RENDER_SURFACE_STATE::Width */
   182407 
   182408 
   182409 #define GEN10_RENDER_SURFACE_STATE_Width_bits  14
   182410 #define GEN9_RENDER_SURFACE_STATE_Width_bits  14
   182411 #define GEN8_RENDER_SURFACE_STATE_Width_bits  14
   182412 #define GEN75_RENDER_SURFACE_STATE_Width_bits  14
   182413 #define GEN7_RENDER_SURFACE_STATE_Width_bits  14
   182414 #define GEN6_RENDER_SURFACE_STATE_Width_bits  13
   182415 #define GEN5_RENDER_SURFACE_STATE_Width_bits  13
   182416 #define GEN45_RENDER_SURFACE_STATE_Width_bits  13
   182417 #define GEN4_RENDER_SURFACE_STATE_Width_bits  13
   182418 
   182419 static inline uint32_t ATTRIBUTE_PURE
   182420 RENDER_SURFACE_STATE_Width_bits(const struct gen_device_info *devinfo)
   182421 {
   182422    switch (devinfo->gen) {
   182423    case 10: return 14;
   182424    case 9: return 14;
   182425    case 8: return 14;
   182426    case 7:
   182427       if (devinfo->is_haswell) {
   182428          return 14;
   182429       } else {
   182430          return 14;
   182431       }
   182432    case 6: return 13;
   182433    case 5: return 13;
   182434    case 4:
   182435       if (devinfo->is_g4x) {
   182436          return 13;
   182437       } else {
   182438          return 13;
   182439       }
   182440    default:
   182441       unreachable("Invalid hardware generation");
   182442    }
   182443 }
   182444 
   182445 
   182446 
   182447 #define GEN10_RENDER_SURFACE_STATE_Width_start  64
   182448 #define GEN9_RENDER_SURFACE_STATE_Width_start  64
   182449 #define GEN8_RENDER_SURFACE_STATE_Width_start  64
   182450 #define GEN75_RENDER_SURFACE_STATE_Width_start  64
   182451 #define GEN7_RENDER_SURFACE_STATE_Width_start  64
   182452 #define GEN6_RENDER_SURFACE_STATE_Width_start  70
   182453 #define GEN5_RENDER_SURFACE_STATE_Width_start  70
   182454 #define GEN45_RENDER_SURFACE_STATE_Width_start  70
   182455 #define GEN4_RENDER_SURFACE_STATE_Width_start  70
   182456 
   182457 static inline uint32_t ATTRIBUTE_PURE
   182458 RENDER_SURFACE_STATE_Width_start(const struct gen_device_info *devinfo)
   182459 {
   182460    switch (devinfo->gen) {
   182461    case 10: return 64;
   182462    case 9: return 64;
   182463    case 8: return 64;
   182464    case 7:
   182465       if (devinfo->is_haswell) {
   182466          return 64;
   182467       } else {
   182468          return 64;
   182469       }
   182470    case 6: return 70;
   182471    case 5: return 70;
   182472    case 4:
   182473       if (devinfo->is_g4x) {
   182474          return 70;
   182475       } else {
   182476          return 70;
   182477       }
   182478    default:
   182479       unreachable("Invalid hardware generation");
   182480    }
   182481 }
   182482 
   182483 
   182484 
   182485 /* RENDER_SURFACE_STATE::X Offset */
   182486 
   182487 
   182488 #define GEN10_RENDER_SURFACE_STATE_XOffset_bits  7
   182489 #define GEN9_RENDER_SURFACE_STATE_XOffset_bits  7
   182490 #define GEN8_RENDER_SURFACE_STATE_XOffset_bits  7
   182491 #define GEN75_RENDER_SURFACE_STATE_XOffset_bits  7
   182492 #define GEN7_RENDER_SURFACE_STATE_XOffset_bits  7
   182493 #define GEN6_RENDER_SURFACE_STATE_XOffset_bits  7
   182494 #define GEN5_RENDER_SURFACE_STATE_XOffset_bits  7
   182495 #define GEN45_RENDER_SURFACE_STATE_XOffset_bits  7
   182496 
   182497 static inline uint32_t ATTRIBUTE_PURE
   182498 RENDER_SURFACE_STATE_XOffset_bits(const struct gen_device_info *devinfo)
   182499 {
   182500    switch (devinfo->gen) {
   182501    case 10: return 7;
   182502    case 9: return 7;
   182503    case 8: return 7;
   182504    case 7:
   182505       if (devinfo->is_haswell) {
   182506          return 7;
   182507       } else {
   182508          return 7;
   182509       }
   182510    case 6: return 7;
   182511    case 5: return 7;
   182512    case 4:
   182513       if (devinfo->is_g4x) {
   182514          return 7;
   182515       } else {
   182516          return 0;
   182517       }
   182518    default:
   182519       unreachable("Invalid hardware generation");
   182520    }
   182521 }
   182522 
   182523 
   182524 
   182525 #define GEN10_RENDER_SURFACE_STATE_XOffset_start  185
   182526 #define GEN9_RENDER_SURFACE_STATE_XOffset_start  185
   182527 #define GEN8_RENDER_SURFACE_STATE_XOffset_start  185
   182528 #define GEN75_RENDER_SURFACE_STATE_XOffset_start  185
   182529 #define GEN7_RENDER_SURFACE_STATE_XOffset_start  185
   182530 #define GEN6_RENDER_SURFACE_STATE_XOffset_start  185
   182531 #define GEN5_RENDER_SURFACE_STATE_XOffset_start  185
   182532 #define GEN45_RENDER_SURFACE_STATE_XOffset_start  185
   182533 
   182534 static inline uint32_t ATTRIBUTE_PURE
   182535 RENDER_SURFACE_STATE_XOffset_start(const struct gen_device_info *devinfo)
   182536 {
   182537    switch (devinfo->gen) {
   182538    case 10: return 185;
   182539    case 9: return 185;
   182540    case 8: return 185;
   182541    case 7:
   182542       if (devinfo->is_haswell) {
   182543          return 185;
   182544       } else {
   182545          return 185;
   182546       }
   182547    case 6: return 185;
   182548    case 5: return 185;
   182549    case 4:
   182550       if (devinfo->is_g4x) {
   182551          return 185;
   182552       } else {
   182553          return 0;
   182554       }
   182555    default:
   182556       unreachable("Invalid hardware generation");
   182557    }
   182558 }
   182559 
   182560 
   182561 
   182562 /* RENDER_SURFACE_STATE::X Offset for U or UV Plane */
   182563 
   182564 
   182565 #define GEN10_RENDER_SURFACE_STATE_XOffsetforUorUVPlane_bits  14
   182566 #define GEN9_RENDER_SURFACE_STATE_XOffsetforUorUVPlane_bits  14
   182567 #define GEN8_RENDER_SURFACE_STATE_XOffsetforUorUVPlane_bits  14
   182568 
   182569 static inline uint32_t ATTRIBUTE_PURE
   182570 RENDER_SURFACE_STATE_XOffsetforUorUVPlane_bits(const struct gen_device_info *devinfo)
   182571 {
   182572    switch (devinfo->gen) {
   182573    case 10: return 14;
   182574    case 9: return 14;
   182575    case 8: return 14;
   182576    case 7:
   182577       if (devinfo->is_haswell) {
   182578          return 0;
   182579       } else {
   182580          return 0;
   182581       }
   182582    case 6: return 0;
   182583    case 5: return 0;
   182584    case 4:
   182585       if (devinfo->is_g4x) {
   182586          return 0;
   182587       } else {
   182588          return 0;
   182589       }
   182590    default:
   182591       unreachable("Invalid hardware generation");
   182592    }
   182593 }
   182594 
   182595 
   182596 
   182597 #define GEN10_RENDER_SURFACE_STATE_XOffsetforUorUVPlane_start  208
   182598 #define GEN9_RENDER_SURFACE_STATE_XOffsetforUorUVPlane_start  208
   182599 #define GEN8_RENDER_SURFACE_STATE_XOffsetforUorUVPlane_start  208
   182600 
   182601 static inline uint32_t ATTRIBUTE_PURE
   182602 RENDER_SURFACE_STATE_XOffsetforUorUVPlane_start(const struct gen_device_info *devinfo)
   182603 {
   182604    switch (devinfo->gen) {
   182605    case 10: return 208;
   182606    case 9: return 208;
   182607    case 8: return 208;
   182608    case 7:
   182609       if (devinfo->is_haswell) {
   182610          return 0;
   182611       } else {
   182612          return 0;
   182613       }
   182614    case 6: return 0;
   182615    case 5: return 0;
   182616    case 4:
   182617       if (devinfo->is_g4x) {
   182618          return 0;
   182619       } else {
   182620          return 0;
   182621       }
   182622    default:
   182623       unreachable("Invalid hardware generation");
   182624    }
   182625 }
   182626 
   182627 
   182628 
   182629 /* RENDER_SURFACE_STATE::X Offset for UV Plane */
   182630 
   182631 
   182632 #define GEN75_RENDER_SURFACE_STATE_XOffsetforUVPlane_bits  14
   182633 #define GEN7_RENDER_SURFACE_STATE_XOffsetforUVPlane_bits  14
   182634 
   182635 static inline uint32_t ATTRIBUTE_PURE
   182636 RENDER_SURFACE_STATE_XOffsetforUVPlane_bits(const struct gen_device_info *devinfo)
   182637 {
   182638    switch (devinfo->gen) {
   182639    case 10: return 0;
   182640    case 9: return 0;
   182641    case 8: return 0;
   182642    case 7:
   182643       if (devinfo->is_haswell) {
   182644          return 14;
   182645       } else {
   182646          return 14;
   182647       }
   182648    case 6: return 0;
   182649    case 5: return 0;
   182650    case 4:
   182651       if (devinfo->is_g4x) {
   182652          return 0;
   182653       } else {
   182654          return 0;
   182655       }
   182656    default:
   182657       unreachable("Invalid hardware generation");
   182658    }
   182659 }
   182660 
   182661 
   182662 
   182663 #define GEN75_RENDER_SURFACE_STATE_XOffsetforUVPlane_start  208
   182664 #define GEN7_RENDER_SURFACE_STATE_XOffsetforUVPlane_start  208
   182665 
   182666 static inline uint32_t ATTRIBUTE_PURE
   182667 RENDER_SURFACE_STATE_XOffsetforUVPlane_start(const struct gen_device_info *devinfo)
   182668 {
   182669    switch (devinfo->gen) {
   182670    case 10: return 0;
   182671    case 9: return 0;
   182672    case 8: return 0;
   182673    case 7:
   182674       if (devinfo->is_haswell) {
   182675          return 208;
   182676       } else {
   182677          return 208;
   182678       }
   182679    case 6: return 0;
   182680    case 5: return 0;
   182681    case 4:
   182682       if (devinfo->is_g4x) {
   182683          return 0;
   182684       } else {
   182685          return 0;
   182686       }
   182687    default:
   182688       unreachable("Invalid hardware generation");
   182689    }
   182690 }
   182691 
   182692 
   182693 
   182694 /* RENDER_SURFACE_STATE::X Offset for V Plane */
   182695 
   182696 
   182697 #define GEN10_RENDER_SURFACE_STATE_XOffsetforVPlane_bits  14
   182698 #define GEN9_RENDER_SURFACE_STATE_XOffsetforVPlane_bits  14
   182699 #define GEN8_RENDER_SURFACE_STATE_XOffsetforVPlane_bits  14
   182700 
   182701 static inline uint32_t ATTRIBUTE_PURE
   182702 RENDER_SURFACE_STATE_XOffsetforVPlane_bits(const struct gen_device_info *devinfo)
   182703 {
   182704    switch (devinfo->gen) {
   182705    case 10: return 14;
   182706    case 9: return 14;
   182707    case 8: return 14;
   182708    case 7:
   182709       if (devinfo->is_haswell) {
   182710          return 0;
   182711       } else {
   182712          return 0;
   182713       }
   182714    case 6: return 0;
   182715    case 5: return 0;
   182716    case 4:
   182717       if (devinfo->is_g4x) {
   182718          return 0;
   182719       } else {
   182720          return 0;
   182721       }
   182722    default:
   182723       unreachable("Invalid hardware generation");
   182724    }
   182725 }
   182726 
   182727 
   182728 
   182729 #define GEN10_RENDER_SURFACE_STATE_XOffsetforVPlane_start  368
   182730 #define GEN9_RENDER_SURFACE_STATE_XOffsetforVPlane_start  368
   182731 #define GEN8_RENDER_SURFACE_STATE_XOffsetforVPlane_start  368
   182732 
   182733 static inline uint32_t ATTRIBUTE_PURE
   182734 RENDER_SURFACE_STATE_XOffsetforVPlane_start(const struct gen_device_info *devinfo)
   182735 {
   182736    switch (devinfo->gen) {
   182737    case 10: return 368;
   182738    case 9: return 368;
   182739    case 8: return 368;
   182740    case 7:
   182741       if (devinfo->is_haswell) {
   182742          return 0;
   182743       } else {
   182744          return 0;
   182745       }
   182746    case 6: return 0;
   182747    case 5: return 0;
   182748    case 4:
   182749       if (devinfo->is_g4x) {
   182750          return 0;
   182751       } else {
   182752          return 0;
   182753       }
   182754    default:
   182755       unreachable("Invalid hardware generation");
   182756    }
   182757 }
   182758 
   182759 
   182760 
   182761 /* RENDER_SURFACE_STATE::Y Offset */
   182762 
   182763 
   182764 #define GEN10_RENDER_SURFACE_STATE_YOffset_bits  3
   182765 #define GEN9_RENDER_SURFACE_STATE_YOffset_bits  3
   182766 #define GEN8_RENDER_SURFACE_STATE_YOffset_bits  3
   182767 #define GEN75_RENDER_SURFACE_STATE_YOffset_bits  4
   182768 #define GEN7_RENDER_SURFACE_STATE_YOffset_bits  4
   182769 #define GEN6_RENDER_SURFACE_STATE_YOffset_bits  4
   182770 #define GEN5_RENDER_SURFACE_STATE_YOffset_bits  4
   182771 #define GEN45_RENDER_SURFACE_STATE_YOffset_bits  4
   182772 
   182773 static inline uint32_t ATTRIBUTE_PURE
   182774 RENDER_SURFACE_STATE_YOffset_bits(const struct gen_device_info *devinfo)
   182775 {
   182776    switch (devinfo->gen) {
   182777    case 10: return 3;
   182778    case 9: return 3;
   182779    case 8: return 3;
   182780    case 7:
   182781       if (devinfo->is_haswell) {
   182782          return 4;
   182783       } else {
   182784          return 4;
   182785       }
   182786    case 6: return 4;
   182787    case 5: return 4;
   182788    case 4:
   182789       if (devinfo->is_g4x) {
   182790          return 4;
   182791       } else {
   182792          return 0;
   182793       }
   182794    default:
   182795       unreachable("Invalid hardware generation");
   182796    }
   182797 }
   182798 
   182799 
   182800 
   182801 #define GEN10_RENDER_SURFACE_STATE_YOffset_start  181
   182802 #define GEN9_RENDER_SURFACE_STATE_YOffset_start  181
   182803 #define GEN8_RENDER_SURFACE_STATE_YOffset_start  181
   182804 #define GEN75_RENDER_SURFACE_STATE_YOffset_start  180
   182805 #define GEN7_RENDER_SURFACE_STATE_YOffset_start  180
   182806 #define GEN6_RENDER_SURFACE_STATE_YOffset_start  180
   182807 #define GEN5_RENDER_SURFACE_STATE_YOffset_start  180
   182808 #define GEN45_RENDER_SURFACE_STATE_YOffset_start  180
   182809 
   182810 static inline uint32_t ATTRIBUTE_PURE
   182811 RENDER_SURFACE_STATE_YOffset_start(const struct gen_device_info *devinfo)
   182812 {
   182813    switch (devinfo->gen) {
   182814    case 10: return 181;
   182815    case 9: return 181;
   182816    case 8: return 181;
   182817    case 7:
   182818       if (devinfo->is_haswell) {
   182819          return 180;
   182820       } else {
   182821          return 180;
   182822       }
   182823    case 6: return 180;
   182824    case 5: return 180;
   182825    case 4:
   182826       if (devinfo->is_g4x) {
   182827          return 180;
   182828       } else {
   182829          return 0;
   182830       }
   182831    default:
   182832       unreachable("Invalid hardware generation");
   182833    }
   182834 }
   182835 
   182836 
   182837 
   182838 /* RENDER_SURFACE_STATE::Y Offset for U or UV Plane */
   182839 
   182840 
   182841 #define GEN10_RENDER_SURFACE_STATE_YOffsetforUorUVPlane_bits  14
   182842 #define GEN9_RENDER_SURFACE_STATE_YOffsetforUorUVPlane_bits  14
   182843 #define GEN8_RENDER_SURFACE_STATE_YOffsetforUorUVPlane_bits  14
   182844 
   182845 static inline uint32_t ATTRIBUTE_PURE
   182846 RENDER_SURFACE_STATE_YOffsetforUorUVPlane_bits(const struct gen_device_info *devinfo)
   182847 {
   182848    switch (devinfo->gen) {
   182849    case 10: return 14;
   182850    case 9: return 14;
   182851    case 8: return 14;
   182852    case 7:
   182853       if (devinfo->is_haswell) {
   182854          return 0;
   182855       } else {
   182856          return 0;
   182857       }
   182858    case 6: return 0;
   182859    case 5: return 0;
   182860    case 4:
   182861       if (devinfo->is_g4x) {
   182862          return 0;
   182863       } else {
   182864          return 0;
   182865       }
   182866    default:
   182867       unreachable("Invalid hardware generation");
   182868    }
   182869 }
   182870 
   182871 
   182872 
   182873 #define GEN10_RENDER_SURFACE_STATE_YOffsetforUorUVPlane_start  192
   182874 #define GEN9_RENDER_SURFACE_STATE_YOffsetforUorUVPlane_start  192
   182875 #define GEN8_RENDER_SURFACE_STATE_YOffsetforUorUVPlane_start  192
   182876 
   182877 static inline uint32_t ATTRIBUTE_PURE
   182878 RENDER_SURFACE_STATE_YOffsetforUorUVPlane_start(const struct gen_device_info *devinfo)
   182879 {
   182880    switch (devinfo->gen) {
   182881    case 10: return 192;
   182882    case 9: return 192;
   182883    case 8: return 192;
   182884    case 7:
   182885       if (devinfo->is_haswell) {
   182886          return 0;
   182887       } else {
   182888          return 0;
   182889       }
   182890    case 6: return 0;
   182891    case 5: return 0;
   182892    case 4:
   182893       if (devinfo->is_g4x) {
   182894          return 0;
   182895       } else {
   182896          return 0;
   182897       }
   182898    default:
   182899       unreachable("Invalid hardware generation");
   182900    }
   182901 }
   182902 
   182903 
   182904 
   182905 /* RENDER_SURFACE_STATE::Y Offset for UV Plane */
   182906 
   182907 
   182908 #define GEN75_RENDER_SURFACE_STATE_YOffsetforUVPlane_bits  14
   182909 #define GEN7_RENDER_SURFACE_STATE_YOffsetforUVPlane_bits  14
   182910 
   182911 static inline uint32_t ATTRIBUTE_PURE
   182912 RENDER_SURFACE_STATE_YOffsetforUVPlane_bits(const struct gen_device_info *devinfo)
   182913 {
   182914    switch (devinfo->gen) {
   182915    case 10: return 0;
   182916    case 9: return 0;
   182917    case 8: return 0;
   182918    case 7:
   182919       if (devinfo->is_haswell) {
   182920          return 14;
   182921       } else {
   182922          return 14;
   182923       }
   182924    case 6: return 0;
   182925    case 5: return 0;
   182926    case 4:
   182927       if (devinfo->is_g4x) {
   182928          return 0;
   182929       } else {
   182930          return 0;
   182931       }
   182932    default:
   182933       unreachable("Invalid hardware generation");
   182934    }
   182935 }
   182936 
   182937 
   182938 
   182939 #define GEN75_RENDER_SURFACE_STATE_YOffsetforUVPlane_start  192
   182940 #define GEN7_RENDER_SURFACE_STATE_YOffsetforUVPlane_start  192
   182941 
   182942 static inline uint32_t ATTRIBUTE_PURE
   182943 RENDER_SURFACE_STATE_YOffsetforUVPlane_start(const struct gen_device_info *devinfo)
   182944 {
   182945    switch (devinfo->gen) {
   182946    case 10: return 0;
   182947    case 9: return 0;
   182948    case 8: return 0;
   182949    case 7:
   182950       if (devinfo->is_haswell) {
   182951          return 192;
   182952       } else {
   182953          return 192;
   182954       }
   182955    case 6: return 0;
   182956    case 5: return 0;
   182957    case 4:
   182958       if (devinfo->is_g4x) {
   182959          return 0;
   182960       } else {
   182961          return 0;
   182962       }
   182963    default:
   182964       unreachable("Invalid hardware generation");
   182965    }
   182966 }
   182967 
   182968 
   182969 
   182970 /* RENDER_SURFACE_STATE::Y Offset for V Plane */
   182971 
   182972 
   182973 #define GEN10_RENDER_SURFACE_STATE_YOffsetforVPlane_bits  14
   182974 #define GEN9_RENDER_SURFACE_STATE_YOffsetforVPlane_bits  14
   182975 #define GEN8_RENDER_SURFACE_STATE_YOffsetforVPlane_bits  14
   182976 
   182977 static inline uint32_t ATTRIBUTE_PURE
   182978 RENDER_SURFACE_STATE_YOffsetforVPlane_bits(const struct gen_device_info *devinfo)
   182979 {
   182980    switch (devinfo->gen) {
   182981    case 10: return 14;
   182982    case 9: return 14;
   182983    case 8: return 14;
   182984    case 7:
   182985       if (devinfo->is_haswell) {
   182986          return 0;
   182987       } else {
   182988          return 0;
   182989       }
   182990    case 6: return 0;
   182991    case 5: return 0;
   182992    case 4:
   182993       if (devinfo->is_g4x) {
   182994          return 0;
   182995       } else {
   182996          return 0;
   182997       }
   182998    default:
   182999       unreachable("Invalid hardware generation");
   183000    }
   183001 }
   183002 
   183003 
   183004 
   183005 #define GEN10_RENDER_SURFACE_STATE_YOffsetforVPlane_start  352
   183006 #define GEN9_RENDER_SURFACE_STATE_YOffsetforVPlane_start  352
   183007 #define GEN8_RENDER_SURFACE_STATE_YOffsetforVPlane_start  352
   183008 
   183009 static inline uint32_t ATTRIBUTE_PURE
   183010 RENDER_SURFACE_STATE_YOffsetforVPlane_start(const struct gen_device_info *devinfo)
   183011 {
   183012    switch (devinfo->gen) {
   183013    case 10: return 352;
   183014    case 9: return 352;
   183015    case 8: return 352;
   183016    case 7:
   183017       if (devinfo->is_haswell) {
   183018          return 0;
   183019       } else {
   183020          return 0;
   183021       }
   183022    case 6: return 0;
   183023    case 5: return 0;
   183024    case 4:
   183025       if (devinfo->is_g4x) {
   183026          return 0;
   183027       } else {
   183028          return 0;
   183029       }
   183030    default:
   183031       unreachable("Invalid hardware generation");
   183032    }
   183033 }
   183034 
   183035 
   183036 
   183037 /* ROUNDINGPRECISIONTABLE_3_BITS */
   183038 
   183039 
   183040 #define GEN10_ROUNDINGPRECISIONTABLE_3_BITS_length  1
   183041 #define GEN9_ROUNDINGPRECISIONTABLE_3_BITS_length  1
   183042 
   183043 static inline uint32_t ATTRIBUTE_PURE
   183044 ROUNDINGPRECISIONTABLE_3_BITS_length(const struct gen_device_info *devinfo)
   183045 {
   183046    switch (devinfo->gen) {
   183047    case 10: return 1;
   183048    case 9: return 1;
   183049    case 8: return 0;
   183050    case 7:
   183051       if (devinfo->is_haswell) {
   183052          return 0;
   183053       } else {
   183054          return 0;
   183055       }
   183056    case 6: return 0;
   183057    case 5: return 0;
   183058    case 4:
   183059       if (devinfo->is_g4x) {
   183060          return 0;
   183061       } else {
   183062          return 0;
   183063       }
   183064    default:
   183065       unreachable("Invalid hardware generation");
   183066    }
   183067 }
   183068 
   183069 
   183070 
   183071 /* ROUNDINGPRECISIONTABLE_3_BITS::Rounding Precision */
   183072 
   183073 
   183074 #define GEN10_ROUNDINGPRECISIONTABLE_3_BITS_RoundingPrecision_bits  3
   183075 #define GEN9_ROUNDINGPRECISIONTABLE_3_BITS_RoundingPrecision_bits  3
   183076 
   183077 static inline uint32_t ATTRIBUTE_PURE
   183078 ROUNDINGPRECISIONTABLE_3_BITS_RoundingPrecision_bits(const struct gen_device_info *devinfo)
   183079 {
   183080    switch (devinfo->gen) {
   183081    case 10: return 3;
   183082    case 9: return 3;
   183083    case 8: return 0;
   183084    case 7:
   183085       if (devinfo->is_haswell) {
   183086          return 0;
   183087       } else {
   183088          return 0;
   183089       }
   183090    case 6: return 0;
   183091    case 5: return 0;
   183092    case 4:
   183093       if (devinfo->is_g4x) {
   183094          return 0;
   183095       } else {
   183096          return 0;
   183097       }
   183098    default:
   183099       unreachable("Invalid hardware generation");
   183100    }
   183101 }
   183102 
   183103 
   183104 
   183105 #define GEN10_ROUNDINGPRECISIONTABLE_3_BITS_RoundingPrecision_start  0
   183106 #define GEN9_ROUNDINGPRECISIONTABLE_3_BITS_RoundingPrecision_start  0
   183107 
   183108 static inline uint32_t ATTRIBUTE_PURE
   183109 ROUNDINGPRECISIONTABLE_3_BITS_RoundingPrecision_start(const struct gen_device_info *devinfo)
   183110 {
   183111    switch (devinfo->gen) {
   183112    case 10: return 0;
   183113    case 9: return 0;
   183114    case 8: return 0;
   183115    case 7:
   183116       if (devinfo->is_haswell) {
   183117          return 0;
   183118       } else {
   183119          return 0;
   183120       }
   183121    case 6: return 0;
   183122    case 5: return 0;
   183123    case 4:
   183124       if (devinfo->is_g4x) {
   183125          return 0;
   183126       } else {
   183127          return 0;
   183128       }
   183129    default:
   183130       unreachable("Invalid hardware generation");
   183131    }
   183132 }
   183133 
   183134 
   183135 
   183136 /* SAMPLER_BORDER_COLOR_STATE */
   183137 
   183138 
   183139 #define GEN10_SAMPLER_BORDER_COLOR_STATE_length  4
   183140 #define GEN9_SAMPLER_BORDER_COLOR_STATE_length  4
   183141 #define GEN8_SAMPLER_BORDER_COLOR_STATE_length  4
   183142 #define GEN75_SAMPLER_BORDER_COLOR_STATE_length  20
   183143 #define GEN7_SAMPLER_BORDER_COLOR_STATE_length  4
   183144 #define GEN6_SAMPLER_BORDER_COLOR_STATE_length  12
   183145 #define GEN5_SAMPLER_BORDER_COLOR_STATE_length  12
   183146 #define GEN45_SAMPLER_BORDER_COLOR_STATE_length  12
   183147 #define GEN4_SAMPLER_BORDER_COLOR_STATE_length  12
   183148 
   183149 static inline uint32_t ATTRIBUTE_PURE
   183150 SAMPLER_BORDER_COLOR_STATE_length(const struct gen_device_info *devinfo)
   183151 {
   183152    switch (devinfo->gen) {
   183153    case 10: return 4;
   183154    case 9: return 4;
   183155    case 8: return 4;
   183156    case 7:
   183157       if (devinfo->is_haswell) {
   183158          return 20;
   183159       } else {
   183160          return 4;
   183161       }
   183162    case 6: return 12;
   183163    case 5: return 12;
   183164    case 4:
   183165       if (devinfo->is_g4x) {
   183166          return 12;
   183167       } else {
   183168          return 12;
   183169       }
   183170    default:
   183171       unreachable("Invalid hardware generation");
   183172    }
   183173 }
   183174 
   183175 
   183176 
   183177 /* SAMPLER_BORDER_COLOR_STATE::Border Color 16bit Alpha */
   183178 
   183179 
   183180 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor16bitAlpha_bits  16
   183181 
   183182 static inline uint32_t ATTRIBUTE_PURE
   183183 SAMPLER_BORDER_COLOR_STATE_BorderColor16bitAlpha_bits(const struct gen_device_info *devinfo)
   183184 {
   183185    switch (devinfo->gen) {
   183186    case 10: return 0;
   183187    case 9: return 0;
   183188    case 8: return 0;
   183189    case 7:
   183190       if (devinfo->is_haswell) {
   183191          return 16;
   183192       } else {
   183193          return 0;
   183194       }
   183195    case 6: return 0;
   183196    case 5: return 0;
   183197    case 4:
   183198       if (devinfo->is_g4x) {
   183199          return 0;
   183200       } else {
   183201          return 0;
   183202       }
   183203    default:
   183204       unreachable("Invalid hardware generation");
   183205    }
   183206 }
   183207 
   183208 
   183209 
   183210 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor16bitAlpha_start  592
   183211 
   183212 static inline uint32_t ATTRIBUTE_PURE
   183213 SAMPLER_BORDER_COLOR_STATE_BorderColor16bitAlpha_start(const struct gen_device_info *devinfo)
   183214 {
   183215    switch (devinfo->gen) {
   183216    case 10: return 0;
   183217    case 9: return 0;
   183218    case 8: return 0;
   183219    case 7:
   183220       if (devinfo->is_haswell) {
   183221          return 592;
   183222       } else {
   183223          return 0;
   183224       }
   183225    case 6: return 0;
   183226    case 5: return 0;
   183227    case 4:
   183228       if (devinfo->is_g4x) {
   183229          return 0;
   183230       } else {
   183231          return 0;
   183232       }
   183233    default:
   183234       unreachable("Invalid hardware generation");
   183235    }
   183236 }
   183237 
   183238 
   183239 
   183240 /* SAMPLER_BORDER_COLOR_STATE::Border Color 16bit Blue */
   183241 
   183242 
   183243 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor16bitBlue_bits  16
   183244 
   183245 static inline uint32_t ATTRIBUTE_PURE
   183246 SAMPLER_BORDER_COLOR_STATE_BorderColor16bitBlue_bits(const struct gen_device_info *devinfo)
   183247 {
   183248    switch (devinfo->gen) {
   183249    case 10: return 0;
   183250    case 9: return 0;
   183251    case 8: return 0;
   183252    case 7:
   183253       if (devinfo->is_haswell) {
   183254          return 16;
   183255       } else {
   183256          return 0;
   183257       }
   183258    case 6: return 0;
   183259    case 5: return 0;
   183260    case 4:
   183261       if (devinfo->is_g4x) {
   183262          return 0;
   183263       } else {
   183264          return 0;
   183265       }
   183266    default:
   183267       unreachable("Invalid hardware generation");
   183268    }
   183269 }
   183270 
   183271 
   183272 
   183273 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor16bitBlue_start  576
   183274 
   183275 static inline uint32_t ATTRIBUTE_PURE
   183276 SAMPLER_BORDER_COLOR_STATE_BorderColor16bitBlue_start(const struct gen_device_info *devinfo)
   183277 {
   183278    switch (devinfo->gen) {
   183279    case 10: return 0;
   183280    case 9: return 0;
   183281    case 8: return 0;
   183282    case 7:
   183283       if (devinfo->is_haswell) {
   183284          return 576;
   183285       } else {
   183286          return 0;
   183287       }
   183288    case 6: return 0;
   183289    case 5: return 0;
   183290    case 4:
   183291       if (devinfo->is_g4x) {
   183292          return 0;
   183293       } else {
   183294          return 0;
   183295       }
   183296    default:
   183297       unreachable("Invalid hardware generation");
   183298    }
   183299 }
   183300 
   183301 
   183302 
   183303 /* SAMPLER_BORDER_COLOR_STATE::Border Color 16bit Green */
   183304 
   183305 
   183306 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor16bitGreen_bits  16
   183307 
   183308 static inline uint32_t ATTRIBUTE_PURE
   183309 SAMPLER_BORDER_COLOR_STATE_BorderColor16bitGreen_bits(const struct gen_device_info *devinfo)
   183310 {
   183311    switch (devinfo->gen) {
   183312    case 10: return 0;
   183313    case 9: return 0;
   183314    case 8: return 0;
   183315    case 7:
   183316       if (devinfo->is_haswell) {
   183317          return 16;
   183318       } else {
   183319          return 0;
   183320       }
   183321    case 6: return 0;
   183322    case 5: return 0;
   183323    case 4:
   183324       if (devinfo->is_g4x) {
   183325          return 0;
   183326       } else {
   183327          return 0;
   183328       }
   183329    default:
   183330       unreachable("Invalid hardware generation");
   183331    }
   183332 }
   183333 
   183334 
   183335 
   183336 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor16bitGreen_start  528
   183337 
   183338 static inline uint32_t ATTRIBUTE_PURE
   183339 SAMPLER_BORDER_COLOR_STATE_BorderColor16bitGreen_start(const struct gen_device_info *devinfo)
   183340 {
   183341    switch (devinfo->gen) {
   183342    case 10: return 0;
   183343    case 9: return 0;
   183344    case 8: return 0;
   183345    case 7:
   183346       if (devinfo->is_haswell) {
   183347          return 528;
   183348       } else {
   183349          return 0;
   183350       }
   183351    case 6: return 0;
   183352    case 5: return 0;
   183353    case 4:
   183354       if (devinfo->is_g4x) {
   183355          return 0;
   183356       } else {
   183357          return 0;
   183358       }
   183359    default:
   183360       unreachable("Invalid hardware generation");
   183361    }
   183362 }
   183363 
   183364 
   183365 
   183366 /* SAMPLER_BORDER_COLOR_STATE::Border Color 16bit Red */
   183367 
   183368 
   183369 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor16bitRed_bits  16
   183370 
   183371 static inline uint32_t ATTRIBUTE_PURE
   183372 SAMPLER_BORDER_COLOR_STATE_BorderColor16bitRed_bits(const struct gen_device_info *devinfo)
   183373 {
   183374    switch (devinfo->gen) {
   183375    case 10: return 0;
   183376    case 9: return 0;
   183377    case 8: return 0;
   183378    case 7:
   183379       if (devinfo->is_haswell) {
   183380          return 16;
   183381       } else {
   183382          return 0;
   183383       }
   183384    case 6: return 0;
   183385    case 5: return 0;
   183386    case 4:
   183387       if (devinfo->is_g4x) {
   183388          return 0;
   183389       } else {
   183390          return 0;
   183391       }
   183392    default:
   183393       unreachable("Invalid hardware generation");
   183394    }
   183395 }
   183396 
   183397 
   183398 
   183399 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor16bitRed_start  512
   183400 
   183401 static inline uint32_t ATTRIBUTE_PURE
   183402 SAMPLER_BORDER_COLOR_STATE_BorderColor16bitRed_start(const struct gen_device_info *devinfo)
   183403 {
   183404    switch (devinfo->gen) {
   183405    case 10: return 0;
   183406    case 9: return 0;
   183407    case 8: return 0;
   183408    case 7:
   183409       if (devinfo->is_haswell) {
   183410          return 512;
   183411       } else {
   183412          return 0;
   183413       }
   183414    case 6: return 0;
   183415    case 5: return 0;
   183416    case 4:
   183417       if (devinfo->is_g4x) {
   183418          return 0;
   183419       } else {
   183420          return 0;
   183421       }
   183422    default:
   183423       unreachable("Invalid hardware generation");
   183424    }
   183425 }
   183426 
   183427 
   183428 
   183429 /* SAMPLER_BORDER_COLOR_STATE::Border Color 32bit Alpha */
   183430 
   183431 
   183432 #define GEN10_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitAlpha_bits  32
   183433 #define GEN9_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitAlpha_bits  32
   183434 #define GEN8_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitAlpha_bits  32
   183435 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitAlpha_bits  32
   183436 
   183437 static inline uint32_t ATTRIBUTE_PURE
   183438 SAMPLER_BORDER_COLOR_STATE_BorderColor32bitAlpha_bits(const struct gen_device_info *devinfo)
   183439 {
   183440    switch (devinfo->gen) {
   183441    case 10: return 32;
   183442    case 9: return 32;
   183443    case 8: return 32;
   183444    case 7:
   183445       if (devinfo->is_haswell) {
   183446          return 32;
   183447       } else {
   183448          return 0;
   183449       }
   183450    case 6: return 0;
   183451    case 5: return 0;
   183452    case 4:
   183453       if (devinfo->is_g4x) {
   183454          return 0;
   183455       } else {
   183456          return 0;
   183457       }
   183458    default:
   183459       unreachable("Invalid hardware generation");
   183460    }
   183461 }
   183462 
   183463 
   183464 
   183465 #define GEN10_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitAlpha_start  96
   183466 #define GEN9_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitAlpha_start  96
   183467 #define GEN8_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitAlpha_start  96
   183468 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitAlpha_start  608
   183469 
   183470 static inline uint32_t ATTRIBUTE_PURE
   183471 SAMPLER_BORDER_COLOR_STATE_BorderColor32bitAlpha_start(const struct gen_device_info *devinfo)
   183472 {
   183473    switch (devinfo->gen) {
   183474    case 10: return 96;
   183475    case 9: return 96;
   183476    case 8: return 96;
   183477    case 7:
   183478       if (devinfo->is_haswell) {
   183479          return 608;
   183480       } else {
   183481          return 0;
   183482       }
   183483    case 6: return 0;
   183484    case 5: return 0;
   183485    case 4:
   183486       if (devinfo->is_g4x) {
   183487          return 0;
   183488       } else {
   183489          return 0;
   183490       }
   183491    default:
   183492       unreachable("Invalid hardware generation");
   183493    }
   183494 }
   183495 
   183496 
   183497 
   183498 /* SAMPLER_BORDER_COLOR_STATE::Border Color 32bit Blue */
   183499 
   183500 
   183501 #define GEN10_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitBlue_bits  32
   183502 #define GEN9_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitBlue_bits  32
   183503 #define GEN8_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitBlue_bits  32
   183504 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitBlue_bits  32
   183505 
   183506 static inline uint32_t ATTRIBUTE_PURE
   183507 SAMPLER_BORDER_COLOR_STATE_BorderColor32bitBlue_bits(const struct gen_device_info *devinfo)
   183508 {
   183509    switch (devinfo->gen) {
   183510    case 10: return 32;
   183511    case 9: return 32;
   183512    case 8: return 32;
   183513    case 7:
   183514       if (devinfo->is_haswell) {
   183515          return 32;
   183516       } else {
   183517          return 0;
   183518       }
   183519    case 6: return 0;
   183520    case 5: return 0;
   183521    case 4:
   183522       if (devinfo->is_g4x) {
   183523          return 0;
   183524       } else {
   183525          return 0;
   183526       }
   183527    default:
   183528       unreachable("Invalid hardware generation");
   183529    }
   183530 }
   183531 
   183532 
   183533 
   183534 #define GEN10_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitBlue_start  64
   183535 #define GEN9_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitBlue_start  64
   183536 #define GEN8_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitBlue_start  64
   183537 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitBlue_start  576
   183538 
   183539 static inline uint32_t ATTRIBUTE_PURE
   183540 SAMPLER_BORDER_COLOR_STATE_BorderColor32bitBlue_start(const struct gen_device_info *devinfo)
   183541 {
   183542    switch (devinfo->gen) {
   183543    case 10: return 64;
   183544    case 9: return 64;
   183545    case 8: return 64;
   183546    case 7:
   183547       if (devinfo->is_haswell) {
   183548          return 576;
   183549       } else {
   183550          return 0;
   183551       }
   183552    case 6: return 0;
   183553    case 5: return 0;
   183554    case 4:
   183555       if (devinfo->is_g4x) {
   183556          return 0;
   183557       } else {
   183558          return 0;
   183559       }
   183560    default:
   183561       unreachable("Invalid hardware generation");
   183562    }
   183563 }
   183564 
   183565 
   183566 
   183567 /* SAMPLER_BORDER_COLOR_STATE::Border Color 32bit Green */
   183568 
   183569 
   183570 #define GEN10_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitGreen_bits  32
   183571 #define GEN9_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitGreen_bits  32
   183572 #define GEN8_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitGreen_bits  32
   183573 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitGreen_bits  32
   183574 
   183575 static inline uint32_t ATTRIBUTE_PURE
   183576 SAMPLER_BORDER_COLOR_STATE_BorderColor32bitGreen_bits(const struct gen_device_info *devinfo)
   183577 {
   183578    switch (devinfo->gen) {
   183579    case 10: return 32;
   183580    case 9: return 32;
   183581    case 8: return 32;
   183582    case 7:
   183583       if (devinfo->is_haswell) {
   183584          return 32;
   183585       } else {
   183586          return 0;
   183587       }
   183588    case 6: return 0;
   183589    case 5: return 0;
   183590    case 4:
   183591       if (devinfo->is_g4x) {
   183592          return 0;
   183593       } else {
   183594          return 0;
   183595       }
   183596    default:
   183597       unreachable("Invalid hardware generation");
   183598    }
   183599 }
   183600 
   183601 
   183602 
   183603 #define GEN10_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitGreen_start  32
   183604 #define GEN9_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitGreen_start  32
   183605 #define GEN8_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitGreen_start  32
   183606 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitGreen_start  544
   183607 
   183608 static inline uint32_t ATTRIBUTE_PURE
   183609 SAMPLER_BORDER_COLOR_STATE_BorderColor32bitGreen_start(const struct gen_device_info *devinfo)
   183610 {
   183611    switch (devinfo->gen) {
   183612    case 10: return 32;
   183613    case 9: return 32;
   183614    case 8: return 32;
   183615    case 7:
   183616       if (devinfo->is_haswell) {
   183617          return 544;
   183618       } else {
   183619          return 0;
   183620       }
   183621    case 6: return 0;
   183622    case 5: return 0;
   183623    case 4:
   183624       if (devinfo->is_g4x) {
   183625          return 0;
   183626       } else {
   183627          return 0;
   183628       }
   183629    default:
   183630       unreachable("Invalid hardware generation");
   183631    }
   183632 }
   183633 
   183634 
   183635 
   183636 /* SAMPLER_BORDER_COLOR_STATE::Border Color 32bit Red */
   183637 
   183638 
   183639 #define GEN10_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitRed_bits  32
   183640 #define GEN9_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitRed_bits  32
   183641 #define GEN8_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitRed_bits  32
   183642 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitRed_bits  32
   183643 
   183644 static inline uint32_t ATTRIBUTE_PURE
   183645 SAMPLER_BORDER_COLOR_STATE_BorderColor32bitRed_bits(const struct gen_device_info *devinfo)
   183646 {
   183647    switch (devinfo->gen) {
   183648    case 10: return 32;
   183649    case 9: return 32;
   183650    case 8: return 32;
   183651    case 7:
   183652       if (devinfo->is_haswell) {
   183653          return 32;
   183654       } else {
   183655          return 0;
   183656       }
   183657    case 6: return 0;
   183658    case 5: return 0;
   183659    case 4:
   183660       if (devinfo->is_g4x) {
   183661          return 0;
   183662       } else {
   183663          return 0;
   183664       }
   183665    default:
   183666       unreachable("Invalid hardware generation");
   183667    }
   183668 }
   183669 
   183670 
   183671 
   183672 #define GEN10_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitRed_start  0
   183673 #define GEN9_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitRed_start  0
   183674 #define GEN8_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitRed_start  0
   183675 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor32bitRed_start  512
   183676 
   183677 static inline uint32_t ATTRIBUTE_PURE
   183678 SAMPLER_BORDER_COLOR_STATE_BorderColor32bitRed_start(const struct gen_device_info *devinfo)
   183679 {
   183680    switch (devinfo->gen) {
   183681    case 10: return 0;
   183682    case 9: return 0;
   183683    case 8: return 0;
   183684    case 7:
   183685       if (devinfo->is_haswell) {
   183686          return 512;
   183687       } else {
   183688          return 0;
   183689       }
   183690    case 6: return 0;
   183691    case 5: return 0;
   183692    case 4:
   183693       if (devinfo->is_g4x) {
   183694          return 0;
   183695       } else {
   183696          return 0;
   183697       }
   183698    default:
   183699       unreachable("Invalid hardware generation");
   183700    }
   183701 }
   183702 
   183703 
   183704 
   183705 /* SAMPLER_BORDER_COLOR_STATE::Border Color 8bit Alpha */
   183706 
   183707 
   183708 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor8bitAlpha_bits  8
   183709 
   183710 static inline uint32_t ATTRIBUTE_PURE
   183711 SAMPLER_BORDER_COLOR_STATE_BorderColor8bitAlpha_bits(const struct gen_device_info *devinfo)
   183712 {
   183713    switch (devinfo->gen) {
   183714    case 10: return 0;
   183715    case 9: return 0;
   183716    case 8: return 0;
   183717    case 7:
   183718       if (devinfo->is_haswell) {
   183719          return 8;
   183720       } else {
   183721          return 0;
   183722       }
   183723    case 6: return 0;
   183724    case 5: return 0;
   183725    case 4:
   183726       if (devinfo->is_g4x) {
   183727          return 0;
   183728       } else {
   183729          return 0;
   183730       }
   183731    default:
   183732       unreachable("Invalid hardware generation");
   183733    }
   183734 }
   183735 
   183736 
   183737 
   183738 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor8bitAlpha_start  536
   183739 
   183740 static inline uint32_t ATTRIBUTE_PURE
   183741 SAMPLER_BORDER_COLOR_STATE_BorderColor8bitAlpha_start(const struct gen_device_info *devinfo)
   183742 {
   183743    switch (devinfo->gen) {
   183744    case 10: return 0;
   183745    case 9: return 0;
   183746    case 8: return 0;
   183747    case 7:
   183748       if (devinfo->is_haswell) {
   183749          return 536;
   183750       } else {
   183751          return 0;
   183752       }
   183753    case 6: return 0;
   183754    case 5: return 0;
   183755    case 4:
   183756       if (devinfo->is_g4x) {
   183757          return 0;
   183758       } else {
   183759          return 0;
   183760       }
   183761    default:
   183762       unreachable("Invalid hardware generation");
   183763    }
   183764 }
   183765 
   183766 
   183767 
   183768 /* SAMPLER_BORDER_COLOR_STATE::Border Color 8bit Blue */
   183769 
   183770 
   183771 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor8bitBlue_bits  8
   183772 
   183773 static inline uint32_t ATTRIBUTE_PURE
   183774 SAMPLER_BORDER_COLOR_STATE_BorderColor8bitBlue_bits(const struct gen_device_info *devinfo)
   183775 {
   183776    switch (devinfo->gen) {
   183777    case 10: return 0;
   183778    case 9: return 0;
   183779    case 8: return 0;
   183780    case 7:
   183781       if (devinfo->is_haswell) {
   183782          return 8;
   183783       } else {
   183784          return 0;
   183785       }
   183786    case 6: return 0;
   183787    case 5: return 0;
   183788    case 4:
   183789       if (devinfo->is_g4x) {
   183790          return 0;
   183791       } else {
   183792          return 0;
   183793       }
   183794    default:
   183795       unreachable("Invalid hardware generation");
   183796    }
   183797 }
   183798 
   183799 
   183800 
   183801 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor8bitBlue_start  528
   183802 
   183803 static inline uint32_t ATTRIBUTE_PURE
   183804 SAMPLER_BORDER_COLOR_STATE_BorderColor8bitBlue_start(const struct gen_device_info *devinfo)
   183805 {
   183806    switch (devinfo->gen) {
   183807    case 10: return 0;
   183808    case 9: return 0;
   183809    case 8: return 0;
   183810    case 7:
   183811       if (devinfo->is_haswell) {
   183812          return 528;
   183813       } else {
   183814          return 0;
   183815       }
   183816    case 6: return 0;
   183817    case 5: return 0;
   183818    case 4:
   183819       if (devinfo->is_g4x) {
   183820          return 0;
   183821       } else {
   183822          return 0;
   183823       }
   183824    default:
   183825       unreachable("Invalid hardware generation");
   183826    }
   183827 }
   183828 
   183829 
   183830 
   183831 /* SAMPLER_BORDER_COLOR_STATE::Border Color 8bit Green */
   183832 
   183833 
   183834 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor8bitGreen_bits  8
   183835 
   183836 static inline uint32_t ATTRIBUTE_PURE
   183837 SAMPLER_BORDER_COLOR_STATE_BorderColor8bitGreen_bits(const struct gen_device_info *devinfo)
   183838 {
   183839    switch (devinfo->gen) {
   183840    case 10: return 0;
   183841    case 9: return 0;
   183842    case 8: return 0;
   183843    case 7:
   183844       if (devinfo->is_haswell) {
   183845          return 8;
   183846       } else {
   183847          return 0;
   183848       }
   183849    case 6: return 0;
   183850    case 5: return 0;
   183851    case 4:
   183852       if (devinfo->is_g4x) {
   183853          return 0;
   183854       } else {
   183855          return 0;
   183856       }
   183857    default:
   183858       unreachable("Invalid hardware generation");
   183859    }
   183860 }
   183861 
   183862 
   183863 
   183864 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor8bitGreen_start  520
   183865 
   183866 static inline uint32_t ATTRIBUTE_PURE
   183867 SAMPLER_BORDER_COLOR_STATE_BorderColor8bitGreen_start(const struct gen_device_info *devinfo)
   183868 {
   183869    switch (devinfo->gen) {
   183870    case 10: return 0;
   183871    case 9: return 0;
   183872    case 8: return 0;
   183873    case 7:
   183874       if (devinfo->is_haswell) {
   183875          return 520;
   183876       } else {
   183877          return 0;
   183878       }
   183879    case 6: return 0;
   183880    case 5: return 0;
   183881    case 4:
   183882       if (devinfo->is_g4x) {
   183883          return 0;
   183884       } else {
   183885          return 0;
   183886       }
   183887    default:
   183888       unreachable("Invalid hardware generation");
   183889    }
   183890 }
   183891 
   183892 
   183893 
   183894 /* SAMPLER_BORDER_COLOR_STATE::Border Color 8bit Red */
   183895 
   183896 
   183897 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor8bitRed_bits  8
   183898 
   183899 static inline uint32_t ATTRIBUTE_PURE
   183900 SAMPLER_BORDER_COLOR_STATE_BorderColor8bitRed_bits(const struct gen_device_info *devinfo)
   183901 {
   183902    switch (devinfo->gen) {
   183903    case 10: return 0;
   183904    case 9: return 0;
   183905    case 8: return 0;
   183906    case 7:
   183907       if (devinfo->is_haswell) {
   183908          return 8;
   183909       } else {
   183910          return 0;
   183911       }
   183912    case 6: return 0;
   183913    case 5: return 0;
   183914    case 4:
   183915       if (devinfo->is_g4x) {
   183916          return 0;
   183917       } else {
   183918          return 0;
   183919       }
   183920    default:
   183921       unreachable("Invalid hardware generation");
   183922    }
   183923 }
   183924 
   183925 
   183926 
   183927 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColor8bitRed_start  512
   183928 
   183929 static inline uint32_t ATTRIBUTE_PURE
   183930 SAMPLER_BORDER_COLOR_STATE_BorderColor8bitRed_start(const struct gen_device_info *devinfo)
   183931 {
   183932    switch (devinfo->gen) {
   183933    case 10: return 0;
   183934    case 9: return 0;
   183935    case 8: return 0;
   183936    case 7:
   183937       if (devinfo->is_haswell) {
   183938          return 512;
   183939       } else {
   183940          return 0;
   183941       }
   183942    case 6: return 0;
   183943    case 5: return 0;
   183944    case 4:
   183945       if (devinfo->is_g4x) {
   183946          return 0;
   183947       } else {
   183948          return 0;
   183949       }
   183950    default:
   183951       unreachable("Invalid hardware generation");
   183952    }
   183953 }
   183954 
   183955 
   183956 
   183957 /* SAMPLER_BORDER_COLOR_STATE::Border Color Alpha */
   183958 
   183959 
   183960 #define GEN45_SAMPLER_BORDER_COLOR_STATE_BorderColorAlpha_bits  32
   183961 #define GEN4_SAMPLER_BORDER_COLOR_STATE_BorderColorAlpha_bits  32
   183962 
   183963 static inline uint32_t ATTRIBUTE_PURE
   183964 SAMPLER_BORDER_COLOR_STATE_BorderColorAlpha_bits(const struct gen_device_info *devinfo)
   183965 {
   183966    switch (devinfo->gen) {
   183967    case 10: return 0;
   183968    case 9: return 0;
   183969    case 8: return 0;
   183970    case 7:
   183971       if (devinfo->is_haswell) {
   183972          return 0;
   183973       } else {
   183974          return 0;
   183975       }
   183976    case 6: return 0;
   183977    case 5: return 0;
   183978    case 4:
   183979       if (devinfo->is_g4x) {
   183980          return 32;
   183981       } else {
   183982          return 32;
   183983       }
   183984    default:
   183985       unreachable("Invalid hardware generation");
   183986    }
   183987 }
   183988 
   183989 
   183990 
   183991 #define GEN45_SAMPLER_BORDER_COLOR_STATE_BorderColorAlpha_start  96
   183992 #define GEN4_SAMPLER_BORDER_COLOR_STATE_BorderColorAlpha_start  96
   183993 
   183994 static inline uint32_t ATTRIBUTE_PURE
   183995 SAMPLER_BORDER_COLOR_STATE_BorderColorAlpha_start(const struct gen_device_info *devinfo)
   183996 {
   183997    switch (devinfo->gen) {
   183998    case 10: return 0;
   183999    case 9: return 0;
   184000    case 8: return 0;
   184001    case 7:
   184002       if (devinfo->is_haswell) {
   184003          return 0;
   184004       } else {
   184005          return 0;
   184006       }
   184007    case 6: return 0;
   184008    case 5: return 0;
   184009    case 4:
   184010       if (devinfo->is_g4x) {
   184011          return 96;
   184012       } else {
   184013          return 96;
   184014       }
   184015    default:
   184016       unreachable("Invalid hardware generation");
   184017    }
   184018 }
   184019 
   184020 
   184021 
   184022 /* SAMPLER_BORDER_COLOR_STATE::Border Color Blue */
   184023 
   184024 
   184025 #define GEN45_SAMPLER_BORDER_COLOR_STATE_BorderColorBlue_bits  32
   184026 #define GEN4_SAMPLER_BORDER_COLOR_STATE_BorderColorBlue_bits  32
   184027 
   184028 static inline uint32_t ATTRIBUTE_PURE
   184029 SAMPLER_BORDER_COLOR_STATE_BorderColorBlue_bits(const struct gen_device_info *devinfo)
   184030 {
   184031    switch (devinfo->gen) {
   184032    case 10: return 0;
   184033    case 9: return 0;
   184034    case 8: return 0;
   184035    case 7:
   184036       if (devinfo->is_haswell) {
   184037          return 0;
   184038       } else {
   184039          return 0;
   184040       }
   184041    case 6: return 0;
   184042    case 5: return 0;
   184043    case 4:
   184044       if (devinfo->is_g4x) {
   184045          return 32;
   184046       } else {
   184047          return 32;
   184048       }
   184049    default:
   184050       unreachable("Invalid hardware generation");
   184051    }
   184052 }
   184053 
   184054 
   184055 
   184056 #define GEN45_SAMPLER_BORDER_COLOR_STATE_BorderColorBlue_start  64
   184057 #define GEN4_SAMPLER_BORDER_COLOR_STATE_BorderColorBlue_start  64
   184058 
   184059 static inline uint32_t ATTRIBUTE_PURE
   184060 SAMPLER_BORDER_COLOR_STATE_BorderColorBlue_start(const struct gen_device_info *devinfo)
   184061 {
   184062    switch (devinfo->gen) {
   184063    case 10: return 0;
   184064    case 9: return 0;
   184065    case 8: return 0;
   184066    case 7:
   184067       if (devinfo->is_haswell) {
   184068          return 0;
   184069       } else {
   184070          return 0;
   184071       }
   184072    case 6: return 0;
   184073    case 5: return 0;
   184074    case 4:
   184075       if (devinfo->is_g4x) {
   184076          return 64;
   184077       } else {
   184078          return 64;
   184079       }
   184080    default:
   184081       unreachable("Invalid hardware generation");
   184082    }
   184083 }
   184084 
   184085 
   184086 
   184087 /* SAMPLER_BORDER_COLOR_STATE::Border Color Float Alpha */
   184088 
   184089 
   184090 #define GEN10_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatAlpha_bits  32
   184091 #define GEN9_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatAlpha_bits  32
   184092 #define GEN8_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatAlpha_bits  32
   184093 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatAlpha_bits  32
   184094 #define GEN7_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatAlpha_bits  32
   184095 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatAlpha_bits  32
   184096 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatAlpha_bits  32
   184097 
   184098 static inline uint32_t ATTRIBUTE_PURE
   184099 SAMPLER_BORDER_COLOR_STATE_BorderColorFloatAlpha_bits(const struct gen_device_info *devinfo)
   184100 {
   184101    switch (devinfo->gen) {
   184102    case 10: return 32;
   184103    case 9: return 32;
   184104    case 8: return 32;
   184105    case 7:
   184106       if (devinfo->is_haswell) {
   184107          return 32;
   184108       } else {
   184109          return 32;
   184110       }
   184111    case 6: return 32;
   184112    case 5: return 32;
   184113    case 4:
   184114       if (devinfo->is_g4x) {
   184115          return 0;
   184116       } else {
   184117          return 0;
   184118       }
   184119    default:
   184120       unreachable("Invalid hardware generation");
   184121    }
   184122 }
   184123 
   184124 
   184125 
   184126 #define GEN10_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatAlpha_start  96
   184127 #define GEN9_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatAlpha_start  96
   184128 #define GEN8_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatAlpha_start  96
   184129 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatAlpha_start  96
   184130 #define GEN7_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatAlpha_start  96
   184131 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatAlpha_start  128
   184132 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatAlpha_start  128
   184133 
   184134 static inline uint32_t ATTRIBUTE_PURE
   184135 SAMPLER_BORDER_COLOR_STATE_BorderColorFloatAlpha_start(const struct gen_device_info *devinfo)
   184136 {
   184137    switch (devinfo->gen) {
   184138    case 10: return 96;
   184139    case 9: return 96;
   184140    case 8: return 96;
   184141    case 7:
   184142       if (devinfo->is_haswell) {
   184143          return 96;
   184144       } else {
   184145          return 96;
   184146       }
   184147    case 6: return 128;
   184148    case 5: return 128;
   184149    case 4:
   184150       if (devinfo->is_g4x) {
   184151          return 0;
   184152       } else {
   184153          return 0;
   184154       }
   184155    default:
   184156       unreachable("Invalid hardware generation");
   184157    }
   184158 }
   184159 
   184160 
   184161 
   184162 /* SAMPLER_BORDER_COLOR_STATE::Border Color Float Blue */
   184163 
   184164 
   184165 #define GEN10_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatBlue_bits  32
   184166 #define GEN9_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatBlue_bits  32
   184167 #define GEN8_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatBlue_bits  32
   184168 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatBlue_bits  32
   184169 #define GEN7_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatBlue_bits  32
   184170 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatBlue_bits  32
   184171 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatBlue_bits  32
   184172 
   184173 static inline uint32_t ATTRIBUTE_PURE
   184174 SAMPLER_BORDER_COLOR_STATE_BorderColorFloatBlue_bits(const struct gen_device_info *devinfo)
   184175 {
   184176    switch (devinfo->gen) {
   184177    case 10: return 32;
   184178    case 9: return 32;
   184179    case 8: return 32;
   184180    case 7:
   184181       if (devinfo->is_haswell) {
   184182          return 32;
   184183       } else {
   184184          return 32;
   184185       }
   184186    case 6: return 32;
   184187    case 5: return 32;
   184188    case 4:
   184189       if (devinfo->is_g4x) {
   184190          return 0;
   184191       } else {
   184192          return 0;
   184193       }
   184194    default:
   184195       unreachable("Invalid hardware generation");
   184196    }
   184197 }
   184198 
   184199 
   184200 
   184201 #define GEN10_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatBlue_start  64
   184202 #define GEN9_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatBlue_start  64
   184203 #define GEN8_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatBlue_start  64
   184204 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatBlue_start  64
   184205 #define GEN7_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatBlue_start  64
   184206 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatBlue_start  96
   184207 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatBlue_start  96
   184208 
   184209 static inline uint32_t ATTRIBUTE_PURE
   184210 SAMPLER_BORDER_COLOR_STATE_BorderColorFloatBlue_start(const struct gen_device_info *devinfo)
   184211 {
   184212    switch (devinfo->gen) {
   184213    case 10: return 64;
   184214    case 9: return 64;
   184215    case 8: return 64;
   184216    case 7:
   184217       if (devinfo->is_haswell) {
   184218          return 64;
   184219       } else {
   184220          return 64;
   184221       }
   184222    case 6: return 96;
   184223    case 5: return 96;
   184224    case 4:
   184225       if (devinfo->is_g4x) {
   184226          return 0;
   184227       } else {
   184228          return 0;
   184229       }
   184230    default:
   184231       unreachable("Invalid hardware generation");
   184232    }
   184233 }
   184234 
   184235 
   184236 
   184237 /* SAMPLER_BORDER_COLOR_STATE::Border Color Float Green */
   184238 
   184239 
   184240 #define GEN10_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatGreen_bits  32
   184241 #define GEN9_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatGreen_bits  32
   184242 #define GEN8_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatGreen_bits  32
   184243 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatGreen_bits  32
   184244 #define GEN7_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatGreen_bits  32
   184245 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatGreen_bits  32
   184246 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatGreen_bits  32
   184247 
   184248 static inline uint32_t ATTRIBUTE_PURE
   184249 SAMPLER_BORDER_COLOR_STATE_BorderColorFloatGreen_bits(const struct gen_device_info *devinfo)
   184250 {
   184251    switch (devinfo->gen) {
   184252    case 10: return 32;
   184253    case 9: return 32;
   184254    case 8: return 32;
   184255    case 7:
   184256       if (devinfo->is_haswell) {
   184257          return 32;
   184258       } else {
   184259          return 32;
   184260       }
   184261    case 6: return 32;
   184262    case 5: return 32;
   184263    case 4:
   184264       if (devinfo->is_g4x) {
   184265          return 0;
   184266       } else {
   184267          return 0;
   184268       }
   184269    default:
   184270       unreachable("Invalid hardware generation");
   184271    }
   184272 }
   184273 
   184274 
   184275 
   184276 #define GEN10_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatGreen_start  32
   184277 #define GEN9_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatGreen_start  32
   184278 #define GEN8_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatGreen_start  32
   184279 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatGreen_start  32
   184280 #define GEN7_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatGreen_start  32
   184281 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatGreen_start  64
   184282 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatGreen_start  64
   184283 
   184284 static inline uint32_t ATTRIBUTE_PURE
   184285 SAMPLER_BORDER_COLOR_STATE_BorderColorFloatGreen_start(const struct gen_device_info *devinfo)
   184286 {
   184287    switch (devinfo->gen) {
   184288    case 10: return 32;
   184289    case 9: return 32;
   184290    case 8: return 32;
   184291    case 7:
   184292       if (devinfo->is_haswell) {
   184293          return 32;
   184294       } else {
   184295          return 32;
   184296       }
   184297    case 6: return 64;
   184298    case 5: return 64;
   184299    case 4:
   184300       if (devinfo->is_g4x) {
   184301          return 0;
   184302       } else {
   184303          return 0;
   184304       }
   184305    default:
   184306       unreachable("Invalid hardware generation");
   184307    }
   184308 }
   184309 
   184310 
   184311 
   184312 /* SAMPLER_BORDER_COLOR_STATE::Border Color Float Red */
   184313 
   184314 
   184315 #define GEN10_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatRed_bits  32
   184316 #define GEN9_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatRed_bits  32
   184317 #define GEN8_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatRed_bits  32
   184318 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatRed_bits  32
   184319 #define GEN7_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatRed_bits  32
   184320 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatRed_bits  32
   184321 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatRed_bits  32
   184322 
   184323 static inline uint32_t ATTRIBUTE_PURE
   184324 SAMPLER_BORDER_COLOR_STATE_BorderColorFloatRed_bits(const struct gen_device_info *devinfo)
   184325 {
   184326    switch (devinfo->gen) {
   184327    case 10: return 32;
   184328    case 9: return 32;
   184329    case 8: return 32;
   184330    case 7:
   184331       if (devinfo->is_haswell) {
   184332          return 32;
   184333       } else {
   184334          return 32;
   184335       }
   184336    case 6: return 32;
   184337    case 5: return 32;
   184338    case 4:
   184339       if (devinfo->is_g4x) {
   184340          return 0;
   184341       } else {
   184342          return 0;
   184343       }
   184344    default:
   184345       unreachable("Invalid hardware generation");
   184346    }
   184347 }
   184348 
   184349 
   184350 
   184351 #define GEN10_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatRed_start  0
   184352 #define GEN9_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatRed_start  0
   184353 #define GEN8_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatRed_start  0
   184354 #define GEN75_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatRed_start  0
   184355 #define GEN7_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatRed_start  0
   184356 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatRed_start  32
   184357 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorFloatRed_start  32
   184358 
   184359 static inline uint32_t ATTRIBUTE_PURE
   184360 SAMPLER_BORDER_COLOR_STATE_BorderColorFloatRed_start(const struct gen_device_info *devinfo)
   184361 {
   184362    switch (devinfo->gen) {
   184363    case 10: return 0;
   184364    case 9: return 0;
   184365    case 8: return 0;
   184366    case 7:
   184367       if (devinfo->is_haswell) {
   184368          return 0;
   184369       } else {
   184370          return 0;
   184371       }
   184372    case 6: return 32;
   184373    case 5: return 32;
   184374    case 4:
   184375       if (devinfo->is_g4x) {
   184376          return 0;
   184377       } else {
   184378          return 0;
   184379       }
   184380    default:
   184381       unreachable("Invalid hardware generation");
   184382    }
   184383 }
   184384 
   184385 
   184386 
   184387 /* SAMPLER_BORDER_COLOR_STATE::Border Color Float16 Alpha */
   184388 
   184389 
   184390 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Alpha_bits  16
   184391 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Alpha_bits  16
   184392 
   184393 static inline uint32_t ATTRIBUTE_PURE
   184394 SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Alpha_bits(const struct gen_device_info *devinfo)
   184395 {
   184396    switch (devinfo->gen) {
   184397    case 10: return 0;
   184398    case 9: return 0;
   184399    case 8: return 0;
   184400    case 7:
   184401       if (devinfo->is_haswell) {
   184402          return 0;
   184403       } else {
   184404          return 0;
   184405       }
   184406    case 6: return 16;
   184407    case 5: return 16;
   184408    case 4:
   184409       if (devinfo->is_g4x) {
   184410          return 0;
   184411       } else {
   184412          return 0;
   184413       }
   184414    default:
   184415       unreachable("Invalid hardware generation");
   184416    }
   184417 }
   184418 
   184419 
   184420 
   184421 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Alpha_start  208
   184422 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Alpha_start  208
   184423 
   184424 static inline uint32_t ATTRIBUTE_PURE
   184425 SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Alpha_start(const struct gen_device_info *devinfo)
   184426 {
   184427    switch (devinfo->gen) {
   184428    case 10: return 0;
   184429    case 9: return 0;
   184430    case 8: return 0;
   184431    case 7:
   184432       if (devinfo->is_haswell) {
   184433          return 0;
   184434       } else {
   184435          return 0;
   184436       }
   184437    case 6: return 208;
   184438    case 5: return 208;
   184439    case 4:
   184440       if (devinfo->is_g4x) {
   184441          return 0;
   184442       } else {
   184443          return 0;
   184444       }
   184445    default:
   184446       unreachable("Invalid hardware generation");
   184447    }
   184448 }
   184449 
   184450 
   184451 
   184452 /* SAMPLER_BORDER_COLOR_STATE::Border Color Float16 Blue */
   184453 
   184454 
   184455 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Blue_bits  16
   184456 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Blue_bits  16
   184457 
   184458 static inline uint32_t ATTRIBUTE_PURE
   184459 SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Blue_bits(const struct gen_device_info *devinfo)
   184460 {
   184461    switch (devinfo->gen) {
   184462    case 10: return 0;
   184463    case 9: return 0;
   184464    case 8: return 0;
   184465    case 7:
   184466       if (devinfo->is_haswell) {
   184467          return 0;
   184468       } else {
   184469          return 0;
   184470       }
   184471    case 6: return 16;
   184472    case 5: return 16;
   184473    case 4:
   184474       if (devinfo->is_g4x) {
   184475          return 0;
   184476       } else {
   184477          return 0;
   184478       }
   184479    default:
   184480       unreachable("Invalid hardware generation");
   184481    }
   184482 }
   184483 
   184484 
   184485 
   184486 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Blue_start  192
   184487 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Blue_start  192
   184488 
   184489 static inline uint32_t ATTRIBUTE_PURE
   184490 SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Blue_start(const struct gen_device_info *devinfo)
   184491 {
   184492    switch (devinfo->gen) {
   184493    case 10: return 0;
   184494    case 9: return 0;
   184495    case 8: return 0;
   184496    case 7:
   184497       if (devinfo->is_haswell) {
   184498          return 0;
   184499       } else {
   184500          return 0;
   184501       }
   184502    case 6: return 192;
   184503    case 5: return 192;
   184504    case 4:
   184505       if (devinfo->is_g4x) {
   184506          return 0;
   184507       } else {
   184508          return 0;
   184509       }
   184510    default:
   184511       unreachable("Invalid hardware generation");
   184512    }
   184513 }
   184514 
   184515 
   184516 
   184517 /* SAMPLER_BORDER_COLOR_STATE::Border Color Float16 Green */
   184518 
   184519 
   184520 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Green_bits  16
   184521 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Green_bits  16
   184522 
   184523 static inline uint32_t ATTRIBUTE_PURE
   184524 SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Green_bits(const struct gen_device_info *devinfo)
   184525 {
   184526    switch (devinfo->gen) {
   184527    case 10: return 0;
   184528    case 9: return 0;
   184529    case 8: return 0;
   184530    case 7:
   184531       if (devinfo->is_haswell) {
   184532          return 0;
   184533       } else {
   184534          return 0;
   184535       }
   184536    case 6: return 16;
   184537    case 5: return 16;
   184538    case 4:
   184539       if (devinfo->is_g4x) {
   184540          return 0;
   184541       } else {
   184542          return 0;
   184543       }
   184544    default:
   184545       unreachable("Invalid hardware generation");
   184546    }
   184547 }
   184548 
   184549 
   184550 
   184551 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Green_start  176
   184552 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Green_start  176
   184553 
   184554 static inline uint32_t ATTRIBUTE_PURE
   184555 SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Green_start(const struct gen_device_info *devinfo)
   184556 {
   184557    switch (devinfo->gen) {
   184558    case 10: return 0;
   184559    case 9: return 0;
   184560    case 8: return 0;
   184561    case 7:
   184562       if (devinfo->is_haswell) {
   184563          return 0;
   184564       } else {
   184565          return 0;
   184566       }
   184567    case 6: return 176;
   184568    case 5: return 176;
   184569    case 4:
   184570       if (devinfo->is_g4x) {
   184571          return 0;
   184572       } else {
   184573          return 0;
   184574       }
   184575    default:
   184576       unreachable("Invalid hardware generation");
   184577    }
   184578 }
   184579 
   184580 
   184581 
   184582 /* SAMPLER_BORDER_COLOR_STATE::Border Color Float16 Red */
   184583 
   184584 
   184585 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Red_bits  16
   184586 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Red_bits  16
   184587 
   184588 static inline uint32_t ATTRIBUTE_PURE
   184589 SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Red_bits(const struct gen_device_info *devinfo)
   184590 {
   184591    switch (devinfo->gen) {
   184592    case 10: return 0;
   184593    case 9: return 0;
   184594    case 8: return 0;
   184595    case 7:
   184596       if (devinfo->is_haswell) {
   184597          return 0;
   184598       } else {
   184599          return 0;
   184600       }
   184601    case 6: return 16;
   184602    case 5: return 16;
   184603    case 4:
   184604       if (devinfo->is_g4x) {
   184605          return 0;
   184606       } else {
   184607          return 0;
   184608       }
   184609    default:
   184610       unreachable("Invalid hardware generation");
   184611    }
   184612 }
   184613 
   184614 
   184615 
   184616 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Red_start  160
   184617 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Red_start  160
   184618 
   184619 static inline uint32_t ATTRIBUTE_PURE
   184620 SAMPLER_BORDER_COLOR_STATE_BorderColorFloat16Red_start(const struct gen_device_info *devinfo)
   184621 {
   184622    switch (devinfo->gen) {
   184623    case 10: return 0;
   184624    case 9: return 0;
   184625    case 8: return 0;
   184626    case 7:
   184627       if (devinfo->is_haswell) {
   184628          return 0;
   184629       } else {
   184630          return 0;
   184631       }
   184632    case 6: return 160;
   184633    case 5: return 160;
   184634    case 4:
   184635       if (devinfo->is_g4x) {
   184636          return 0;
   184637       } else {
   184638          return 0;
   184639       }
   184640    default:
   184641       unreachable("Invalid hardware generation");
   184642    }
   184643 }
   184644 
   184645 
   184646 
   184647 /* SAMPLER_BORDER_COLOR_STATE::Border Color Green */
   184648 
   184649 
   184650 #define GEN45_SAMPLER_BORDER_COLOR_STATE_BorderColorGreen_bits  32
   184651 #define GEN4_SAMPLER_BORDER_COLOR_STATE_BorderColorGreen_bits  32
   184652 
   184653 static inline uint32_t ATTRIBUTE_PURE
   184654 SAMPLER_BORDER_COLOR_STATE_BorderColorGreen_bits(const struct gen_device_info *devinfo)
   184655 {
   184656    switch (devinfo->gen) {
   184657    case 10: return 0;
   184658    case 9: return 0;
   184659    case 8: return 0;
   184660    case 7:
   184661       if (devinfo->is_haswell) {
   184662          return 0;
   184663       } else {
   184664          return 0;
   184665       }
   184666    case 6: return 0;
   184667    case 5: return 0;
   184668    case 4:
   184669       if (devinfo->is_g4x) {
   184670          return 32;
   184671       } else {
   184672          return 32;
   184673       }
   184674    default:
   184675       unreachable("Invalid hardware generation");
   184676    }
   184677 }
   184678 
   184679 
   184680 
   184681 #define GEN45_SAMPLER_BORDER_COLOR_STATE_BorderColorGreen_start  32
   184682 #define GEN4_SAMPLER_BORDER_COLOR_STATE_BorderColorGreen_start  32
   184683 
   184684 static inline uint32_t ATTRIBUTE_PURE
   184685 SAMPLER_BORDER_COLOR_STATE_BorderColorGreen_start(const struct gen_device_info *devinfo)
   184686 {
   184687    switch (devinfo->gen) {
   184688    case 10: return 0;
   184689    case 9: return 0;
   184690    case 8: return 0;
   184691    case 7:
   184692       if (devinfo->is_haswell) {
   184693          return 0;
   184694       } else {
   184695          return 0;
   184696       }
   184697    case 6: return 0;
   184698    case 5: return 0;
   184699    case 4:
   184700       if (devinfo->is_g4x) {
   184701          return 32;
   184702       } else {
   184703          return 32;
   184704       }
   184705    default:
   184706       unreachable("Invalid hardware generation");
   184707    }
   184708 }
   184709 
   184710 
   184711 
   184712 /* SAMPLER_BORDER_COLOR_STATE::Border Color Red */
   184713 
   184714 
   184715 #define GEN45_SAMPLER_BORDER_COLOR_STATE_BorderColorRed_bits  32
   184716 #define GEN4_SAMPLER_BORDER_COLOR_STATE_BorderColorRed_bits  32
   184717 
   184718 static inline uint32_t ATTRIBUTE_PURE
   184719 SAMPLER_BORDER_COLOR_STATE_BorderColorRed_bits(const struct gen_device_info *devinfo)
   184720 {
   184721    switch (devinfo->gen) {
   184722    case 10: return 0;
   184723    case 9: return 0;
   184724    case 8: return 0;
   184725    case 7:
   184726       if (devinfo->is_haswell) {
   184727          return 0;
   184728       } else {
   184729          return 0;
   184730       }
   184731    case 6: return 0;
   184732    case 5: return 0;
   184733    case 4:
   184734       if (devinfo->is_g4x) {
   184735          return 32;
   184736       } else {
   184737          return 32;
   184738       }
   184739    default:
   184740       unreachable("Invalid hardware generation");
   184741    }
   184742 }
   184743 
   184744 
   184745 
   184746 #define GEN45_SAMPLER_BORDER_COLOR_STATE_BorderColorRed_start  0
   184747 #define GEN4_SAMPLER_BORDER_COLOR_STATE_BorderColorRed_start  0
   184748 
   184749 static inline uint32_t ATTRIBUTE_PURE
   184750 SAMPLER_BORDER_COLOR_STATE_BorderColorRed_start(const struct gen_device_info *devinfo)
   184751 {
   184752    switch (devinfo->gen) {
   184753    case 10: return 0;
   184754    case 9: return 0;
   184755    case 8: return 0;
   184756    case 7:
   184757       if (devinfo->is_haswell) {
   184758          return 0;
   184759       } else {
   184760          return 0;
   184761       }
   184762    case 6: return 0;
   184763    case 5: return 0;
   184764    case 4:
   184765       if (devinfo->is_g4x) {
   184766          return 0;
   184767       } else {
   184768          return 0;
   184769       }
   184770    default:
   184771       unreachable("Invalid hardware generation");
   184772    }
   184773 }
   184774 
   184775 
   184776 
   184777 /* SAMPLER_BORDER_COLOR_STATE::Border Color Snorm16 Alpha */
   184778 
   184779 
   184780 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Alpha_bits  16
   184781 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Alpha_bits  16
   184782 
   184783 static inline uint32_t ATTRIBUTE_PURE
   184784 SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Alpha_bits(const struct gen_device_info *devinfo)
   184785 {
   184786    switch (devinfo->gen) {
   184787    case 10: return 0;
   184788    case 9: return 0;
   184789    case 8: return 0;
   184790    case 7:
   184791       if (devinfo->is_haswell) {
   184792          return 0;
   184793       } else {
   184794          return 0;
   184795       }
   184796    case 6: return 16;
   184797    case 5: return 16;
   184798    case 4:
   184799       if (devinfo->is_g4x) {
   184800          return 0;
   184801       } else {
   184802          return 0;
   184803       }
   184804    default:
   184805       unreachable("Invalid hardware generation");
   184806    }
   184807 }
   184808 
   184809 
   184810 
   184811 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Alpha_start  336
   184812 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Alpha_start  336
   184813 
   184814 static inline uint32_t ATTRIBUTE_PURE
   184815 SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Alpha_start(const struct gen_device_info *devinfo)
   184816 {
   184817    switch (devinfo->gen) {
   184818    case 10: return 0;
   184819    case 9: return 0;
   184820    case 8: return 0;
   184821    case 7:
   184822       if (devinfo->is_haswell) {
   184823          return 0;
   184824       } else {
   184825          return 0;
   184826       }
   184827    case 6: return 336;
   184828    case 5: return 336;
   184829    case 4:
   184830       if (devinfo->is_g4x) {
   184831          return 0;
   184832       } else {
   184833          return 0;
   184834       }
   184835    default:
   184836       unreachable("Invalid hardware generation");
   184837    }
   184838 }
   184839 
   184840 
   184841 
   184842 /* SAMPLER_BORDER_COLOR_STATE::Border Color Snorm16 Blue */
   184843 
   184844 
   184845 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Blue_bits  16
   184846 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Blue_bits  16
   184847 
   184848 static inline uint32_t ATTRIBUTE_PURE
   184849 SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Blue_bits(const struct gen_device_info *devinfo)
   184850 {
   184851    switch (devinfo->gen) {
   184852    case 10: return 0;
   184853    case 9: return 0;
   184854    case 8: return 0;
   184855    case 7:
   184856       if (devinfo->is_haswell) {
   184857          return 0;
   184858       } else {
   184859          return 0;
   184860       }
   184861    case 6: return 16;
   184862    case 5: return 16;
   184863    case 4:
   184864       if (devinfo->is_g4x) {
   184865          return 0;
   184866       } else {
   184867          return 0;
   184868       }
   184869    default:
   184870       unreachable("Invalid hardware generation");
   184871    }
   184872 }
   184873 
   184874 
   184875 
   184876 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Blue_start  320
   184877 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Blue_start  320
   184878 
   184879 static inline uint32_t ATTRIBUTE_PURE
   184880 SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Blue_start(const struct gen_device_info *devinfo)
   184881 {
   184882    switch (devinfo->gen) {
   184883    case 10: return 0;
   184884    case 9: return 0;
   184885    case 8: return 0;
   184886    case 7:
   184887       if (devinfo->is_haswell) {
   184888          return 0;
   184889       } else {
   184890          return 0;
   184891       }
   184892    case 6: return 320;
   184893    case 5: return 320;
   184894    case 4:
   184895       if (devinfo->is_g4x) {
   184896          return 0;
   184897       } else {
   184898          return 0;
   184899       }
   184900    default:
   184901       unreachable("Invalid hardware generation");
   184902    }
   184903 }
   184904 
   184905 
   184906 
   184907 /* SAMPLER_BORDER_COLOR_STATE::Border Color Snorm16 Green */
   184908 
   184909 
   184910 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Green_bits  16
   184911 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Green_bits  16
   184912 
   184913 static inline uint32_t ATTRIBUTE_PURE
   184914 SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Green_bits(const struct gen_device_info *devinfo)
   184915 {
   184916    switch (devinfo->gen) {
   184917    case 10: return 0;
   184918    case 9: return 0;
   184919    case 8: return 0;
   184920    case 7:
   184921       if (devinfo->is_haswell) {
   184922          return 0;
   184923       } else {
   184924          return 0;
   184925       }
   184926    case 6: return 16;
   184927    case 5: return 16;
   184928    case 4:
   184929       if (devinfo->is_g4x) {
   184930          return 0;
   184931       } else {
   184932          return 0;
   184933       }
   184934    default:
   184935       unreachable("Invalid hardware generation");
   184936    }
   184937 }
   184938 
   184939 
   184940 
   184941 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Green_start  304
   184942 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Green_start  304
   184943 
   184944 static inline uint32_t ATTRIBUTE_PURE
   184945 SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Green_start(const struct gen_device_info *devinfo)
   184946 {
   184947    switch (devinfo->gen) {
   184948    case 10: return 0;
   184949    case 9: return 0;
   184950    case 8: return 0;
   184951    case 7:
   184952       if (devinfo->is_haswell) {
   184953          return 0;
   184954       } else {
   184955          return 0;
   184956       }
   184957    case 6: return 304;
   184958    case 5: return 304;
   184959    case 4:
   184960       if (devinfo->is_g4x) {
   184961          return 0;
   184962       } else {
   184963          return 0;
   184964       }
   184965    default:
   184966       unreachable("Invalid hardware generation");
   184967    }
   184968 }
   184969 
   184970 
   184971 
   184972 /* SAMPLER_BORDER_COLOR_STATE::Border Color Snorm16 Red */
   184973 
   184974 
   184975 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Red_bits  16
   184976 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Red_bits  16
   184977 
   184978 static inline uint32_t ATTRIBUTE_PURE
   184979 SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Red_bits(const struct gen_device_info *devinfo)
   184980 {
   184981    switch (devinfo->gen) {
   184982    case 10: return 0;
   184983    case 9: return 0;
   184984    case 8: return 0;
   184985    case 7:
   184986       if (devinfo->is_haswell) {
   184987          return 0;
   184988       } else {
   184989          return 0;
   184990       }
   184991    case 6: return 16;
   184992    case 5: return 16;
   184993    case 4:
   184994       if (devinfo->is_g4x) {
   184995          return 0;
   184996       } else {
   184997          return 0;
   184998       }
   184999    default:
   185000       unreachable("Invalid hardware generation");
   185001    }
   185002 }
   185003 
   185004 
   185005 
   185006 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Red_start  288
   185007 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Red_start  288
   185008 
   185009 static inline uint32_t ATTRIBUTE_PURE
   185010 SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm16Red_start(const struct gen_device_info *devinfo)
   185011 {
   185012    switch (devinfo->gen) {
   185013    case 10: return 0;
   185014    case 9: return 0;
   185015    case 8: return 0;
   185016    case 7:
   185017       if (devinfo->is_haswell) {
   185018          return 0;
   185019       } else {
   185020          return 0;
   185021       }
   185022    case 6: return 288;
   185023    case 5: return 288;
   185024    case 4:
   185025       if (devinfo->is_g4x) {
   185026          return 0;
   185027       } else {
   185028          return 0;
   185029       }
   185030    default:
   185031       unreachable("Invalid hardware generation");
   185032    }
   185033 }
   185034 
   185035 
   185036 
   185037 /* SAMPLER_BORDER_COLOR_STATE::Border Color Snorm8 Alpha */
   185038 
   185039 
   185040 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Alpha_bits  8
   185041 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Alpha_bits  8
   185042 
   185043 static inline uint32_t ATTRIBUTE_PURE
   185044 SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Alpha_bits(const struct gen_device_info *devinfo)
   185045 {
   185046    switch (devinfo->gen) {
   185047    case 10: return 0;
   185048    case 9: return 0;
   185049    case 8: return 0;
   185050    case 7:
   185051       if (devinfo->is_haswell) {
   185052          return 0;
   185053       } else {
   185054          return 0;
   185055       }
   185056    case 6: return 8;
   185057    case 5: return 8;
   185058    case 4:
   185059       if (devinfo->is_g4x) {
   185060          return 0;
   185061       } else {
   185062          return 0;
   185063       }
   185064    default:
   185065       unreachable("Invalid hardware generation");
   185066    }
   185067 }
   185068 
   185069 
   185070 
   185071 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Alpha_start  376
   185072 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Alpha_start  376
   185073 
   185074 static inline uint32_t ATTRIBUTE_PURE
   185075 SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Alpha_start(const struct gen_device_info *devinfo)
   185076 {
   185077    switch (devinfo->gen) {
   185078    case 10: return 0;
   185079    case 9: return 0;
   185080    case 8: return 0;
   185081    case 7:
   185082       if (devinfo->is_haswell) {
   185083          return 0;
   185084       } else {
   185085          return 0;
   185086       }
   185087    case 6: return 376;
   185088    case 5: return 376;
   185089    case 4:
   185090       if (devinfo->is_g4x) {
   185091          return 0;
   185092       } else {
   185093          return 0;
   185094       }
   185095    default:
   185096       unreachable("Invalid hardware generation");
   185097    }
   185098 }
   185099 
   185100 
   185101 
   185102 /* SAMPLER_BORDER_COLOR_STATE::Border Color Snorm8 Blue */
   185103 
   185104 
   185105 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Blue_bits  8
   185106 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Blue_bits  8
   185107 
   185108 static inline uint32_t ATTRIBUTE_PURE
   185109 SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Blue_bits(const struct gen_device_info *devinfo)
   185110 {
   185111    switch (devinfo->gen) {
   185112    case 10: return 0;
   185113    case 9: return 0;
   185114    case 8: return 0;
   185115    case 7:
   185116       if (devinfo->is_haswell) {
   185117          return 0;
   185118       } else {
   185119          return 0;
   185120       }
   185121    case 6: return 8;
   185122    case 5: return 8;
   185123    case 4:
   185124       if (devinfo->is_g4x) {
   185125          return 0;
   185126       } else {
   185127          return 0;
   185128       }
   185129    default:
   185130       unreachable("Invalid hardware generation");
   185131    }
   185132 }
   185133 
   185134 
   185135 
   185136 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Blue_start  368
   185137 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Blue_start  368
   185138 
   185139 static inline uint32_t ATTRIBUTE_PURE
   185140 SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Blue_start(const struct gen_device_info *devinfo)
   185141 {
   185142    switch (devinfo->gen) {
   185143    case 10: return 0;
   185144    case 9: return 0;
   185145    case 8: return 0;
   185146    case 7:
   185147       if (devinfo->is_haswell) {
   185148          return 0;
   185149       } else {
   185150          return 0;
   185151       }
   185152    case 6: return 368;
   185153    case 5: return 368;
   185154    case 4:
   185155       if (devinfo->is_g4x) {
   185156          return 0;
   185157       } else {
   185158          return 0;
   185159       }
   185160    default:
   185161       unreachable("Invalid hardware generation");
   185162    }
   185163 }
   185164 
   185165 
   185166 
   185167 /* SAMPLER_BORDER_COLOR_STATE::Border Color Snorm8 Green */
   185168 
   185169 
   185170 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Green_bits  8
   185171 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Green_bits  8
   185172 
   185173 static inline uint32_t ATTRIBUTE_PURE
   185174 SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Green_bits(const struct gen_device_info *devinfo)
   185175 {
   185176    switch (devinfo->gen) {
   185177    case 10: return 0;
   185178    case 9: return 0;
   185179    case 8: return 0;
   185180    case 7:
   185181       if (devinfo->is_haswell) {
   185182          return 0;
   185183       } else {
   185184          return 0;
   185185       }
   185186    case 6: return 8;
   185187    case 5: return 8;
   185188    case 4:
   185189       if (devinfo->is_g4x) {
   185190          return 0;
   185191       } else {
   185192          return 0;
   185193       }
   185194    default:
   185195       unreachable("Invalid hardware generation");
   185196    }
   185197 }
   185198 
   185199 
   185200 
   185201 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Green_start  360
   185202 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Green_start  360
   185203 
   185204 static inline uint32_t ATTRIBUTE_PURE
   185205 SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Green_start(const struct gen_device_info *devinfo)
   185206 {
   185207    switch (devinfo->gen) {
   185208    case 10: return 0;
   185209    case 9: return 0;
   185210    case 8: return 0;
   185211    case 7:
   185212       if (devinfo->is_haswell) {
   185213          return 0;
   185214       } else {
   185215          return 0;
   185216       }
   185217    case 6: return 360;
   185218    case 5: return 360;
   185219    case 4:
   185220       if (devinfo->is_g4x) {
   185221          return 0;
   185222       } else {
   185223          return 0;
   185224       }
   185225    default:
   185226       unreachable("Invalid hardware generation");
   185227    }
   185228 }
   185229 
   185230 
   185231 
   185232 /* SAMPLER_BORDER_COLOR_STATE::Border Color Snorm8 Red */
   185233 
   185234 
   185235 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Red_bits  8
   185236 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Red_bits  8
   185237 
   185238 static inline uint32_t ATTRIBUTE_PURE
   185239 SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Red_bits(const struct gen_device_info *devinfo)
   185240 {
   185241    switch (devinfo->gen) {
   185242    case 10: return 0;
   185243    case 9: return 0;
   185244    case 8: return 0;
   185245    case 7:
   185246       if (devinfo->is_haswell) {
   185247          return 0;
   185248       } else {
   185249          return 0;
   185250       }
   185251    case 6: return 8;
   185252    case 5: return 8;
   185253    case 4:
   185254       if (devinfo->is_g4x) {
   185255          return 0;
   185256       } else {
   185257          return 0;
   185258       }
   185259    default:
   185260       unreachable("Invalid hardware generation");
   185261    }
   185262 }
   185263 
   185264 
   185265 
   185266 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Red_start  352
   185267 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Red_start  352
   185268 
   185269 static inline uint32_t ATTRIBUTE_PURE
   185270 SAMPLER_BORDER_COLOR_STATE_BorderColorSnorm8Red_start(const struct gen_device_info *devinfo)
   185271 {
   185272    switch (devinfo->gen) {
   185273    case 10: return 0;
   185274    case 9: return 0;
   185275    case 8: return 0;
   185276    case 7:
   185277       if (devinfo->is_haswell) {
   185278          return 0;
   185279       } else {
   185280          return 0;
   185281       }
   185282    case 6: return 352;
   185283    case 5: return 352;
   185284    case 4:
   185285       if (devinfo->is_g4x) {
   185286          return 0;
   185287       } else {
   185288          return 0;
   185289       }
   185290    default:
   185291       unreachable("Invalid hardware generation");
   185292    }
   185293 }
   185294 
   185295 
   185296 
   185297 /* SAMPLER_BORDER_COLOR_STATE::Border Color Unorm Alpha */
   185298 
   185299 
   185300 #define GEN7_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormAlpha_bits  8
   185301 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormAlpha_bits  8
   185302 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormAlpha_bits  8
   185303 
   185304 static inline uint32_t ATTRIBUTE_PURE
   185305 SAMPLER_BORDER_COLOR_STATE_BorderColorUnormAlpha_bits(const struct gen_device_info *devinfo)
   185306 {
   185307    switch (devinfo->gen) {
   185308    case 10: return 0;
   185309    case 9: return 0;
   185310    case 8: return 0;
   185311    case 7:
   185312       if (devinfo->is_haswell) {
   185313          return 0;
   185314       } else {
   185315          return 8;
   185316       }
   185317    case 6: return 8;
   185318    case 5: return 8;
   185319    case 4:
   185320       if (devinfo->is_g4x) {
   185321          return 0;
   185322       } else {
   185323          return 0;
   185324       }
   185325    default:
   185326       unreachable("Invalid hardware generation");
   185327    }
   185328 }
   185329 
   185330 
   185331 
   185332 #define GEN7_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormAlpha_start  24
   185333 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormAlpha_start  24
   185334 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormAlpha_start  24
   185335 
   185336 static inline uint32_t ATTRIBUTE_PURE
   185337 SAMPLER_BORDER_COLOR_STATE_BorderColorUnormAlpha_start(const struct gen_device_info *devinfo)
   185338 {
   185339    switch (devinfo->gen) {
   185340    case 10: return 0;
   185341    case 9: return 0;
   185342    case 8: return 0;
   185343    case 7:
   185344       if (devinfo->is_haswell) {
   185345          return 0;
   185346       } else {
   185347          return 24;
   185348       }
   185349    case 6: return 24;
   185350    case 5: return 24;
   185351    case 4:
   185352       if (devinfo->is_g4x) {
   185353          return 0;
   185354       } else {
   185355          return 0;
   185356       }
   185357    default:
   185358       unreachable("Invalid hardware generation");
   185359    }
   185360 }
   185361 
   185362 
   185363 
   185364 /* SAMPLER_BORDER_COLOR_STATE::Border Color Unorm Blue */
   185365 
   185366 
   185367 #define GEN7_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormBlue_bits  8
   185368 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormBlue_bits  8
   185369 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormBlue_bits  8
   185370 
   185371 static inline uint32_t ATTRIBUTE_PURE
   185372 SAMPLER_BORDER_COLOR_STATE_BorderColorUnormBlue_bits(const struct gen_device_info *devinfo)
   185373 {
   185374    switch (devinfo->gen) {
   185375    case 10: return 0;
   185376    case 9: return 0;
   185377    case 8: return 0;
   185378    case 7:
   185379       if (devinfo->is_haswell) {
   185380          return 0;
   185381       } else {
   185382          return 8;
   185383       }
   185384    case 6: return 8;
   185385    case 5: return 8;
   185386    case 4:
   185387       if (devinfo->is_g4x) {
   185388          return 0;
   185389       } else {
   185390          return 0;
   185391       }
   185392    default:
   185393       unreachable("Invalid hardware generation");
   185394    }
   185395 }
   185396 
   185397 
   185398 
   185399 #define GEN7_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormBlue_start  16
   185400 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormBlue_start  16
   185401 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormBlue_start  16
   185402 
   185403 static inline uint32_t ATTRIBUTE_PURE
   185404 SAMPLER_BORDER_COLOR_STATE_BorderColorUnormBlue_start(const struct gen_device_info *devinfo)
   185405 {
   185406    switch (devinfo->gen) {
   185407    case 10: return 0;
   185408    case 9: return 0;
   185409    case 8: return 0;
   185410    case 7:
   185411       if (devinfo->is_haswell) {
   185412          return 0;
   185413       } else {
   185414          return 16;
   185415       }
   185416    case 6: return 16;
   185417    case 5: return 16;
   185418    case 4:
   185419       if (devinfo->is_g4x) {
   185420          return 0;
   185421       } else {
   185422          return 0;
   185423       }
   185424    default:
   185425       unreachable("Invalid hardware generation");
   185426    }
   185427 }
   185428 
   185429 
   185430 
   185431 /* SAMPLER_BORDER_COLOR_STATE::Border Color Unorm Green */
   185432 
   185433 
   185434 #define GEN7_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormGreen_bits  8
   185435 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormGreen_bits  8
   185436 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormGreen_bits  8
   185437 
   185438 static inline uint32_t ATTRIBUTE_PURE
   185439 SAMPLER_BORDER_COLOR_STATE_BorderColorUnormGreen_bits(const struct gen_device_info *devinfo)
   185440 {
   185441    switch (devinfo->gen) {
   185442    case 10: return 0;
   185443    case 9: return 0;
   185444    case 8: return 0;
   185445    case 7:
   185446       if (devinfo->is_haswell) {
   185447          return 0;
   185448       } else {
   185449          return 8;
   185450       }
   185451    case 6: return 8;
   185452    case 5: return 8;
   185453    case 4:
   185454       if (devinfo->is_g4x) {
   185455          return 0;
   185456       } else {
   185457          return 0;
   185458       }
   185459    default:
   185460       unreachable("Invalid hardware generation");
   185461    }
   185462 }
   185463 
   185464 
   185465 
   185466 #define GEN7_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormGreen_start  8
   185467 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormGreen_start  8
   185468 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormGreen_start  8
   185469 
   185470 static inline uint32_t ATTRIBUTE_PURE
   185471 SAMPLER_BORDER_COLOR_STATE_BorderColorUnormGreen_start(const struct gen_device_info *devinfo)
   185472 {
   185473    switch (devinfo->gen) {
   185474    case 10: return 0;
   185475    case 9: return 0;
   185476    case 8: return 0;
   185477    case 7:
   185478       if (devinfo->is_haswell) {
   185479          return 0;
   185480       } else {
   185481          return 8;
   185482       }
   185483    case 6: return 8;
   185484    case 5: return 8;
   185485    case 4:
   185486       if (devinfo->is_g4x) {
   185487          return 0;
   185488       } else {
   185489          return 0;
   185490       }
   185491    default:
   185492       unreachable("Invalid hardware generation");
   185493    }
   185494 }
   185495 
   185496 
   185497 
   185498 /* SAMPLER_BORDER_COLOR_STATE::Border Color Unorm Red */
   185499 
   185500 
   185501 #define GEN7_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormRed_bits  8
   185502 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormRed_bits  8
   185503 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormRed_bits  8
   185504 
   185505 static inline uint32_t ATTRIBUTE_PURE
   185506 SAMPLER_BORDER_COLOR_STATE_BorderColorUnormRed_bits(const struct gen_device_info *devinfo)
   185507 {
   185508    switch (devinfo->gen) {
   185509    case 10: return 0;
   185510    case 9: return 0;
   185511    case 8: return 0;
   185512    case 7:
   185513       if (devinfo->is_haswell) {
   185514          return 0;
   185515       } else {
   185516          return 8;
   185517       }
   185518    case 6: return 8;
   185519    case 5: return 8;
   185520    case 4:
   185521       if (devinfo->is_g4x) {
   185522          return 0;
   185523       } else {
   185524          return 0;
   185525       }
   185526    default:
   185527       unreachable("Invalid hardware generation");
   185528    }
   185529 }
   185530 
   185531 
   185532 
   185533 #define GEN7_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormRed_start  0
   185534 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormRed_start  0
   185535 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorUnormRed_start  0
   185536 
   185537 static inline uint32_t ATTRIBUTE_PURE
   185538 SAMPLER_BORDER_COLOR_STATE_BorderColorUnormRed_start(const struct gen_device_info *devinfo)
   185539 {
   185540    switch (devinfo->gen) {
   185541    case 10: return 0;
   185542    case 9: return 0;
   185543    case 8: return 0;
   185544    case 7:
   185545       if (devinfo->is_haswell) {
   185546          return 0;
   185547       } else {
   185548          return 0;
   185549       }
   185550    case 6: return 0;
   185551    case 5: return 0;
   185552    case 4:
   185553       if (devinfo->is_g4x) {
   185554          return 0;
   185555       } else {
   185556          return 0;
   185557       }
   185558    default:
   185559       unreachable("Invalid hardware generation");
   185560    }
   185561 }
   185562 
   185563 
   185564 
   185565 /* SAMPLER_BORDER_COLOR_STATE::Border Color Unorm16 Alpha */
   185566 
   185567 
   185568 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Alpha_bits  16
   185569 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Alpha_bits  16
   185570 
   185571 static inline uint32_t ATTRIBUTE_PURE
   185572 SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Alpha_bits(const struct gen_device_info *devinfo)
   185573 {
   185574    switch (devinfo->gen) {
   185575    case 10: return 0;
   185576    case 9: return 0;
   185577    case 8: return 0;
   185578    case 7:
   185579       if (devinfo->is_haswell) {
   185580          return 0;
   185581       } else {
   185582          return 0;
   185583       }
   185584    case 6: return 16;
   185585    case 5: return 16;
   185586    case 4:
   185587       if (devinfo->is_g4x) {
   185588          return 0;
   185589       } else {
   185590          return 0;
   185591       }
   185592    default:
   185593       unreachable("Invalid hardware generation");
   185594    }
   185595 }
   185596 
   185597 
   185598 
   185599 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Alpha_start  272
   185600 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Alpha_start  272
   185601 
   185602 static inline uint32_t ATTRIBUTE_PURE
   185603 SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Alpha_start(const struct gen_device_info *devinfo)
   185604 {
   185605    switch (devinfo->gen) {
   185606    case 10: return 0;
   185607    case 9: return 0;
   185608    case 8: return 0;
   185609    case 7:
   185610       if (devinfo->is_haswell) {
   185611          return 0;
   185612       } else {
   185613          return 0;
   185614       }
   185615    case 6: return 272;
   185616    case 5: return 272;
   185617    case 4:
   185618       if (devinfo->is_g4x) {
   185619          return 0;
   185620       } else {
   185621          return 0;
   185622       }
   185623    default:
   185624       unreachable("Invalid hardware generation");
   185625    }
   185626 }
   185627 
   185628 
   185629 
   185630 /* SAMPLER_BORDER_COLOR_STATE::Border Color Unorm16 Blue */
   185631 
   185632 
   185633 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Blue_bits  16
   185634 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Blue_bits  16
   185635 
   185636 static inline uint32_t ATTRIBUTE_PURE
   185637 SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Blue_bits(const struct gen_device_info *devinfo)
   185638 {
   185639    switch (devinfo->gen) {
   185640    case 10: return 0;
   185641    case 9: return 0;
   185642    case 8: return 0;
   185643    case 7:
   185644       if (devinfo->is_haswell) {
   185645          return 0;
   185646       } else {
   185647          return 0;
   185648       }
   185649    case 6: return 16;
   185650    case 5: return 16;
   185651    case 4:
   185652       if (devinfo->is_g4x) {
   185653          return 0;
   185654       } else {
   185655          return 0;
   185656       }
   185657    default:
   185658       unreachable("Invalid hardware generation");
   185659    }
   185660 }
   185661 
   185662 
   185663 
   185664 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Blue_start  256
   185665 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Blue_start  256
   185666 
   185667 static inline uint32_t ATTRIBUTE_PURE
   185668 SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Blue_start(const struct gen_device_info *devinfo)
   185669 {
   185670    switch (devinfo->gen) {
   185671    case 10: return 0;
   185672    case 9: return 0;
   185673    case 8: return 0;
   185674    case 7:
   185675       if (devinfo->is_haswell) {
   185676          return 0;
   185677       } else {
   185678          return 0;
   185679       }
   185680    case 6: return 256;
   185681    case 5: return 256;
   185682    case 4:
   185683       if (devinfo->is_g4x) {
   185684          return 0;
   185685       } else {
   185686          return 0;
   185687       }
   185688    default:
   185689       unreachable("Invalid hardware generation");
   185690    }
   185691 }
   185692 
   185693 
   185694 
   185695 /* SAMPLER_BORDER_COLOR_STATE::Border Color Unorm16 Green */
   185696 
   185697 
   185698 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Green_bits  16
   185699 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Green_bits  16
   185700 
   185701 static inline uint32_t ATTRIBUTE_PURE
   185702 SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Green_bits(const struct gen_device_info *devinfo)
   185703 {
   185704    switch (devinfo->gen) {
   185705    case 10: return 0;
   185706    case 9: return 0;
   185707    case 8: return 0;
   185708    case 7:
   185709       if (devinfo->is_haswell) {
   185710          return 0;
   185711       } else {
   185712          return 0;
   185713       }
   185714    case 6: return 16;
   185715    case 5: return 16;
   185716    case 4:
   185717       if (devinfo->is_g4x) {
   185718          return 0;
   185719       } else {
   185720          return 0;
   185721       }
   185722    default:
   185723       unreachable("Invalid hardware generation");
   185724    }
   185725 }
   185726 
   185727 
   185728 
   185729 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Green_start  240
   185730 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Green_start  240
   185731 
   185732 static inline uint32_t ATTRIBUTE_PURE
   185733 SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Green_start(const struct gen_device_info *devinfo)
   185734 {
   185735    switch (devinfo->gen) {
   185736    case 10: return 0;
   185737    case 9: return 0;
   185738    case 8: return 0;
   185739    case 7:
   185740       if (devinfo->is_haswell) {
   185741          return 0;
   185742       } else {
   185743          return 0;
   185744       }
   185745    case 6: return 240;
   185746    case 5: return 240;
   185747    case 4:
   185748       if (devinfo->is_g4x) {
   185749          return 0;
   185750       } else {
   185751          return 0;
   185752       }
   185753    default:
   185754       unreachable("Invalid hardware generation");
   185755    }
   185756 }
   185757 
   185758 
   185759 
   185760 /* SAMPLER_BORDER_COLOR_STATE::Border Color Unorm16 Red */
   185761 
   185762 
   185763 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Red_bits  16
   185764 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Red_bits  16
   185765 
   185766 static inline uint32_t ATTRIBUTE_PURE
   185767 SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Red_bits(const struct gen_device_info *devinfo)
   185768 {
   185769    switch (devinfo->gen) {
   185770    case 10: return 0;
   185771    case 9: return 0;
   185772    case 8: return 0;
   185773    case 7:
   185774       if (devinfo->is_haswell) {
   185775          return 0;
   185776       } else {
   185777          return 0;
   185778       }
   185779    case 6: return 16;
   185780    case 5: return 16;
   185781    case 4:
   185782       if (devinfo->is_g4x) {
   185783          return 0;
   185784       } else {
   185785          return 0;
   185786       }
   185787    default:
   185788       unreachable("Invalid hardware generation");
   185789    }
   185790 }
   185791 
   185792 
   185793 
   185794 #define GEN6_SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Red_start  224
   185795 #define GEN5_SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Red_start  224
   185796 
   185797 static inline uint32_t ATTRIBUTE_PURE
   185798 SAMPLER_BORDER_COLOR_STATE_BorderColorUnorm16Red_start(const struct gen_device_info *devinfo)
   185799 {
   185800    switch (devinfo->gen) {
   185801    case 10: return 0;
   185802    case 9: return 0;
   185803    case 8: return 0;
   185804    case 7:
   185805       if (devinfo->is_haswell) {
   185806          return 0;
   185807       } else {
   185808          return 0;
   185809       }
   185810    case 6: return 224;
   185811    case 5: return 224;
   185812    case 4:
   185813       if (devinfo->is_g4x) {
   185814          return 0;
   185815       } else {
   185816          return 0;
   185817       }
   185818    default:
   185819       unreachable("Invalid hardware generation");
   185820    }
   185821 }
   185822 
   185823 
   185824 
   185825 /* SAMPLER_INDIRECT_STATE_BORDER_COLOR */
   185826 
   185827 
   185828 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_length  4
   185829 
   185830 static inline uint32_t ATTRIBUTE_PURE
   185831 SAMPLER_INDIRECT_STATE_BORDER_COLOR_length(const struct gen_device_info *devinfo)
   185832 {
   185833    switch (devinfo->gen) {
   185834    case 10: return 4;
   185835    case 9: return 0;
   185836    case 8: return 0;
   185837    case 7:
   185838       if (devinfo->is_haswell) {
   185839          return 0;
   185840       } else {
   185841          return 0;
   185842       }
   185843    case 6: return 0;
   185844    case 5: return 0;
   185845    case 4:
   185846       if (devinfo->is_g4x) {
   185847          return 0;
   185848       } else {
   185849          return 0;
   185850       }
   185851    default:
   185852       unreachable("Invalid hardware generation");
   185853    }
   185854 }
   185855 
   185856 
   185857 
   185858 /* SAMPLER_INDIRECT_STATE_BORDER_COLOR::Border Color Alpha As Float */
   185859 
   185860 
   185861 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorAlphaAsFloat_bits  32
   185862 
   185863 static inline uint32_t ATTRIBUTE_PURE
   185864 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorAlphaAsFloat_bits(const struct gen_device_info *devinfo)
   185865 {
   185866    switch (devinfo->gen) {
   185867    case 10: return 32;
   185868    case 9: return 0;
   185869    case 8: return 0;
   185870    case 7:
   185871       if (devinfo->is_haswell) {
   185872          return 0;
   185873       } else {
   185874          return 0;
   185875       }
   185876    case 6: return 0;
   185877    case 5: return 0;
   185878    case 4:
   185879       if (devinfo->is_g4x) {
   185880          return 0;
   185881       } else {
   185882          return 0;
   185883       }
   185884    default:
   185885       unreachable("Invalid hardware generation");
   185886    }
   185887 }
   185888 
   185889 
   185890 
   185891 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorAlphaAsFloat_start  96
   185892 
   185893 static inline uint32_t ATTRIBUTE_PURE
   185894 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorAlphaAsFloat_start(const struct gen_device_info *devinfo)
   185895 {
   185896    switch (devinfo->gen) {
   185897    case 10: return 96;
   185898    case 9: return 0;
   185899    case 8: return 0;
   185900    case 7:
   185901       if (devinfo->is_haswell) {
   185902          return 0;
   185903       } else {
   185904          return 0;
   185905       }
   185906    case 6: return 0;
   185907    case 5: return 0;
   185908    case 4:
   185909       if (devinfo->is_g4x) {
   185910          return 0;
   185911       } else {
   185912          return 0;
   185913       }
   185914    default:
   185915       unreachable("Invalid hardware generation");
   185916    }
   185917 }
   185918 
   185919 
   185920 
   185921 /* SAMPLER_INDIRECT_STATE_BORDER_COLOR::Border Color Alpha As S31 */
   185922 
   185923 
   185924 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorAlphaAsS31_bits  32
   185925 
   185926 static inline uint32_t ATTRIBUTE_PURE
   185927 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorAlphaAsS31_bits(const struct gen_device_info *devinfo)
   185928 {
   185929    switch (devinfo->gen) {
   185930    case 10: return 32;
   185931    case 9: return 0;
   185932    case 8: return 0;
   185933    case 7:
   185934       if (devinfo->is_haswell) {
   185935          return 0;
   185936       } else {
   185937          return 0;
   185938       }
   185939    case 6: return 0;
   185940    case 5: return 0;
   185941    case 4:
   185942       if (devinfo->is_g4x) {
   185943          return 0;
   185944       } else {
   185945          return 0;
   185946       }
   185947    default:
   185948       unreachable("Invalid hardware generation");
   185949    }
   185950 }
   185951 
   185952 
   185953 
   185954 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorAlphaAsS31_start  96
   185955 
   185956 static inline uint32_t ATTRIBUTE_PURE
   185957 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorAlphaAsS31_start(const struct gen_device_info *devinfo)
   185958 {
   185959    switch (devinfo->gen) {
   185960    case 10: return 96;
   185961    case 9: return 0;
   185962    case 8: return 0;
   185963    case 7:
   185964       if (devinfo->is_haswell) {
   185965          return 0;
   185966       } else {
   185967          return 0;
   185968       }
   185969    case 6: return 0;
   185970    case 5: return 0;
   185971    case 4:
   185972       if (devinfo->is_g4x) {
   185973          return 0;
   185974       } else {
   185975          return 0;
   185976       }
   185977    default:
   185978       unreachable("Invalid hardware generation");
   185979    }
   185980 }
   185981 
   185982 
   185983 
   185984 /* SAMPLER_INDIRECT_STATE_BORDER_COLOR::Border Color Alpha As U32 */
   185985 
   185986 
   185987 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorAlphaAsU32_bits  32
   185988 
   185989 static inline uint32_t ATTRIBUTE_PURE
   185990 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorAlphaAsU32_bits(const struct gen_device_info *devinfo)
   185991 {
   185992    switch (devinfo->gen) {
   185993    case 10: return 32;
   185994    case 9: return 0;
   185995    case 8: return 0;
   185996    case 7:
   185997       if (devinfo->is_haswell) {
   185998          return 0;
   185999       } else {
   186000          return 0;
   186001       }
   186002    case 6: return 0;
   186003    case 5: return 0;
   186004    case 4:
   186005       if (devinfo->is_g4x) {
   186006          return 0;
   186007       } else {
   186008          return 0;
   186009       }
   186010    default:
   186011       unreachable("Invalid hardware generation");
   186012    }
   186013 }
   186014 
   186015 
   186016 
   186017 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorAlphaAsU32_start  96
   186018 
   186019 static inline uint32_t ATTRIBUTE_PURE
   186020 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorAlphaAsU32_start(const struct gen_device_info *devinfo)
   186021 {
   186022    switch (devinfo->gen) {
   186023    case 10: return 96;
   186024    case 9: return 0;
   186025    case 8: return 0;
   186026    case 7:
   186027       if (devinfo->is_haswell) {
   186028          return 0;
   186029       } else {
   186030          return 0;
   186031       }
   186032    case 6: return 0;
   186033    case 5: return 0;
   186034    case 4:
   186035       if (devinfo->is_g4x) {
   186036          return 0;
   186037       } else {
   186038          return 0;
   186039       }
   186040    default:
   186041       unreachable("Invalid hardware generation");
   186042    }
   186043 }
   186044 
   186045 
   186046 
   186047 /* SAMPLER_INDIRECT_STATE_BORDER_COLOR::Border Color Alpha As U8 */
   186048 
   186049 
   186050 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorAlphaAsU8_bits  8
   186051 
   186052 static inline uint32_t ATTRIBUTE_PURE
   186053 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorAlphaAsU8_bits(const struct gen_device_info *devinfo)
   186054 {
   186055    switch (devinfo->gen) {
   186056    case 10: return 8;
   186057    case 9: return 0;
   186058    case 8: return 0;
   186059    case 7:
   186060       if (devinfo->is_haswell) {
   186061          return 0;
   186062       } else {
   186063          return 0;
   186064       }
   186065    case 6: return 0;
   186066    case 5: return 0;
   186067    case 4:
   186068       if (devinfo->is_g4x) {
   186069          return 0;
   186070       } else {
   186071          return 0;
   186072       }
   186073    default:
   186074       unreachable("Invalid hardware generation");
   186075    }
   186076 }
   186077 
   186078 
   186079 
   186080 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorAlphaAsU8_start  24
   186081 
   186082 static inline uint32_t ATTRIBUTE_PURE
   186083 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorAlphaAsU8_start(const struct gen_device_info *devinfo)
   186084 {
   186085    switch (devinfo->gen) {
   186086    case 10: return 24;
   186087    case 9: return 0;
   186088    case 8: return 0;
   186089    case 7:
   186090       if (devinfo->is_haswell) {
   186091          return 0;
   186092       } else {
   186093          return 0;
   186094       }
   186095    case 6: return 0;
   186096    case 5: return 0;
   186097    case 4:
   186098       if (devinfo->is_g4x) {
   186099          return 0;
   186100       } else {
   186101          return 0;
   186102       }
   186103    default:
   186104       unreachable("Invalid hardware generation");
   186105    }
   186106 }
   186107 
   186108 
   186109 
   186110 /* SAMPLER_INDIRECT_STATE_BORDER_COLOR::Border Color Blue As Float */
   186111 
   186112 
   186113 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorBlueAsFloat_bits  32
   186114 
   186115 static inline uint32_t ATTRIBUTE_PURE
   186116 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorBlueAsFloat_bits(const struct gen_device_info *devinfo)
   186117 {
   186118    switch (devinfo->gen) {
   186119    case 10: return 32;
   186120    case 9: return 0;
   186121    case 8: return 0;
   186122    case 7:
   186123       if (devinfo->is_haswell) {
   186124          return 0;
   186125       } else {
   186126          return 0;
   186127       }
   186128    case 6: return 0;
   186129    case 5: return 0;
   186130    case 4:
   186131       if (devinfo->is_g4x) {
   186132          return 0;
   186133       } else {
   186134          return 0;
   186135       }
   186136    default:
   186137       unreachable("Invalid hardware generation");
   186138    }
   186139 }
   186140 
   186141 
   186142 
   186143 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorBlueAsFloat_start  64
   186144 
   186145 static inline uint32_t ATTRIBUTE_PURE
   186146 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorBlueAsFloat_start(const struct gen_device_info *devinfo)
   186147 {
   186148    switch (devinfo->gen) {
   186149    case 10: return 64;
   186150    case 9: return 0;
   186151    case 8: return 0;
   186152    case 7:
   186153       if (devinfo->is_haswell) {
   186154          return 0;
   186155       } else {
   186156          return 0;
   186157       }
   186158    case 6: return 0;
   186159    case 5: return 0;
   186160    case 4:
   186161       if (devinfo->is_g4x) {
   186162          return 0;
   186163       } else {
   186164          return 0;
   186165       }
   186166    default:
   186167       unreachable("Invalid hardware generation");
   186168    }
   186169 }
   186170 
   186171 
   186172 
   186173 /* SAMPLER_INDIRECT_STATE_BORDER_COLOR::Border Color Blue As S31 */
   186174 
   186175 
   186176 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorBlueAsS31_bits  32
   186177 
   186178 static inline uint32_t ATTRIBUTE_PURE
   186179 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorBlueAsS31_bits(const struct gen_device_info *devinfo)
   186180 {
   186181    switch (devinfo->gen) {
   186182    case 10: return 32;
   186183    case 9: return 0;
   186184    case 8: return 0;
   186185    case 7:
   186186       if (devinfo->is_haswell) {
   186187          return 0;
   186188       } else {
   186189          return 0;
   186190       }
   186191    case 6: return 0;
   186192    case 5: return 0;
   186193    case 4:
   186194       if (devinfo->is_g4x) {
   186195          return 0;
   186196       } else {
   186197          return 0;
   186198       }
   186199    default:
   186200       unreachable("Invalid hardware generation");
   186201    }
   186202 }
   186203 
   186204 
   186205 
   186206 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorBlueAsS31_start  64
   186207 
   186208 static inline uint32_t ATTRIBUTE_PURE
   186209 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorBlueAsS31_start(const struct gen_device_info *devinfo)
   186210 {
   186211    switch (devinfo->gen) {
   186212    case 10: return 64;
   186213    case 9: return 0;
   186214    case 8: return 0;
   186215    case 7:
   186216       if (devinfo->is_haswell) {
   186217          return 0;
   186218       } else {
   186219          return 0;
   186220       }
   186221    case 6: return 0;
   186222    case 5: return 0;
   186223    case 4:
   186224       if (devinfo->is_g4x) {
   186225          return 0;
   186226       } else {
   186227          return 0;
   186228       }
   186229    default:
   186230       unreachable("Invalid hardware generation");
   186231    }
   186232 }
   186233 
   186234 
   186235 
   186236 /* SAMPLER_INDIRECT_STATE_BORDER_COLOR::Border Color Blue As U32 */
   186237 
   186238 
   186239 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorBlueAsU32_bits  32
   186240 
   186241 static inline uint32_t ATTRIBUTE_PURE
   186242 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorBlueAsU32_bits(const struct gen_device_info *devinfo)
   186243 {
   186244    switch (devinfo->gen) {
   186245    case 10: return 32;
   186246    case 9: return 0;
   186247    case 8: return 0;
   186248    case 7:
   186249       if (devinfo->is_haswell) {
   186250          return 0;
   186251       } else {
   186252          return 0;
   186253       }
   186254    case 6: return 0;
   186255    case 5: return 0;
   186256    case 4:
   186257       if (devinfo->is_g4x) {
   186258          return 0;
   186259       } else {
   186260          return 0;
   186261       }
   186262    default:
   186263       unreachable("Invalid hardware generation");
   186264    }
   186265 }
   186266 
   186267 
   186268 
   186269 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorBlueAsU32_start  64
   186270 
   186271 static inline uint32_t ATTRIBUTE_PURE
   186272 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorBlueAsU32_start(const struct gen_device_info *devinfo)
   186273 {
   186274    switch (devinfo->gen) {
   186275    case 10: return 64;
   186276    case 9: return 0;
   186277    case 8: return 0;
   186278    case 7:
   186279       if (devinfo->is_haswell) {
   186280          return 0;
   186281       } else {
   186282          return 0;
   186283       }
   186284    case 6: return 0;
   186285    case 5: return 0;
   186286    case 4:
   186287       if (devinfo->is_g4x) {
   186288          return 0;
   186289       } else {
   186290          return 0;
   186291       }
   186292    default:
   186293       unreachable("Invalid hardware generation");
   186294    }
   186295 }
   186296 
   186297 
   186298 
   186299 /* SAMPLER_INDIRECT_STATE_BORDER_COLOR::Border Color Blue As U8 */
   186300 
   186301 
   186302 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorBlueAsU8_bits  8
   186303 
   186304 static inline uint32_t ATTRIBUTE_PURE
   186305 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorBlueAsU8_bits(const struct gen_device_info *devinfo)
   186306 {
   186307    switch (devinfo->gen) {
   186308    case 10: return 8;
   186309    case 9: return 0;
   186310    case 8: return 0;
   186311    case 7:
   186312       if (devinfo->is_haswell) {
   186313          return 0;
   186314       } else {
   186315          return 0;
   186316       }
   186317    case 6: return 0;
   186318    case 5: return 0;
   186319    case 4:
   186320       if (devinfo->is_g4x) {
   186321          return 0;
   186322       } else {
   186323          return 0;
   186324       }
   186325    default:
   186326       unreachable("Invalid hardware generation");
   186327    }
   186328 }
   186329 
   186330 
   186331 
   186332 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorBlueAsU8_start  16
   186333 
   186334 static inline uint32_t ATTRIBUTE_PURE
   186335 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorBlueAsU8_start(const struct gen_device_info *devinfo)
   186336 {
   186337    switch (devinfo->gen) {
   186338    case 10: return 16;
   186339    case 9: return 0;
   186340    case 8: return 0;
   186341    case 7:
   186342       if (devinfo->is_haswell) {
   186343          return 0;
   186344       } else {
   186345          return 0;
   186346       }
   186347    case 6: return 0;
   186348    case 5: return 0;
   186349    case 4:
   186350       if (devinfo->is_g4x) {
   186351          return 0;
   186352       } else {
   186353          return 0;
   186354       }
   186355    default:
   186356       unreachable("Invalid hardware generation");
   186357    }
   186358 }
   186359 
   186360 
   186361 
   186362 /* SAMPLER_INDIRECT_STATE_BORDER_COLOR::Border Color Green As Float */
   186363 
   186364 
   186365 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorGreenAsFloat_bits  32
   186366 
   186367 static inline uint32_t ATTRIBUTE_PURE
   186368 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorGreenAsFloat_bits(const struct gen_device_info *devinfo)
   186369 {
   186370    switch (devinfo->gen) {
   186371    case 10: return 32;
   186372    case 9: return 0;
   186373    case 8: return 0;
   186374    case 7:
   186375       if (devinfo->is_haswell) {
   186376          return 0;
   186377       } else {
   186378          return 0;
   186379       }
   186380    case 6: return 0;
   186381    case 5: return 0;
   186382    case 4:
   186383       if (devinfo->is_g4x) {
   186384          return 0;
   186385       } else {
   186386          return 0;
   186387       }
   186388    default:
   186389       unreachable("Invalid hardware generation");
   186390    }
   186391 }
   186392 
   186393 
   186394 
   186395 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorGreenAsFloat_start  32
   186396 
   186397 static inline uint32_t ATTRIBUTE_PURE
   186398 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorGreenAsFloat_start(const struct gen_device_info *devinfo)
   186399 {
   186400    switch (devinfo->gen) {
   186401    case 10: return 32;
   186402    case 9: return 0;
   186403    case 8: return 0;
   186404    case 7:
   186405       if (devinfo->is_haswell) {
   186406          return 0;
   186407       } else {
   186408          return 0;
   186409       }
   186410    case 6: return 0;
   186411    case 5: return 0;
   186412    case 4:
   186413       if (devinfo->is_g4x) {
   186414          return 0;
   186415       } else {
   186416          return 0;
   186417       }
   186418    default:
   186419       unreachable("Invalid hardware generation");
   186420    }
   186421 }
   186422 
   186423 
   186424 
   186425 /* SAMPLER_INDIRECT_STATE_BORDER_COLOR::Border Color Green As S31 */
   186426 
   186427 
   186428 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorGreenAsS31_bits  32
   186429 
   186430 static inline uint32_t ATTRIBUTE_PURE
   186431 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorGreenAsS31_bits(const struct gen_device_info *devinfo)
   186432 {
   186433    switch (devinfo->gen) {
   186434    case 10: return 32;
   186435    case 9: return 0;
   186436    case 8: return 0;
   186437    case 7:
   186438       if (devinfo->is_haswell) {
   186439          return 0;
   186440       } else {
   186441          return 0;
   186442       }
   186443    case 6: return 0;
   186444    case 5: return 0;
   186445    case 4:
   186446       if (devinfo->is_g4x) {
   186447          return 0;
   186448       } else {
   186449          return 0;
   186450       }
   186451    default:
   186452       unreachable("Invalid hardware generation");
   186453    }
   186454 }
   186455 
   186456 
   186457 
   186458 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorGreenAsS31_start  32
   186459 
   186460 static inline uint32_t ATTRIBUTE_PURE
   186461 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorGreenAsS31_start(const struct gen_device_info *devinfo)
   186462 {
   186463    switch (devinfo->gen) {
   186464    case 10: return 32;
   186465    case 9: return 0;
   186466    case 8: return 0;
   186467    case 7:
   186468       if (devinfo->is_haswell) {
   186469          return 0;
   186470       } else {
   186471          return 0;
   186472       }
   186473    case 6: return 0;
   186474    case 5: return 0;
   186475    case 4:
   186476       if (devinfo->is_g4x) {
   186477          return 0;
   186478       } else {
   186479          return 0;
   186480       }
   186481    default:
   186482       unreachable("Invalid hardware generation");
   186483    }
   186484 }
   186485 
   186486 
   186487 
   186488 /* SAMPLER_INDIRECT_STATE_BORDER_COLOR::Border Color Green As U32 */
   186489 
   186490 
   186491 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorGreenAsU32_bits  32
   186492 
   186493 static inline uint32_t ATTRIBUTE_PURE
   186494 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorGreenAsU32_bits(const struct gen_device_info *devinfo)
   186495 {
   186496    switch (devinfo->gen) {
   186497    case 10: return 32;
   186498    case 9: return 0;
   186499    case 8: return 0;
   186500    case 7:
   186501       if (devinfo->is_haswell) {
   186502          return 0;
   186503       } else {
   186504          return 0;
   186505       }
   186506    case 6: return 0;
   186507    case 5: return 0;
   186508    case 4:
   186509       if (devinfo->is_g4x) {
   186510          return 0;
   186511       } else {
   186512          return 0;
   186513       }
   186514    default:
   186515       unreachable("Invalid hardware generation");
   186516    }
   186517 }
   186518 
   186519 
   186520 
   186521 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorGreenAsU32_start  32
   186522 
   186523 static inline uint32_t ATTRIBUTE_PURE
   186524 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorGreenAsU32_start(const struct gen_device_info *devinfo)
   186525 {
   186526    switch (devinfo->gen) {
   186527    case 10: return 32;
   186528    case 9: return 0;
   186529    case 8: return 0;
   186530    case 7:
   186531       if (devinfo->is_haswell) {
   186532          return 0;
   186533       } else {
   186534          return 0;
   186535       }
   186536    case 6: return 0;
   186537    case 5: return 0;
   186538    case 4:
   186539       if (devinfo->is_g4x) {
   186540          return 0;
   186541       } else {
   186542          return 0;
   186543       }
   186544    default:
   186545       unreachable("Invalid hardware generation");
   186546    }
   186547 }
   186548 
   186549 
   186550 
   186551 /* SAMPLER_INDIRECT_STATE_BORDER_COLOR::Border Color Green As U8 */
   186552 
   186553 
   186554 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorGreenAsU8_bits  8
   186555 
   186556 static inline uint32_t ATTRIBUTE_PURE
   186557 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorGreenAsU8_bits(const struct gen_device_info *devinfo)
   186558 {
   186559    switch (devinfo->gen) {
   186560    case 10: return 8;
   186561    case 9: return 0;
   186562    case 8: return 0;
   186563    case 7:
   186564       if (devinfo->is_haswell) {
   186565          return 0;
   186566       } else {
   186567          return 0;
   186568       }
   186569    case 6: return 0;
   186570    case 5: return 0;
   186571    case 4:
   186572       if (devinfo->is_g4x) {
   186573          return 0;
   186574       } else {
   186575          return 0;
   186576       }
   186577    default:
   186578       unreachable("Invalid hardware generation");
   186579    }
   186580 }
   186581 
   186582 
   186583 
   186584 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorGreenAsU8_start  8
   186585 
   186586 static inline uint32_t ATTRIBUTE_PURE
   186587 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorGreenAsU8_start(const struct gen_device_info *devinfo)
   186588 {
   186589    switch (devinfo->gen) {
   186590    case 10: return 8;
   186591    case 9: return 0;
   186592    case 8: return 0;
   186593    case 7:
   186594       if (devinfo->is_haswell) {
   186595          return 0;
   186596       } else {
   186597          return 0;
   186598       }
   186599    case 6: return 0;
   186600    case 5: return 0;
   186601    case 4:
   186602       if (devinfo->is_g4x) {
   186603          return 0;
   186604       } else {
   186605          return 0;
   186606       }
   186607    default:
   186608       unreachable("Invalid hardware generation");
   186609    }
   186610 }
   186611 
   186612 
   186613 
   186614 /* SAMPLER_INDIRECT_STATE_BORDER_COLOR::Border Color Red As Float */
   186615 
   186616 
   186617 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorRedAsFloat_bits  32
   186618 
   186619 static inline uint32_t ATTRIBUTE_PURE
   186620 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorRedAsFloat_bits(const struct gen_device_info *devinfo)
   186621 {
   186622    switch (devinfo->gen) {
   186623    case 10: return 32;
   186624    case 9: return 0;
   186625    case 8: return 0;
   186626    case 7:
   186627       if (devinfo->is_haswell) {
   186628          return 0;
   186629       } else {
   186630          return 0;
   186631       }
   186632    case 6: return 0;
   186633    case 5: return 0;
   186634    case 4:
   186635       if (devinfo->is_g4x) {
   186636          return 0;
   186637       } else {
   186638          return 0;
   186639       }
   186640    default:
   186641       unreachable("Invalid hardware generation");
   186642    }
   186643 }
   186644 
   186645 
   186646 
   186647 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorRedAsFloat_start  0
   186648 
   186649 static inline uint32_t ATTRIBUTE_PURE
   186650 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorRedAsFloat_start(const struct gen_device_info *devinfo)
   186651 {
   186652    switch (devinfo->gen) {
   186653    case 10: return 0;
   186654    case 9: return 0;
   186655    case 8: return 0;
   186656    case 7:
   186657       if (devinfo->is_haswell) {
   186658          return 0;
   186659       } else {
   186660          return 0;
   186661       }
   186662    case 6: return 0;
   186663    case 5: return 0;
   186664    case 4:
   186665       if (devinfo->is_g4x) {
   186666          return 0;
   186667       } else {
   186668          return 0;
   186669       }
   186670    default:
   186671       unreachable("Invalid hardware generation");
   186672    }
   186673 }
   186674 
   186675 
   186676 
   186677 /* SAMPLER_INDIRECT_STATE_BORDER_COLOR::Border Color Red As S31 */
   186678 
   186679 
   186680 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorRedAsS31_bits  32
   186681 
   186682 static inline uint32_t ATTRIBUTE_PURE
   186683 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorRedAsS31_bits(const struct gen_device_info *devinfo)
   186684 {
   186685    switch (devinfo->gen) {
   186686    case 10: return 32;
   186687    case 9: return 0;
   186688    case 8: return 0;
   186689    case 7:
   186690       if (devinfo->is_haswell) {
   186691          return 0;
   186692       } else {
   186693          return 0;
   186694       }
   186695    case 6: return 0;
   186696    case 5: return 0;
   186697    case 4:
   186698       if (devinfo->is_g4x) {
   186699          return 0;
   186700       } else {
   186701          return 0;
   186702       }
   186703    default:
   186704       unreachable("Invalid hardware generation");
   186705    }
   186706 }
   186707 
   186708 
   186709 
   186710 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorRedAsS31_start  0
   186711 
   186712 static inline uint32_t ATTRIBUTE_PURE
   186713 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorRedAsS31_start(const struct gen_device_info *devinfo)
   186714 {
   186715    switch (devinfo->gen) {
   186716    case 10: return 0;
   186717    case 9: return 0;
   186718    case 8: return 0;
   186719    case 7:
   186720       if (devinfo->is_haswell) {
   186721          return 0;
   186722       } else {
   186723          return 0;
   186724       }
   186725    case 6: return 0;
   186726    case 5: return 0;
   186727    case 4:
   186728       if (devinfo->is_g4x) {
   186729          return 0;
   186730       } else {
   186731          return 0;
   186732       }
   186733    default:
   186734       unreachable("Invalid hardware generation");
   186735    }
   186736 }
   186737 
   186738 
   186739 
   186740 /* SAMPLER_INDIRECT_STATE_BORDER_COLOR::Border Color Red As U32 */
   186741 
   186742 
   186743 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorRedAsU32_bits  32
   186744 
   186745 static inline uint32_t ATTRIBUTE_PURE
   186746 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorRedAsU32_bits(const struct gen_device_info *devinfo)
   186747 {
   186748    switch (devinfo->gen) {
   186749    case 10: return 32;
   186750    case 9: return 0;
   186751    case 8: return 0;
   186752    case 7:
   186753       if (devinfo->is_haswell) {
   186754          return 0;
   186755       } else {
   186756          return 0;
   186757       }
   186758    case 6: return 0;
   186759    case 5: return 0;
   186760    case 4:
   186761       if (devinfo->is_g4x) {
   186762          return 0;
   186763       } else {
   186764          return 0;
   186765       }
   186766    default:
   186767       unreachable("Invalid hardware generation");
   186768    }
   186769 }
   186770 
   186771 
   186772 
   186773 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorRedAsU32_start  0
   186774 
   186775 static inline uint32_t ATTRIBUTE_PURE
   186776 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorRedAsU32_start(const struct gen_device_info *devinfo)
   186777 {
   186778    switch (devinfo->gen) {
   186779    case 10: return 0;
   186780    case 9: return 0;
   186781    case 8: return 0;
   186782    case 7:
   186783       if (devinfo->is_haswell) {
   186784          return 0;
   186785       } else {
   186786          return 0;
   186787       }
   186788    case 6: return 0;
   186789    case 5: return 0;
   186790    case 4:
   186791       if (devinfo->is_g4x) {
   186792          return 0;
   186793       } else {
   186794          return 0;
   186795       }
   186796    default:
   186797       unreachable("Invalid hardware generation");
   186798    }
   186799 }
   186800 
   186801 
   186802 
   186803 /* SAMPLER_INDIRECT_STATE_BORDER_COLOR::Border Color Red As U8 */
   186804 
   186805 
   186806 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorRedAsU8_bits  8
   186807 
   186808 static inline uint32_t ATTRIBUTE_PURE
   186809 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorRedAsU8_bits(const struct gen_device_info *devinfo)
   186810 {
   186811    switch (devinfo->gen) {
   186812    case 10: return 8;
   186813    case 9: return 0;
   186814    case 8: return 0;
   186815    case 7:
   186816       if (devinfo->is_haswell) {
   186817          return 0;
   186818       } else {
   186819          return 0;
   186820       }
   186821    case 6: return 0;
   186822    case 5: return 0;
   186823    case 4:
   186824       if (devinfo->is_g4x) {
   186825          return 0;
   186826       } else {
   186827          return 0;
   186828       }
   186829    default:
   186830       unreachable("Invalid hardware generation");
   186831    }
   186832 }
   186833 
   186834 
   186835 
   186836 #define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorRedAsU8_start  0
   186837 
   186838 static inline uint32_t ATTRIBUTE_PURE
   186839 SAMPLER_INDIRECT_STATE_BORDER_COLOR_BorderColorRedAsU8_start(const struct gen_device_info *devinfo)
   186840 {
   186841    switch (devinfo->gen) {
   186842    case 10: return 0;
   186843    case 9: return 0;
   186844    case 8: return 0;
   186845    case 7:
   186846       if (devinfo->is_haswell) {
   186847          return 0;
   186848       } else {
   186849          return 0;
   186850       }
   186851    case 6: return 0;
   186852    case 5: return 0;
   186853    case 4:
   186854       if (devinfo->is_g4x) {
   186855          return 0;
   186856       } else {
   186857          return 0;
   186858       }
   186859    default:
   186860       unreachable("Invalid hardware generation");
   186861    }
   186862 }
   186863 
   186864 
   186865 
   186866 /* SAMPLER_STATE */
   186867 
   186868 
   186869 #define GEN10_SAMPLER_STATE_length  4
   186870 #define GEN9_SAMPLER_STATE_length  4
   186871 #define GEN8_SAMPLER_STATE_length  4
   186872 #define GEN75_SAMPLER_STATE_length  4
   186873 #define GEN7_SAMPLER_STATE_length  4
   186874 #define GEN6_SAMPLER_STATE_length  4
   186875 #define GEN5_SAMPLER_STATE_length  4
   186876 #define GEN45_SAMPLER_STATE_length  4
   186877 #define GEN4_SAMPLER_STATE_length  4
   186878 
   186879 static inline uint32_t ATTRIBUTE_PURE
   186880 SAMPLER_STATE_length(const struct gen_device_info *devinfo)
   186881 {
   186882    switch (devinfo->gen) {
   186883    case 10: return 4;
   186884    case 9: return 4;
   186885    case 8: return 4;
   186886    case 7:
   186887       if (devinfo->is_haswell) {
   186888          return 4;
   186889       } else {
   186890          return 4;
   186891       }
   186892    case 6: return 4;
   186893    case 5: return 4;
   186894    case 4:
   186895       if (devinfo->is_g4x) {
   186896          return 4;
   186897       } else {
   186898          return 4;
   186899       }
   186900    default:
   186901       unreachable("Invalid hardware generation");
   186902    }
   186903 }
   186904 
   186905 
   186906 
   186907 /* SAMPLER_STATE::Anisotropic Algorithm */
   186908 
   186909 
   186910 #define GEN10_SAMPLER_STATE_AnisotropicAlgorithm_bits  1
   186911 #define GEN9_SAMPLER_STATE_AnisotropicAlgorithm_bits  1
   186912 #define GEN8_SAMPLER_STATE_AnisotropicAlgorithm_bits  1
   186913 #define GEN75_SAMPLER_STATE_AnisotropicAlgorithm_bits  1
   186914 #define GEN7_SAMPLER_STATE_AnisotropicAlgorithm_bits  1
   186915 
   186916 static inline uint32_t ATTRIBUTE_PURE
   186917 SAMPLER_STATE_AnisotropicAlgorithm_bits(const struct gen_device_info *devinfo)
   186918 {
   186919    switch (devinfo->gen) {
   186920    case 10: return 1;
   186921    case 9: return 1;
   186922    case 8: return 1;
   186923    case 7:
   186924       if (devinfo->is_haswell) {
   186925          return 1;
   186926       } else {
   186927          return 1;
   186928       }
   186929    case 6: return 0;
   186930    case 5: return 0;
   186931    case 4:
   186932       if (devinfo->is_g4x) {
   186933          return 0;
   186934       } else {
   186935          return 0;
   186936       }
   186937    default:
   186938       unreachable("Invalid hardware generation");
   186939    }
   186940 }
   186941 
   186942 
   186943 
   186944 #define GEN10_SAMPLER_STATE_AnisotropicAlgorithm_start  0
   186945 #define GEN9_SAMPLER_STATE_AnisotropicAlgorithm_start  0
   186946 #define GEN8_SAMPLER_STATE_AnisotropicAlgorithm_start  0
   186947 #define GEN75_SAMPLER_STATE_AnisotropicAlgorithm_start  0
   186948 #define GEN7_SAMPLER_STATE_AnisotropicAlgorithm_start  0
   186949 
   186950 static inline uint32_t ATTRIBUTE_PURE
   186951 SAMPLER_STATE_AnisotropicAlgorithm_start(const struct gen_device_info *devinfo)
   186952 {
   186953    switch (devinfo->gen) {
   186954    case 10: return 0;
   186955    case 9: return 0;
   186956    case 8: return 0;
   186957    case 7:
   186958       if (devinfo->is_haswell) {
   186959          return 0;
   186960       } else {
   186961          return 0;
   186962       }
   186963    case 6: return 0;
   186964    case 5: return 0;
   186965    case 4:
   186966       if (devinfo->is_g4x) {
   186967          return 0;
   186968       } else {
   186969          return 0;
   186970       }
   186971    default:
   186972       unreachable("Invalid hardware generation");
   186973    }
   186974 }
   186975 
   186976 
   186977 
   186978 /* SAMPLER_STATE::Base Mip Level */
   186979 
   186980 
   186981 #define GEN8_SAMPLER_STATE_BaseMipLevel_bits  5
   186982 #define GEN75_SAMPLER_STATE_BaseMipLevel_bits  5
   186983 #define GEN7_SAMPLER_STATE_BaseMipLevel_bits  5
   186984 #define GEN6_SAMPLER_STATE_BaseMipLevel_bits  5
   186985 #define GEN5_SAMPLER_STATE_BaseMipLevel_bits  5
   186986 #define GEN45_SAMPLER_STATE_BaseMipLevel_bits  5
   186987 #define GEN4_SAMPLER_STATE_BaseMipLevel_bits  5
   186988 
   186989 static inline uint32_t ATTRIBUTE_PURE
   186990 SAMPLER_STATE_BaseMipLevel_bits(const struct gen_device_info *devinfo)
   186991 {
   186992    switch (devinfo->gen) {
   186993    case 10: return 0;
   186994    case 9: return 0;
   186995    case 8: return 5;
   186996    case 7:
   186997       if (devinfo->is_haswell) {
   186998          return 5;
   186999       } else {
   187000          return 5;
   187001       }
   187002    case 6: return 5;
   187003    case 5: return 5;
   187004    case 4:
   187005       if (devinfo->is_g4x) {
   187006          return 5;
   187007       } else {
   187008          return 5;
   187009       }
   187010    default:
   187011       unreachable("Invalid hardware generation");
   187012    }
   187013 }
   187014 
   187015 
   187016 
   187017 #define GEN8_SAMPLER_STATE_BaseMipLevel_start  22
   187018 #define GEN75_SAMPLER_STATE_BaseMipLevel_start  22
   187019 #define GEN7_SAMPLER_STATE_BaseMipLevel_start  22
   187020 #define GEN6_SAMPLER_STATE_BaseMipLevel_start  22
   187021 #define GEN5_SAMPLER_STATE_BaseMipLevel_start  22
   187022 #define GEN45_SAMPLER_STATE_BaseMipLevel_start  22
   187023 #define GEN4_SAMPLER_STATE_BaseMipLevel_start  22
   187024 
   187025 static inline uint32_t ATTRIBUTE_PURE
   187026 SAMPLER_STATE_BaseMipLevel_start(const struct gen_device_info *devinfo)
   187027 {
   187028    switch (devinfo->gen) {
   187029    case 10: return 0;
   187030    case 9: return 0;
   187031    case 8: return 22;
   187032    case 7:
   187033       if (devinfo->is_haswell) {
   187034          return 22;
   187035       } else {
   187036          return 22;
   187037       }
   187038    case 6: return 22;
   187039    case 5: return 22;
   187040    case 4:
   187041       if (devinfo->is_g4x) {
   187042          return 22;
   187043       } else {
   187044          return 22;
   187045       }
   187046    default:
   187047       unreachable("Invalid hardware generation");
   187048    }
   187049 }
   187050 
   187051 
   187052 
   187053 /* SAMPLER_STATE::Border Color Pointer */
   187054 
   187055 
   187056 #define GEN10_SAMPLER_STATE_BorderColorPointer_bits  18
   187057 #define GEN9_SAMPLER_STATE_BorderColorPointer_bits  18
   187058 #define GEN8_SAMPLER_STATE_BorderColorPointer_bits  18
   187059 #define GEN75_SAMPLER_STATE_BorderColorPointer_bits  27
   187060 #define GEN7_SAMPLER_STATE_BorderColorPointer_bits  27
   187061 #define GEN6_SAMPLER_STATE_BorderColorPointer_bits  27
   187062 #define GEN5_SAMPLER_STATE_BorderColorPointer_bits  27
   187063 #define GEN45_SAMPLER_STATE_BorderColorPointer_bits  27
   187064 #define GEN4_SAMPLER_STATE_BorderColorPointer_bits  27
   187065 
   187066 static inline uint32_t ATTRIBUTE_PURE
   187067 SAMPLER_STATE_BorderColorPointer_bits(const struct gen_device_info *devinfo)
   187068 {
   187069    switch (devinfo->gen) {
   187070    case 10: return 18;
   187071    case 9: return 18;
   187072    case 8: return 18;
   187073    case 7:
   187074       if (devinfo->is_haswell) {
   187075          return 27;
   187076       } else {
   187077          return 27;
   187078       }
   187079    case 6: return 27;
   187080    case 5: return 27;
   187081    case 4:
   187082       if (devinfo->is_g4x) {
   187083          return 27;
   187084       } else {
   187085          return 27;
   187086       }
   187087    default:
   187088       unreachable("Invalid hardware generation");
   187089    }
   187090 }
   187091 
   187092 
   187093 
   187094 #define GEN10_SAMPLER_STATE_BorderColorPointer_start  70
   187095 #define GEN9_SAMPLER_STATE_BorderColorPointer_start  70
   187096 #define GEN8_SAMPLER_STATE_BorderColorPointer_start  70
   187097 #define GEN75_SAMPLER_STATE_BorderColorPointer_start  69
   187098 #define GEN7_SAMPLER_STATE_BorderColorPointer_start  69
   187099 #define GEN6_SAMPLER_STATE_BorderColorPointer_start  69
   187100 #define GEN5_SAMPLER_STATE_BorderColorPointer_start  69
   187101 #define GEN45_SAMPLER_STATE_BorderColorPointer_start  69
   187102 #define GEN4_SAMPLER_STATE_BorderColorPointer_start  69
   187103 
   187104 static inline uint32_t ATTRIBUTE_PURE
   187105 SAMPLER_STATE_BorderColorPointer_start(const struct gen_device_info *devinfo)
   187106 {
   187107    switch (devinfo->gen) {
   187108    case 10: return 70;
   187109    case 9: return 70;
   187110    case 8: return 70;
   187111    case 7:
   187112       if (devinfo->is_haswell) {
   187113          return 69;
   187114       } else {
   187115          return 69;
   187116       }
   187117    case 6: return 69;
   187118    case 5: return 69;
   187119    case 4:
   187120       if (devinfo->is_g4x) {
   187121          return 69;
   187122       } else {
   187123          return 69;
   187124       }
   187125    default:
   187126       unreachable("Invalid hardware generation");
   187127    }
   187128 }
   187129 
   187130 
   187131 
   187132 /* SAMPLER_STATE::ChromaKey Enable */
   187133 
   187134 
   187135 #define GEN10_SAMPLER_STATE_ChromaKeyEnable_bits  1
   187136 #define GEN9_SAMPLER_STATE_ChromaKeyEnable_bits  1
   187137 #define GEN8_SAMPLER_STATE_ChromaKeyEnable_bits  1
   187138 #define GEN75_SAMPLER_STATE_ChromaKeyEnable_bits  1
   187139 #define GEN7_SAMPLER_STATE_ChromaKeyEnable_bits  1
   187140 #define GEN6_SAMPLER_STATE_ChromaKeyEnable_bits  1
   187141 #define GEN5_SAMPLER_STATE_ChromaKeyEnable_bits  1
   187142 #define GEN45_SAMPLER_STATE_ChromaKeyEnable_bits  1
   187143 #define GEN4_SAMPLER_STATE_ChromaKeyEnable_bits  1
   187144 
   187145 static inline uint32_t ATTRIBUTE_PURE
   187146 SAMPLER_STATE_ChromaKeyEnable_bits(const struct gen_device_info *devinfo)
   187147 {
   187148    switch (devinfo->gen) {
   187149    case 10: return 1;
   187150    case 9: return 1;
   187151    case 8: return 1;
   187152    case 7:
   187153       if (devinfo->is_haswell) {
   187154          return 1;
   187155       } else {
   187156          return 1;
   187157       }
   187158    case 6: return 1;
   187159    case 5: return 1;
   187160    case 4:
   187161       if (devinfo->is_g4x) {
   187162          return 1;
   187163       } else {
   187164          return 1;
   187165       }
   187166    default:
   187167       unreachable("Invalid hardware generation");
   187168    }
   187169 }
   187170 
   187171 
   187172 
   187173 #define GEN10_SAMPLER_STATE_ChromaKeyEnable_start  39
   187174 #define GEN9_SAMPLER_STATE_ChromaKeyEnable_start  39
   187175 #define GEN8_SAMPLER_STATE_ChromaKeyEnable_start  39
   187176 #define GEN75_SAMPLER_STATE_ChromaKeyEnable_start  121
   187177 #define GEN7_SAMPLER_STATE_ChromaKeyEnable_start  121
   187178 #define GEN6_SAMPLER_STATE_ChromaKeyEnable_start  121
   187179 #define GEN5_SAMPLER_STATE_ChromaKeyEnable_start  121
   187180 #define GEN45_SAMPLER_STATE_ChromaKeyEnable_start  121
   187181 #define GEN4_SAMPLER_STATE_ChromaKeyEnable_start  121
   187182 
   187183 static inline uint32_t ATTRIBUTE_PURE
   187184 SAMPLER_STATE_ChromaKeyEnable_start(const struct gen_device_info *devinfo)
   187185 {
   187186    switch (devinfo->gen) {
   187187    case 10: return 39;
   187188    case 9: return 39;
   187189    case 8: return 39;
   187190    case 7:
   187191       if (devinfo->is_haswell) {
   187192          return 121;
   187193       } else {
   187194          return 121;
   187195       }
   187196    case 6: return 121;
   187197    case 5: return 121;
   187198    case 4:
   187199       if (devinfo->is_g4x) {
   187200          return 121;
   187201       } else {
   187202          return 121;
   187203       }
   187204    default:
   187205       unreachable("Invalid hardware generation");
   187206    }
   187207 }
   187208 
   187209 
   187210 
   187211 /* SAMPLER_STATE::ChromaKey Index */
   187212 
   187213 
   187214 #define GEN10_SAMPLER_STATE_ChromaKeyIndex_bits  2
   187215 #define GEN9_SAMPLER_STATE_ChromaKeyIndex_bits  2
   187216 #define GEN8_SAMPLER_STATE_ChromaKeyIndex_bits  2
   187217 #define GEN75_SAMPLER_STATE_ChromaKeyIndex_bits  2
   187218 #define GEN7_SAMPLER_STATE_ChromaKeyIndex_bits  2
   187219 #define GEN6_SAMPLER_STATE_ChromaKeyIndex_bits  2
   187220 #define GEN5_SAMPLER_STATE_ChromaKeyIndex_bits  2
   187221 #define GEN45_SAMPLER_STATE_ChromaKeyIndex_bits  2
   187222 #define GEN4_SAMPLER_STATE_ChromaKeyIndex_bits  2
   187223 
   187224 static inline uint32_t ATTRIBUTE_PURE
   187225 SAMPLER_STATE_ChromaKeyIndex_bits(const struct gen_device_info *devinfo)
   187226 {
   187227    switch (devinfo->gen) {
   187228    case 10: return 2;
   187229    case 9: return 2;
   187230    case 8: return 2;
   187231    case 7:
   187232       if (devinfo->is_haswell) {
   187233          return 2;
   187234       } else {
   187235          return 2;
   187236       }
   187237    case 6: return 2;
   187238    case 5: return 2;
   187239    case 4:
   187240       if (devinfo->is_g4x) {
   187241          return 2;
   187242       } else {
   187243          return 2;
   187244       }
   187245    default:
   187246       unreachable("Invalid hardware generation");
   187247    }
   187248 }
   187249 
   187250 
   187251 
   187252 #define GEN10_SAMPLER_STATE_ChromaKeyIndex_start  37
   187253 #define GEN9_SAMPLER_STATE_ChromaKeyIndex_start  37
   187254 #define GEN8_SAMPLER_STATE_ChromaKeyIndex_start  37
   187255 #define GEN75_SAMPLER_STATE_ChromaKeyIndex_start  119
   187256 #define GEN7_SAMPLER_STATE_ChromaKeyIndex_start  119
   187257 #define GEN6_SAMPLER_STATE_ChromaKeyIndex_start  119
   187258 #define GEN5_SAMPLER_STATE_ChromaKeyIndex_start  119
   187259 #define GEN45_SAMPLER_STATE_ChromaKeyIndex_start  119
   187260 #define GEN4_SAMPLER_STATE_ChromaKeyIndex_start  119
   187261 
   187262 static inline uint32_t ATTRIBUTE_PURE
   187263 SAMPLER_STATE_ChromaKeyIndex_start(const struct gen_device_info *devinfo)
   187264 {
   187265    switch (devinfo->gen) {
   187266    case 10: return 37;
   187267    case 9: return 37;
   187268    case 8: return 37;
   187269    case 7:
   187270       if (devinfo->is_haswell) {
   187271          return 119;
   187272       } else {
   187273          return 119;
   187274       }
   187275    case 6: return 119;
   187276    case 5: return 119;
   187277    case 4:
   187278       if (devinfo->is_g4x) {
   187279          return 119;
   187280       } else {
   187281          return 119;
   187282       }
   187283    default:
   187284       unreachable("Invalid hardware generation");
   187285    }
   187286 }
   187287 
   187288 
   187289 
   187290 /* SAMPLER_STATE::ChromaKey Mode */
   187291 
   187292 
   187293 #define GEN10_SAMPLER_STATE_ChromaKeyMode_bits  1
   187294 #define GEN9_SAMPLER_STATE_ChromaKeyMode_bits  1
   187295 #define GEN8_SAMPLER_STATE_ChromaKeyMode_bits  1
   187296 #define GEN75_SAMPLER_STATE_ChromaKeyMode_bits  1
   187297 #define GEN7_SAMPLER_STATE_ChromaKeyMode_bits  1
   187298 #define GEN6_SAMPLER_STATE_ChromaKeyMode_bits  1
   187299 #define GEN5_SAMPLER_STATE_ChromaKeyMode_bits  1
   187300 #define GEN45_SAMPLER_STATE_ChromaKeyMode_bits  1
   187301 #define GEN4_SAMPLER_STATE_ChromaKeyMode_bits  1
   187302 
   187303 static inline uint32_t ATTRIBUTE_PURE
   187304 SAMPLER_STATE_ChromaKeyMode_bits(const struct gen_device_info *devinfo)
   187305 {
   187306    switch (devinfo->gen) {
   187307    case 10: return 1;
   187308    case 9: return 1;
   187309    case 8: return 1;
   187310    case 7:
   187311       if (devinfo->is_haswell) {
   187312          return 1;
   187313       } else {
   187314          return 1;
   187315       }
   187316    case 6: return 1;
   187317    case 5: return 1;
   187318    case 4:
   187319       if (devinfo->is_g4x) {
   187320          return 1;
   187321       } else {
   187322          return 1;
   187323       }
   187324    default:
   187325       unreachable("Invalid hardware generation");
   187326    }
   187327 }
   187328 
   187329 
   187330 
   187331 #define GEN10_SAMPLER_STATE_ChromaKeyMode_start  36
   187332 #define GEN9_SAMPLER_STATE_ChromaKeyMode_start  36
   187333 #define GEN8_SAMPLER_STATE_ChromaKeyMode_start  36
   187334 #define GEN75_SAMPLER_STATE_ChromaKeyMode_start  118
   187335 #define GEN7_SAMPLER_STATE_ChromaKeyMode_start  118
   187336 #define GEN6_SAMPLER_STATE_ChromaKeyMode_start  118
   187337 #define GEN5_SAMPLER_STATE_ChromaKeyMode_start  118
   187338 #define GEN45_SAMPLER_STATE_ChromaKeyMode_start  118
   187339 #define GEN4_SAMPLER_STATE_ChromaKeyMode_start  118
   187340 
   187341 static inline uint32_t ATTRIBUTE_PURE
   187342 SAMPLER_STATE_ChromaKeyMode_start(const struct gen_device_info *devinfo)
   187343 {
   187344    switch (devinfo->gen) {
   187345    case 10: return 36;
   187346    case 9: return 36;
   187347    case 8: return 36;
   187348    case 7:
   187349       if (devinfo->is_haswell) {
   187350          return 118;
   187351       } else {
   187352          return 118;
   187353       }
   187354    case 6: return 118;
   187355    case 5: return 118;
   187356    case 4:
   187357       if (devinfo->is_g4x) {
   187358          return 118;
   187359       } else {
   187360          return 118;
   187361       }
   187362    default:
   187363       unreachable("Invalid hardware generation");
   187364    }
   187365 }
   187366 
   187367 
   187368 
   187369 /* SAMPLER_STATE::Coarse LOD Quality Mode */
   187370 
   187371 
   187372 #define GEN10_SAMPLER_STATE_CoarseLODQualityMode_bits  5
   187373 #define GEN9_SAMPLER_STATE_CoarseLODQualityMode_bits  5
   187374 
   187375 static inline uint32_t ATTRIBUTE_PURE
   187376 SAMPLER_STATE_CoarseLODQualityMode_bits(const struct gen_device_info *devinfo)
   187377 {
   187378    switch (devinfo->gen) {
   187379    case 10: return 5;
   187380    case 9: return 5;
   187381    case 8: return 0;
   187382    case 7:
   187383       if (devinfo->is_haswell) {
   187384          return 0;
   187385       } else {
   187386          return 0;
   187387       }
   187388    case 6: return 0;
   187389    case 5: return 0;
   187390    case 4:
   187391       if (devinfo->is_g4x) {
   187392          return 0;
   187393       } else {
   187394          return 0;
   187395       }
   187396    default:
   187397       unreachable("Invalid hardware generation");
   187398    }
   187399 }
   187400 
   187401 
   187402 
   187403 #define GEN10_SAMPLER_STATE_CoarseLODQualityMode_start  22
   187404 #define GEN9_SAMPLER_STATE_CoarseLODQualityMode_start  22
   187405 
   187406 static inline uint32_t ATTRIBUTE_PURE
   187407 SAMPLER_STATE_CoarseLODQualityMode_start(const struct gen_device_info *devinfo)
   187408 {
   187409    switch (devinfo->gen) {
   187410    case 10: return 22;
   187411    case 9: return 22;
   187412    case 8: return 0;
   187413    case 7:
   187414       if (devinfo->is_haswell) {
   187415          return 0;
   187416       } else {
   187417          return 0;
   187418       }
   187419    case 6: return 0;
   187420    case 5: return 0;
   187421    case 4:
   187422       if (devinfo->is_g4x) {
   187423          return 0;
   187424       } else {
   187425          return 0;
   187426       }
   187427    default:
   187428       unreachable("Invalid hardware generation");
   187429    }
   187430 }
   187431 
   187432 
   187433 
   187434 /* SAMPLER_STATE::Cube Surface Control Mode */
   187435 
   187436 
   187437 #define GEN10_SAMPLER_STATE_CubeSurfaceControlMode_bits  1
   187438 #define GEN9_SAMPLER_STATE_CubeSurfaceControlMode_bits  1
   187439 #define GEN8_SAMPLER_STATE_CubeSurfaceControlMode_bits  1
   187440 #define GEN75_SAMPLER_STATE_CubeSurfaceControlMode_bits  1
   187441 #define GEN7_SAMPLER_STATE_CubeSurfaceControlMode_bits  1
   187442 #define GEN6_SAMPLER_STATE_CubeSurfaceControlMode_bits  1
   187443 #define GEN5_SAMPLER_STATE_CubeSurfaceControlMode_bits  1
   187444 #define GEN45_SAMPLER_STATE_CubeSurfaceControlMode_bits  1
   187445 #define GEN4_SAMPLER_STATE_CubeSurfaceControlMode_bits  1
   187446 
   187447 static inline uint32_t ATTRIBUTE_PURE
   187448 SAMPLER_STATE_CubeSurfaceControlMode_bits(const struct gen_device_info *devinfo)
   187449 {
   187450    switch (devinfo->gen) {
   187451    case 10: return 1;
   187452    case 9: return 1;
   187453    case 8: return 1;
   187454    case 7:
   187455       if (devinfo->is_haswell) {
   187456          return 1;
   187457       } else {
   187458          return 1;
   187459       }
   187460    case 6: return 1;
   187461    case 5: return 1;
   187462    case 4:
   187463       if (devinfo->is_g4x) {
   187464          return 1;
   187465       } else {
   187466          return 1;
   187467       }
   187468    default:
   187469       unreachable("Invalid hardware generation");
   187470    }
   187471 }
   187472 
   187473 
   187474 
   187475 #define GEN10_SAMPLER_STATE_CubeSurfaceControlMode_start  32
   187476 #define GEN9_SAMPLER_STATE_CubeSurfaceControlMode_start  32
   187477 #define GEN8_SAMPLER_STATE_CubeSurfaceControlMode_start  32
   187478 #define GEN75_SAMPLER_STATE_CubeSurfaceControlMode_start  32
   187479 #define GEN7_SAMPLER_STATE_CubeSurfaceControlMode_start  32
   187480 #define GEN6_SAMPLER_STATE_CubeSurfaceControlMode_start  41
   187481 #define GEN5_SAMPLER_STATE_CubeSurfaceControlMode_start  41
   187482 #define GEN45_SAMPLER_STATE_CubeSurfaceControlMode_start  41
   187483 #define GEN4_SAMPLER_STATE_CubeSurfaceControlMode_start  41
   187484 
   187485 static inline uint32_t ATTRIBUTE_PURE
   187486 SAMPLER_STATE_CubeSurfaceControlMode_start(const struct gen_device_info *devinfo)
   187487 {
   187488    switch (devinfo->gen) {
   187489    case 10: return 32;
   187490    case 9: return 32;
   187491    case 8: return 32;
   187492    case 7:
   187493       if (devinfo->is_haswell) {
   187494          return 32;
   187495       } else {
   187496          return 32;
   187497       }
   187498    case 6: return 41;
   187499    case 5: return 41;
   187500    case 4:
   187501       if (devinfo->is_g4x) {
   187502          return 41;
   187503       } else {
   187504          return 41;
   187505       }
   187506    default:
   187507       unreachable("Invalid hardware generation");
   187508    }
   187509 }
   187510 
   187511 
   187512 
   187513 /* SAMPLER_STATE::Force gather4 Behavior */
   187514 
   187515 
   187516 #define GEN10_SAMPLER_STATE_Forcegather4Behavior_bits  1
   187517 
   187518 static inline uint32_t ATTRIBUTE_PURE
   187519 SAMPLER_STATE_Forcegather4Behavior_bits(const struct gen_device_info *devinfo)
   187520 {
   187521    switch (devinfo->gen) {
   187522    case 10: return 1;
   187523    case 9: return 0;
   187524    case 8: return 0;
   187525    case 7:
   187526       if (devinfo->is_haswell) {
   187527          return 0;
   187528       } else {
   187529          return 0;
   187530       }
   187531    case 6: return 0;
   187532    case 5: return 0;
   187533    case 4:
   187534       if (devinfo->is_g4x) {
   187535          return 0;
   187536       } else {
   187537          return 0;
   187538       }
   187539    default:
   187540       unreachable("Invalid hardware generation");
   187541    }
   187542 }
   187543 
   187544 
   187545 
   187546 #define GEN10_SAMPLER_STATE_Forcegather4Behavior_start  69
   187547 
   187548 static inline uint32_t ATTRIBUTE_PURE
   187549 SAMPLER_STATE_Forcegather4Behavior_start(const struct gen_device_info *devinfo)
   187550 {
   187551    switch (devinfo->gen) {
   187552    case 10: return 69;
   187553    case 9: return 0;
   187554    case 8: return 0;
   187555    case 7:
   187556       if (devinfo->is_haswell) {
   187557          return 0;
   187558       } else {
   187559          return 0;
   187560       }
   187561    case 6: return 0;
   187562    case 5: return 0;
   187563    case 4:
   187564       if (devinfo->is_g4x) {
   187565          return 0;
   187566       } else {
   187567          return 0;
   187568       }
   187569    default:
   187570       unreachable("Invalid hardware generation");
   187571    }
   187572 }
   187573 
   187574 
   187575 
   187576 /* SAMPLER_STATE::LOD Clamp Magnification Mode */
   187577 
   187578 
   187579 #define GEN10_SAMPLER_STATE_LODClampMagnificationMode_bits  1
   187580 #define GEN9_SAMPLER_STATE_LODClampMagnificationMode_bits  1
   187581 #define GEN8_SAMPLER_STATE_LODClampMagnificationMode_bits  1
   187582 
   187583 static inline uint32_t ATTRIBUTE_PURE
   187584 SAMPLER_STATE_LODClampMagnificationMode_bits(const struct gen_device_info *devinfo)
   187585 {
   187586    switch (devinfo->gen) {
   187587    case 10: return 1;
   187588    case 9: return 1;
   187589    case 8: return 1;
   187590    case 7:
   187591       if (devinfo->is_haswell) {
   187592          return 0;
   187593       } else {
   187594          return 0;
   187595       }
   187596    case 6: return 0;
   187597    case 5: return 0;
   187598    case 4:
   187599       if (devinfo->is_g4x) {
   187600          return 0;
   187601       } else {
   187602          return 0;
   187603       }
   187604    default:
   187605       unreachable("Invalid hardware generation");
   187606    }
   187607 }
   187608 
   187609 
   187610 
   187611 #define GEN10_SAMPLER_STATE_LODClampMagnificationMode_start  64
   187612 #define GEN9_SAMPLER_STATE_LODClampMagnificationMode_start  64
   187613 #define GEN8_SAMPLER_STATE_LODClampMagnificationMode_start  64
   187614 
   187615 static inline uint32_t ATTRIBUTE_PURE
   187616 SAMPLER_STATE_LODClampMagnificationMode_start(const struct gen_device_info *devinfo)
   187617 {
   187618    switch (devinfo->gen) {
   187619    case 10: return 64;
   187620    case 9: return 64;
   187621    case 8: return 64;
   187622    case 7:
   187623       if (devinfo->is_haswell) {
   187624          return 0;
   187625       } else {
   187626          return 0;
   187627       }
   187628    case 6: return 0;
   187629    case 5: return 0;
   187630    case 4:
   187631       if (devinfo->is_g4x) {
   187632          return 0;
   187633       } else {
   187634          return 0;
   187635       }
   187636    default:
   187637       unreachable("Invalid hardware generation");
   187638    }
   187639 }
   187640 
   187641 
   187642 
   187643 /* SAMPLER_STATE::LOD PreClamp Enable */
   187644 
   187645 
   187646 #define GEN75_SAMPLER_STATE_LODPreClampEnable_bits  1
   187647 #define GEN7_SAMPLER_STATE_LODPreClampEnable_bits  1
   187648 #define GEN6_SAMPLER_STATE_LODPreClampEnable_bits  1
   187649 #define GEN5_SAMPLER_STATE_LODPreClampEnable_bits  1
   187650 #define GEN45_SAMPLER_STATE_LODPreClampEnable_bits  1
   187651 #define GEN4_SAMPLER_STATE_LODPreClampEnable_bits  1
   187652 
   187653 static inline uint32_t ATTRIBUTE_PURE
   187654 SAMPLER_STATE_LODPreClampEnable_bits(const struct gen_device_info *devinfo)
   187655 {
   187656    switch (devinfo->gen) {
   187657    case 10: return 0;
   187658    case 9: return 0;
   187659    case 8: return 0;
   187660    case 7:
   187661       if (devinfo->is_haswell) {
   187662          return 1;
   187663       } else {
   187664          return 1;
   187665       }
   187666    case 6: return 1;
   187667    case 5: return 1;
   187668    case 4:
   187669       if (devinfo->is_g4x) {
   187670          return 1;
   187671       } else {
   187672          return 1;
   187673       }
   187674    default:
   187675       unreachable("Invalid hardware generation");
   187676    }
   187677 }
   187678 
   187679 
   187680 
   187681 #define GEN75_SAMPLER_STATE_LODPreClampEnable_start  28
   187682 #define GEN7_SAMPLER_STATE_LODPreClampEnable_start  28
   187683 #define GEN6_SAMPLER_STATE_LODPreClampEnable_start  28
   187684 #define GEN5_SAMPLER_STATE_LODPreClampEnable_start  28
   187685 #define GEN45_SAMPLER_STATE_LODPreClampEnable_start  28
   187686 #define GEN4_SAMPLER_STATE_LODPreClampEnable_start  28
   187687 
   187688 static inline uint32_t ATTRIBUTE_PURE
   187689 SAMPLER_STATE_LODPreClampEnable_start(const struct gen_device_info *devinfo)
   187690 {
   187691    switch (devinfo->gen) {
   187692    case 10: return 0;
   187693    case 9: return 0;
   187694    case 8: return 0;
   187695    case 7:
   187696       if (devinfo->is_haswell) {
   187697          return 28;
   187698       } else {
   187699          return 28;
   187700       }
   187701    case 6: return 28;
   187702    case 5: return 28;
   187703    case 4:
   187704       if (devinfo->is_g4x) {
   187705          return 28;
   187706       } else {
   187707          return 28;
   187708       }
   187709    default:
   187710       unreachable("Invalid hardware generation");
   187711    }
   187712 }
   187713 
   187714 
   187715 
   187716 /* SAMPLER_STATE::LOD PreClamp Mode */
   187717 
   187718 
   187719 #define GEN10_SAMPLER_STATE_LODPreClampMode_bits  2
   187720 #define GEN9_SAMPLER_STATE_LODPreClampMode_bits  2
   187721 #define GEN8_SAMPLER_STATE_LODPreClampMode_bits  2
   187722 
   187723 static inline uint32_t ATTRIBUTE_PURE
   187724 SAMPLER_STATE_LODPreClampMode_bits(const struct gen_device_info *devinfo)
   187725 {
   187726    switch (devinfo->gen) {
   187727    case 10: return 2;
   187728    case 9: return 2;
   187729    case 8: return 2;
   187730    case 7:
   187731       if (devinfo->is_haswell) {
   187732          return 0;
   187733       } else {
   187734          return 0;
   187735       }
   187736    case 6: return 0;
   187737    case 5: return 0;
   187738    case 4:
   187739       if (devinfo->is_g4x) {
   187740          return 0;
   187741       } else {
   187742          return 0;
   187743       }
   187744    default:
   187745       unreachable("Invalid hardware generation");
   187746    }
   187747 }
   187748 
   187749 
   187750 
   187751 #define GEN10_SAMPLER_STATE_LODPreClampMode_start  27
   187752 #define GEN9_SAMPLER_STATE_LODPreClampMode_start  27
   187753 #define GEN8_SAMPLER_STATE_LODPreClampMode_start  27
   187754 
   187755 static inline uint32_t ATTRIBUTE_PURE
   187756 SAMPLER_STATE_LODPreClampMode_start(const struct gen_device_info *devinfo)
   187757 {
   187758    switch (devinfo->gen) {
   187759    case 10: return 27;
   187760    case 9: return 27;
   187761    case 8: return 27;
   187762    case 7:
   187763       if (devinfo->is_haswell) {
   187764          return 0;
   187765       } else {
   187766          return 0;
   187767       }
   187768    case 6: return 0;
   187769    case 5: return 0;
   187770    case 4:
   187771       if (devinfo->is_g4x) {
   187772          return 0;
   187773       } else {
   187774          return 0;
   187775       }
   187776    default:
   187777       unreachable("Invalid hardware generation");
   187778    }
   187779 }
   187780 
   187781 
   187782 
   187783 /* SAMPLER_STATE::Mag Mode Filter */
   187784 
   187785 
   187786 #define GEN10_SAMPLER_STATE_MagModeFilter_bits  3
   187787 #define GEN9_SAMPLER_STATE_MagModeFilter_bits  3
   187788 #define GEN8_SAMPLER_STATE_MagModeFilter_bits  3
   187789 #define GEN75_SAMPLER_STATE_MagModeFilter_bits  3
   187790 #define GEN7_SAMPLER_STATE_MagModeFilter_bits  3
   187791 #define GEN6_SAMPLER_STATE_MagModeFilter_bits  3
   187792 #define GEN5_SAMPLER_STATE_MagModeFilter_bits  3
   187793 #define GEN45_SAMPLER_STATE_MagModeFilter_bits  3
   187794 #define GEN4_SAMPLER_STATE_MagModeFilter_bits  3
   187795 
   187796 static inline uint32_t ATTRIBUTE_PURE
   187797 SAMPLER_STATE_MagModeFilter_bits(const struct gen_device_info *devinfo)
   187798 {
   187799    switch (devinfo->gen) {
   187800    case 10: return 3;
   187801    case 9: return 3;
   187802    case 8: return 3;
   187803    case 7:
   187804       if (devinfo->is_haswell) {
   187805          return 3;
   187806       } else {
   187807          return 3;
   187808       }
   187809    case 6: return 3;
   187810    case 5: return 3;
   187811    case 4:
   187812       if (devinfo->is_g4x) {
   187813          return 3;
   187814       } else {
   187815          return 3;
   187816       }
   187817    default:
   187818       unreachable("Invalid hardware generation");
   187819    }
   187820 }
   187821 
   187822 
   187823 
   187824 #define GEN10_SAMPLER_STATE_MagModeFilter_start  17
   187825 #define GEN9_SAMPLER_STATE_MagModeFilter_start  17
   187826 #define GEN8_SAMPLER_STATE_MagModeFilter_start  17
   187827 #define GEN75_SAMPLER_STATE_MagModeFilter_start  17
   187828 #define GEN7_SAMPLER_STATE_MagModeFilter_start  17
   187829 #define GEN6_SAMPLER_STATE_MagModeFilter_start  17
   187830 #define GEN5_SAMPLER_STATE_MagModeFilter_start  17
   187831 #define GEN45_SAMPLER_STATE_MagModeFilter_start  17
   187832 #define GEN4_SAMPLER_STATE_MagModeFilter_start  17
   187833 
   187834 static inline uint32_t ATTRIBUTE_PURE
   187835 SAMPLER_STATE_MagModeFilter_start(const struct gen_device_info *devinfo)
   187836 {
   187837    switch (devinfo->gen) {
   187838    case 10: return 17;
   187839    case 9: return 17;
   187840    case 8: return 17;
   187841    case 7:
   187842       if (devinfo->is_haswell) {
   187843          return 17;
   187844       } else {
   187845          return 17;
   187846       }
   187847    case 6: return 17;
   187848    case 5: return 17;
   187849    case 4:
   187850       if (devinfo->is_g4x) {
   187851          return 17;
   187852       } else {
   187853          return 17;
   187854       }
   187855    default:
   187856       unreachable("Invalid hardware generation");
   187857    }
   187858 }
   187859 
   187860 
   187861 
   187862 /* SAMPLER_STATE::Max LOD */
   187863 
   187864 
   187865 #define GEN10_SAMPLER_STATE_MaxLOD_bits  12
   187866 #define GEN9_SAMPLER_STATE_MaxLOD_bits  12
   187867 #define GEN8_SAMPLER_STATE_MaxLOD_bits  12
   187868 #define GEN75_SAMPLER_STATE_MaxLOD_bits  12
   187869 #define GEN7_SAMPLER_STATE_MaxLOD_bits  12
   187870 #define GEN6_SAMPLER_STATE_MaxLOD_bits  10
   187871 #define GEN5_SAMPLER_STATE_MaxLOD_bits  10
   187872 #define GEN45_SAMPLER_STATE_MaxLOD_bits  10
   187873 #define GEN4_SAMPLER_STATE_MaxLOD_bits  10
   187874 
   187875 static inline uint32_t ATTRIBUTE_PURE
   187876 SAMPLER_STATE_MaxLOD_bits(const struct gen_device_info *devinfo)
   187877 {
   187878    switch (devinfo->gen) {
   187879    case 10: return 12;
   187880    case 9: return 12;
   187881    case 8: return 12;
   187882    case 7:
   187883       if (devinfo->is_haswell) {
   187884          return 12;
   187885       } else {
   187886          return 12;
   187887       }
   187888    case 6: return 10;
   187889    case 5: return 10;
   187890    case 4:
   187891       if (devinfo->is_g4x) {
   187892          return 10;
   187893       } else {
   187894          return 10;
   187895       }
   187896    default:
   187897       unreachable("Invalid hardware generation");
   187898    }
   187899 }
   187900 
   187901 
   187902 
   187903 #define GEN10_SAMPLER_STATE_MaxLOD_start  40
   187904 #define GEN9_SAMPLER_STATE_MaxLOD_start  40
   187905 #define GEN8_SAMPLER_STATE_MaxLOD_start  40
   187906 #define GEN75_SAMPLER_STATE_MaxLOD_start  40
   187907 #define GEN7_SAMPLER_STATE_MaxLOD_start  40
   187908 #define GEN6_SAMPLER_STATE_MaxLOD_start  44
   187909 #define GEN5_SAMPLER_STATE_MaxLOD_start  44
   187910 #define GEN45_SAMPLER_STATE_MaxLOD_start  44
   187911 #define GEN4_SAMPLER_STATE_MaxLOD_start  44
   187912 
   187913 static inline uint32_t ATTRIBUTE_PURE
   187914 SAMPLER_STATE_MaxLOD_start(const struct gen_device_info *devinfo)
   187915 {
   187916    switch (devinfo->gen) {
   187917    case 10: return 40;
   187918    case 9: return 40;
   187919    case 8: return 40;
   187920    case 7:
   187921       if (devinfo->is_haswell) {
   187922          return 40;
   187923       } else {
   187924          return 40;
   187925       }
   187926    case 6: return 44;
   187927    case 5: return 44;
   187928    case 4:
   187929       if (devinfo->is_g4x) {
   187930          return 44;
   187931       } else {
   187932          return 44;
   187933       }
   187934    default:
   187935       unreachable("Invalid hardware generation");
   187936    }
   187937 }
   187938 
   187939 
   187940 
   187941 /* SAMPLER_STATE::Maximum Anisotropy */
   187942 
   187943 
   187944 #define GEN10_SAMPLER_STATE_MaximumAnisotropy_bits  3
   187945 #define GEN9_SAMPLER_STATE_MaximumAnisotropy_bits  3
   187946 #define GEN8_SAMPLER_STATE_MaximumAnisotropy_bits  3
   187947 #define GEN75_SAMPLER_STATE_MaximumAnisotropy_bits  3
   187948 #define GEN7_SAMPLER_STATE_MaximumAnisotropy_bits  3
   187949 #define GEN6_SAMPLER_STATE_MaximumAnisotropy_bits  3
   187950 #define GEN5_SAMPLER_STATE_MaximumAnisotropy_bits  3
   187951 #define GEN45_SAMPLER_STATE_MaximumAnisotropy_bits  3
   187952 #define GEN4_SAMPLER_STATE_MaximumAnisotropy_bits  3
   187953 
   187954 static inline uint32_t ATTRIBUTE_PURE
   187955 SAMPLER_STATE_MaximumAnisotropy_bits(const struct gen_device_info *devinfo)
   187956 {
   187957    switch (devinfo->gen) {
   187958    case 10: return 3;
   187959    case 9: return 3;
   187960    case 8: return 3;
   187961    case 7:
   187962       if (devinfo->is_haswell) {
   187963          return 3;
   187964       } else {
   187965          return 3;
   187966       }
   187967    case 6: return 3;
   187968    case 5: return 3;
   187969    case 4:
   187970       if (devinfo->is_g4x) {
   187971          return 3;
   187972       } else {
   187973          return 3;
   187974       }
   187975    default:
   187976       unreachable("Invalid hardware generation");
   187977    }
   187978 }
   187979 
   187980 
   187981 
   187982 #define GEN10_SAMPLER_STATE_MaximumAnisotropy_start  115
   187983 #define GEN9_SAMPLER_STATE_MaximumAnisotropy_start  115
   187984 #define GEN8_SAMPLER_STATE_MaximumAnisotropy_start  115
   187985 #define GEN75_SAMPLER_STATE_MaximumAnisotropy_start  115
   187986 #define GEN7_SAMPLER_STATE_MaximumAnisotropy_start  115
   187987 #define GEN6_SAMPLER_STATE_MaximumAnisotropy_start  115
   187988 #define GEN5_SAMPLER_STATE_MaximumAnisotropy_start  115
   187989 #define GEN45_SAMPLER_STATE_MaximumAnisotropy_start  115
   187990 #define GEN4_SAMPLER_STATE_MaximumAnisotropy_start  115
   187991 
   187992 static inline uint32_t ATTRIBUTE_PURE
   187993 SAMPLER_STATE_MaximumAnisotropy_start(const struct gen_device_info *devinfo)
   187994 {
   187995    switch (devinfo->gen) {
   187996    case 10: return 115;
   187997    case 9: return 115;
   187998    case 8: return 115;
   187999    case 7:
   188000       if (devinfo->is_haswell) {
   188001          return 115;
   188002       } else {
   188003          return 115;
   188004       }
   188005    case 6: return 115;
   188006    case 5: return 115;
   188007    case 4:
   188008       if (devinfo->is_g4x) {
   188009          return 115;
   188010       } else {
   188011          return 115;
   188012       }
   188013    default:
   188014       unreachable("Invalid hardware generation");
   188015    }
   188016 }
   188017 
   188018 
   188019 
   188020 /* SAMPLER_STATE::Min LOD */
   188021 
   188022 
   188023 #define GEN10_SAMPLER_STATE_MinLOD_bits  12
   188024 #define GEN9_SAMPLER_STATE_MinLOD_bits  12
   188025 #define GEN8_SAMPLER_STATE_MinLOD_bits  12
   188026 #define GEN75_SAMPLER_STATE_MinLOD_bits  12
   188027 #define GEN7_SAMPLER_STATE_MinLOD_bits  12
   188028 #define GEN6_SAMPLER_STATE_MinLOD_bits  10
   188029 #define GEN5_SAMPLER_STATE_MinLOD_bits  10
   188030 #define GEN45_SAMPLER_STATE_MinLOD_bits  10
   188031 #define GEN4_SAMPLER_STATE_MinLOD_bits  10
   188032 
   188033 static inline uint32_t ATTRIBUTE_PURE
   188034 SAMPLER_STATE_MinLOD_bits(const struct gen_device_info *devinfo)
   188035 {
   188036    switch (devinfo->gen) {
   188037    case 10: return 12;
   188038    case 9: return 12;
   188039    case 8: return 12;
   188040    case 7:
   188041       if (devinfo->is_haswell) {
   188042          return 12;
   188043       } else {
   188044          return 12;
   188045       }
   188046    case 6: return 10;
   188047    case 5: return 10;
   188048    case 4:
   188049       if (devinfo->is_g4x) {
   188050          return 10;
   188051       } else {
   188052          return 10;
   188053       }
   188054    default:
   188055       unreachable("Invalid hardware generation");
   188056    }
   188057 }
   188058 
   188059 
   188060 
   188061 #define GEN10_SAMPLER_STATE_MinLOD_start  52
   188062 #define GEN9_SAMPLER_STATE_MinLOD_start  52
   188063 #define GEN8_SAMPLER_STATE_MinLOD_start  52
   188064 #define GEN75_SAMPLER_STATE_MinLOD_start  52
   188065 #define GEN7_SAMPLER_STATE_MinLOD_start  52
   188066 #define GEN6_SAMPLER_STATE_MinLOD_start  54
   188067 #define GEN5_SAMPLER_STATE_MinLOD_start  54
   188068 #define GEN45_SAMPLER_STATE_MinLOD_start  54
   188069 #define GEN4_SAMPLER_STATE_MinLOD_start  54
   188070 
   188071 static inline uint32_t ATTRIBUTE_PURE
   188072 SAMPLER_STATE_MinLOD_start(const struct gen_device_info *devinfo)
   188073 {
   188074    switch (devinfo->gen) {
   188075    case 10: return 52;
   188076    case 9: return 52;
   188077    case 8: return 52;
   188078    case 7:
   188079       if (devinfo->is_haswell) {
   188080          return 52;
   188081       } else {
   188082          return 52;
   188083       }
   188084    case 6: return 54;
   188085    case 5: return 54;
   188086    case 4:
   188087       if (devinfo->is_g4x) {
   188088          return 54;
   188089       } else {
   188090          return 54;
   188091       }
   188092    default:
   188093       unreachable("Invalid hardware generation");
   188094    }
   188095 }
   188096 
   188097 
   188098 
   188099 /* SAMPLER_STATE::Min Mode Filter */
   188100 
   188101 
   188102 #define GEN10_SAMPLER_STATE_MinModeFilter_bits  3
   188103 #define GEN9_SAMPLER_STATE_MinModeFilter_bits  3
   188104 #define GEN8_SAMPLER_STATE_MinModeFilter_bits  3
   188105 #define GEN75_SAMPLER_STATE_MinModeFilter_bits  3
   188106 #define GEN7_SAMPLER_STATE_MinModeFilter_bits  3
   188107 #define GEN6_SAMPLER_STATE_MinModeFilter_bits  3
   188108 #define GEN5_SAMPLER_STATE_MinModeFilter_bits  3
   188109 #define GEN45_SAMPLER_STATE_MinModeFilter_bits  3
   188110 #define GEN4_SAMPLER_STATE_MinModeFilter_bits  3
   188111 
   188112 static inline uint32_t ATTRIBUTE_PURE
   188113 SAMPLER_STATE_MinModeFilter_bits(const struct gen_device_info *devinfo)
   188114 {
   188115    switch (devinfo->gen) {
   188116    case 10: return 3;
   188117    case 9: return 3;
   188118    case 8: return 3;
   188119    case 7:
   188120       if (devinfo->is_haswell) {
   188121          return 3;
   188122       } else {
   188123          return 3;
   188124       }
   188125    case 6: return 3;
   188126    case 5: return 3;
   188127    case 4:
   188128       if (devinfo->is_g4x) {
   188129          return 3;
   188130       } else {
   188131          return 3;
   188132       }
   188133    default:
   188134       unreachable("Invalid hardware generation");
   188135    }
   188136 }
   188137 
   188138 
   188139 
   188140 #define GEN10_SAMPLER_STATE_MinModeFilter_start  14
   188141 #define GEN9_SAMPLER_STATE_MinModeFilter_start  14
   188142 #define GEN8_SAMPLER_STATE_MinModeFilter_start  14
   188143 #define GEN75_SAMPLER_STATE_MinModeFilter_start  14
   188144 #define GEN7_SAMPLER_STATE_MinModeFilter_start  14
   188145 #define GEN6_SAMPLER_STATE_MinModeFilter_start  14
   188146 #define GEN5_SAMPLER_STATE_MinModeFilter_start  14
   188147 #define GEN45_SAMPLER_STATE_MinModeFilter_start  14
   188148 #define GEN4_SAMPLER_STATE_MinModeFilter_start  14
   188149 
   188150 static inline uint32_t ATTRIBUTE_PURE
   188151 SAMPLER_STATE_MinModeFilter_start(const struct gen_device_info *devinfo)
   188152 {
   188153    switch (devinfo->gen) {
   188154    case 10: return 14;
   188155    case 9: return 14;
   188156    case 8: return 14;
   188157    case 7:
   188158       if (devinfo->is_haswell) {
   188159          return 14;
   188160       } else {
   188161          return 14;
   188162       }
   188163    case 6: return 14;
   188164    case 5: return 14;
   188165    case 4:
   188166       if (devinfo->is_g4x) {
   188167          return 14;
   188168       } else {
   188169          return 14;
   188170       }
   188171    default:
   188172       unreachable("Invalid hardware generation");
   188173    }
   188174 }
   188175 
   188176 
   188177 
   188178 /* SAMPLER_STATE::Min and Mag State Not Equal */
   188179 
   188180 
   188181 #define GEN6_SAMPLER_STATE_MinandMagStateNotEqual_bits  1
   188182 
   188183 static inline uint32_t ATTRIBUTE_PURE
   188184 SAMPLER_STATE_MinandMagStateNotEqual_bits(const struct gen_device_info *devinfo)
   188185 {
   188186    switch (devinfo->gen) {
   188187    case 10: return 0;
   188188    case 9: return 0;
   188189    case 8: return 0;
   188190    case 7:
   188191       if (devinfo->is_haswell) {
   188192          return 0;
   188193       } else {
   188194          return 0;
   188195       }
   188196    case 6: return 1;
   188197    case 5: return 0;
   188198    case 4:
   188199       if (devinfo->is_g4x) {
   188200          return 0;
   188201       } else {
   188202          return 0;
   188203       }
   188204    default:
   188205       unreachable("Invalid hardware generation");
   188206    }
   188207 }
   188208 
   188209 
   188210 
   188211 #define GEN6_SAMPLER_STATE_MinandMagStateNotEqual_start  27
   188212 
   188213 static inline uint32_t ATTRIBUTE_PURE
   188214 SAMPLER_STATE_MinandMagStateNotEqual_start(const struct gen_device_info *devinfo)
   188215 {
   188216    switch (devinfo->gen) {
   188217    case 10: return 0;
   188218    case 9: return 0;
   188219    case 8: return 0;
   188220    case 7:
   188221       if (devinfo->is_haswell) {
   188222          return 0;
   188223       } else {
   188224          return 0;
   188225       }
   188226    case 6: return 27;
   188227    case 5: return 0;
   188228    case 4:
   188229       if (devinfo->is_g4x) {
   188230          return 0;
   188231       } else {
   188232          return 0;
   188233       }
   188234    default:
   188235       unreachable("Invalid hardware generation");
   188236    }
   188237 }
   188238 
   188239 
   188240 
   188241 /* SAMPLER_STATE::Mip Mode Filter */
   188242 
   188243 
   188244 #define GEN10_SAMPLER_STATE_MipModeFilter_bits  2
   188245 #define GEN9_SAMPLER_STATE_MipModeFilter_bits  2
   188246 #define GEN8_SAMPLER_STATE_MipModeFilter_bits  2
   188247 #define GEN75_SAMPLER_STATE_MipModeFilter_bits  2
   188248 #define GEN7_SAMPLER_STATE_MipModeFilter_bits  2
   188249 #define GEN6_SAMPLER_STATE_MipModeFilter_bits  2
   188250 #define GEN5_SAMPLER_STATE_MipModeFilter_bits  2
   188251 #define GEN45_SAMPLER_STATE_MipModeFilter_bits  2
   188252 #define GEN4_SAMPLER_STATE_MipModeFilter_bits  2
   188253 
   188254 static inline uint32_t ATTRIBUTE_PURE
   188255 SAMPLER_STATE_MipModeFilter_bits(const struct gen_device_info *devinfo)
   188256 {
   188257    switch (devinfo->gen) {
   188258    case 10: return 2;
   188259    case 9: return 2;
   188260    case 8: return 2;
   188261    case 7:
   188262       if (devinfo->is_haswell) {
   188263          return 2;
   188264       } else {
   188265          return 2;
   188266       }
   188267    case 6: return 2;
   188268    case 5: return 2;
   188269    case 4:
   188270       if (devinfo->is_g4x) {
   188271          return 2;
   188272       } else {
   188273          return 2;
   188274       }
   188275    default:
   188276       unreachable("Invalid hardware generation");
   188277    }
   188278 }
   188279 
   188280 
   188281 
   188282 #define GEN10_SAMPLER_STATE_MipModeFilter_start  20
   188283 #define GEN9_SAMPLER_STATE_MipModeFilter_start  20
   188284 #define GEN8_SAMPLER_STATE_MipModeFilter_start  20
   188285 #define GEN75_SAMPLER_STATE_MipModeFilter_start  20
   188286 #define GEN7_SAMPLER_STATE_MipModeFilter_start  20
   188287 #define GEN6_SAMPLER_STATE_MipModeFilter_start  20
   188288 #define GEN5_SAMPLER_STATE_MipModeFilter_start  20
   188289 #define GEN45_SAMPLER_STATE_MipModeFilter_start  20
   188290 #define GEN4_SAMPLER_STATE_MipModeFilter_start  20
   188291 
   188292 static inline uint32_t ATTRIBUTE_PURE
   188293 SAMPLER_STATE_MipModeFilter_start(const struct gen_device_info *devinfo)
   188294 {
   188295    switch (devinfo->gen) {
   188296    case 10: return 20;
   188297    case 9: return 20;
   188298    case 8: return 20;
   188299    case 7:
   188300       if (devinfo->is_haswell) {
   188301          return 20;
   188302       } else {
   188303          return 20;
   188304       }
   188305    case 6: return 20;
   188306    case 5: return 20;
   188307    case 4:
   188308       if (devinfo->is_g4x) {
   188309          return 20;
   188310       } else {
   188311          return 20;
   188312       }
   188313    default:
   188314       unreachable("Invalid hardware generation");
   188315    }
   188316 }
   188317 
   188318 
   188319 
   188320 /* SAMPLER_STATE::Monochrome Filter Height */
   188321 
   188322 
   188323 #define GEN5_SAMPLER_STATE_MonochromeFilterHeight_bits  3
   188324 #define GEN45_SAMPLER_STATE_MonochromeFilterHeight_bits  3
   188325 
   188326 static inline uint32_t ATTRIBUTE_PURE
   188327 SAMPLER_STATE_MonochromeFilterHeight_bits(const struct gen_device_info *devinfo)
   188328 {
   188329    switch (devinfo->gen) {
   188330    case 10: return 0;
   188331    case 9: return 0;
   188332    case 8: return 0;
   188333    case 7:
   188334       if (devinfo->is_haswell) {
   188335          return 0;
   188336       } else {
   188337          return 0;
   188338       }
   188339    case 6: return 0;
   188340    case 5: return 3;
   188341    case 4:
   188342       if (devinfo->is_g4x) {
   188343          return 3;
   188344       } else {
   188345          return 0;
   188346       }
   188347    default:
   188348       unreachable("Invalid hardware generation");
   188349    }
   188350 }
   188351 
   188352 
   188353 
   188354 #define GEN5_SAMPLER_STATE_MonochromeFilterHeight_start  125
   188355 #define GEN45_SAMPLER_STATE_MonochromeFilterHeight_start  125
   188356 
   188357 static inline uint32_t ATTRIBUTE_PURE
   188358 SAMPLER_STATE_MonochromeFilterHeight_start(const struct gen_device_info *devinfo)
   188359 {
   188360    switch (devinfo->gen) {
   188361    case 10: return 0;
   188362    case 9: return 0;
   188363    case 8: return 0;
   188364    case 7:
   188365       if (devinfo->is_haswell) {
   188366          return 0;
   188367       } else {
   188368          return 0;
   188369       }
   188370    case 6: return 0;
   188371    case 5: return 125;
   188372    case 4:
   188373       if (devinfo->is_g4x) {
   188374          return 125;
   188375       } else {
   188376          return 0;
   188377       }
   188378    default:
   188379       unreachable("Invalid hardware generation");
   188380    }
   188381 }
   188382 
   188383 
   188384 
   188385 /* SAMPLER_STATE::Monochrome Filter Height: Reserved */
   188386 
   188387 
   188388 #define GEN6_SAMPLER_STATE_MonochromeFilterHeightReserved_bits  3
   188389 
   188390 static inline uint32_t ATTRIBUTE_PURE
   188391 SAMPLER_STATE_MonochromeFilterHeightReserved_bits(const struct gen_device_info *devinfo)
   188392 {
   188393    switch (devinfo->gen) {
   188394    case 10: return 0;
   188395    case 9: return 0;
   188396    case 8: return 0;
   188397    case 7:
   188398       if (devinfo->is_haswell) {
   188399          return 0;
   188400       } else {
   188401          return 0;
   188402       }
   188403    case 6: return 3;
   188404    case 5: return 0;
   188405    case 4:
   188406       if (devinfo->is_g4x) {
   188407          return 0;
   188408       } else {
   188409          return 0;
   188410       }
   188411    default:
   188412       unreachable("Invalid hardware generation");
   188413    }
   188414 }
   188415 
   188416 
   188417 
   188418 #define GEN6_SAMPLER_STATE_MonochromeFilterHeightReserved_start  125
   188419 
   188420 static inline uint32_t ATTRIBUTE_PURE
   188421 SAMPLER_STATE_MonochromeFilterHeightReserved_start(const struct gen_device_info *devinfo)
   188422 {
   188423    switch (devinfo->gen) {
   188424    case 10: return 0;
   188425    case 9: return 0;
   188426    case 8: return 0;
   188427    case 7:
   188428       if (devinfo->is_haswell) {
   188429          return 0;
   188430       } else {
   188431          return 0;
   188432       }
   188433    case 6: return 125;
   188434    case 5: return 0;
   188435    case 4:
   188436       if (devinfo->is_g4x) {
   188437          return 0;
   188438       } else {
   188439          return 0;
   188440       }
   188441    default:
   188442       unreachable("Invalid hardware generation");
   188443    }
   188444 }
   188445 
   188446 
   188447 
   188448 /* SAMPLER_STATE::Monochrome Filter Width */
   188449 
   188450 
   188451 #define GEN6_SAMPLER_STATE_MonochromeFilterWidth_bits  3
   188452 #define GEN5_SAMPLER_STATE_MonochromeFilterWidth_bits  3
   188453 #define GEN45_SAMPLER_STATE_MonochromeFilterWidth_bits  3
   188454 
   188455 static inline uint32_t ATTRIBUTE_PURE
   188456 SAMPLER_STATE_MonochromeFilterWidth_bits(const struct gen_device_info *devinfo)
   188457 {
   188458    switch (devinfo->gen) {
   188459    case 10: return 0;
   188460    case 9: return 0;
   188461    case 8: return 0;
   188462    case 7:
   188463       if (devinfo->is_haswell) {
   188464          return 0;
   188465       } else {
   188466          return 0;
   188467       }
   188468    case 6: return 3;
   188469    case 5: return 3;
   188470    case 4:
   188471       if (devinfo->is_g4x) {
   188472          return 3;
   188473       } else {
   188474          return 0;
   188475       }
   188476    default:
   188477       unreachable("Invalid hardware generation");
   188478    }
   188479 }
   188480 
   188481 
   188482 
   188483 #define GEN6_SAMPLER_STATE_MonochromeFilterWidth_start  122
   188484 #define GEN5_SAMPLER_STATE_MonochromeFilterWidth_start  122
   188485 #define GEN45_SAMPLER_STATE_MonochromeFilterWidth_start  122
   188486 
   188487 static inline uint32_t ATTRIBUTE_PURE
   188488 SAMPLER_STATE_MonochromeFilterWidth_start(const struct gen_device_info *devinfo)
   188489 {
   188490    switch (devinfo->gen) {
   188491    case 10: return 0;
   188492    case 9: return 0;
   188493    case 8: return 0;
   188494    case 7:
   188495       if (devinfo->is_haswell) {
   188496          return 0;
   188497       } else {
   188498          return 0;
   188499       }
   188500    case 6: return 122;
   188501    case 5: return 122;
   188502    case 4:
   188503       if (devinfo->is_g4x) {
   188504          return 122;
   188505       } else {
   188506          return 0;
   188507       }
   188508    default:
   188509       unreachable("Invalid hardware generation");
   188510    }
   188511 }
   188512 
   188513 
   188514 
   188515 /* SAMPLER_STATE::Non-normalized Coordinate Enable */
   188516 
   188517 
   188518 #define GEN10_SAMPLER_STATE_NonnormalizedCoordinateEnable_bits  1
   188519 #define GEN9_SAMPLER_STATE_NonnormalizedCoordinateEnable_bits  1
   188520 #define GEN8_SAMPLER_STATE_NonnormalizedCoordinateEnable_bits  1
   188521 #define GEN75_SAMPLER_STATE_NonnormalizedCoordinateEnable_bits  1
   188522 #define GEN7_SAMPLER_STATE_NonnormalizedCoordinateEnable_bits  1
   188523 #define GEN6_SAMPLER_STATE_NonnormalizedCoordinateEnable_bits  1
   188524 
   188525 static inline uint32_t ATTRIBUTE_PURE
   188526 SAMPLER_STATE_NonnormalizedCoordinateEnable_bits(const struct gen_device_info *devinfo)
   188527 {
   188528    switch (devinfo->gen) {
   188529    case 10: return 1;
   188530    case 9: return 1;
   188531    case 8: return 1;
   188532    case 7:
   188533       if (devinfo->is_haswell) {
   188534          return 1;
   188535       } else {
   188536          return 1;
   188537       }
   188538    case 6: return 1;
   188539    case 5: return 0;
   188540    case 4:
   188541       if (devinfo->is_g4x) {
   188542          return 0;
   188543       } else {
   188544          return 0;
   188545       }
   188546    default:
   188547       unreachable("Invalid hardware generation");
   188548    }
   188549 }
   188550 
   188551 
   188552 
   188553 #define GEN10_SAMPLER_STATE_NonnormalizedCoordinateEnable_start  106
   188554 #define GEN9_SAMPLER_STATE_NonnormalizedCoordinateEnable_start  106
   188555 #define GEN8_SAMPLER_STATE_NonnormalizedCoordinateEnable_start  106
   188556 #define GEN75_SAMPLER_STATE_NonnormalizedCoordinateEnable_start  106
   188557 #define GEN7_SAMPLER_STATE_NonnormalizedCoordinateEnable_start  106
   188558 #define GEN6_SAMPLER_STATE_NonnormalizedCoordinateEnable_start  96
   188559 
   188560 static inline uint32_t ATTRIBUTE_PURE
   188561 SAMPLER_STATE_NonnormalizedCoordinateEnable_start(const struct gen_device_info *devinfo)
   188562 {
   188563    switch (devinfo->gen) {
   188564    case 10: return 106;
   188565    case 9: return 106;
   188566    case 8: return 106;
   188567    case 7:
   188568       if (devinfo->is_haswell) {
   188569          return 106;
   188570       } else {
   188571          return 106;
   188572       }
   188573    case 6: return 96;
   188574    case 5: return 0;
   188575    case 4:
   188576       if (devinfo->is_g4x) {
   188577          return 0;
   188578       } else {
   188579          return 0;
   188580       }
   188581    default:
   188582       unreachable("Invalid hardware generation");
   188583    }
   188584 }
   188585 
   188586 
   188587 
   188588 /* SAMPLER_STATE::R Address Mag Filter Rounding Enable */
   188589 
   188590 
   188591 #define GEN10_SAMPLER_STATE_RAddressMagFilterRoundingEnable_bits  1
   188592 #define GEN9_SAMPLER_STATE_RAddressMagFilterRoundingEnable_bits  1
   188593 #define GEN8_SAMPLER_STATE_RAddressMagFilterRoundingEnable_bits  1
   188594 #define GEN75_SAMPLER_STATE_RAddressMagFilterRoundingEnable_bits  1
   188595 #define GEN7_SAMPLER_STATE_RAddressMagFilterRoundingEnable_bits  1
   188596 #define GEN6_SAMPLER_STATE_RAddressMagFilterRoundingEnable_bits  1
   188597 #define GEN5_SAMPLER_STATE_RAddressMagFilterRoundingEnable_bits  1
   188598 #define GEN45_SAMPLER_STATE_RAddressMagFilterRoundingEnable_bits  1
   188599 #define GEN4_SAMPLER_STATE_RAddressMagFilterRoundingEnable_bits  1
   188600 
   188601 static inline uint32_t ATTRIBUTE_PURE
   188602 SAMPLER_STATE_RAddressMagFilterRoundingEnable_bits(const struct gen_device_info *devinfo)
   188603 {
   188604    switch (devinfo->gen) {
   188605    case 10: return 1;
   188606    case 9: return 1;
   188607    case 8: return 1;
   188608    case 7:
   188609       if (devinfo->is_haswell) {
   188610          return 1;
   188611       } else {
   188612          return 1;
   188613       }
   188614    case 6: return 1;
   188615    case 5: return 1;
   188616    case 4:
   188617       if (devinfo->is_g4x) {
   188618          return 1;
   188619       } else {
   188620          return 1;
   188621       }
   188622    default:
   188623       unreachable("Invalid hardware generation");
   188624    }
   188625 }
   188626 
   188627 
   188628 
   188629 #define GEN10_SAMPLER_STATE_RAddressMagFilterRoundingEnable_start  110
   188630 #define GEN9_SAMPLER_STATE_RAddressMagFilterRoundingEnable_start  110
   188631 #define GEN8_SAMPLER_STATE_RAddressMagFilterRoundingEnable_start  110
   188632 #define GEN75_SAMPLER_STATE_RAddressMagFilterRoundingEnable_start  110
   188633 #define GEN7_SAMPLER_STATE_RAddressMagFilterRoundingEnable_start  110
   188634 #define GEN6_SAMPLER_STATE_RAddressMagFilterRoundingEnable_start  110
   188635 #define GEN5_SAMPLER_STATE_RAddressMagFilterRoundingEnable_start  110
   188636 #define GEN45_SAMPLER_STATE_RAddressMagFilterRoundingEnable_start  110
   188637 #define GEN4_SAMPLER_STATE_RAddressMagFilterRoundingEnable_start  110
   188638 
   188639 static inline uint32_t ATTRIBUTE_PURE
   188640 SAMPLER_STATE_RAddressMagFilterRoundingEnable_start(const struct gen_device_info *devinfo)
   188641 {
   188642    switch (devinfo->gen) {
   188643    case 10: return 110;
   188644    case 9: return 110;
   188645    case 8: return 110;
   188646    case 7:
   188647       if (devinfo->is_haswell) {
   188648          return 110;
   188649       } else {
   188650          return 110;
   188651       }
   188652    case 6: return 110;
   188653    case 5: return 110;
   188654    case 4:
   188655       if (devinfo->is_g4x) {
   188656          return 110;
   188657       } else {
   188658          return 110;
   188659       }
   188660    default:
   188661       unreachable("Invalid hardware generation");
   188662    }
   188663 }
   188664 
   188665 
   188666 
   188667 /* SAMPLER_STATE::R Address Min Filter Rounding Enable */
   188668 
   188669 
   188670 #define GEN10_SAMPLER_STATE_RAddressMinFilterRoundingEnable_bits  1
   188671 #define GEN9_SAMPLER_STATE_RAddressMinFilterRoundingEnable_bits  1
   188672 #define GEN8_SAMPLER_STATE_RAddressMinFilterRoundingEnable_bits  1
   188673 #define GEN75_SAMPLER_STATE_RAddressMinFilterRoundingEnable_bits  1
   188674 #define GEN7_SAMPLER_STATE_RAddressMinFilterRoundingEnable_bits  1
   188675 #define GEN6_SAMPLER_STATE_RAddressMinFilterRoundingEnable_bits  1
   188676 #define GEN5_SAMPLER_STATE_RAddressMinFilterRoundingEnable_bits  1
   188677 #define GEN45_SAMPLER_STATE_RAddressMinFilterRoundingEnable_bits  1
   188678 #define GEN4_SAMPLER_STATE_RAddressMinFilterRoundingEnable_bits  1
   188679 
   188680 static inline uint32_t ATTRIBUTE_PURE
   188681 SAMPLER_STATE_RAddressMinFilterRoundingEnable_bits(const struct gen_device_info *devinfo)
   188682 {
   188683    switch (devinfo->gen) {
   188684    case 10: return 1;
   188685    case 9: return 1;
   188686    case 8: return 1;
   188687    case 7:
   188688       if (devinfo->is_haswell) {
   188689          return 1;
   188690       } else {
   188691          return 1;
   188692       }
   188693    case 6: return 1;
   188694    case 5: return 1;
   188695    case 4:
   188696       if (devinfo->is_g4x) {
   188697          return 1;
   188698       } else {
   188699          return 1;
   188700       }
   188701    default:
   188702       unreachable("Invalid hardware generation");
   188703    }
   188704 }
   188705 
   188706 
   188707 
   188708 #define GEN10_SAMPLER_STATE_RAddressMinFilterRoundingEnable_start  109
   188709 #define GEN9_SAMPLER_STATE_RAddressMinFilterRoundingEnable_start  109
   188710 #define GEN8_SAMPLER_STATE_RAddressMinFilterRoundingEnable_start  109
   188711 #define GEN75_SAMPLER_STATE_RAddressMinFilterRoundingEnable_start  109
   188712 #define GEN7_SAMPLER_STATE_RAddressMinFilterRoundingEnable_start  109
   188713 #define GEN6_SAMPLER_STATE_RAddressMinFilterRoundingEnable_start  109
   188714 #define GEN5_SAMPLER_STATE_RAddressMinFilterRoundingEnable_start  109
   188715 #define GEN45_SAMPLER_STATE_RAddressMinFilterRoundingEnable_start  109
   188716 #define GEN4_SAMPLER_STATE_RAddressMinFilterRoundingEnable_start  109
   188717 
   188718 static inline uint32_t ATTRIBUTE_PURE
   188719 SAMPLER_STATE_RAddressMinFilterRoundingEnable_start(const struct gen_device_info *devinfo)
   188720 {
   188721    switch (devinfo->gen) {
   188722    case 10: return 109;
   188723    case 9: return 109;
   188724    case 8: return 109;
   188725    case 7:
   188726       if (devinfo->is_haswell) {
   188727          return 109;
   188728       } else {
   188729          return 109;
   188730       }
   188731    case 6: return 109;
   188732    case 5: return 109;
   188733    case 4:
   188734       if (devinfo->is_g4x) {
   188735          return 109;
   188736       } else {
   188737          return 109;
   188738       }
   188739    default:
   188740       unreachable("Invalid hardware generation");
   188741    }
   188742 }
   188743 
   188744 
   188745 
   188746 /* SAMPLER_STATE::Reduction Type */
   188747 
   188748 
   188749 #define GEN10_SAMPLER_STATE_ReductionType_bits  2
   188750 #define GEN9_SAMPLER_STATE_ReductionType_bits  2
   188751 
   188752 static inline uint32_t ATTRIBUTE_PURE
   188753 SAMPLER_STATE_ReductionType_bits(const struct gen_device_info *devinfo)
   188754 {
   188755    switch (devinfo->gen) {
   188756    case 10: return 2;
   188757    case 9: return 2;
   188758    case 8: return 0;
   188759    case 7:
   188760       if (devinfo->is_haswell) {
   188761          return 0;
   188762       } else {
   188763          return 0;
   188764       }
   188765    case 6: return 0;
   188766    case 5: return 0;
   188767    case 4:
   188768       if (devinfo->is_g4x) {
   188769          return 0;
   188770       } else {
   188771          return 0;
   188772       }
   188773    default:
   188774       unreachable("Invalid hardware generation");
   188775    }
   188776 }
   188777 
   188778 
   188779 
   188780 #define GEN10_SAMPLER_STATE_ReductionType_start  118
   188781 #define GEN9_SAMPLER_STATE_ReductionType_start  118
   188782 
   188783 static inline uint32_t ATTRIBUTE_PURE
   188784 SAMPLER_STATE_ReductionType_start(const struct gen_device_info *devinfo)
   188785 {
   188786    switch (devinfo->gen) {
   188787    case 10: return 118;
   188788    case 9: return 118;
   188789    case 8: return 0;
   188790    case 7:
   188791       if (devinfo->is_haswell) {
   188792          return 0;
   188793       } else {
   188794          return 0;
   188795       }
   188796    case 6: return 0;
   188797    case 5: return 0;
   188798    case 4:
   188799       if (devinfo->is_g4x) {
   188800          return 0;
   188801       } else {
   188802          return 0;
   188803       }
   188804    default:
   188805       unreachable("Invalid hardware generation");
   188806    }
   188807 }
   188808 
   188809 
   188810 
   188811 /* SAMPLER_STATE::Reduction Type Enable */
   188812 
   188813 
   188814 #define GEN10_SAMPLER_STATE_ReductionTypeEnable_bits  1
   188815 #define GEN9_SAMPLER_STATE_ReductionTypeEnable_bits  1
   188816 
   188817 static inline uint32_t ATTRIBUTE_PURE
   188818 SAMPLER_STATE_ReductionTypeEnable_bits(const struct gen_device_info *devinfo)
   188819 {
   188820    switch (devinfo->gen) {
   188821    case 10: return 1;
   188822    case 9: return 1;
   188823    case 8: return 0;
   188824    case 7:
   188825       if (devinfo->is_haswell) {
   188826          return 0;
   188827       } else {
   188828          return 0;
   188829       }
   188830    case 6: return 0;
   188831    case 5: return 0;
   188832    case 4:
   188833       if (devinfo->is_g4x) {
   188834          return 0;
   188835       } else {
   188836          return 0;
   188837       }
   188838    default:
   188839       unreachable("Invalid hardware generation");
   188840    }
   188841 }
   188842 
   188843 
   188844 
   188845 #define GEN10_SAMPLER_STATE_ReductionTypeEnable_start  105
   188846 #define GEN9_SAMPLER_STATE_ReductionTypeEnable_start  105
   188847 
   188848 static inline uint32_t ATTRIBUTE_PURE
   188849 SAMPLER_STATE_ReductionTypeEnable_start(const struct gen_device_info *devinfo)
   188850 {
   188851    switch (devinfo->gen) {
   188852    case 10: return 105;
   188853    case 9: return 105;
   188854    case 8: return 0;
   188855    case 7:
   188856       if (devinfo->is_haswell) {
   188857          return 0;
   188858       } else {
   188859          return 0;
   188860       }
   188861    case 6: return 0;
   188862    case 5: return 0;
   188863    case 4:
   188864       if (devinfo->is_g4x) {
   188865          return 0;
   188866       } else {
   188867          return 0;
   188868       }
   188869    default:
   188870       unreachable("Invalid hardware generation");
   188871    }
   188872 }
   188873 
   188874 
   188875 
   188876 /* SAMPLER_STATE::Sampler Disable */
   188877 
   188878 
   188879 #define GEN10_SAMPLER_STATE_SamplerDisable_bits  1
   188880 #define GEN9_SAMPLER_STATE_SamplerDisable_bits  1
   188881 #define GEN8_SAMPLER_STATE_SamplerDisable_bits  1
   188882 #define GEN75_SAMPLER_STATE_SamplerDisable_bits  1
   188883 #define GEN7_SAMPLER_STATE_SamplerDisable_bits  1
   188884 #define GEN6_SAMPLER_STATE_SamplerDisable_bits  1
   188885 #define GEN5_SAMPLER_STATE_SamplerDisable_bits  1
   188886 #define GEN45_SAMPLER_STATE_SamplerDisable_bits  1
   188887 #define GEN4_SAMPLER_STATE_SamplerDisable_bits  1
   188888 
   188889 static inline uint32_t ATTRIBUTE_PURE
   188890 SAMPLER_STATE_SamplerDisable_bits(const struct gen_device_info *devinfo)
   188891 {
   188892    switch (devinfo->gen) {
   188893    case 10: return 1;
   188894    case 9: return 1;
   188895    case 8: return 1;
   188896    case 7:
   188897       if (devinfo->is_haswell) {
   188898          return 1;
   188899       } else {
   188900          return 1;
   188901       }
   188902    case 6: return 1;
   188903    case 5: return 1;
   188904    case 4:
   188905       if (devinfo->is_g4x) {
   188906          return 1;
   188907       } else {
   188908          return 1;
   188909       }
   188910    default:
   188911       unreachable("Invalid hardware generation");
   188912    }
   188913 }
   188914 
   188915 
   188916 
   188917 #define GEN10_SAMPLER_STATE_SamplerDisable_start  31
   188918 #define GEN9_SAMPLER_STATE_SamplerDisable_start  31
   188919 #define GEN8_SAMPLER_STATE_SamplerDisable_start  31
   188920 #define GEN75_SAMPLER_STATE_SamplerDisable_start  31
   188921 #define GEN7_SAMPLER_STATE_SamplerDisable_start  31
   188922 #define GEN6_SAMPLER_STATE_SamplerDisable_start  31
   188923 #define GEN5_SAMPLER_STATE_SamplerDisable_start  31
   188924 #define GEN45_SAMPLER_STATE_SamplerDisable_start  31
   188925 #define GEN4_SAMPLER_STATE_SamplerDisable_start  31
   188926 
   188927 static inline uint32_t ATTRIBUTE_PURE
   188928 SAMPLER_STATE_SamplerDisable_start(const struct gen_device_info *devinfo)
   188929 {
   188930    switch (devinfo->gen) {
   188931    case 10: return 31;
   188932    case 9: return 31;
   188933    case 8: return 31;
   188934    case 7:
   188935       if (devinfo->is_haswell) {
   188936          return 31;
   188937       } else {
   188938          return 31;
   188939       }
   188940    case 6: return 31;
   188941    case 5: return 31;
   188942    case 4:
   188943       if (devinfo->is_g4x) {
   188944          return 31;
   188945       } else {
   188946          return 31;
   188947       }
   188948    default:
   188949       unreachable("Invalid hardware generation");
   188950    }
   188951 }
   188952 
   188953 
   188954 
   188955 /* SAMPLER_STATE::Shadow Function */
   188956 
   188957 
   188958 #define GEN10_SAMPLER_STATE_ShadowFunction_bits  3
   188959 #define GEN9_SAMPLER_STATE_ShadowFunction_bits  3
   188960 #define GEN8_SAMPLER_STATE_ShadowFunction_bits  3
   188961 #define GEN75_SAMPLER_STATE_ShadowFunction_bits  3
   188962 #define GEN7_SAMPLER_STATE_ShadowFunction_bits  3
   188963 #define GEN6_SAMPLER_STATE_ShadowFunction_bits  3
   188964 #define GEN5_SAMPLER_STATE_ShadowFunction_bits  3
   188965 #define GEN45_SAMPLER_STATE_ShadowFunction_bits  3
   188966 #define GEN4_SAMPLER_STATE_ShadowFunction_bits  3
   188967 
   188968 static inline uint32_t ATTRIBUTE_PURE
   188969 SAMPLER_STATE_ShadowFunction_bits(const struct gen_device_info *devinfo)
   188970 {
   188971    switch (devinfo->gen) {
   188972    case 10: return 3;
   188973    case 9: return 3;
   188974    case 8: return 3;
   188975    case 7:
   188976       if (devinfo->is_haswell) {
   188977          return 3;
   188978       } else {
   188979          return 3;
   188980       }
   188981    case 6: return 3;
   188982    case 5: return 3;
   188983    case 4:
   188984       if (devinfo->is_g4x) {
   188985          return 3;
   188986       } else {
   188987          return 3;
   188988       }
   188989    default:
   188990       unreachable("Invalid hardware generation");
   188991    }
   188992 }
   188993 
   188994 
   188995 
   188996 #define GEN10_SAMPLER_STATE_ShadowFunction_start  33
   188997 #define GEN9_SAMPLER_STATE_ShadowFunction_start  33
   188998 #define GEN8_SAMPLER_STATE_ShadowFunction_start  33
   188999 #define GEN75_SAMPLER_STATE_ShadowFunction_start  33
   189000 #define GEN7_SAMPLER_STATE_ShadowFunction_start  33
   189001 #define GEN6_SAMPLER_STATE_ShadowFunction_start  0
   189002 #define GEN5_SAMPLER_STATE_ShadowFunction_start  0
   189003 #define GEN45_SAMPLER_STATE_ShadowFunction_start  0
   189004 #define GEN4_SAMPLER_STATE_ShadowFunction_start  0
   189005 
   189006 static inline uint32_t ATTRIBUTE_PURE
   189007 SAMPLER_STATE_ShadowFunction_start(const struct gen_device_info *devinfo)
   189008 {
   189009    switch (devinfo->gen) {
   189010    case 10: return 33;
   189011    case 9: return 33;
   189012    case 8: return 33;
   189013    case 7:
   189014       if (devinfo->is_haswell) {
   189015          return 33;
   189016       } else {
   189017          return 33;
   189018       }
   189019    case 6: return 0;
   189020    case 5: return 0;
   189021    case 4:
   189022       if (devinfo->is_g4x) {
   189023          return 0;
   189024       } else {
   189025          return 0;
   189026       }
   189027    default:
   189028       unreachable("Invalid hardware generation");
   189029    }
   189030 }
   189031 
   189032 
   189033 
   189034 /* SAMPLER_STATE::TCX Address Control Mode */
   189035 
   189036 
   189037 #define GEN10_SAMPLER_STATE_TCXAddressControlMode_bits  3
   189038 #define GEN9_SAMPLER_STATE_TCXAddressControlMode_bits  3
   189039 #define GEN8_SAMPLER_STATE_TCXAddressControlMode_bits  3
   189040 #define GEN75_SAMPLER_STATE_TCXAddressControlMode_bits  3
   189041 #define GEN7_SAMPLER_STATE_TCXAddressControlMode_bits  3
   189042 #define GEN6_SAMPLER_STATE_TCXAddressControlMode_bits  3
   189043 #define GEN5_SAMPLER_STATE_TCXAddressControlMode_bits  3
   189044 #define GEN45_SAMPLER_STATE_TCXAddressControlMode_bits  3
   189045 #define GEN4_SAMPLER_STATE_TCXAddressControlMode_bits  3
   189046 
   189047 static inline uint32_t ATTRIBUTE_PURE
   189048 SAMPLER_STATE_TCXAddressControlMode_bits(const struct gen_device_info *devinfo)
   189049 {
   189050    switch (devinfo->gen) {
   189051    case 10: return 3;
   189052    case 9: return 3;
   189053    case 8: return 3;
   189054    case 7:
   189055       if (devinfo->is_haswell) {
   189056          return 3;
   189057       } else {
   189058          return 3;
   189059       }
   189060    case 6: return 3;
   189061    case 5: return 3;
   189062    case 4:
   189063       if (devinfo->is_g4x) {
   189064          return 3;
   189065       } else {
   189066          return 3;
   189067       }
   189068    default:
   189069       unreachable("Invalid hardware generation");
   189070    }
   189071 }
   189072 
   189073 
   189074 
   189075 #define GEN10_SAMPLER_STATE_TCXAddressControlMode_start  102
   189076 #define GEN9_SAMPLER_STATE_TCXAddressControlMode_start  102
   189077 #define GEN8_SAMPLER_STATE_TCXAddressControlMode_start  102
   189078 #define GEN75_SAMPLER_STATE_TCXAddressControlMode_start  102
   189079 #define GEN7_SAMPLER_STATE_TCXAddressControlMode_start  102
   189080 #define GEN6_SAMPLER_STATE_TCXAddressControlMode_start  38
   189081 #define GEN5_SAMPLER_STATE_TCXAddressControlMode_start  38
   189082 #define GEN45_SAMPLER_STATE_TCXAddressControlMode_start  38
   189083 #define GEN4_SAMPLER_STATE_TCXAddressControlMode_start  38
   189084 
   189085 static inline uint32_t ATTRIBUTE_PURE
   189086 SAMPLER_STATE_TCXAddressControlMode_start(const struct gen_device_info *devinfo)
   189087 {
   189088    switch (devinfo->gen) {
   189089    case 10: return 102;
   189090    case 9: return 102;
   189091    case 8: return 102;
   189092    case 7:
   189093       if (devinfo->is_haswell) {
   189094          return 102;
   189095       } else {
   189096          return 102;
   189097       }
   189098    case 6: return 38;
   189099    case 5: return 38;
   189100    case 4:
   189101       if (devinfo->is_g4x) {
   189102          return 38;
   189103       } else {
   189104          return 38;
   189105       }
   189106    default:
   189107       unreachable("Invalid hardware generation");
   189108    }
   189109 }
   189110 
   189111 
   189112 
   189113 /* SAMPLER_STATE::TCY Address Control Mode */
   189114 
   189115 
   189116 #define GEN10_SAMPLER_STATE_TCYAddressControlMode_bits  3
   189117 #define GEN9_SAMPLER_STATE_TCYAddressControlMode_bits  3
   189118 #define GEN8_SAMPLER_STATE_TCYAddressControlMode_bits  3
   189119 #define GEN75_SAMPLER_STATE_TCYAddressControlMode_bits  3
   189120 #define GEN7_SAMPLER_STATE_TCYAddressControlMode_bits  3
   189121 #define GEN6_SAMPLER_STATE_TCYAddressControlMode_bits  3
   189122 #define GEN5_SAMPLER_STATE_TCYAddressControlMode_bits  3
   189123 #define GEN45_SAMPLER_STATE_TCYAddressControlMode_bits  3
   189124 #define GEN4_SAMPLER_STATE_TCYAddressControlMode_bits  3
   189125 
   189126 static inline uint32_t ATTRIBUTE_PURE
   189127 SAMPLER_STATE_TCYAddressControlMode_bits(const struct gen_device_info *devinfo)
   189128 {
   189129    switch (devinfo->gen) {
   189130    case 10: return 3;
   189131    case 9: return 3;
   189132    case 8: return 3;
   189133    case 7:
   189134       if (devinfo->is_haswell) {
   189135          return 3;
   189136       } else {
   189137          return 3;
   189138       }
   189139    case 6: return 3;
   189140    case 5: return 3;
   189141    case 4:
   189142       if (devinfo->is_g4x) {
   189143          return 3;
   189144       } else {
   189145          return 3;
   189146       }
   189147    default:
   189148       unreachable("Invalid hardware generation");
   189149    }
   189150 }
   189151 
   189152 
   189153 
   189154 #define GEN10_SAMPLER_STATE_TCYAddressControlMode_start  99
   189155 #define GEN9_SAMPLER_STATE_TCYAddressControlMode_start  99
   189156 #define GEN8_SAMPLER_STATE_TCYAddressControlMode_start  99
   189157 #define GEN75_SAMPLER_STATE_TCYAddressControlMode_start  99
   189158 #define GEN7_SAMPLER_STATE_TCYAddressControlMode_start  99
   189159 #define GEN6_SAMPLER_STATE_TCYAddressControlMode_start  35
   189160 #define GEN5_SAMPLER_STATE_TCYAddressControlMode_start  35
   189161 #define GEN45_SAMPLER_STATE_TCYAddressControlMode_start  35
   189162 #define GEN4_SAMPLER_STATE_TCYAddressControlMode_start  35
   189163 
   189164 static inline uint32_t ATTRIBUTE_PURE
   189165 SAMPLER_STATE_TCYAddressControlMode_start(const struct gen_device_info *devinfo)
   189166 {
   189167    switch (devinfo->gen) {
   189168    case 10: return 99;
   189169    case 9: return 99;
   189170    case 8: return 99;
   189171    case 7:
   189172       if (devinfo->is_haswell) {
   189173          return 99;
   189174       } else {
   189175          return 99;
   189176       }
   189177    case 6: return 35;
   189178    case 5: return 35;
   189179    case 4:
   189180       if (devinfo->is_g4x) {
   189181          return 35;
   189182       } else {
   189183          return 35;
   189184       }
   189185    default:
   189186       unreachable("Invalid hardware generation");
   189187    }
   189188 }
   189189 
   189190 
   189191 
   189192 /* SAMPLER_STATE::TCZ Address Control Mode */
   189193 
   189194 
   189195 #define GEN10_SAMPLER_STATE_TCZAddressControlMode_bits  3
   189196 #define GEN9_SAMPLER_STATE_TCZAddressControlMode_bits  3
   189197 #define GEN8_SAMPLER_STATE_TCZAddressControlMode_bits  3
   189198 #define GEN75_SAMPLER_STATE_TCZAddressControlMode_bits  3
   189199 #define GEN7_SAMPLER_STATE_TCZAddressControlMode_bits  3
   189200 #define GEN6_SAMPLER_STATE_TCZAddressControlMode_bits  3
   189201 #define GEN5_SAMPLER_STATE_TCZAddressControlMode_bits  3
   189202 #define GEN45_SAMPLER_STATE_TCZAddressControlMode_bits  3
   189203 #define GEN4_SAMPLER_STATE_TCZAddressControlMode_bits  3
   189204 
   189205 static inline uint32_t ATTRIBUTE_PURE
   189206 SAMPLER_STATE_TCZAddressControlMode_bits(const struct gen_device_info *devinfo)
   189207 {
   189208    switch (devinfo->gen) {
   189209    case 10: return 3;
   189210    case 9: return 3;
   189211    case 8: return 3;
   189212    case 7:
   189213       if (devinfo->is_haswell) {
   189214          return 3;
   189215       } else {
   189216          return 3;
   189217       }
   189218    case 6: return 3;
   189219    case 5: return 3;
   189220    case 4:
   189221       if (devinfo->is_g4x) {
   189222          return 3;
   189223       } else {
   189224          return 3;
   189225       }
   189226    default:
   189227       unreachable("Invalid hardware generation");
   189228    }
   189229 }
   189230 
   189231 
   189232 
   189233 #define GEN10_SAMPLER_STATE_TCZAddressControlMode_start  96
   189234 #define GEN9_SAMPLER_STATE_TCZAddressControlMode_start  96
   189235 #define GEN8_SAMPLER_STATE_TCZAddressControlMode_start  96
   189236 #define GEN75_SAMPLER_STATE_TCZAddressControlMode_start  96
   189237 #define GEN7_SAMPLER_STATE_TCZAddressControlMode_start  96
   189238 #define GEN6_SAMPLER_STATE_TCZAddressControlMode_start  32
   189239 #define GEN5_SAMPLER_STATE_TCZAddressControlMode_start  32
   189240 #define GEN45_SAMPLER_STATE_TCZAddressControlMode_start  32
   189241 #define GEN4_SAMPLER_STATE_TCZAddressControlMode_start  32
   189242 
   189243 static inline uint32_t ATTRIBUTE_PURE
   189244 SAMPLER_STATE_TCZAddressControlMode_start(const struct gen_device_info *devinfo)
   189245 {
   189246    switch (devinfo->gen) {
   189247    case 10: return 96;
   189248    case 9: return 96;
   189249    case 8: return 96;
   189250    case 7:
   189251       if (devinfo->is_haswell) {
   189252          return 96;
   189253       } else {
   189254          return 96;
   189255       }
   189256    case 6: return 32;
   189257    case 5: return 32;
   189258    case 4:
   189259       if (devinfo->is_g4x) {
   189260          return 32;
   189261       } else {
   189262          return 32;
   189263       }
   189264    default:
   189265       unreachable("Invalid hardware generation");
   189266    }
   189267 }
   189268 
   189269 
   189270 
   189271 /* SAMPLER_STATE::Texture Border Color Mode */
   189272 
   189273 
   189274 #define GEN10_SAMPLER_STATE_TextureBorderColorMode_bits  1
   189275 #define GEN9_SAMPLER_STATE_TextureBorderColorMode_bits  1
   189276 #define GEN8_SAMPLER_STATE_TextureBorderColorMode_bits  1
   189277 #define GEN75_SAMPLER_STATE_TextureBorderColorMode_bits  1
   189278 #define GEN7_SAMPLER_STATE_TextureBorderColorMode_bits  1
   189279 #define GEN6_SAMPLER_STATE_TextureBorderColorMode_bits  1
   189280 
   189281 static inline uint32_t ATTRIBUTE_PURE
   189282 SAMPLER_STATE_TextureBorderColorMode_bits(const struct gen_device_info *devinfo)
   189283 {
   189284    switch (devinfo->gen) {
   189285    case 10: return 1;
   189286    case 9: return 1;
   189287    case 8: return 1;
   189288    case 7:
   189289       if (devinfo->is_haswell) {
   189290          return 1;
   189291       } else {
   189292          return 1;
   189293       }
   189294    case 6: return 1;
   189295    case 5: return 0;
   189296    case 4:
   189297       if (devinfo->is_g4x) {
   189298          return 0;
   189299       } else {
   189300          return 0;
   189301       }
   189302    default:
   189303       unreachable("Invalid hardware generation");
   189304    }
   189305 }
   189306 
   189307 
   189308 
   189309 #define GEN10_SAMPLER_STATE_TextureBorderColorMode_start  29
   189310 #define GEN9_SAMPLER_STATE_TextureBorderColorMode_start  29
   189311 #define GEN8_SAMPLER_STATE_TextureBorderColorMode_start  29
   189312 #define GEN75_SAMPLER_STATE_TextureBorderColorMode_start  29
   189313 #define GEN7_SAMPLER_STATE_TextureBorderColorMode_start  29
   189314 #define GEN6_SAMPLER_STATE_TextureBorderColorMode_start  29
   189315 
   189316 static inline uint32_t ATTRIBUTE_PURE
   189317 SAMPLER_STATE_TextureBorderColorMode_start(const struct gen_device_info *devinfo)
   189318 {
   189319    switch (devinfo->gen) {
   189320    case 10: return 29;
   189321    case 9: return 29;
   189322    case 8: return 29;
   189323    case 7:
   189324       if (devinfo->is_haswell) {
   189325          return 29;
   189326       } else {
   189327          return 29;
   189328       }
   189329    case 6: return 29;
   189330    case 5: return 0;
   189331    case 4:
   189332       if (devinfo->is_g4x) {
   189333          return 0;
   189334       } else {
   189335          return 0;
   189336       }
   189337    default:
   189338       unreachable("Invalid hardware generation");
   189339    }
   189340 }
   189341 
   189342 
   189343 
   189344 /* SAMPLER_STATE::Texture LOD Bias */
   189345 
   189346 
   189347 #define GEN10_SAMPLER_STATE_TextureLODBias_bits  13
   189348 #define GEN9_SAMPLER_STATE_TextureLODBias_bits  13
   189349 #define GEN8_SAMPLER_STATE_TextureLODBias_bits  13
   189350 #define GEN75_SAMPLER_STATE_TextureLODBias_bits  13
   189351 #define GEN7_SAMPLER_STATE_TextureLODBias_bits  13
   189352 #define GEN6_SAMPLER_STATE_TextureLODBias_bits  11
   189353 #define GEN5_SAMPLER_STATE_TextureLODBias_bits  11
   189354 #define GEN45_SAMPLER_STATE_TextureLODBias_bits  11
   189355 #define GEN4_SAMPLER_STATE_TextureLODBias_bits  11
   189356 
   189357 static inline uint32_t ATTRIBUTE_PURE
   189358 SAMPLER_STATE_TextureLODBias_bits(const struct gen_device_info *devinfo)
   189359 {
   189360    switch (devinfo->gen) {
   189361    case 10: return 13;
   189362    case 9: return 13;
   189363    case 8: return 13;
   189364    case 7:
   189365       if (devinfo->is_haswell) {
   189366          return 13;
   189367       } else {
   189368          return 13;
   189369       }
   189370    case 6: return 11;
   189371    case 5: return 11;
   189372    case 4:
   189373       if (devinfo->is_g4x) {
   189374          return 11;
   189375       } else {
   189376          return 11;
   189377       }
   189378    default:
   189379       unreachable("Invalid hardware generation");
   189380    }
   189381 }
   189382 
   189383 
   189384 
   189385 #define GEN10_SAMPLER_STATE_TextureLODBias_start  1
   189386 #define GEN9_SAMPLER_STATE_TextureLODBias_start  1
   189387 #define GEN8_SAMPLER_STATE_TextureLODBias_start  1
   189388 #define GEN75_SAMPLER_STATE_TextureLODBias_start  1
   189389 #define GEN7_SAMPLER_STATE_TextureLODBias_start  1
   189390 #define GEN6_SAMPLER_STATE_TextureLODBias_start  3
   189391 #define GEN5_SAMPLER_STATE_TextureLODBias_start  3
   189392 #define GEN45_SAMPLER_STATE_TextureLODBias_start  3
   189393 #define GEN4_SAMPLER_STATE_TextureLODBias_start  3
   189394 
   189395 static inline uint32_t ATTRIBUTE_PURE
   189396 SAMPLER_STATE_TextureLODBias_start(const struct gen_device_info *devinfo)
   189397 {
   189398    switch (devinfo->gen) {
   189399    case 10: return 1;
   189400    case 9: return 1;
   189401    case 8: return 1;
   189402    case 7:
   189403       if (devinfo->is_haswell) {
   189404          return 1;
   189405       } else {
   189406          return 1;
   189407       }
   189408    case 6: return 3;
   189409    case 5: return 3;
   189410    case 4:
   189411       if (devinfo->is_g4x) {
   189412          return 3;
   189413       } else {
   189414          return 3;
   189415       }
   189416    default:
   189417       unreachable("Invalid hardware generation");
   189418    }
   189419 }
   189420 
   189421 
   189422 
   189423 /* SAMPLER_STATE::Trilinear Filter Quality */
   189424 
   189425 
   189426 #define GEN10_SAMPLER_STATE_TrilinearFilterQuality_bits  2
   189427 #define GEN9_SAMPLER_STATE_TrilinearFilterQuality_bits  2
   189428 #define GEN8_SAMPLER_STATE_TrilinearFilterQuality_bits  2
   189429 #define GEN75_SAMPLER_STATE_TrilinearFilterQuality_bits  2
   189430 #define GEN7_SAMPLER_STATE_TrilinearFilterQuality_bits  2
   189431 
   189432 static inline uint32_t ATTRIBUTE_PURE
   189433 SAMPLER_STATE_TrilinearFilterQuality_bits(const struct gen_device_info *devinfo)
   189434 {
   189435    switch (devinfo->gen) {
   189436    case 10: return 2;
   189437    case 9: return 2;
   189438    case 8: return 2;
   189439    case 7:
   189440       if (devinfo->is_haswell) {
   189441          return 2;
   189442       } else {
   189443          return 2;
   189444       }
   189445    case 6: return 0;
   189446    case 5: return 0;
   189447    case 4:
   189448       if (devinfo->is_g4x) {
   189449          return 0;
   189450       } else {
   189451          return 0;
   189452       }
   189453    default:
   189454       unreachable("Invalid hardware generation");
   189455    }
   189456 }
   189457 
   189458 
   189459 
   189460 #define GEN10_SAMPLER_STATE_TrilinearFilterQuality_start  107
   189461 #define GEN9_SAMPLER_STATE_TrilinearFilterQuality_start  107
   189462 #define GEN8_SAMPLER_STATE_TrilinearFilterQuality_start  107
   189463 #define GEN75_SAMPLER_STATE_TrilinearFilterQuality_start  107
   189464 #define GEN7_SAMPLER_STATE_TrilinearFilterQuality_start  107
   189465 
   189466 static inline uint32_t ATTRIBUTE_PURE
   189467 SAMPLER_STATE_TrilinearFilterQuality_start(const struct gen_device_info *devinfo)
   189468 {
   189469    switch (devinfo->gen) {
   189470    case 10: return 107;
   189471    case 9: return 107;
   189472    case 8: return 107;
   189473    case 7:
   189474       if (devinfo->is_haswell) {
   189475          return 107;
   189476       } else {
   189477          return 107;
   189478       }
   189479    case 6: return 0;
   189480    case 5: return 0;
   189481    case 4:
   189482       if (devinfo->is_g4x) {
   189483          return 0;
   189484       } else {
   189485          return 0;
   189486       }
   189487    default:
   189488       unreachable("Invalid hardware generation");
   189489    }
   189490 }
   189491 
   189492 
   189493 
   189494 /* SAMPLER_STATE::U Address Mag Filter Rounding Enable */
   189495 
   189496 
   189497 #define GEN10_SAMPLER_STATE_UAddressMagFilterRoundingEnable_bits  1
   189498 #define GEN9_SAMPLER_STATE_UAddressMagFilterRoundingEnable_bits  1
   189499 #define GEN8_SAMPLER_STATE_UAddressMagFilterRoundingEnable_bits  1
   189500 #define GEN75_SAMPLER_STATE_UAddressMagFilterRoundingEnable_bits  1
   189501 #define GEN7_SAMPLER_STATE_UAddressMagFilterRoundingEnable_bits  1
   189502 #define GEN6_SAMPLER_STATE_UAddressMagFilterRoundingEnable_bits  1
   189503 #define GEN5_SAMPLER_STATE_UAddressMagFilterRoundingEnable_bits  1
   189504 #define GEN45_SAMPLER_STATE_UAddressMagFilterRoundingEnable_bits  1
   189505 #define GEN4_SAMPLER_STATE_UAddressMagFilterRoundingEnable_bits  1
   189506 
   189507 static inline uint32_t ATTRIBUTE_PURE
   189508 SAMPLER_STATE_UAddressMagFilterRoundingEnable_bits(const struct gen_device_info *devinfo)
   189509 {
   189510    switch (devinfo->gen) {
   189511    case 10: return 1;
   189512    case 9: return 1;
   189513    case 8: return 1;
   189514    case 7:
   189515       if (devinfo->is_haswell) {
   189516          return 1;
   189517       } else {
   189518          return 1;
   189519       }
   189520    case 6: return 1;
   189521    case 5: return 1;
   189522    case 4:
   189523       if (devinfo->is_g4x) {
   189524          return 1;
   189525       } else {
   189526          return 1;
   189527       }
   189528    default:
   189529       unreachable("Invalid hardware generation");
   189530    }
   189531 }
   189532 
   189533 
   189534 
   189535 #define GEN10_SAMPLER_STATE_UAddressMagFilterRoundingEnable_start  114
   189536 #define GEN9_SAMPLER_STATE_UAddressMagFilterRoundingEnable_start  114
   189537 #define GEN8_SAMPLER_STATE_UAddressMagFilterRoundingEnable_start  114
   189538 #define GEN75_SAMPLER_STATE_UAddressMagFilterRoundingEnable_start  114
   189539 #define GEN7_SAMPLER_STATE_UAddressMagFilterRoundingEnable_start  114
   189540 #define GEN6_SAMPLER_STATE_UAddressMagFilterRoundingEnable_start  114
   189541 #define GEN5_SAMPLER_STATE_UAddressMagFilterRoundingEnable_start  114
   189542 #define GEN45_SAMPLER_STATE_UAddressMagFilterRoundingEnable_start  114
   189543 #define GEN4_SAMPLER_STATE_UAddressMagFilterRoundingEnable_start  114
   189544 
   189545 static inline uint32_t ATTRIBUTE_PURE
   189546 SAMPLER_STATE_UAddressMagFilterRoundingEnable_start(const struct gen_device_info *devinfo)
   189547 {
   189548    switch (devinfo->gen) {
   189549    case 10: return 114;
   189550    case 9: return 114;
   189551    case 8: return 114;
   189552    case 7:
   189553       if (devinfo->is_haswell) {
   189554          return 114;
   189555       } else {
   189556          return 114;
   189557       }
   189558    case 6: return 114;
   189559    case 5: return 114;
   189560    case 4:
   189561       if (devinfo->is_g4x) {
   189562          return 114;
   189563       } else {
   189564          return 114;
   189565       }
   189566    default:
   189567       unreachable("Invalid hardware generation");
   189568    }
   189569 }
   189570 
   189571 
   189572 
   189573 /* SAMPLER_STATE::U Address Min Filter Rounding Enable */
   189574 
   189575 
   189576 #define GEN10_SAMPLER_STATE_UAddressMinFilterRoundingEnable_bits  1
   189577 #define GEN9_SAMPLER_STATE_UAddressMinFilterRoundingEnable_bits  1
   189578 #define GEN8_SAMPLER_STATE_UAddressMinFilterRoundingEnable_bits  1
   189579 #define GEN75_SAMPLER_STATE_UAddressMinFilterRoundingEnable_bits  1
   189580 #define GEN7_SAMPLER_STATE_UAddressMinFilterRoundingEnable_bits  1
   189581 #define GEN6_SAMPLER_STATE_UAddressMinFilterRoundingEnable_bits  1
   189582 #define GEN5_SAMPLER_STATE_UAddressMinFilterRoundingEnable_bits  1
   189583 #define GEN45_SAMPLER_STATE_UAddressMinFilterRoundingEnable_bits  1
   189584 #define GEN4_SAMPLER_STATE_UAddressMinFilterRoundingEnable_bits  1
   189585 
   189586 static inline uint32_t ATTRIBUTE_PURE
   189587 SAMPLER_STATE_UAddressMinFilterRoundingEnable_bits(const struct gen_device_info *devinfo)
   189588 {
   189589    switch (devinfo->gen) {
   189590    case 10: return 1;
   189591    case 9: return 1;
   189592    case 8: return 1;
   189593    case 7:
   189594       if (devinfo->is_haswell) {
   189595          return 1;
   189596       } else {
   189597          return 1;
   189598       }
   189599    case 6: return 1;
   189600    case 5: return 1;
   189601    case 4:
   189602       if (devinfo->is_g4x) {
   189603          return 1;
   189604       } else {
   189605          return 1;
   189606       }
   189607    default:
   189608       unreachable("Invalid hardware generation");
   189609    }
   189610 }
   189611 
   189612 
   189613 
   189614 #define GEN10_SAMPLER_STATE_UAddressMinFilterRoundingEnable_start  113
   189615 #define GEN9_SAMPLER_STATE_UAddressMinFilterRoundingEnable_start  113
   189616 #define GEN8_SAMPLER_STATE_UAddressMinFilterRoundingEnable_start  113
   189617 #define GEN75_SAMPLER_STATE_UAddressMinFilterRoundingEnable_start  113
   189618 #define GEN7_SAMPLER_STATE_UAddressMinFilterRoundingEnable_start  113
   189619 #define GEN6_SAMPLER_STATE_UAddressMinFilterRoundingEnable_start  113
   189620 #define GEN5_SAMPLER_STATE_UAddressMinFilterRoundingEnable_start  113
   189621 #define GEN45_SAMPLER_STATE_UAddressMinFilterRoundingEnable_start  113
   189622 #define GEN4_SAMPLER_STATE_UAddressMinFilterRoundingEnable_start  113
   189623 
   189624 static inline uint32_t ATTRIBUTE_PURE
   189625 SAMPLER_STATE_UAddressMinFilterRoundingEnable_start(const struct gen_device_info *devinfo)
   189626 {
   189627    switch (devinfo->gen) {
   189628    case 10: return 113;
   189629    case 9: return 113;
   189630    case 8: return 113;
   189631    case 7:
   189632       if (devinfo->is_haswell) {
   189633          return 113;
   189634       } else {
   189635          return 113;
   189636       }
   189637    case 6: return 113;
   189638    case 5: return 113;
   189639    case 4:
   189640       if (devinfo->is_g4x) {
   189641          return 113;
   189642       } else {
   189643          return 113;
   189644       }
   189645    default:
   189646       unreachable("Invalid hardware generation");
   189647    }
   189648 }
   189649 
   189650 
   189651 
   189652 /* SAMPLER_STATE::V Address Mag Filter Rounding Enable */
   189653 
   189654 
   189655 #define GEN10_SAMPLER_STATE_VAddressMagFilterRoundingEnable_bits  1
   189656 #define GEN9_SAMPLER_STATE_VAddressMagFilterRoundingEnable_bits  1
   189657 #define GEN8_SAMPLER_STATE_VAddressMagFilterRoundingEnable_bits  1
   189658 #define GEN75_SAMPLER_STATE_VAddressMagFilterRoundingEnable_bits  1
   189659 #define GEN7_SAMPLER_STATE_VAddressMagFilterRoundingEnable_bits  1
   189660 #define GEN6_SAMPLER_STATE_VAddressMagFilterRoundingEnable_bits  1
   189661 #define GEN5_SAMPLER_STATE_VAddressMagFilterRoundingEnable_bits  1
   189662 #define GEN45_SAMPLER_STATE_VAddressMagFilterRoundingEnable_bits  1
   189663 #define GEN4_SAMPLER_STATE_VAddressMagFilterRoundingEnable_bits  1
   189664 
   189665 static inline uint32_t ATTRIBUTE_PURE
   189666 SAMPLER_STATE_VAddressMagFilterRoundingEnable_bits(const struct gen_device_info *devinfo)
   189667 {
   189668    switch (devinfo->gen) {
   189669    case 10: return 1;
   189670    case 9: return 1;
   189671    case 8: return 1;
   189672    case 7:
   189673       if (devinfo->is_haswell) {
   189674          return 1;
   189675       } else {
   189676          return 1;
   189677       }
   189678    case 6: return 1;
   189679    case 5: return 1;
   189680    case 4:
   189681       if (devinfo->is_g4x) {
   189682          return 1;
   189683       } else {
   189684          return 1;
   189685       }
   189686    default:
   189687       unreachable("Invalid hardware generation");
   189688    }
   189689 }
   189690 
   189691 
   189692 
   189693 #define GEN10_SAMPLER_STATE_VAddressMagFilterRoundingEnable_start  112
   189694 #define GEN9_SAMPLER_STATE_VAddressMagFilterRoundingEnable_start  112
   189695 #define GEN8_SAMPLER_STATE_VAddressMagFilterRoundingEnable_start  112
   189696 #define GEN75_SAMPLER_STATE_VAddressMagFilterRoundingEnable_start  112
   189697 #define GEN7_SAMPLER_STATE_VAddressMagFilterRoundingEnable_start  112
   189698 #define GEN6_SAMPLER_STATE_VAddressMagFilterRoundingEnable_start  112
   189699 #define GEN5_SAMPLER_STATE_VAddressMagFilterRoundingEnable_start  112
   189700 #define GEN45_SAMPLER_STATE_VAddressMagFilterRoundingEnable_start  112
   189701 #define GEN4_SAMPLER_STATE_VAddressMagFilterRoundingEnable_start  112
   189702 
   189703 static inline uint32_t ATTRIBUTE_PURE
   189704 SAMPLER_STATE_VAddressMagFilterRoundingEnable_start(const struct gen_device_info *devinfo)
   189705 {
   189706    switch (devinfo->gen) {
   189707    case 10: return 112;
   189708    case 9: return 112;
   189709    case 8: return 112;
   189710    case 7:
   189711       if (devinfo->is_haswell) {
   189712          return 112;
   189713       } else {
   189714          return 112;
   189715       }
   189716    case 6: return 112;
   189717    case 5: return 112;
   189718    case 4:
   189719       if (devinfo->is_g4x) {
   189720          return 112;
   189721       } else {
   189722          return 112;
   189723       }
   189724    default:
   189725       unreachable("Invalid hardware generation");
   189726    }
   189727 }
   189728 
   189729 
   189730 
   189731 /* SAMPLER_STATE::V Address Min Filter Rounding Enable */
   189732 
   189733 
   189734 #define GEN10_SAMPLER_STATE_VAddressMinFilterRoundingEnable_bits  1
   189735 #define GEN9_SAMPLER_STATE_VAddressMinFilterRoundingEnable_bits  1
   189736 #define GEN8_SAMPLER_STATE_VAddressMinFilterRoundingEnable_bits  1
   189737 #define GEN75_SAMPLER_STATE_VAddressMinFilterRoundingEnable_bits  1
   189738 #define GEN7_SAMPLER_STATE_VAddressMinFilterRoundingEnable_bits  1
   189739 #define GEN6_SAMPLER_STATE_VAddressMinFilterRoundingEnable_bits  1
   189740 #define GEN5_SAMPLER_STATE_VAddressMinFilterRoundingEnable_bits  1
   189741 #define GEN45_SAMPLER_STATE_VAddressMinFilterRoundingEnable_bits  1
   189742 #define GEN4_SAMPLER_STATE_VAddressMinFilterRoundingEnable_bits  1
   189743 
   189744 static inline uint32_t ATTRIBUTE_PURE
   189745 SAMPLER_STATE_VAddressMinFilterRoundingEnable_bits(const struct gen_device_info *devinfo)
   189746 {
   189747    switch (devinfo->gen) {
   189748    case 10: return 1;
   189749    case 9: return 1;
   189750    case 8: return 1;
   189751    case 7:
   189752       if (devinfo->is_haswell) {
   189753          return 1;
   189754       } else {
   189755          return 1;
   189756       }
   189757    case 6: return 1;
   189758    case 5: return 1;
   189759    case 4:
   189760       if (devinfo->is_g4x) {
   189761          return 1;
   189762       } else {
   189763          return 1;
   189764       }
   189765    default:
   189766       unreachable("Invalid hardware generation");
   189767    }
   189768 }
   189769 
   189770 
   189771 
   189772 #define GEN10_SAMPLER_STATE_VAddressMinFilterRoundingEnable_start  111
   189773 #define GEN9_SAMPLER_STATE_VAddressMinFilterRoundingEnable_start  111
   189774 #define GEN8_SAMPLER_STATE_VAddressMinFilterRoundingEnable_start  111
   189775 #define GEN75_SAMPLER_STATE_VAddressMinFilterRoundingEnable_start  111
   189776 #define GEN7_SAMPLER_STATE_VAddressMinFilterRoundingEnable_start  111
   189777 #define GEN6_SAMPLER_STATE_VAddressMinFilterRoundingEnable_start  111
   189778 #define GEN5_SAMPLER_STATE_VAddressMinFilterRoundingEnable_start  111
   189779 #define GEN45_SAMPLER_STATE_VAddressMinFilterRoundingEnable_start  111
   189780 #define GEN4_SAMPLER_STATE_VAddressMinFilterRoundingEnable_start  111
   189781 
   189782 static inline uint32_t ATTRIBUTE_PURE
   189783 SAMPLER_STATE_VAddressMinFilterRoundingEnable_start(const struct gen_device_info *devinfo)
   189784 {
   189785    switch (devinfo->gen) {
   189786    case 10: return 111;
   189787    case 9: return 111;
   189788    case 8: return 111;
   189789    case 7:
   189790       if (devinfo->is_haswell) {
   189791          return 111;
   189792       } else {
   189793          return 111;
   189794       }
   189795    case 6: return 111;
   189796    case 5: return 111;
   189797    case 4:
   189798       if (devinfo->is_g4x) {
   189799          return 111;
   189800       } else {
   189801          return 111;
   189802       }
   189803    default:
   189804       unreachable("Invalid hardware generation");
   189805    }
   189806 }
   189807 
   189808 
   189809 
   189810 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS */
   189811 
   189812 
   189813 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_length  8
   189814 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_length  8
   189815 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_length  8
   189816 
   189817 static inline uint32_t ATTRIBUTE_PURE
   189818 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_length(const struct gen_device_info *devinfo)
   189819 {
   189820    switch (devinfo->gen) {
   189821    case 10: return 8;
   189822    case 9: return 8;
   189823    case 8: return 8;
   189824    case 7:
   189825       if (devinfo->is_haswell) {
   189826          return 0;
   189827       } else {
   189828          return 0;
   189829       }
   189830    case 6: return 0;
   189831    case 5: return 0;
   189832    case 4:
   189833       if (devinfo->is_g4x) {
   189834          return 0;
   189835       } else {
   189836          return 0;
   189837       }
   189838    default:
   189839       unreachable("Invalid hardware generation");
   189840    }
   189841 }
   189842 
   189843 
   189844 
   189845 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 0X Filter Coefficient[n,0] */
   189846 
   189847 
   189848 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn0_bits  8
   189849 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn0_bits  8
   189850 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn0_bits  8
   189851 
   189852 static inline uint32_t ATTRIBUTE_PURE
   189853 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn0_bits(const struct gen_device_info *devinfo)
   189854 {
   189855    switch (devinfo->gen) {
   189856    case 10: return 8;
   189857    case 9: return 8;
   189858    case 8: return 8;
   189859    case 7:
   189860       if (devinfo->is_haswell) {
   189861          return 0;
   189862       } else {
   189863          return 0;
   189864       }
   189865    case 6: return 0;
   189866    case 5: return 0;
   189867    case 4:
   189868       if (devinfo->is_g4x) {
   189869          return 0;
   189870       } else {
   189871          return 0;
   189872       }
   189873    default:
   189874       unreachable("Invalid hardware generation");
   189875    }
   189876 }
   189877 
   189878 
   189879 
   189880 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn0_start  0
   189881 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn0_start  0
   189882 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn0_start  0
   189883 
   189884 static inline uint32_t ATTRIBUTE_PURE
   189885 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn0_start(const struct gen_device_info *devinfo)
   189886 {
   189887    switch (devinfo->gen) {
   189888    case 10: return 0;
   189889    case 9: return 0;
   189890    case 8: return 0;
   189891    case 7:
   189892       if (devinfo->is_haswell) {
   189893          return 0;
   189894       } else {
   189895          return 0;
   189896       }
   189897    case 6: return 0;
   189898    case 5: return 0;
   189899    case 4:
   189900       if (devinfo->is_g4x) {
   189901          return 0;
   189902       } else {
   189903          return 0;
   189904       }
   189905    default:
   189906       unreachable("Invalid hardware generation");
   189907    }
   189908 }
   189909 
   189910 
   189911 
   189912 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 0X Filter Coefficient[n,1] */
   189913 
   189914 
   189915 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn1_bits  8
   189916 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn1_bits  8
   189917 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn1_bits  8
   189918 
   189919 static inline uint32_t ATTRIBUTE_PURE
   189920 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn1_bits(const struct gen_device_info *devinfo)
   189921 {
   189922    switch (devinfo->gen) {
   189923    case 10: return 8;
   189924    case 9: return 8;
   189925    case 8: return 8;
   189926    case 7:
   189927       if (devinfo->is_haswell) {
   189928          return 0;
   189929       } else {
   189930          return 0;
   189931       }
   189932    case 6: return 0;
   189933    case 5: return 0;
   189934    case 4:
   189935       if (devinfo->is_g4x) {
   189936          return 0;
   189937       } else {
   189938          return 0;
   189939       }
   189940    default:
   189941       unreachable("Invalid hardware generation");
   189942    }
   189943 }
   189944 
   189945 
   189946 
   189947 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn1_start  16
   189948 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn1_start  16
   189949 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn1_start  16
   189950 
   189951 static inline uint32_t ATTRIBUTE_PURE
   189952 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn1_start(const struct gen_device_info *devinfo)
   189953 {
   189954    switch (devinfo->gen) {
   189955    case 10: return 16;
   189956    case 9: return 16;
   189957    case 8: return 16;
   189958    case 7:
   189959       if (devinfo->is_haswell) {
   189960          return 0;
   189961       } else {
   189962          return 0;
   189963       }
   189964    case 6: return 0;
   189965    case 5: return 0;
   189966    case 4:
   189967       if (devinfo->is_g4x) {
   189968          return 0;
   189969       } else {
   189970          return 0;
   189971       }
   189972    default:
   189973       unreachable("Invalid hardware generation");
   189974    }
   189975 }
   189976 
   189977 
   189978 
   189979 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 0X Filter Coefficient[n,2] */
   189980 
   189981 
   189982 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn2_bits  8
   189983 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn2_bits  8
   189984 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn2_bits  8
   189985 
   189986 static inline uint32_t ATTRIBUTE_PURE
   189987 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn2_bits(const struct gen_device_info *devinfo)
   189988 {
   189989    switch (devinfo->gen) {
   189990    case 10: return 8;
   189991    case 9: return 8;
   189992    case 8: return 8;
   189993    case 7:
   189994       if (devinfo->is_haswell) {
   189995          return 0;
   189996       } else {
   189997          return 0;
   189998       }
   189999    case 6: return 0;
   190000    case 5: return 0;
   190001    case 4:
   190002       if (devinfo->is_g4x) {
   190003          return 0;
   190004       } else {
   190005          return 0;
   190006       }
   190007    default:
   190008       unreachable("Invalid hardware generation");
   190009    }
   190010 }
   190011 
   190012 
   190013 
   190014 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn2_start  32
   190015 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn2_start  32
   190016 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn2_start  32
   190017 
   190018 static inline uint32_t ATTRIBUTE_PURE
   190019 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn2_start(const struct gen_device_info *devinfo)
   190020 {
   190021    switch (devinfo->gen) {
   190022    case 10: return 32;
   190023    case 9: return 32;
   190024    case 8: return 32;
   190025    case 7:
   190026       if (devinfo->is_haswell) {
   190027          return 0;
   190028       } else {
   190029          return 0;
   190030       }
   190031    case 6: return 0;
   190032    case 5: return 0;
   190033    case 4:
   190034       if (devinfo->is_g4x) {
   190035          return 0;
   190036       } else {
   190037          return 0;
   190038       }
   190039    default:
   190040       unreachable("Invalid hardware generation");
   190041    }
   190042 }
   190043 
   190044 
   190045 
   190046 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 0X Filter Coefficient[n,3] */
   190047 
   190048 
   190049 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn3_bits  8
   190050 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn3_bits  8
   190051 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn3_bits  8
   190052 
   190053 static inline uint32_t ATTRIBUTE_PURE
   190054 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn3_bits(const struct gen_device_info *devinfo)
   190055 {
   190056    switch (devinfo->gen) {
   190057    case 10: return 8;
   190058    case 9: return 8;
   190059    case 8: return 8;
   190060    case 7:
   190061       if (devinfo->is_haswell) {
   190062          return 0;
   190063       } else {
   190064          return 0;
   190065       }
   190066    case 6: return 0;
   190067    case 5: return 0;
   190068    case 4:
   190069       if (devinfo->is_g4x) {
   190070          return 0;
   190071       } else {
   190072          return 0;
   190073       }
   190074    default:
   190075       unreachable("Invalid hardware generation");
   190076    }
   190077 }
   190078 
   190079 
   190080 
   190081 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn3_start  48
   190082 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn3_start  48
   190083 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn3_start  48
   190084 
   190085 static inline uint32_t ATTRIBUTE_PURE
   190086 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn3_start(const struct gen_device_info *devinfo)
   190087 {
   190088    switch (devinfo->gen) {
   190089    case 10: return 48;
   190090    case 9: return 48;
   190091    case 8: return 48;
   190092    case 7:
   190093       if (devinfo->is_haswell) {
   190094          return 0;
   190095       } else {
   190096          return 0;
   190097       }
   190098    case 6: return 0;
   190099    case 5: return 0;
   190100    case 4:
   190101       if (devinfo->is_g4x) {
   190102          return 0;
   190103       } else {
   190104          return 0;
   190105       }
   190106    default:
   190107       unreachable("Invalid hardware generation");
   190108    }
   190109 }
   190110 
   190111 
   190112 
   190113 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 0X Filter Coefficient[n,4] */
   190114 
   190115 
   190116 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn4_bits  8
   190117 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn4_bits  8
   190118 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn4_bits  8
   190119 
   190120 static inline uint32_t ATTRIBUTE_PURE
   190121 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn4_bits(const struct gen_device_info *devinfo)
   190122 {
   190123    switch (devinfo->gen) {
   190124    case 10: return 8;
   190125    case 9: return 8;
   190126    case 8: return 8;
   190127    case 7:
   190128       if (devinfo->is_haswell) {
   190129          return 0;
   190130       } else {
   190131          return 0;
   190132       }
   190133    case 6: return 0;
   190134    case 5: return 0;
   190135    case 4:
   190136       if (devinfo->is_g4x) {
   190137          return 0;
   190138       } else {
   190139          return 0;
   190140       }
   190141    default:
   190142       unreachable("Invalid hardware generation");
   190143    }
   190144 }
   190145 
   190146 
   190147 
   190148 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn4_start  64
   190149 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn4_start  64
   190150 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn4_start  64
   190151 
   190152 static inline uint32_t ATTRIBUTE_PURE
   190153 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn4_start(const struct gen_device_info *devinfo)
   190154 {
   190155    switch (devinfo->gen) {
   190156    case 10: return 64;
   190157    case 9: return 64;
   190158    case 8: return 64;
   190159    case 7:
   190160       if (devinfo->is_haswell) {
   190161          return 0;
   190162       } else {
   190163          return 0;
   190164       }
   190165    case 6: return 0;
   190166    case 5: return 0;
   190167    case 4:
   190168       if (devinfo->is_g4x) {
   190169          return 0;
   190170       } else {
   190171          return 0;
   190172       }
   190173    default:
   190174       unreachable("Invalid hardware generation");
   190175    }
   190176 }
   190177 
   190178 
   190179 
   190180 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 0X Filter Coefficient[n,5] */
   190181 
   190182 
   190183 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn5_bits  8
   190184 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn5_bits  8
   190185 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn5_bits  8
   190186 
   190187 static inline uint32_t ATTRIBUTE_PURE
   190188 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn5_bits(const struct gen_device_info *devinfo)
   190189 {
   190190    switch (devinfo->gen) {
   190191    case 10: return 8;
   190192    case 9: return 8;
   190193    case 8: return 8;
   190194    case 7:
   190195       if (devinfo->is_haswell) {
   190196          return 0;
   190197       } else {
   190198          return 0;
   190199       }
   190200    case 6: return 0;
   190201    case 5: return 0;
   190202    case 4:
   190203       if (devinfo->is_g4x) {
   190204          return 0;
   190205       } else {
   190206          return 0;
   190207       }
   190208    default:
   190209       unreachable("Invalid hardware generation");
   190210    }
   190211 }
   190212 
   190213 
   190214 
   190215 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn5_start  80
   190216 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn5_start  80
   190217 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn5_start  80
   190218 
   190219 static inline uint32_t ATTRIBUTE_PURE
   190220 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn5_start(const struct gen_device_info *devinfo)
   190221 {
   190222    switch (devinfo->gen) {
   190223    case 10: return 80;
   190224    case 9: return 80;
   190225    case 8: return 80;
   190226    case 7:
   190227       if (devinfo->is_haswell) {
   190228          return 0;
   190229       } else {
   190230          return 0;
   190231       }
   190232    case 6: return 0;
   190233    case 5: return 0;
   190234    case 4:
   190235       if (devinfo->is_g4x) {
   190236          return 0;
   190237       } else {
   190238          return 0;
   190239       }
   190240    default:
   190241       unreachable("Invalid hardware generation");
   190242    }
   190243 }
   190244 
   190245 
   190246 
   190247 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 0X Filter Coefficient[n,6] */
   190248 
   190249 
   190250 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn6_bits  8
   190251 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn6_bits  8
   190252 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn6_bits  8
   190253 
   190254 static inline uint32_t ATTRIBUTE_PURE
   190255 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn6_bits(const struct gen_device_info *devinfo)
   190256 {
   190257    switch (devinfo->gen) {
   190258    case 10: return 8;
   190259    case 9: return 8;
   190260    case 8: return 8;
   190261    case 7:
   190262       if (devinfo->is_haswell) {
   190263          return 0;
   190264       } else {
   190265          return 0;
   190266       }
   190267    case 6: return 0;
   190268    case 5: return 0;
   190269    case 4:
   190270       if (devinfo->is_g4x) {
   190271          return 0;
   190272       } else {
   190273          return 0;
   190274       }
   190275    default:
   190276       unreachable("Invalid hardware generation");
   190277    }
   190278 }
   190279 
   190280 
   190281 
   190282 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn6_start  96
   190283 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn6_start  96
   190284 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn6_start  96
   190285 
   190286 static inline uint32_t ATTRIBUTE_PURE
   190287 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn6_start(const struct gen_device_info *devinfo)
   190288 {
   190289    switch (devinfo->gen) {
   190290    case 10: return 96;
   190291    case 9: return 96;
   190292    case 8: return 96;
   190293    case 7:
   190294       if (devinfo->is_haswell) {
   190295          return 0;
   190296       } else {
   190297          return 0;
   190298       }
   190299    case 6: return 0;
   190300    case 5: return 0;
   190301    case 4:
   190302       if (devinfo->is_g4x) {
   190303          return 0;
   190304       } else {
   190305          return 0;
   190306       }
   190307    default:
   190308       unreachable("Invalid hardware generation");
   190309    }
   190310 }
   190311 
   190312 
   190313 
   190314 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 0X Filter Coefficient[n,7] */
   190315 
   190316 
   190317 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn7_bits  8
   190318 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn7_bits  8
   190319 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn7_bits  8
   190320 
   190321 static inline uint32_t ATTRIBUTE_PURE
   190322 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn7_bits(const struct gen_device_info *devinfo)
   190323 {
   190324    switch (devinfo->gen) {
   190325    case 10: return 8;
   190326    case 9: return 8;
   190327    case 8: return 8;
   190328    case 7:
   190329       if (devinfo->is_haswell) {
   190330          return 0;
   190331       } else {
   190332          return 0;
   190333       }
   190334    case 6: return 0;
   190335    case 5: return 0;
   190336    case 4:
   190337       if (devinfo->is_g4x) {
   190338          return 0;
   190339       } else {
   190340          return 0;
   190341       }
   190342    default:
   190343       unreachable("Invalid hardware generation");
   190344    }
   190345 }
   190346 
   190347 
   190348 
   190349 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn7_start  112
   190350 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn7_start  112
   190351 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn7_start  112
   190352 
   190353 static inline uint32_t ATTRIBUTE_PURE
   190354 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0XFilterCoefficientn7_start(const struct gen_device_info *devinfo)
   190355 {
   190356    switch (devinfo->gen) {
   190357    case 10: return 112;
   190358    case 9: return 112;
   190359    case 8: return 112;
   190360    case 7:
   190361       if (devinfo->is_haswell) {
   190362          return 0;
   190363       } else {
   190364          return 0;
   190365       }
   190366    case 6: return 0;
   190367    case 5: return 0;
   190368    case 4:
   190369       if (devinfo->is_g4x) {
   190370          return 0;
   190371       } else {
   190372          return 0;
   190373       }
   190374    default:
   190375       unreachable("Invalid hardware generation");
   190376    }
   190377 }
   190378 
   190379 
   190380 
   190381 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 0Y Filter Coefficient[n,0] */
   190382 
   190383 
   190384 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn0_bits  8
   190385 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn0_bits  8
   190386 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn0_bits  8
   190387 
   190388 static inline uint32_t ATTRIBUTE_PURE
   190389 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn0_bits(const struct gen_device_info *devinfo)
   190390 {
   190391    switch (devinfo->gen) {
   190392    case 10: return 8;
   190393    case 9: return 8;
   190394    case 8: return 8;
   190395    case 7:
   190396       if (devinfo->is_haswell) {
   190397          return 0;
   190398       } else {
   190399          return 0;
   190400       }
   190401    case 6: return 0;
   190402    case 5: return 0;
   190403    case 4:
   190404       if (devinfo->is_g4x) {
   190405          return 0;
   190406       } else {
   190407          return 0;
   190408       }
   190409    default:
   190410       unreachable("Invalid hardware generation");
   190411    }
   190412 }
   190413 
   190414 
   190415 
   190416 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn0_start  8
   190417 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn0_start  8
   190418 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn0_start  8
   190419 
   190420 static inline uint32_t ATTRIBUTE_PURE
   190421 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn0_start(const struct gen_device_info *devinfo)
   190422 {
   190423    switch (devinfo->gen) {
   190424    case 10: return 8;
   190425    case 9: return 8;
   190426    case 8: return 8;
   190427    case 7:
   190428       if (devinfo->is_haswell) {
   190429          return 0;
   190430       } else {
   190431          return 0;
   190432       }
   190433    case 6: return 0;
   190434    case 5: return 0;
   190435    case 4:
   190436       if (devinfo->is_g4x) {
   190437          return 0;
   190438       } else {
   190439          return 0;
   190440       }
   190441    default:
   190442       unreachable("Invalid hardware generation");
   190443    }
   190444 }
   190445 
   190446 
   190447 
   190448 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 0Y Filter Coefficient[n,1] */
   190449 
   190450 
   190451 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn1_bits  8
   190452 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn1_bits  8
   190453 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn1_bits  8
   190454 
   190455 static inline uint32_t ATTRIBUTE_PURE
   190456 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn1_bits(const struct gen_device_info *devinfo)
   190457 {
   190458    switch (devinfo->gen) {
   190459    case 10: return 8;
   190460    case 9: return 8;
   190461    case 8: return 8;
   190462    case 7:
   190463       if (devinfo->is_haswell) {
   190464          return 0;
   190465       } else {
   190466          return 0;
   190467       }
   190468    case 6: return 0;
   190469    case 5: return 0;
   190470    case 4:
   190471       if (devinfo->is_g4x) {
   190472          return 0;
   190473       } else {
   190474          return 0;
   190475       }
   190476    default:
   190477       unreachable("Invalid hardware generation");
   190478    }
   190479 }
   190480 
   190481 
   190482 
   190483 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn1_start  24
   190484 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn1_start  24
   190485 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn1_start  24
   190486 
   190487 static inline uint32_t ATTRIBUTE_PURE
   190488 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn1_start(const struct gen_device_info *devinfo)
   190489 {
   190490    switch (devinfo->gen) {
   190491    case 10: return 24;
   190492    case 9: return 24;
   190493    case 8: return 24;
   190494    case 7:
   190495       if (devinfo->is_haswell) {
   190496          return 0;
   190497       } else {
   190498          return 0;
   190499       }
   190500    case 6: return 0;
   190501    case 5: return 0;
   190502    case 4:
   190503       if (devinfo->is_g4x) {
   190504          return 0;
   190505       } else {
   190506          return 0;
   190507       }
   190508    default:
   190509       unreachable("Invalid hardware generation");
   190510    }
   190511 }
   190512 
   190513 
   190514 
   190515 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 0Y Filter Coefficient[n,2] */
   190516 
   190517 
   190518 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn2_bits  8
   190519 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn2_bits  8
   190520 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn2_bits  8
   190521 
   190522 static inline uint32_t ATTRIBUTE_PURE
   190523 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn2_bits(const struct gen_device_info *devinfo)
   190524 {
   190525    switch (devinfo->gen) {
   190526    case 10: return 8;
   190527    case 9: return 8;
   190528    case 8: return 8;
   190529    case 7:
   190530       if (devinfo->is_haswell) {
   190531          return 0;
   190532       } else {
   190533          return 0;
   190534       }
   190535    case 6: return 0;
   190536    case 5: return 0;
   190537    case 4:
   190538       if (devinfo->is_g4x) {
   190539          return 0;
   190540       } else {
   190541          return 0;
   190542       }
   190543    default:
   190544       unreachable("Invalid hardware generation");
   190545    }
   190546 }
   190547 
   190548 
   190549 
   190550 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn2_start  40
   190551 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn2_start  40
   190552 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn2_start  40
   190553 
   190554 static inline uint32_t ATTRIBUTE_PURE
   190555 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn2_start(const struct gen_device_info *devinfo)
   190556 {
   190557    switch (devinfo->gen) {
   190558    case 10: return 40;
   190559    case 9: return 40;
   190560    case 8: return 40;
   190561    case 7:
   190562       if (devinfo->is_haswell) {
   190563          return 0;
   190564       } else {
   190565          return 0;
   190566       }
   190567    case 6: return 0;
   190568    case 5: return 0;
   190569    case 4:
   190570       if (devinfo->is_g4x) {
   190571          return 0;
   190572       } else {
   190573          return 0;
   190574       }
   190575    default:
   190576       unreachable("Invalid hardware generation");
   190577    }
   190578 }
   190579 
   190580 
   190581 
   190582 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 0Y Filter Coefficient[n,3] */
   190583 
   190584 
   190585 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn3_bits  8
   190586 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn3_bits  8
   190587 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn3_bits  8
   190588 
   190589 static inline uint32_t ATTRIBUTE_PURE
   190590 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn3_bits(const struct gen_device_info *devinfo)
   190591 {
   190592    switch (devinfo->gen) {
   190593    case 10: return 8;
   190594    case 9: return 8;
   190595    case 8: return 8;
   190596    case 7:
   190597       if (devinfo->is_haswell) {
   190598          return 0;
   190599       } else {
   190600          return 0;
   190601       }
   190602    case 6: return 0;
   190603    case 5: return 0;
   190604    case 4:
   190605       if (devinfo->is_g4x) {
   190606          return 0;
   190607       } else {
   190608          return 0;
   190609       }
   190610    default:
   190611       unreachable("Invalid hardware generation");
   190612    }
   190613 }
   190614 
   190615 
   190616 
   190617 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn3_start  56
   190618 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn3_start  56
   190619 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn3_start  56
   190620 
   190621 static inline uint32_t ATTRIBUTE_PURE
   190622 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn3_start(const struct gen_device_info *devinfo)
   190623 {
   190624    switch (devinfo->gen) {
   190625    case 10: return 56;
   190626    case 9: return 56;
   190627    case 8: return 56;
   190628    case 7:
   190629       if (devinfo->is_haswell) {
   190630          return 0;
   190631       } else {
   190632          return 0;
   190633       }
   190634    case 6: return 0;
   190635    case 5: return 0;
   190636    case 4:
   190637       if (devinfo->is_g4x) {
   190638          return 0;
   190639       } else {
   190640          return 0;
   190641       }
   190642    default:
   190643       unreachable("Invalid hardware generation");
   190644    }
   190645 }
   190646 
   190647 
   190648 
   190649 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 0Y Filter Coefficient[n,4] */
   190650 
   190651 
   190652 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn4_bits  8
   190653 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn4_bits  8
   190654 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn4_bits  8
   190655 
   190656 static inline uint32_t ATTRIBUTE_PURE
   190657 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn4_bits(const struct gen_device_info *devinfo)
   190658 {
   190659    switch (devinfo->gen) {
   190660    case 10: return 8;
   190661    case 9: return 8;
   190662    case 8: return 8;
   190663    case 7:
   190664       if (devinfo->is_haswell) {
   190665          return 0;
   190666       } else {
   190667          return 0;
   190668       }
   190669    case 6: return 0;
   190670    case 5: return 0;
   190671    case 4:
   190672       if (devinfo->is_g4x) {
   190673          return 0;
   190674       } else {
   190675          return 0;
   190676       }
   190677    default:
   190678       unreachable("Invalid hardware generation");
   190679    }
   190680 }
   190681 
   190682 
   190683 
   190684 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn4_start  72
   190685 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn4_start  72
   190686 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn4_start  72
   190687 
   190688 static inline uint32_t ATTRIBUTE_PURE
   190689 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn4_start(const struct gen_device_info *devinfo)
   190690 {
   190691    switch (devinfo->gen) {
   190692    case 10: return 72;
   190693    case 9: return 72;
   190694    case 8: return 72;
   190695    case 7:
   190696       if (devinfo->is_haswell) {
   190697          return 0;
   190698       } else {
   190699          return 0;
   190700       }
   190701    case 6: return 0;
   190702    case 5: return 0;
   190703    case 4:
   190704       if (devinfo->is_g4x) {
   190705          return 0;
   190706       } else {
   190707          return 0;
   190708       }
   190709    default:
   190710       unreachable("Invalid hardware generation");
   190711    }
   190712 }
   190713 
   190714 
   190715 
   190716 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 0Y Filter Coefficient[n,5] */
   190717 
   190718 
   190719 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn5_bits  8
   190720 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn5_bits  8
   190721 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn5_bits  8
   190722 
   190723 static inline uint32_t ATTRIBUTE_PURE
   190724 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn5_bits(const struct gen_device_info *devinfo)
   190725 {
   190726    switch (devinfo->gen) {
   190727    case 10: return 8;
   190728    case 9: return 8;
   190729    case 8: return 8;
   190730    case 7:
   190731       if (devinfo->is_haswell) {
   190732          return 0;
   190733       } else {
   190734          return 0;
   190735       }
   190736    case 6: return 0;
   190737    case 5: return 0;
   190738    case 4:
   190739       if (devinfo->is_g4x) {
   190740          return 0;
   190741       } else {
   190742          return 0;
   190743       }
   190744    default:
   190745       unreachable("Invalid hardware generation");
   190746    }
   190747 }
   190748 
   190749 
   190750 
   190751 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn5_start  88
   190752 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn5_start  88
   190753 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn5_start  88
   190754 
   190755 static inline uint32_t ATTRIBUTE_PURE
   190756 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn5_start(const struct gen_device_info *devinfo)
   190757 {
   190758    switch (devinfo->gen) {
   190759    case 10: return 88;
   190760    case 9: return 88;
   190761    case 8: return 88;
   190762    case 7:
   190763       if (devinfo->is_haswell) {
   190764          return 0;
   190765       } else {
   190766          return 0;
   190767       }
   190768    case 6: return 0;
   190769    case 5: return 0;
   190770    case 4:
   190771       if (devinfo->is_g4x) {
   190772          return 0;
   190773       } else {
   190774          return 0;
   190775       }
   190776    default:
   190777       unreachable("Invalid hardware generation");
   190778    }
   190779 }
   190780 
   190781 
   190782 
   190783 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 0Y Filter Coefficient[n,6] */
   190784 
   190785 
   190786 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn6_bits  8
   190787 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn6_bits  8
   190788 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn6_bits  8
   190789 
   190790 static inline uint32_t ATTRIBUTE_PURE
   190791 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn6_bits(const struct gen_device_info *devinfo)
   190792 {
   190793    switch (devinfo->gen) {
   190794    case 10: return 8;
   190795    case 9: return 8;
   190796    case 8: return 8;
   190797    case 7:
   190798       if (devinfo->is_haswell) {
   190799          return 0;
   190800       } else {
   190801          return 0;
   190802       }
   190803    case 6: return 0;
   190804    case 5: return 0;
   190805    case 4:
   190806       if (devinfo->is_g4x) {
   190807          return 0;
   190808       } else {
   190809          return 0;
   190810       }
   190811    default:
   190812       unreachable("Invalid hardware generation");
   190813    }
   190814 }
   190815 
   190816 
   190817 
   190818 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn6_start  104
   190819 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn6_start  104
   190820 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn6_start  104
   190821 
   190822 static inline uint32_t ATTRIBUTE_PURE
   190823 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn6_start(const struct gen_device_info *devinfo)
   190824 {
   190825    switch (devinfo->gen) {
   190826    case 10: return 104;
   190827    case 9: return 104;
   190828    case 8: return 104;
   190829    case 7:
   190830       if (devinfo->is_haswell) {
   190831          return 0;
   190832       } else {
   190833          return 0;
   190834       }
   190835    case 6: return 0;
   190836    case 5: return 0;
   190837    case 4:
   190838       if (devinfo->is_g4x) {
   190839          return 0;
   190840       } else {
   190841          return 0;
   190842       }
   190843    default:
   190844       unreachable("Invalid hardware generation");
   190845    }
   190846 }
   190847 
   190848 
   190849 
   190850 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 0Y Filter Coefficient[n,7] */
   190851 
   190852 
   190853 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn7_bits  8
   190854 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn7_bits  8
   190855 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn7_bits  8
   190856 
   190857 static inline uint32_t ATTRIBUTE_PURE
   190858 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn7_bits(const struct gen_device_info *devinfo)
   190859 {
   190860    switch (devinfo->gen) {
   190861    case 10: return 8;
   190862    case 9: return 8;
   190863    case 8: return 8;
   190864    case 7:
   190865       if (devinfo->is_haswell) {
   190866          return 0;
   190867       } else {
   190868          return 0;
   190869       }
   190870    case 6: return 0;
   190871    case 5: return 0;
   190872    case 4:
   190873       if (devinfo->is_g4x) {
   190874          return 0;
   190875       } else {
   190876          return 0;
   190877       }
   190878    default:
   190879       unreachable("Invalid hardware generation");
   190880    }
   190881 }
   190882 
   190883 
   190884 
   190885 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn7_start  120
   190886 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn7_start  120
   190887 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn7_start  120
   190888 
   190889 static inline uint32_t ATTRIBUTE_PURE
   190890 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table0YFilterCoefficientn7_start(const struct gen_device_info *devinfo)
   190891 {
   190892    switch (devinfo->gen) {
   190893    case 10: return 120;
   190894    case 9: return 120;
   190895    case 8: return 120;
   190896    case 7:
   190897       if (devinfo->is_haswell) {
   190898          return 0;
   190899       } else {
   190900          return 0;
   190901       }
   190902    case 6: return 0;
   190903    case 5: return 0;
   190904    case 4:
   190905       if (devinfo->is_g4x) {
   190906          return 0;
   190907       } else {
   190908          return 0;
   190909       }
   190910    default:
   190911       unreachable("Invalid hardware generation");
   190912    }
   190913 }
   190914 
   190915 
   190916 
   190917 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 1X Filter Coefficient[n,2] */
   190918 
   190919 
   190920 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn2_bits  8
   190921 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn2_bits  8
   190922 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn2_bits  8
   190923 
   190924 static inline uint32_t ATTRIBUTE_PURE
   190925 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn2_bits(const struct gen_device_info *devinfo)
   190926 {
   190927    switch (devinfo->gen) {
   190928    case 10: return 8;
   190929    case 9: return 8;
   190930    case 8: return 8;
   190931    case 7:
   190932       if (devinfo->is_haswell) {
   190933          return 0;
   190934       } else {
   190935          return 0;
   190936       }
   190937    case 6: return 0;
   190938    case 5: return 0;
   190939    case 4:
   190940       if (devinfo->is_g4x) {
   190941          return 0;
   190942       } else {
   190943          return 0;
   190944       }
   190945    default:
   190946       unreachable("Invalid hardware generation");
   190947    }
   190948 }
   190949 
   190950 
   190951 
   190952 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn2_start  144
   190953 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn2_start  144
   190954 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn2_start  144
   190955 
   190956 static inline uint32_t ATTRIBUTE_PURE
   190957 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn2_start(const struct gen_device_info *devinfo)
   190958 {
   190959    switch (devinfo->gen) {
   190960    case 10: return 144;
   190961    case 9: return 144;
   190962    case 8: return 144;
   190963    case 7:
   190964       if (devinfo->is_haswell) {
   190965          return 0;
   190966       } else {
   190967          return 0;
   190968       }
   190969    case 6: return 0;
   190970    case 5: return 0;
   190971    case 4:
   190972       if (devinfo->is_g4x) {
   190973          return 0;
   190974       } else {
   190975          return 0;
   190976       }
   190977    default:
   190978       unreachable("Invalid hardware generation");
   190979    }
   190980 }
   190981 
   190982 
   190983 
   190984 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 1X Filter Coefficient[n,3] */
   190985 
   190986 
   190987 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn3_bits  8
   190988 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn3_bits  8
   190989 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn3_bits  8
   190990 
   190991 static inline uint32_t ATTRIBUTE_PURE
   190992 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn3_bits(const struct gen_device_info *devinfo)
   190993 {
   190994    switch (devinfo->gen) {
   190995    case 10: return 8;
   190996    case 9: return 8;
   190997    case 8: return 8;
   190998    case 7:
   190999       if (devinfo->is_haswell) {
   191000          return 0;
   191001       } else {
   191002          return 0;
   191003       }
   191004    case 6: return 0;
   191005    case 5: return 0;
   191006    case 4:
   191007       if (devinfo->is_g4x) {
   191008          return 0;
   191009       } else {
   191010          return 0;
   191011       }
   191012    default:
   191013       unreachable("Invalid hardware generation");
   191014    }
   191015 }
   191016 
   191017 
   191018 
   191019 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn3_start  152
   191020 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn3_start  152
   191021 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn3_start  152
   191022 
   191023 static inline uint32_t ATTRIBUTE_PURE
   191024 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn3_start(const struct gen_device_info *devinfo)
   191025 {
   191026    switch (devinfo->gen) {
   191027    case 10: return 152;
   191028    case 9: return 152;
   191029    case 8: return 152;
   191030    case 7:
   191031       if (devinfo->is_haswell) {
   191032          return 0;
   191033       } else {
   191034          return 0;
   191035       }
   191036    case 6: return 0;
   191037    case 5: return 0;
   191038    case 4:
   191039       if (devinfo->is_g4x) {
   191040          return 0;
   191041       } else {
   191042          return 0;
   191043       }
   191044    default:
   191045       unreachable("Invalid hardware generation");
   191046    }
   191047 }
   191048 
   191049 
   191050 
   191051 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 1X Filter Coefficient[n,4] */
   191052 
   191053 
   191054 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn4_bits  8
   191055 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn4_bits  8
   191056 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn4_bits  8
   191057 
   191058 static inline uint32_t ATTRIBUTE_PURE
   191059 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn4_bits(const struct gen_device_info *devinfo)
   191060 {
   191061    switch (devinfo->gen) {
   191062    case 10: return 8;
   191063    case 9: return 8;
   191064    case 8: return 8;
   191065    case 7:
   191066       if (devinfo->is_haswell) {
   191067          return 0;
   191068       } else {
   191069          return 0;
   191070       }
   191071    case 6: return 0;
   191072    case 5: return 0;
   191073    case 4:
   191074       if (devinfo->is_g4x) {
   191075          return 0;
   191076       } else {
   191077          return 0;
   191078       }
   191079    default:
   191080       unreachable("Invalid hardware generation");
   191081    }
   191082 }
   191083 
   191084 
   191085 
   191086 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn4_start  160
   191087 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn4_start  160
   191088 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn4_start  160
   191089 
   191090 static inline uint32_t ATTRIBUTE_PURE
   191091 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn4_start(const struct gen_device_info *devinfo)
   191092 {
   191093    switch (devinfo->gen) {
   191094    case 10: return 160;
   191095    case 9: return 160;
   191096    case 8: return 160;
   191097    case 7:
   191098       if (devinfo->is_haswell) {
   191099          return 0;
   191100       } else {
   191101          return 0;
   191102       }
   191103    case 6: return 0;
   191104    case 5: return 0;
   191105    case 4:
   191106       if (devinfo->is_g4x) {
   191107          return 0;
   191108       } else {
   191109          return 0;
   191110       }
   191111    default:
   191112       unreachable("Invalid hardware generation");
   191113    }
   191114 }
   191115 
   191116 
   191117 
   191118 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 1X Filter Coefficient[n,5] */
   191119 
   191120 
   191121 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn5_bits  8
   191122 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn5_bits  8
   191123 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn5_bits  8
   191124 
   191125 static inline uint32_t ATTRIBUTE_PURE
   191126 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn5_bits(const struct gen_device_info *devinfo)
   191127 {
   191128    switch (devinfo->gen) {
   191129    case 10: return 8;
   191130    case 9: return 8;
   191131    case 8: return 8;
   191132    case 7:
   191133       if (devinfo->is_haswell) {
   191134          return 0;
   191135       } else {
   191136          return 0;
   191137       }
   191138    case 6: return 0;
   191139    case 5: return 0;
   191140    case 4:
   191141       if (devinfo->is_g4x) {
   191142          return 0;
   191143       } else {
   191144          return 0;
   191145       }
   191146    default:
   191147       unreachable("Invalid hardware generation");
   191148    }
   191149 }
   191150 
   191151 
   191152 
   191153 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn5_start  168
   191154 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn5_start  168
   191155 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn5_start  168
   191156 
   191157 static inline uint32_t ATTRIBUTE_PURE
   191158 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1XFilterCoefficientn5_start(const struct gen_device_info *devinfo)
   191159 {
   191160    switch (devinfo->gen) {
   191161    case 10: return 168;
   191162    case 9: return 168;
   191163    case 8: return 168;
   191164    case 7:
   191165       if (devinfo->is_haswell) {
   191166          return 0;
   191167       } else {
   191168          return 0;
   191169       }
   191170    case 6: return 0;
   191171    case 5: return 0;
   191172    case 4:
   191173       if (devinfo->is_g4x) {
   191174          return 0;
   191175       } else {
   191176          return 0;
   191177       }
   191178    default:
   191179       unreachable("Invalid hardware generation");
   191180    }
   191181 }
   191182 
   191183 
   191184 
   191185 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 1Y Filter Coefficient[n,2] */
   191186 
   191187 
   191188 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn2_bits  8
   191189 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn2_bits  8
   191190 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn2_bits  8
   191191 
   191192 static inline uint32_t ATTRIBUTE_PURE
   191193 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn2_bits(const struct gen_device_info *devinfo)
   191194 {
   191195    switch (devinfo->gen) {
   191196    case 10: return 8;
   191197    case 9: return 8;
   191198    case 8: return 8;
   191199    case 7:
   191200       if (devinfo->is_haswell) {
   191201          return 0;
   191202       } else {
   191203          return 0;
   191204       }
   191205    case 6: return 0;
   191206    case 5: return 0;
   191207    case 4:
   191208       if (devinfo->is_g4x) {
   191209          return 0;
   191210       } else {
   191211          return 0;
   191212       }
   191213    default:
   191214       unreachable("Invalid hardware generation");
   191215    }
   191216 }
   191217 
   191218 
   191219 
   191220 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn2_start  208
   191221 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn2_start  208
   191222 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn2_start  208
   191223 
   191224 static inline uint32_t ATTRIBUTE_PURE
   191225 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn2_start(const struct gen_device_info *devinfo)
   191226 {
   191227    switch (devinfo->gen) {
   191228    case 10: return 208;
   191229    case 9: return 208;
   191230    case 8: return 208;
   191231    case 7:
   191232       if (devinfo->is_haswell) {
   191233          return 0;
   191234       } else {
   191235          return 0;
   191236       }
   191237    case 6: return 0;
   191238    case 5: return 0;
   191239    case 4:
   191240       if (devinfo->is_g4x) {
   191241          return 0;
   191242       } else {
   191243          return 0;
   191244       }
   191245    default:
   191246       unreachable("Invalid hardware generation");
   191247    }
   191248 }
   191249 
   191250 
   191251 
   191252 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 1Y Filter Coefficient[n,3] */
   191253 
   191254 
   191255 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn3_bits  8
   191256 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn3_bits  8
   191257 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn3_bits  8
   191258 
   191259 static inline uint32_t ATTRIBUTE_PURE
   191260 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn3_bits(const struct gen_device_info *devinfo)
   191261 {
   191262    switch (devinfo->gen) {
   191263    case 10: return 8;
   191264    case 9: return 8;
   191265    case 8: return 8;
   191266    case 7:
   191267       if (devinfo->is_haswell) {
   191268          return 0;
   191269       } else {
   191270          return 0;
   191271       }
   191272    case 6: return 0;
   191273    case 5: return 0;
   191274    case 4:
   191275       if (devinfo->is_g4x) {
   191276          return 0;
   191277       } else {
   191278          return 0;
   191279       }
   191280    default:
   191281       unreachable("Invalid hardware generation");
   191282    }
   191283 }
   191284 
   191285 
   191286 
   191287 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn3_start  216
   191288 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn3_start  216
   191289 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn3_start  216
   191290 
   191291 static inline uint32_t ATTRIBUTE_PURE
   191292 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn3_start(const struct gen_device_info *devinfo)
   191293 {
   191294    switch (devinfo->gen) {
   191295    case 10: return 216;
   191296    case 9: return 216;
   191297    case 8: return 216;
   191298    case 7:
   191299       if (devinfo->is_haswell) {
   191300          return 0;
   191301       } else {
   191302          return 0;
   191303       }
   191304    case 6: return 0;
   191305    case 5: return 0;
   191306    case 4:
   191307       if (devinfo->is_g4x) {
   191308          return 0;
   191309       } else {
   191310          return 0;
   191311       }
   191312    default:
   191313       unreachable("Invalid hardware generation");
   191314    }
   191315 }
   191316 
   191317 
   191318 
   191319 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 1Y Filter Coefficient[n,4] */
   191320 
   191321 
   191322 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn4_bits  8
   191323 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn4_bits  8
   191324 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn4_bits  8
   191325 
   191326 static inline uint32_t ATTRIBUTE_PURE
   191327 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn4_bits(const struct gen_device_info *devinfo)
   191328 {
   191329    switch (devinfo->gen) {
   191330    case 10: return 8;
   191331    case 9: return 8;
   191332    case 8: return 8;
   191333    case 7:
   191334       if (devinfo->is_haswell) {
   191335          return 0;
   191336       } else {
   191337          return 0;
   191338       }
   191339    case 6: return 0;
   191340    case 5: return 0;
   191341    case 4:
   191342       if (devinfo->is_g4x) {
   191343          return 0;
   191344       } else {
   191345          return 0;
   191346       }
   191347    default:
   191348       unreachable("Invalid hardware generation");
   191349    }
   191350 }
   191351 
   191352 
   191353 
   191354 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn4_start  224
   191355 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn4_start  224
   191356 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn4_start  224
   191357 
   191358 static inline uint32_t ATTRIBUTE_PURE
   191359 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn4_start(const struct gen_device_info *devinfo)
   191360 {
   191361    switch (devinfo->gen) {
   191362    case 10: return 224;
   191363    case 9: return 224;
   191364    case 8: return 224;
   191365    case 7:
   191366       if (devinfo->is_haswell) {
   191367          return 0;
   191368       } else {
   191369          return 0;
   191370       }
   191371    case 6: return 0;
   191372    case 5: return 0;
   191373    case 4:
   191374       if (devinfo->is_g4x) {
   191375          return 0;
   191376       } else {
   191377          return 0;
   191378       }
   191379    default:
   191380       unreachable("Invalid hardware generation");
   191381    }
   191382 }
   191383 
   191384 
   191385 
   191386 /* SAMPLER_STATE_8X8_AVS_COEFFICIENTS::Table 1Y Filter Coefficient[n,5] */
   191387 
   191388 
   191389 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn5_bits  8
   191390 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn5_bits  8
   191391 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn5_bits  8
   191392 
   191393 static inline uint32_t ATTRIBUTE_PURE
   191394 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn5_bits(const struct gen_device_info *devinfo)
   191395 {
   191396    switch (devinfo->gen) {
   191397    case 10: return 8;
   191398    case 9: return 8;
   191399    case 8: return 8;
   191400    case 7:
   191401       if (devinfo->is_haswell) {
   191402          return 0;
   191403       } else {
   191404          return 0;
   191405       }
   191406    case 6: return 0;
   191407    case 5: return 0;
   191408    case 4:
   191409       if (devinfo->is_g4x) {
   191410          return 0;
   191411       } else {
   191412          return 0;
   191413       }
   191414    default:
   191415       unreachable("Invalid hardware generation");
   191416    }
   191417 }
   191418 
   191419 
   191420 
   191421 #define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn5_start  232
   191422 #define GEN9_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn5_start  232
   191423 #define GEN8_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn5_start  232
   191424 
   191425 static inline uint32_t ATTRIBUTE_PURE
   191426 SAMPLER_STATE_8X8_AVS_COEFFICIENTS_Table1YFilterCoefficientn5_start(const struct gen_device_info *devinfo)
   191427 {
   191428    switch (devinfo->gen) {
   191429    case 10: return 232;
   191430    case 9: return 232;
   191431    case 8: return 232;
   191432    case 7:
   191433       if (devinfo->is_haswell) {
   191434          return 0;
   191435       } else {
   191436          return 0;
   191437       }
   191438    case 6: return 0;
   191439    case 5: return 0;
   191440    case 4:
   191441       if (devinfo->is_g4x) {
   191442          return 0;
   191443       } else {
   191444          return 0;
   191445       }
   191446    default:
   191447       unreachable("Invalid hardware generation");
   191448    }
   191449 }
   191450 
   191451 
   191452 
   191453 /* SCISSOR_RECT */
   191454 
   191455 
   191456 #define GEN10_SCISSOR_RECT_length  2
   191457 #define GEN9_SCISSOR_RECT_length  2
   191458 #define GEN8_SCISSOR_RECT_length  2
   191459 #define GEN75_SCISSOR_RECT_length  2
   191460 #define GEN7_SCISSOR_RECT_length  2
   191461 #define GEN6_SCISSOR_RECT_length  2
   191462 #define GEN5_SCISSOR_RECT_length  2
   191463 #define GEN45_SCISSOR_RECT_length  2
   191464 #define GEN4_SCISSOR_RECT_length  2
   191465 
   191466 static inline uint32_t ATTRIBUTE_PURE
   191467 SCISSOR_RECT_length(const struct gen_device_info *devinfo)
   191468 {
   191469    switch (devinfo->gen) {
   191470    case 10: return 2;
   191471    case 9: return 2;
   191472    case 8: return 2;
   191473    case 7:
   191474       if (devinfo->is_haswell) {
   191475          return 2;
   191476       } else {
   191477          return 2;
   191478       }
   191479    case 6: return 2;
   191480    case 5: return 2;
   191481    case 4:
   191482       if (devinfo->is_g4x) {
   191483          return 2;
   191484       } else {
   191485          return 2;
   191486       }
   191487    default:
   191488       unreachable("Invalid hardware generation");
   191489    }
   191490 }
   191491 
   191492 
   191493 
   191494 /* SCISSOR_RECT::Scissor Rectangle X Max */
   191495 
   191496 
   191497 #define GEN10_SCISSOR_RECT_ScissorRectangleXMax_bits  16
   191498 #define GEN9_SCISSOR_RECT_ScissorRectangleXMax_bits  16
   191499 #define GEN8_SCISSOR_RECT_ScissorRectangleXMax_bits  16
   191500 #define GEN75_SCISSOR_RECT_ScissorRectangleXMax_bits  16
   191501 #define GEN7_SCISSOR_RECT_ScissorRectangleXMax_bits  16
   191502 #define GEN6_SCISSOR_RECT_ScissorRectangleXMax_bits  16
   191503 #define GEN5_SCISSOR_RECT_ScissorRectangleXMax_bits  16
   191504 #define GEN45_SCISSOR_RECT_ScissorRectangleXMax_bits  16
   191505 #define GEN4_SCISSOR_RECT_ScissorRectangleXMax_bits  16
   191506 
   191507 static inline uint32_t ATTRIBUTE_PURE
   191508 SCISSOR_RECT_ScissorRectangleXMax_bits(const struct gen_device_info *devinfo)
   191509 {
   191510    switch (devinfo->gen) {
   191511    case 10: return 16;
   191512    case 9: return 16;
   191513    case 8: return 16;
   191514    case 7:
   191515       if (devinfo->is_haswell) {
   191516          return 16;
   191517       } else {
   191518          return 16;
   191519       }
   191520    case 6: return 16;
   191521    case 5: return 16;
   191522    case 4:
   191523       if (devinfo->is_g4x) {
   191524          return 16;
   191525       } else {
   191526          return 16;
   191527       }
   191528    default:
   191529       unreachable("Invalid hardware generation");
   191530    }
   191531 }
   191532 
   191533 
   191534 
   191535 #define GEN10_SCISSOR_RECT_ScissorRectangleXMax_start  32
   191536 #define GEN9_SCISSOR_RECT_ScissorRectangleXMax_start  32
   191537 #define GEN8_SCISSOR_RECT_ScissorRectangleXMax_start  32
   191538 #define GEN75_SCISSOR_RECT_ScissorRectangleXMax_start  32
   191539 #define GEN7_SCISSOR_RECT_ScissorRectangleXMax_start  32
   191540 #define GEN6_SCISSOR_RECT_ScissorRectangleXMax_start  32
   191541 #define GEN5_SCISSOR_RECT_ScissorRectangleXMax_start  32
   191542 #define GEN45_SCISSOR_RECT_ScissorRectangleXMax_start  32
   191543 #define GEN4_SCISSOR_RECT_ScissorRectangleXMax_start  32
   191544 
   191545 static inline uint32_t ATTRIBUTE_PURE
   191546 SCISSOR_RECT_ScissorRectangleXMax_start(const struct gen_device_info *devinfo)
   191547 {
   191548    switch (devinfo->gen) {
   191549    case 10: return 32;
   191550    case 9: return 32;
   191551    case 8: return 32;
   191552    case 7:
   191553       if (devinfo->is_haswell) {
   191554          return 32;
   191555       } else {
   191556          return 32;
   191557       }
   191558    case 6: return 32;
   191559    case 5: return 32;
   191560    case 4:
   191561       if (devinfo->is_g4x) {
   191562          return 32;
   191563       } else {
   191564          return 32;
   191565       }
   191566    default:
   191567       unreachable("Invalid hardware generation");
   191568    }
   191569 }
   191570 
   191571 
   191572 
   191573 /* SCISSOR_RECT::Scissor Rectangle X Min */
   191574 
   191575 
   191576 #define GEN10_SCISSOR_RECT_ScissorRectangleXMin_bits  16
   191577 #define GEN9_SCISSOR_RECT_ScissorRectangleXMin_bits  16
   191578 #define GEN8_SCISSOR_RECT_ScissorRectangleXMin_bits  16
   191579 #define GEN75_SCISSOR_RECT_ScissorRectangleXMin_bits  16
   191580 #define GEN7_SCISSOR_RECT_ScissorRectangleXMin_bits  16
   191581 #define GEN6_SCISSOR_RECT_ScissorRectangleXMin_bits  16
   191582 #define GEN5_SCISSOR_RECT_ScissorRectangleXMin_bits  16
   191583 #define GEN45_SCISSOR_RECT_ScissorRectangleXMin_bits  16
   191584 #define GEN4_SCISSOR_RECT_ScissorRectangleXMin_bits  16
   191585 
   191586 static inline uint32_t ATTRIBUTE_PURE
   191587 SCISSOR_RECT_ScissorRectangleXMin_bits(const struct gen_device_info *devinfo)
   191588 {
   191589    switch (devinfo->gen) {
   191590    case 10: return 16;
   191591    case 9: return 16;
   191592    case 8: return 16;
   191593    case 7:
   191594       if (devinfo->is_haswell) {
   191595          return 16;
   191596       } else {
   191597          return 16;
   191598       }
   191599    case 6: return 16;
   191600    case 5: return 16;
   191601    case 4:
   191602       if (devinfo->is_g4x) {
   191603          return 16;
   191604       } else {
   191605          return 16;
   191606       }
   191607    default:
   191608       unreachable("Invalid hardware generation");
   191609    }
   191610 }
   191611 
   191612 
   191613 
   191614 #define GEN10_SCISSOR_RECT_ScissorRectangleXMin_start  0
   191615 #define GEN9_SCISSOR_RECT_ScissorRectangleXMin_start  0
   191616 #define GEN8_SCISSOR_RECT_ScissorRectangleXMin_start  0
   191617 #define GEN75_SCISSOR_RECT_ScissorRectangleXMin_start  0
   191618 #define GEN7_SCISSOR_RECT_ScissorRectangleXMin_start  0
   191619 #define GEN6_SCISSOR_RECT_ScissorRectangleXMin_start  0
   191620 #define GEN5_SCISSOR_RECT_ScissorRectangleXMin_start  0
   191621 #define GEN45_SCISSOR_RECT_ScissorRectangleXMin_start  0
   191622 #define GEN4_SCISSOR_RECT_ScissorRectangleXMin_start  0
   191623 
   191624 static inline uint32_t ATTRIBUTE_PURE
   191625 SCISSOR_RECT_ScissorRectangleXMin_start(const struct gen_device_info *devinfo)
   191626 {
   191627    switch (devinfo->gen) {
   191628    case 10: return 0;
   191629    case 9: return 0;
   191630    case 8: return 0;
   191631    case 7:
   191632       if (devinfo->is_haswell) {
   191633          return 0;
   191634       } else {
   191635          return 0;
   191636       }
   191637    case 6: return 0;
   191638    case 5: return 0;
   191639    case 4:
   191640       if (devinfo->is_g4x) {
   191641          return 0;
   191642       } else {
   191643          return 0;
   191644       }
   191645    default:
   191646       unreachable("Invalid hardware generation");
   191647    }
   191648 }
   191649 
   191650 
   191651 
   191652 /* SCISSOR_RECT::Scissor Rectangle Y Max */
   191653 
   191654 
   191655 #define GEN10_SCISSOR_RECT_ScissorRectangleYMax_bits  16
   191656 #define GEN9_SCISSOR_RECT_ScissorRectangleYMax_bits  16
   191657 #define GEN8_SCISSOR_RECT_ScissorRectangleYMax_bits  16
   191658 #define GEN75_SCISSOR_RECT_ScissorRectangleYMax_bits  16
   191659 #define GEN7_SCISSOR_RECT_ScissorRectangleYMax_bits  16
   191660 #define GEN6_SCISSOR_RECT_ScissorRectangleYMax_bits  16
   191661 #define GEN5_SCISSOR_RECT_ScissorRectangleYMax_bits  16
   191662 #define GEN45_SCISSOR_RECT_ScissorRectangleYMax_bits  16
   191663 #define GEN4_SCISSOR_RECT_ScissorRectangleYMax_bits  16
   191664 
   191665 static inline uint32_t ATTRIBUTE_PURE
   191666 SCISSOR_RECT_ScissorRectangleYMax_bits(const struct gen_device_info *devinfo)
   191667 {
   191668    switch (devinfo->gen) {
   191669    case 10: return 16;
   191670    case 9: return 16;
   191671    case 8: return 16;
   191672    case 7:
   191673       if (devinfo->is_haswell) {
   191674          return 16;
   191675       } else {
   191676          return 16;
   191677       }
   191678    case 6: return 16;
   191679    case 5: return 16;
   191680    case 4:
   191681       if (devinfo->is_g4x) {
   191682          return 16;
   191683       } else {
   191684          return 16;
   191685       }
   191686    default:
   191687       unreachable("Invalid hardware generation");
   191688    }
   191689 }
   191690 
   191691 
   191692 
   191693 #define GEN10_SCISSOR_RECT_ScissorRectangleYMax_start  48
   191694 #define GEN9_SCISSOR_RECT_ScissorRectangleYMax_start  48
   191695 #define GEN8_SCISSOR_RECT_ScissorRectangleYMax_start  48
   191696 #define GEN75_SCISSOR_RECT_ScissorRectangleYMax_start  48
   191697 #define GEN7_SCISSOR_RECT_ScissorRectangleYMax_start  48
   191698 #define GEN6_SCISSOR_RECT_ScissorRectangleYMax_start  48
   191699 #define GEN5_SCISSOR_RECT_ScissorRectangleYMax_start  48
   191700 #define GEN45_SCISSOR_RECT_ScissorRectangleYMax_start  48
   191701 #define GEN4_SCISSOR_RECT_ScissorRectangleYMax_start  48
   191702 
   191703 static inline uint32_t ATTRIBUTE_PURE
   191704 SCISSOR_RECT_ScissorRectangleYMax_start(const struct gen_device_info *devinfo)
   191705 {
   191706    switch (devinfo->gen) {
   191707    case 10: return 48;
   191708    case 9: return 48;
   191709    case 8: return 48;
   191710    case 7:
   191711       if (devinfo->is_haswell) {
   191712          return 48;
   191713       } else {
   191714          return 48;
   191715       }
   191716    case 6: return 48;
   191717    case 5: return 48;
   191718    case 4:
   191719       if (devinfo->is_g4x) {
   191720          return 48;
   191721       } else {
   191722          return 48;
   191723       }
   191724    default:
   191725       unreachable("Invalid hardware generation");
   191726    }
   191727 }
   191728 
   191729 
   191730 
   191731 /* SCISSOR_RECT::Scissor Rectangle Y Min */
   191732 
   191733 
   191734 #define GEN10_SCISSOR_RECT_ScissorRectangleYMin_bits  16
   191735 #define GEN9_SCISSOR_RECT_ScissorRectangleYMin_bits  16
   191736 #define GEN8_SCISSOR_RECT_ScissorRectangleYMin_bits  16
   191737 #define GEN75_SCISSOR_RECT_ScissorRectangleYMin_bits  16
   191738 #define GEN7_SCISSOR_RECT_ScissorRectangleYMin_bits  16
   191739 #define GEN6_SCISSOR_RECT_ScissorRectangleYMin_bits  16
   191740 #define GEN5_SCISSOR_RECT_ScissorRectangleYMin_bits  16
   191741 #define GEN45_SCISSOR_RECT_ScissorRectangleYMin_bits  16
   191742 #define GEN4_SCISSOR_RECT_ScissorRectangleYMin_bits  16
   191743 
   191744 static inline uint32_t ATTRIBUTE_PURE
   191745 SCISSOR_RECT_ScissorRectangleYMin_bits(const struct gen_device_info *devinfo)
   191746 {
   191747    switch (devinfo->gen) {
   191748    case 10: return 16;
   191749    case 9: return 16;
   191750    case 8: return 16;
   191751    case 7:
   191752       if (devinfo->is_haswell) {
   191753          return 16;
   191754       } else {
   191755          return 16;
   191756       }
   191757    case 6: return 16;
   191758    case 5: return 16;
   191759    case 4:
   191760       if (devinfo->is_g4x) {
   191761          return 16;
   191762       } else {
   191763          return 16;
   191764       }
   191765    default:
   191766       unreachable("Invalid hardware generation");
   191767    }
   191768 }
   191769 
   191770 
   191771 
   191772 #define GEN10_SCISSOR_RECT_ScissorRectangleYMin_start  16
   191773 #define GEN9_SCISSOR_RECT_ScissorRectangleYMin_start  16
   191774 #define GEN8_SCISSOR_RECT_ScissorRectangleYMin_start  16
   191775 #define GEN75_SCISSOR_RECT_ScissorRectangleYMin_start  16
   191776 #define GEN7_SCISSOR_RECT_ScissorRectangleYMin_start  16
   191777 #define GEN6_SCISSOR_RECT_ScissorRectangleYMin_start  16
   191778 #define GEN5_SCISSOR_RECT_ScissorRectangleYMin_start  16
   191779 #define GEN45_SCISSOR_RECT_ScissorRectangleYMin_start  16
   191780 #define GEN4_SCISSOR_RECT_ScissorRectangleYMin_start  16
   191781 
   191782 static inline uint32_t ATTRIBUTE_PURE
   191783 SCISSOR_RECT_ScissorRectangleYMin_start(const struct gen_device_info *devinfo)
   191784 {
   191785    switch (devinfo->gen) {
   191786    case 10: return 16;
   191787    case 9: return 16;
   191788    case 8: return 16;
   191789    case 7:
   191790       if (devinfo->is_haswell) {
   191791          return 16;
   191792       } else {
   191793          return 16;
   191794       }
   191795    case 6: return 16;
   191796    case 5: return 16;
   191797    case 4:
   191798       if (devinfo->is_g4x) {
   191799          return 16;
   191800       } else {
   191801          return 16;
   191802       }
   191803    default:
   191804       unreachable("Invalid hardware generation");
   191805    }
   191806 }
   191807 
   191808 
   191809 
   191810 /* SCRATCH1 */
   191811 
   191812 
   191813 #define GEN75_SCRATCH1_length  1
   191814 
   191815 static inline uint32_t ATTRIBUTE_PURE
   191816 SCRATCH1_length(const struct gen_device_info *devinfo)
   191817 {
   191818    switch (devinfo->gen) {
   191819    case 10: return 0;
   191820    case 9: return 0;
   191821    case 8: return 0;
   191822    case 7:
   191823       if (devinfo->is_haswell) {
   191824          return 1;
   191825       } else {
   191826          return 0;
   191827       }
   191828    case 6: return 0;
   191829    case 5: return 0;
   191830    case 4:
   191831       if (devinfo->is_g4x) {
   191832          return 0;
   191833       } else {
   191834          return 0;
   191835       }
   191836    default:
   191837       unreachable("Invalid hardware generation");
   191838    }
   191839 }
   191840 
   191841 
   191842 
   191843 /* SCRATCH1::L3 Atomic Disable */
   191844 
   191845 
   191846 #define GEN75_SCRATCH1_L3AtomicDisable_bits  1
   191847 
   191848 static inline uint32_t ATTRIBUTE_PURE
   191849 SCRATCH1_L3AtomicDisable_bits(const struct gen_device_info *devinfo)
   191850 {
   191851    switch (devinfo->gen) {
   191852    case 10: return 0;
   191853    case 9: return 0;
   191854    case 8: return 0;
   191855    case 7:
   191856       if (devinfo->is_haswell) {
   191857          return 1;
   191858       } else {
   191859          return 0;
   191860       }
   191861    case 6: return 0;
   191862    case 5: return 0;
   191863    case 4:
   191864       if (devinfo->is_g4x) {
   191865          return 0;
   191866       } else {
   191867          return 0;
   191868       }
   191869    default:
   191870       unreachable("Invalid hardware generation");
   191871    }
   191872 }
   191873 
   191874 
   191875 
   191876 #define GEN75_SCRATCH1_L3AtomicDisable_start  27
   191877 
   191878 static inline uint32_t ATTRIBUTE_PURE
   191879 SCRATCH1_L3AtomicDisable_start(const struct gen_device_info *devinfo)
   191880 {
   191881    switch (devinfo->gen) {
   191882    case 10: return 0;
   191883    case 9: return 0;
   191884    case 8: return 0;
   191885    case 7:
   191886       if (devinfo->is_haswell) {
   191887          return 27;
   191888       } else {
   191889          return 0;
   191890       }
   191891    case 6: return 0;
   191892    case 5: return 0;
   191893    case 4:
   191894       if (devinfo->is_g4x) {
   191895          return 0;
   191896       } else {
   191897          return 0;
   191898       }
   191899    default:
   191900       unreachable("Invalid hardware generation");
   191901    }
   191902 }
   191903 
   191904 
   191905 
   191906 /* SF_CLIP_VIEWPORT */
   191907 
   191908 
   191909 #define GEN10_SF_CLIP_VIEWPORT_length  16
   191910 #define GEN9_SF_CLIP_VIEWPORT_length  16
   191911 #define GEN8_SF_CLIP_VIEWPORT_length  16
   191912 #define GEN75_SF_CLIP_VIEWPORT_length  16
   191913 #define GEN7_SF_CLIP_VIEWPORT_length  16
   191914 
   191915 static inline uint32_t ATTRIBUTE_PURE
   191916 SF_CLIP_VIEWPORT_length(const struct gen_device_info *devinfo)
   191917 {
   191918    switch (devinfo->gen) {
   191919    case 10: return 16;
   191920    case 9: return 16;
   191921    case 8: return 16;
   191922    case 7:
   191923       if (devinfo->is_haswell) {
   191924          return 16;
   191925       } else {
   191926          return 16;
   191927       }
   191928    case 6: return 0;
   191929    case 5: return 0;
   191930    case 4:
   191931       if (devinfo->is_g4x) {
   191932          return 0;
   191933       } else {
   191934          return 0;
   191935       }
   191936    default:
   191937       unreachable("Invalid hardware generation");
   191938    }
   191939 }
   191940 
   191941 
   191942 
   191943 /* SF_CLIP_VIEWPORT::Viewport Matrix Element m00 */
   191944 
   191945 
   191946 #define GEN10_SF_CLIP_VIEWPORT_ViewportMatrixElementm00_bits  32
   191947 #define GEN9_SF_CLIP_VIEWPORT_ViewportMatrixElementm00_bits  32
   191948 #define GEN8_SF_CLIP_VIEWPORT_ViewportMatrixElementm00_bits  32
   191949 #define GEN75_SF_CLIP_VIEWPORT_ViewportMatrixElementm00_bits  32
   191950 #define GEN7_SF_CLIP_VIEWPORT_ViewportMatrixElementm00_bits  32
   191951 
   191952 static inline uint32_t ATTRIBUTE_PURE
   191953 SF_CLIP_VIEWPORT_ViewportMatrixElementm00_bits(const struct gen_device_info *devinfo)
   191954 {
   191955    switch (devinfo->gen) {
   191956    case 10: return 32;
   191957    case 9: return 32;
   191958    case 8: return 32;
   191959    case 7:
   191960       if (devinfo->is_haswell) {
   191961          return 32;
   191962       } else {
   191963          return 32;
   191964       }
   191965    case 6: return 0;
   191966    case 5: return 0;
   191967    case 4:
   191968       if (devinfo->is_g4x) {
   191969          return 0;
   191970       } else {
   191971          return 0;
   191972       }
   191973    default:
   191974       unreachable("Invalid hardware generation");
   191975    }
   191976 }
   191977 
   191978 
   191979 
   191980 #define GEN10_SF_CLIP_VIEWPORT_ViewportMatrixElementm00_start  0
   191981 #define GEN9_SF_CLIP_VIEWPORT_ViewportMatrixElementm00_start  0
   191982 #define GEN8_SF_CLIP_VIEWPORT_ViewportMatrixElementm00_start  0
   191983 #define GEN75_SF_CLIP_VIEWPORT_ViewportMatrixElementm00_start  0
   191984 #define GEN7_SF_CLIP_VIEWPORT_ViewportMatrixElementm00_start  0
   191985 
   191986 static inline uint32_t ATTRIBUTE_PURE
   191987 SF_CLIP_VIEWPORT_ViewportMatrixElementm00_start(const struct gen_device_info *devinfo)
   191988 {
   191989    switch (devinfo->gen) {
   191990    case 10: return 0;
   191991    case 9: return 0;
   191992    case 8: return 0;
   191993    case 7:
   191994       if (devinfo->is_haswell) {
   191995          return 0;
   191996       } else {
   191997          return 0;
   191998       }
   191999    case 6: return 0;
   192000    case 5: return 0;
   192001    case 4:
   192002       if (devinfo->is_g4x) {
   192003          return 0;
   192004       } else {
   192005          return 0;
   192006       }
   192007    default:
   192008       unreachable("Invalid hardware generation");
   192009    }
   192010 }
   192011 
   192012 
   192013 
   192014 /* SF_CLIP_VIEWPORT::Viewport Matrix Element m11 */
   192015 
   192016 
   192017 #define GEN10_SF_CLIP_VIEWPORT_ViewportMatrixElementm11_bits  32
   192018 #define GEN9_SF_CLIP_VIEWPORT_ViewportMatrixElementm11_bits  32
   192019 #define GEN8_SF_CLIP_VIEWPORT_ViewportMatrixElementm11_bits  32
   192020 #define GEN75_SF_CLIP_VIEWPORT_ViewportMatrixElementm11_bits  32
   192021 #define GEN7_SF_CLIP_VIEWPORT_ViewportMatrixElementm11_bits  32
   192022 
   192023 static inline uint32_t ATTRIBUTE_PURE
   192024 SF_CLIP_VIEWPORT_ViewportMatrixElementm11_bits(const struct gen_device_info *devinfo)
   192025 {
   192026    switch (devinfo->gen) {
   192027    case 10: return 32;
   192028    case 9: return 32;
   192029    case 8: return 32;
   192030    case 7:
   192031       if (devinfo->is_haswell) {
   192032          return 32;
   192033       } else {
   192034          return 32;
   192035       }
   192036    case 6: return 0;
   192037    case 5: return 0;
   192038    case 4:
   192039       if (devinfo->is_g4x) {
   192040          return 0;
   192041       } else {
   192042          return 0;
   192043       }
   192044    default:
   192045       unreachable("Invalid hardware generation");
   192046    }
   192047 }
   192048 
   192049 
   192050 
   192051 #define GEN10_SF_CLIP_VIEWPORT_ViewportMatrixElementm11_start  32
   192052 #define GEN9_SF_CLIP_VIEWPORT_ViewportMatrixElementm11_start  32
   192053 #define GEN8_SF_CLIP_VIEWPORT_ViewportMatrixElementm11_start  32
   192054 #define GEN75_SF_CLIP_VIEWPORT_ViewportMatrixElementm11_start  32
   192055 #define GEN7_SF_CLIP_VIEWPORT_ViewportMatrixElementm11_start  32
   192056 
   192057 static inline uint32_t ATTRIBUTE_PURE
   192058 SF_CLIP_VIEWPORT_ViewportMatrixElementm11_start(const struct gen_device_info *devinfo)
   192059 {
   192060    switch (devinfo->gen) {
   192061    case 10: return 32;
   192062    case 9: return 32;
   192063    case 8: return 32;
   192064    case 7:
   192065       if (devinfo->is_haswell) {
   192066          return 32;
   192067       } else {
   192068          return 32;
   192069       }
   192070    case 6: return 0;
   192071    case 5: return 0;
   192072    case 4:
   192073       if (devinfo->is_g4x) {
   192074          return 0;
   192075       } else {
   192076          return 0;
   192077       }
   192078    default:
   192079       unreachable("Invalid hardware generation");
   192080    }
   192081 }
   192082 
   192083 
   192084 
   192085 /* SF_CLIP_VIEWPORT::Viewport Matrix Element m22 */
   192086 
   192087 
   192088 #define GEN10_SF_CLIP_VIEWPORT_ViewportMatrixElementm22_bits  32
   192089 #define GEN9_SF_CLIP_VIEWPORT_ViewportMatrixElementm22_bits  32
   192090 #define GEN8_SF_CLIP_VIEWPORT_ViewportMatrixElementm22_bits  32
   192091 #define GEN75_SF_CLIP_VIEWPORT_ViewportMatrixElementm22_bits  32
   192092 #define GEN7_SF_CLIP_VIEWPORT_ViewportMatrixElementm22_bits  32
   192093 
   192094 static inline uint32_t ATTRIBUTE_PURE
   192095 SF_CLIP_VIEWPORT_ViewportMatrixElementm22_bits(const struct gen_device_info *devinfo)
   192096 {
   192097    switch (devinfo->gen) {
   192098    case 10: return 32;
   192099    case 9: return 32;
   192100    case 8: return 32;
   192101    case 7:
   192102       if (devinfo->is_haswell) {
   192103          return 32;
   192104       } else {
   192105          return 32;
   192106       }
   192107    case 6: return 0;
   192108    case 5: return 0;
   192109    case 4:
   192110       if (devinfo->is_g4x) {
   192111          return 0;
   192112       } else {
   192113          return 0;
   192114       }
   192115    default:
   192116       unreachable("Invalid hardware generation");
   192117    }
   192118 }
   192119 
   192120 
   192121 
   192122 #define GEN10_SF_CLIP_VIEWPORT_ViewportMatrixElementm22_start  64
   192123 #define GEN9_SF_CLIP_VIEWPORT_ViewportMatrixElementm22_start  64
   192124 #define GEN8_SF_CLIP_VIEWPORT_ViewportMatrixElementm22_start  64
   192125 #define GEN75_SF_CLIP_VIEWPORT_ViewportMatrixElementm22_start  64
   192126 #define GEN7_SF_CLIP_VIEWPORT_ViewportMatrixElementm22_start  64
   192127 
   192128 static inline uint32_t ATTRIBUTE_PURE
   192129 SF_CLIP_VIEWPORT_ViewportMatrixElementm22_start(const struct gen_device_info *devinfo)
   192130 {
   192131    switch (devinfo->gen) {
   192132    case 10: return 64;
   192133    case 9: return 64;
   192134    case 8: return 64;
   192135    case 7:
   192136       if (devinfo->is_haswell) {
   192137          return 64;
   192138       } else {
   192139          return 64;
   192140       }
   192141    case 6: return 0;
   192142    case 5: return 0;
   192143    case 4:
   192144       if (devinfo->is_g4x) {
   192145          return 0;
   192146       } else {
   192147          return 0;
   192148       }
   192149    default:
   192150       unreachable("Invalid hardware generation");
   192151    }
   192152 }
   192153 
   192154 
   192155 
   192156 /* SF_CLIP_VIEWPORT::Viewport Matrix Element m30 */
   192157 
   192158 
   192159 #define GEN10_SF_CLIP_VIEWPORT_ViewportMatrixElementm30_bits  32
   192160 #define GEN9_SF_CLIP_VIEWPORT_ViewportMatrixElementm30_bits  32
   192161 #define GEN8_SF_CLIP_VIEWPORT_ViewportMatrixElementm30_bits  32
   192162 #define GEN75_SF_CLIP_VIEWPORT_ViewportMatrixElementm30_bits  32
   192163 #define GEN7_SF_CLIP_VIEWPORT_ViewportMatrixElementm30_bits  32
   192164 
   192165 static inline uint32_t ATTRIBUTE_PURE
   192166 SF_CLIP_VIEWPORT_ViewportMatrixElementm30_bits(const struct gen_device_info *devinfo)
   192167 {
   192168    switch (devinfo->gen) {
   192169    case 10: return 32;
   192170    case 9: return 32;
   192171    case 8: return 32;
   192172    case 7:
   192173       if (devinfo->is_haswell) {
   192174          return 32;
   192175       } else {
   192176          return 32;
   192177       }
   192178    case 6: return 0;
   192179    case 5: return 0;
   192180    case 4:
   192181       if (devinfo->is_g4x) {
   192182          return 0;
   192183       } else {
   192184          return 0;
   192185       }
   192186    default:
   192187       unreachable("Invalid hardware generation");
   192188    }
   192189 }
   192190 
   192191 
   192192 
   192193 #define GEN10_SF_CLIP_VIEWPORT_ViewportMatrixElementm30_start  96
   192194 #define GEN9_SF_CLIP_VIEWPORT_ViewportMatrixElementm30_start  96
   192195 #define GEN8_SF_CLIP_VIEWPORT_ViewportMatrixElementm30_start  96
   192196 #define GEN75_SF_CLIP_VIEWPORT_ViewportMatrixElementm30_start  96
   192197 #define GEN7_SF_CLIP_VIEWPORT_ViewportMatrixElementm30_start  96
   192198 
   192199 static inline uint32_t ATTRIBUTE_PURE
   192200 SF_CLIP_VIEWPORT_ViewportMatrixElementm30_start(const struct gen_device_info *devinfo)
   192201 {
   192202    switch (devinfo->gen) {
   192203    case 10: return 96;
   192204    case 9: return 96;
   192205    case 8: return 96;
   192206    case 7:
   192207       if (devinfo->is_haswell) {
   192208          return 96;
   192209       } else {
   192210          return 96;
   192211       }
   192212    case 6: return 0;
   192213    case 5: return 0;
   192214    case 4:
   192215       if (devinfo->is_g4x) {
   192216          return 0;
   192217       } else {
   192218          return 0;
   192219       }
   192220    default:
   192221       unreachable("Invalid hardware generation");
   192222    }
   192223 }
   192224 
   192225 
   192226 
   192227 /* SF_CLIP_VIEWPORT::Viewport Matrix Element m31 */
   192228 
   192229 
   192230 #define GEN10_SF_CLIP_VIEWPORT_ViewportMatrixElementm31_bits  32
   192231 #define GEN9_SF_CLIP_VIEWPORT_ViewportMatrixElementm31_bits  32
   192232 #define GEN8_SF_CLIP_VIEWPORT_ViewportMatrixElementm31_bits  32
   192233 #define GEN75_SF_CLIP_VIEWPORT_ViewportMatrixElementm31_bits  32
   192234 #define GEN7_SF_CLIP_VIEWPORT_ViewportMatrixElementm31_bits  32
   192235 
   192236 static inline uint32_t ATTRIBUTE_PURE
   192237 SF_CLIP_VIEWPORT_ViewportMatrixElementm31_bits(const struct gen_device_info *devinfo)
   192238 {
   192239    switch (devinfo->gen) {
   192240    case 10: return 32;
   192241    case 9: return 32;
   192242    case 8: return 32;
   192243    case 7:
   192244       if (devinfo->is_haswell) {
   192245          return 32;
   192246       } else {
   192247          return 32;
   192248       }
   192249    case 6: return 0;
   192250    case 5: return 0;
   192251    case 4:
   192252       if (devinfo->is_g4x) {
   192253          return 0;
   192254       } else {
   192255          return 0;
   192256       }
   192257    default:
   192258       unreachable("Invalid hardware generation");
   192259    }
   192260 }
   192261 
   192262 
   192263 
   192264 #define GEN10_SF_CLIP_VIEWPORT_ViewportMatrixElementm31_start  128
   192265 #define GEN9_SF_CLIP_VIEWPORT_ViewportMatrixElementm31_start  128
   192266 #define GEN8_SF_CLIP_VIEWPORT_ViewportMatrixElementm31_start  128
   192267 #define GEN75_SF_CLIP_VIEWPORT_ViewportMatrixElementm31_start  128
   192268 #define GEN7_SF_CLIP_VIEWPORT_ViewportMatrixElementm31_start  128
   192269 
   192270 static inline uint32_t ATTRIBUTE_PURE
   192271 SF_CLIP_VIEWPORT_ViewportMatrixElementm31_start(const struct gen_device_info *devinfo)
   192272 {
   192273    switch (devinfo->gen) {
   192274    case 10: return 128;
   192275    case 9: return 128;
   192276    case 8: return 128;
   192277    case 7:
   192278       if (devinfo->is_haswell) {
   192279          return 128;
   192280       } else {
   192281          return 128;
   192282       }
   192283    case 6: return 0;
   192284    case 5: return 0;
   192285    case 4:
   192286       if (devinfo->is_g4x) {
   192287          return 0;
   192288       } else {
   192289          return 0;
   192290       }
   192291    default:
   192292       unreachable("Invalid hardware generation");
   192293    }
   192294 }
   192295 
   192296 
   192297 
   192298 /* SF_CLIP_VIEWPORT::Viewport Matrix Element m32 */
   192299 
   192300 
   192301 #define GEN10_SF_CLIP_VIEWPORT_ViewportMatrixElementm32_bits  32
   192302 #define GEN9_SF_CLIP_VIEWPORT_ViewportMatrixElementm32_bits  32
   192303 #define GEN8_SF_CLIP_VIEWPORT_ViewportMatrixElementm32_bits  32
   192304 #define GEN75_SF_CLIP_VIEWPORT_ViewportMatrixElementm32_bits  32
   192305 #define GEN7_SF_CLIP_VIEWPORT_ViewportMatrixElementm32_bits  32
   192306 
   192307 static inline uint32_t ATTRIBUTE_PURE
   192308 SF_CLIP_VIEWPORT_ViewportMatrixElementm32_bits(const struct gen_device_info *devinfo)
   192309 {
   192310    switch (devinfo->gen) {
   192311    case 10: return 32;
   192312    case 9: return 32;
   192313    case 8: return 32;
   192314    case 7:
   192315       if (devinfo->is_haswell) {
   192316          return 32;
   192317       } else {
   192318          return 32;
   192319       }
   192320    case 6: return 0;
   192321    case 5: return 0;
   192322    case 4:
   192323       if (devinfo->is_g4x) {
   192324          return 0;
   192325       } else {
   192326          return 0;
   192327       }
   192328    default:
   192329       unreachable("Invalid hardware generation");
   192330    }
   192331 }
   192332 
   192333 
   192334 
   192335 #define GEN10_SF_CLIP_VIEWPORT_ViewportMatrixElementm32_start  160
   192336 #define GEN9_SF_CLIP_VIEWPORT_ViewportMatrixElementm32_start  160
   192337 #define GEN8_SF_CLIP_VIEWPORT_ViewportMatrixElementm32_start  160
   192338 #define GEN75_SF_CLIP_VIEWPORT_ViewportMatrixElementm32_start  160
   192339 #define GEN7_SF_CLIP_VIEWPORT_ViewportMatrixElementm32_start  160
   192340 
   192341 static inline uint32_t ATTRIBUTE_PURE
   192342 SF_CLIP_VIEWPORT_ViewportMatrixElementm32_start(const struct gen_device_info *devinfo)
   192343 {
   192344    switch (devinfo->gen) {
   192345    case 10: return 160;
   192346    case 9: return 160;
   192347    case 8: return 160;
   192348    case 7:
   192349       if (devinfo->is_haswell) {
   192350          return 160;
   192351       } else {
   192352          return 160;
   192353       }
   192354    case 6: return 0;
   192355    case 5: return 0;
   192356    case 4:
   192357       if (devinfo->is_g4x) {
   192358          return 0;
   192359       } else {
   192360          return 0;
   192361       }
   192362    default:
   192363       unreachable("Invalid hardware generation");
   192364    }
   192365 }
   192366 
   192367 
   192368 
   192369 /* SF_CLIP_VIEWPORT::X Max Clip Guardband */
   192370 
   192371 
   192372 #define GEN10_SF_CLIP_VIEWPORT_XMaxClipGuardband_bits  32
   192373 #define GEN9_SF_CLIP_VIEWPORT_XMaxClipGuardband_bits  32
   192374 #define GEN8_SF_CLIP_VIEWPORT_XMaxClipGuardband_bits  32
   192375 #define GEN75_SF_CLIP_VIEWPORT_XMaxClipGuardband_bits  32
   192376 #define GEN7_SF_CLIP_VIEWPORT_XMaxClipGuardband_bits  32
   192377 
   192378 static inline uint32_t ATTRIBUTE_PURE
   192379 SF_CLIP_VIEWPORT_XMaxClipGuardband_bits(const struct gen_device_info *devinfo)
   192380 {
   192381    switch (devinfo->gen) {
   192382    case 10: return 32;
   192383    case 9: return 32;
   192384    case 8: return 32;
   192385    case 7:
   192386       if (devinfo->is_haswell) {
   192387          return 32;
   192388       } else {
   192389          return 32;
   192390       }
   192391    case 6: return 0;
   192392    case 5: return 0;
   192393    case 4:
   192394       if (devinfo->is_g4x) {
   192395          return 0;
   192396       } else {
   192397          return 0;
   192398       }
   192399    default:
   192400       unreachable("Invalid hardware generation");
   192401    }
   192402 }
   192403 
   192404 
   192405 
   192406 #define GEN10_SF_CLIP_VIEWPORT_XMaxClipGuardband_start  288
   192407 #define GEN9_SF_CLIP_VIEWPORT_XMaxClipGuardband_start  288
   192408 #define GEN8_SF_CLIP_VIEWPORT_XMaxClipGuardband_start  288
   192409 #define GEN75_SF_CLIP_VIEWPORT_XMaxClipGuardband_start  288
   192410 #define GEN7_SF_CLIP_VIEWPORT_XMaxClipGuardband_start  288
   192411 
   192412 static inline uint32_t ATTRIBUTE_PURE
   192413 SF_CLIP_VIEWPORT_XMaxClipGuardband_start(const struct gen_device_info *devinfo)
   192414 {
   192415    switch (devinfo->gen) {
   192416    case 10: return 288;
   192417    case 9: return 288;
   192418    case 8: return 288;
   192419    case 7:
   192420       if (devinfo->is_haswell) {
   192421          return 288;
   192422       } else {
   192423          return 288;
   192424       }
   192425    case 6: return 0;
   192426    case 5: return 0;
   192427    case 4:
   192428       if (devinfo->is_g4x) {
   192429          return 0;
   192430       } else {
   192431          return 0;
   192432       }
   192433    default:
   192434       unreachable("Invalid hardware generation");
   192435    }
   192436 }
   192437 
   192438 
   192439 
   192440 /* SF_CLIP_VIEWPORT::X Max ViewPort */
   192441 
   192442 
   192443 #define GEN10_SF_CLIP_VIEWPORT_XMaxViewPort_bits  32
   192444 #define GEN9_SF_CLIP_VIEWPORT_XMaxViewPort_bits  32
   192445 #define GEN8_SF_CLIP_VIEWPORT_XMaxViewPort_bits  32
   192446 
   192447 static inline uint32_t ATTRIBUTE_PURE
   192448 SF_CLIP_VIEWPORT_XMaxViewPort_bits(const struct gen_device_info *devinfo)
   192449 {
   192450    switch (devinfo->gen) {
   192451    case 10: return 32;
   192452    case 9: return 32;
   192453    case 8: return 32;
   192454    case 7:
   192455       if (devinfo->is_haswell) {
   192456          return 0;
   192457       } else {
   192458          return 0;
   192459       }
   192460    case 6: return 0;
   192461    case 5: return 0;
   192462    case 4:
   192463       if (devinfo->is_g4x) {
   192464          return 0;
   192465       } else {
   192466          return 0;
   192467       }
   192468    default:
   192469       unreachable("Invalid hardware generation");
   192470    }
   192471 }
   192472 
   192473 
   192474 
   192475 #define GEN10_SF_CLIP_VIEWPORT_XMaxViewPort_start  416
   192476 #define GEN9_SF_CLIP_VIEWPORT_XMaxViewPort_start  416
   192477 #define GEN8_SF_CLIP_VIEWPORT_XMaxViewPort_start  416
   192478 
   192479 static inline uint32_t ATTRIBUTE_PURE
   192480 SF_CLIP_VIEWPORT_XMaxViewPort_start(const struct gen_device_info *devinfo)
   192481 {
   192482    switch (devinfo->gen) {
   192483    case 10: return 416;
   192484    case 9: return 416;
   192485    case 8: return 416;
   192486    case 7:
   192487       if (devinfo->is_haswell) {
   192488          return 0;
   192489       } else {
   192490          return 0;
   192491       }
   192492    case 6: return 0;
   192493    case 5: return 0;
   192494    case 4:
   192495       if (devinfo->is_g4x) {
   192496          return 0;
   192497       } else {
   192498          return 0;
   192499       }
   192500    default:
   192501       unreachable("Invalid hardware generation");
   192502    }
   192503 }
   192504 
   192505 
   192506 
   192507 /* SF_CLIP_VIEWPORT::X Min Clip Guardband */
   192508 
   192509 
   192510 #define GEN10_SF_CLIP_VIEWPORT_XMinClipGuardband_bits  32
   192511 #define GEN9_SF_CLIP_VIEWPORT_XMinClipGuardband_bits  32
   192512 #define GEN8_SF_CLIP_VIEWPORT_XMinClipGuardband_bits  32
   192513 #define GEN75_SF_CLIP_VIEWPORT_XMinClipGuardband_bits  32
   192514 #define GEN7_SF_CLIP_VIEWPORT_XMinClipGuardband_bits  32
   192515 
   192516 static inline uint32_t ATTRIBUTE_PURE
   192517 SF_CLIP_VIEWPORT_XMinClipGuardband_bits(const struct gen_device_info *devinfo)
   192518 {
   192519    switch (devinfo->gen) {
   192520    case 10: return 32;
   192521    case 9: return 32;
   192522    case 8: return 32;
   192523    case 7:
   192524       if (devinfo->is_haswell) {
   192525          return 32;
   192526       } else {
   192527          return 32;
   192528       }
   192529    case 6: return 0;
   192530    case 5: return 0;
   192531    case 4:
   192532       if (devinfo->is_g4x) {
   192533          return 0;
   192534       } else {
   192535          return 0;
   192536       }
   192537    default:
   192538       unreachable("Invalid hardware generation");
   192539    }
   192540 }
   192541 
   192542 
   192543 
   192544 #define GEN10_SF_CLIP_VIEWPORT_XMinClipGuardband_start  256
   192545 #define GEN9_SF_CLIP_VIEWPORT_XMinClipGuardband_start  256
   192546 #define GEN8_SF_CLIP_VIEWPORT_XMinClipGuardband_start  256
   192547 #define GEN75_SF_CLIP_VIEWPORT_XMinClipGuardband_start  256
   192548 #define GEN7_SF_CLIP_VIEWPORT_XMinClipGuardband_start  256
   192549 
   192550 static inline uint32_t ATTRIBUTE_PURE
   192551 SF_CLIP_VIEWPORT_XMinClipGuardband_start(const struct gen_device_info *devinfo)
   192552 {
   192553    switch (devinfo->gen) {
   192554    case 10: return 256;
   192555    case 9: return 256;
   192556    case 8: return 256;
   192557    case 7:
   192558       if (devinfo->is_haswell) {
   192559          return 256;
   192560       } else {
   192561          return 256;
   192562       }
   192563    case 6: return 0;
   192564    case 5: return 0;
   192565    case 4:
   192566       if (devinfo->is_g4x) {
   192567          return 0;
   192568       } else {
   192569          return 0;
   192570       }
   192571    default:
   192572       unreachable("Invalid hardware generation");
   192573    }
   192574 }
   192575 
   192576 
   192577 
   192578 /* SF_CLIP_VIEWPORT::X Min ViewPort */
   192579 
   192580 
   192581 #define GEN10_SF_CLIP_VIEWPORT_XMinViewPort_bits  32
   192582 #define GEN9_SF_CLIP_VIEWPORT_XMinViewPort_bits  32
   192583 #define GEN8_SF_CLIP_VIEWPORT_XMinViewPort_bits  32
   192584 
   192585 static inline uint32_t ATTRIBUTE_PURE
   192586 SF_CLIP_VIEWPORT_XMinViewPort_bits(const struct gen_device_info *devinfo)
   192587 {
   192588    switch (devinfo->gen) {
   192589    case 10: return 32;
   192590    case 9: return 32;
   192591    case 8: return 32;
   192592    case 7:
   192593       if (devinfo->is_haswell) {
   192594          return 0;
   192595       } else {
   192596          return 0;
   192597       }
   192598    case 6: return 0;
   192599    case 5: return 0;
   192600    case 4:
   192601       if (devinfo->is_g4x) {
   192602          return 0;
   192603       } else {
   192604          return 0;
   192605       }
   192606    default:
   192607       unreachable("Invalid hardware generation");
   192608    }
   192609 }
   192610 
   192611 
   192612 
   192613 #define GEN10_SF_CLIP_VIEWPORT_XMinViewPort_start  384
   192614 #define GEN9_SF_CLIP_VIEWPORT_XMinViewPort_start  384
   192615 #define GEN8_SF_CLIP_VIEWPORT_XMinViewPort_start  384
   192616 
   192617 static inline uint32_t ATTRIBUTE_PURE
   192618 SF_CLIP_VIEWPORT_XMinViewPort_start(const struct gen_device_info *devinfo)
   192619 {
   192620    switch (devinfo->gen) {
   192621    case 10: return 384;
   192622    case 9: return 384;
   192623    case 8: return 384;
   192624    case 7:
   192625       if (devinfo->is_haswell) {
   192626          return 0;
   192627       } else {
   192628          return 0;
   192629       }
   192630    case 6: return 0;
   192631    case 5: return 0;
   192632    case 4:
   192633       if (devinfo->is_g4x) {
   192634          return 0;
   192635       } else {
   192636          return 0;
   192637       }
   192638    default:
   192639       unreachable("Invalid hardware generation");
   192640    }
   192641 }
   192642 
   192643 
   192644 
   192645 /* SF_CLIP_VIEWPORT::Y Max Clip Guardband */
   192646 
   192647 
   192648 #define GEN10_SF_CLIP_VIEWPORT_YMaxClipGuardband_bits  32
   192649 #define GEN9_SF_CLIP_VIEWPORT_YMaxClipGuardband_bits  32
   192650 #define GEN8_SF_CLIP_VIEWPORT_YMaxClipGuardband_bits  32
   192651 #define GEN75_SF_CLIP_VIEWPORT_YMaxClipGuardband_bits  32
   192652 #define GEN7_SF_CLIP_VIEWPORT_YMaxClipGuardband_bits  32
   192653 
   192654 static inline uint32_t ATTRIBUTE_PURE
   192655 SF_CLIP_VIEWPORT_YMaxClipGuardband_bits(const struct gen_device_info *devinfo)
   192656 {
   192657    switch (devinfo->gen) {
   192658    case 10: return 32;
   192659    case 9: return 32;
   192660    case 8: return 32;
   192661    case 7:
   192662       if (devinfo->is_haswell) {
   192663          return 32;
   192664       } else {
   192665          return 32;
   192666       }
   192667    case 6: return 0;
   192668    case 5: return 0;
   192669    case 4:
   192670       if (devinfo->is_g4x) {
   192671          return 0;
   192672       } else {
   192673          return 0;
   192674       }
   192675    default:
   192676       unreachable("Invalid hardware generation");
   192677    }
   192678 }
   192679 
   192680 
   192681 
   192682 #define GEN10_SF_CLIP_VIEWPORT_YMaxClipGuardband_start  352
   192683 #define GEN9_SF_CLIP_VIEWPORT_YMaxClipGuardband_start  352
   192684 #define GEN8_SF_CLIP_VIEWPORT_YMaxClipGuardband_start  352
   192685 #define GEN75_SF_CLIP_VIEWPORT_YMaxClipGuardband_start  352
   192686 #define GEN7_SF_CLIP_VIEWPORT_YMaxClipGuardband_start  352
   192687 
   192688 static inline uint32_t ATTRIBUTE_PURE
   192689 SF_CLIP_VIEWPORT_YMaxClipGuardband_start(const struct gen_device_info *devinfo)
   192690 {
   192691    switch (devinfo->gen) {
   192692    case 10: return 352;
   192693    case 9: return 352;
   192694    case 8: return 352;
   192695    case 7:
   192696       if (devinfo->is_haswell) {
   192697          return 352;
   192698       } else {
   192699          return 352;
   192700       }
   192701    case 6: return 0;
   192702    case 5: return 0;
   192703    case 4:
   192704       if (devinfo->is_g4x) {
   192705          return 0;
   192706       } else {
   192707          return 0;
   192708       }
   192709    default:
   192710       unreachable("Invalid hardware generation");
   192711    }
   192712 }
   192713 
   192714 
   192715 
   192716 /* SF_CLIP_VIEWPORT::Y Max ViewPort */
   192717 
   192718 
   192719 #define GEN10_SF_CLIP_VIEWPORT_YMaxViewPort_bits  32
   192720 #define GEN9_SF_CLIP_VIEWPORT_YMaxViewPort_bits  32
   192721 #define GEN8_SF_CLIP_VIEWPORT_YMaxViewPort_bits  32
   192722 
   192723 static inline uint32_t ATTRIBUTE_PURE
   192724 SF_CLIP_VIEWPORT_YMaxViewPort_bits(const struct gen_device_info *devinfo)
   192725 {
   192726    switch (devinfo->gen) {
   192727    case 10: return 32;
   192728    case 9: return 32;
   192729    case 8: return 32;
   192730    case 7:
   192731       if (devinfo->is_haswell) {
   192732          return 0;
   192733       } else {
   192734          return 0;
   192735       }
   192736    case 6: return 0;
   192737    case 5: return 0;
   192738    case 4:
   192739       if (devinfo->is_g4x) {
   192740          return 0;
   192741       } else {
   192742          return 0;
   192743       }
   192744    default:
   192745       unreachable("Invalid hardware generation");
   192746    }
   192747 }
   192748 
   192749 
   192750 
   192751 #define GEN10_SF_CLIP_VIEWPORT_YMaxViewPort_start  480
   192752 #define GEN9_SF_CLIP_VIEWPORT_YMaxViewPort_start  480
   192753 #define GEN8_SF_CLIP_VIEWPORT_YMaxViewPort_start  480
   192754 
   192755 static inline uint32_t ATTRIBUTE_PURE
   192756 SF_CLIP_VIEWPORT_YMaxViewPort_start(const struct gen_device_info *devinfo)
   192757 {
   192758    switch (devinfo->gen) {
   192759    case 10: return 480;
   192760    case 9: return 480;
   192761    case 8: return 480;
   192762    case 7:
   192763       if (devinfo->is_haswell) {
   192764          return 0;
   192765       } else {
   192766          return 0;
   192767       }
   192768    case 6: return 0;
   192769    case 5: return 0;
   192770    case 4:
   192771       if (devinfo->is_g4x) {
   192772          return 0;
   192773       } else {
   192774          return 0;
   192775       }
   192776    default:
   192777       unreachable("Invalid hardware generation");
   192778    }
   192779 }
   192780 
   192781 
   192782 
   192783 /* SF_CLIP_VIEWPORT::Y Min Clip Guardband */
   192784 
   192785 
   192786 #define GEN10_SF_CLIP_VIEWPORT_YMinClipGuardband_bits  32
   192787 #define GEN9_SF_CLIP_VIEWPORT_YMinClipGuardband_bits  32
   192788 #define GEN8_SF_CLIP_VIEWPORT_YMinClipGuardband_bits  32
   192789 #define GEN75_SF_CLIP_VIEWPORT_YMinClipGuardband_bits  32
   192790 #define GEN7_SF_CLIP_VIEWPORT_YMinClipGuardband_bits  32
   192791 
   192792 static inline uint32_t ATTRIBUTE_PURE
   192793 SF_CLIP_VIEWPORT_YMinClipGuardband_bits(const struct gen_device_info *devinfo)
   192794 {
   192795    switch (devinfo->gen) {
   192796    case 10: return 32;
   192797    case 9: return 32;
   192798    case 8: return 32;
   192799    case 7:
   192800       if (devinfo->is_haswell) {
   192801          return 32;
   192802       } else {
   192803          return 32;
   192804       }
   192805    case 6: return 0;
   192806    case 5: return 0;
   192807    case 4:
   192808       if (devinfo->is_g4x) {
   192809          return 0;
   192810       } else {
   192811          return 0;
   192812       }
   192813    default:
   192814       unreachable("Invalid hardware generation");
   192815    }
   192816 }
   192817 
   192818 
   192819 
   192820 #define GEN10_SF_CLIP_VIEWPORT_YMinClipGuardband_start  320
   192821 #define GEN9_SF_CLIP_VIEWPORT_YMinClipGuardband_start  320
   192822 #define GEN8_SF_CLIP_VIEWPORT_YMinClipGuardband_start  320
   192823 #define GEN75_SF_CLIP_VIEWPORT_YMinClipGuardband_start  320
   192824 #define GEN7_SF_CLIP_VIEWPORT_YMinClipGuardband_start  320
   192825 
   192826 static inline uint32_t ATTRIBUTE_PURE
   192827 SF_CLIP_VIEWPORT_YMinClipGuardband_start(const struct gen_device_info *devinfo)
   192828 {
   192829    switch (devinfo->gen) {
   192830    case 10: return 320;
   192831    case 9: return 320;
   192832    case 8: return 320;
   192833    case 7:
   192834       if (devinfo->is_haswell) {
   192835          return 320;
   192836       } else {
   192837          return 320;
   192838       }
   192839    case 6: return 0;
   192840    case 5: return 0;
   192841    case 4:
   192842       if (devinfo->is_g4x) {
   192843          return 0;
   192844       } else {
   192845          return 0;
   192846       }
   192847    default:
   192848       unreachable("Invalid hardware generation");
   192849    }
   192850 }
   192851 
   192852 
   192853 
   192854 /* SF_CLIP_VIEWPORT::Y Min ViewPort */
   192855 
   192856 
   192857 #define GEN10_SF_CLIP_VIEWPORT_YMinViewPort_bits  32
   192858 #define GEN9_SF_CLIP_VIEWPORT_YMinViewPort_bits  32
   192859 #define GEN8_SF_CLIP_VIEWPORT_YMinViewPort_bits  32
   192860 
   192861 static inline uint32_t ATTRIBUTE_PURE
   192862 SF_CLIP_VIEWPORT_YMinViewPort_bits(const struct gen_device_info *devinfo)
   192863 {
   192864    switch (devinfo->gen) {
   192865    case 10: return 32;
   192866    case 9: return 32;
   192867    case 8: return 32;
   192868    case 7:
   192869       if (devinfo->is_haswell) {
   192870          return 0;
   192871       } else {
   192872          return 0;
   192873       }
   192874    case 6: return 0;
   192875    case 5: return 0;
   192876    case 4:
   192877       if (devinfo->is_g4x) {
   192878          return 0;
   192879       } else {
   192880          return 0;
   192881       }
   192882    default:
   192883       unreachable("Invalid hardware generation");
   192884    }
   192885 }
   192886 
   192887 
   192888 
   192889 #define GEN10_SF_CLIP_VIEWPORT_YMinViewPort_start  448
   192890 #define GEN9_SF_CLIP_VIEWPORT_YMinViewPort_start  448
   192891 #define GEN8_SF_CLIP_VIEWPORT_YMinViewPort_start  448
   192892 
   192893 static inline uint32_t ATTRIBUTE_PURE
   192894 SF_CLIP_VIEWPORT_YMinViewPort_start(const struct gen_device_info *devinfo)
   192895 {
   192896    switch (devinfo->gen) {
   192897    case 10: return 448;
   192898    case 9: return 448;
   192899    case 8: return 448;
   192900    case 7:
   192901       if (devinfo->is_haswell) {
   192902          return 0;
   192903       } else {
   192904          return 0;
   192905       }
   192906    case 6: return 0;
   192907    case 5: return 0;
   192908    case 4:
   192909       if (devinfo->is_g4x) {
   192910          return 0;
   192911       } else {
   192912          return 0;
   192913       }
   192914    default:
   192915       unreachable("Invalid hardware generation");
   192916    }
   192917 }
   192918 
   192919 
   192920 
   192921 /* SF_OUTPUT_ATTRIBUTE_DETAIL */
   192922 
   192923 
   192924 #define GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_length  1
   192925 #define GEN9_SF_OUTPUT_ATTRIBUTE_DETAIL_length  1
   192926 #define GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_length  1
   192927 #define GEN75_SF_OUTPUT_ATTRIBUTE_DETAIL_length  1
   192928 #define GEN7_SF_OUTPUT_ATTRIBUTE_DETAIL_length  1
   192929 #define GEN6_SF_OUTPUT_ATTRIBUTE_DETAIL_length  1
   192930 
   192931 static inline uint32_t ATTRIBUTE_PURE
   192932 SF_OUTPUT_ATTRIBUTE_DETAIL_length(const struct gen_device_info *devinfo)
   192933 {
   192934    switch (devinfo->gen) {
   192935    case 10: return 1;
   192936    case 9: return 1;
   192937    case 8: return 1;
   192938    case 7:
   192939       if (devinfo->is_haswell) {
   192940          return 1;
   192941       } else {
   192942          return 1;
   192943       }
   192944    case 6: return 1;
   192945    case 5: return 0;
   192946    case 4:
   192947       if (devinfo->is_g4x) {
   192948          return 0;
   192949       } else {
   192950          return 0;
   192951       }
   192952    default:
   192953       unreachable("Invalid hardware generation");
   192954    }
   192955 }
   192956 
   192957 
   192958 
   192959 /* SF_OUTPUT_ATTRIBUTE_DETAIL::Component Override W */
   192960 
   192961 
   192962 #define GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideW_bits  1
   192963 #define GEN9_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideW_bits  1
   192964 #define GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideW_bits  1
   192965 #define GEN75_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideW_bits  1
   192966 #define GEN7_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideW_bits  1
   192967 #define GEN6_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideW_bits  1
   192968 
   192969 static inline uint32_t ATTRIBUTE_PURE
   192970 SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideW_bits(const struct gen_device_info *devinfo)
   192971 {
   192972    switch (devinfo->gen) {
   192973    case 10: return 1;
   192974    case 9: return 1;
   192975    case 8: return 1;
   192976    case 7:
   192977       if (devinfo->is_haswell) {
   192978          return 1;
   192979       } else {
   192980          return 1;
   192981       }
   192982    case 6: return 1;
   192983    case 5: return 0;
   192984    case 4:
   192985       if (devinfo->is_g4x) {
   192986          return 0;
   192987       } else {
   192988          return 0;
   192989       }
   192990    default:
   192991       unreachable("Invalid hardware generation");
   192992    }
   192993 }
   192994 
   192995 
   192996 
   192997 #define GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideW_start  15
   192998 #define GEN9_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideW_start  15
   192999 #define GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideW_start  15
   193000 #define GEN75_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideW_start  15
   193001 #define GEN7_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideW_start  15
   193002 #define GEN6_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideW_start  15
   193003 
   193004 static inline uint32_t ATTRIBUTE_PURE
   193005 SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideW_start(const struct gen_device_info *devinfo)
   193006 {
   193007    switch (devinfo->gen) {
   193008    case 10: return 15;
   193009    case 9: return 15;
   193010    case 8: return 15;
   193011    case 7:
   193012       if (devinfo->is_haswell) {
   193013          return 15;
   193014       } else {
   193015          return 15;
   193016       }
   193017    case 6: return 15;
   193018    case 5: return 0;
   193019    case 4:
   193020       if (devinfo->is_g4x) {
   193021          return 0;
   193022       } else {
   193023          return 0;
   193024       }
   193025    default:
   193026       unreachable("Invalid hardware generation");
   193027    }
   193028 }
   193029 
   193030 
   193031 
   193032 /* SF_OUTPUT_ATTRIBUTE_DETAIL::Component Override X */
   193033 
   193034 
   193035 #define GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideX_bits  1
   193036 #define GEN9_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideX_bits  1
   193037 #define GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideX_bits  1
   193038 #define GEN75_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideX_bits  1
   193039 #define GEN7_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideX_bits  1
   193040 #define GEN6_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideX_bits  1
   193041 
   193042 static inline uint32_t ATTRIBUTE_PURE
   193043 SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideX_bits(const struct gen_device_info *devinfo)
   193044 {
   193045    switch (devinfo->gen) {
   193046    case 10: return 1;
   193047    case 9: return 1;
   193048    case 8: return 1;
   193049    case 7:
   193050       if (devinfo->is_haswell) {
   193051          return 1;
   193052       } else {
   193053          return 1;
   193054       }
   193055    case 6: return 1;
   193056    case 5: return 0;
   193057    case 4:
   193058       if (devinfo->is_g4x) {
   193059          return 0;
   193060       } else {
   193061          return 0;
   193062       }
   193063    default:
   193064       unreachable("Invalid hardware generation");
   193065    }
   193066 }
   193067 
   193068 
   193069 
   193070 #define GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideX_start  12
   193071 #define GEN9_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideX_start  12
   193072 #define GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideX_start  12
   193073 #define GEN75_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideX_start  12
   193074 #define GEN7_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideX_start  12
   193075 #define GEN6_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideX_start  12
   193076 
   193077 static inline uint32_t ATTRIBUTE_PURE
   193078 SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideX_start(const struct gen_device_info *devinfo)
   193079 {
   193080    switch (devinfo->gen) {
   193081    case 10: return 12;
   193082    case 9: return 12;
   193083    case 8: return 12;
   193084    case 7:
   193085       if (devinfo->is_haswell) {
   193086          return 12;
   193087       } else {
   193088          return 12;
   193089       }
   193090    case 6: return 12;
   193091    case 5: return 0;
   193092    case 4:
   193093       if (devinfo->is_g4x) {
   193094          return 0;
   193095       } else {
   193096          return 0;
   193097       }
   193098    default:
   193099       unreachable("Invalid hardware generation");
   193100    }
   193101 }
   193102 
   193103 
   193104 
   193105 /* SF_OUTPUT_ATTRIBUTE_DETAIL::Component Override Y */
   193106 
   193107 
   193108 #define GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideY_bits  1
   193109 #define GEN9_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideY_bits  1
   193110 #define GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideY_bits  1
   193111 #define GEN75_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideY_bits  1
   193112 #define GEN7_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideY_bits  1
   193113 #define GEN6_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideY_bits  1
   193114 
   193115 static inline uint32_t ATTRIBUTE_PURE
   193116 SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideY_bits(const struct gen_device_info *devinfo)
   193117 {
   193118    switch (devinfo->gen) {
   193119    case 10: return 1;
   193120    case 9: return 1;
   193121    case 8: return 1;
   193122    case 7:
   193123       if (devinfo->is_haswell) {
   193124          return 1;
   193125       } else {
   193126          return 1;
   193127       }
   193128    case 6: return 1;
   193129    case 5: return 0;
   193130    case 4:
   193131       if (devinfo->is_g4x) {
   193132          return 0;
   193133       } else {
   193134          return 0;
   193135       }
   193136    default:
   193137       unreachable("Invalid hardware generation");
   193138    }
   193139 }
   193140 
   193141 
   193142 
   193143 #define GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideY_start  13
   193144 #define GEN9_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideY_start  13
   193145 #define GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideY_start  13
   193146 #define GEN75_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideY_start  13
   193147 #define GEN7_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideY_start  13
   193148 #define GEN6_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideY_start  13
   193149 
   193150 static inline uint32_t ATTRIBUTE_PURE
   193151 SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideY_start(const struct gen_device_info *devinfo)
   193152 {
   193153    switch (devinfo->gen) {
   193154    case 10: return 13;
   193155    case 9: return 13;
   193156    case 8: return 13;
   193157    case 7:
   193158       if (devinfo->is_haswell) {
   193159          return 13;
   193160       } else {
   193161          return 13;
   193162       }
   193163    case 6: return 13;
   193164    case 5: return 0;
   193165    case 4:
   193166       if (devinfo->is_g4x) {
   193167          return 0;
   193168       } else {
   193169          return 0;
   193170       }
   193171    default:
   193172       unreachable("Invalid hardware generation");
   193173    }
   193174 }
   193175 
   193176 
   193177 
   193178 /* SF_OUTPUT_ATTRIBUTE_DETAIL::Component Override Z */
   193179 
   193180 
   193181 #define GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideZ_bits  1
   193182 #define GEN9_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideZ_bits  1
   193183 #define GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideZ_bits  1
   193184 #define GEN75_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideZ_bits  1
   193185 #define GEN7_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideZ_bits  1
   193186 #define GEN6_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideZ_bits  1
   193187 
   193188 static inline uint32_t ATTRIBUTE_PURE
   193189 SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideZ_bits(const struct gen_device_info *devinfo)
   193190 {
   193191    switch (devinfo->gen) {
   193192    case 10: return 1;
   193193    case 9: return 1;
   193194    case 8: return 1;
   193195    case 7:
   193196       if (devinfo->is_haswell) {
   193197          return 1;
   193198       } else {
   193199          return 1;
   193200       }
   193201    case 6: return 1;
   193202    case 5: return 0;
   193203    case 4:
   193204       if (devinfo->is_g4x) {
   193205          return 0;
   193206       } else {
   193207          return 0;
   193208       }
   193209    default:
   193210       unreachable("Invalid hardware generation");
   193211    }
   193212 }
   193213 
   193214 
   193215 
   193216 #define GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideZ_start  14
   193217 #define GEN9_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideZ_start  14
   193218 #define GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideZ_start  14
   193219 #define GEN75_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideZ_start  14
   193220 #define GEN7_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideZ_start  14
   193221 #define GEN6_SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideZ_start  14
   193222 
   193223 static inline uint32_t ATTRIBUTE_PURE
   193224 SF_OUTPUT_ATTRIBUTE_DETAIL_ComponentOverrideZ_start(const struct gen_device_info *devinfo)
   193225 {
   193226    switch (devinfo->gen) {
   193227    case 10: return 14;
   193228    case 9: return 14;
   193229    case 8: return 14;
   193230    case 7:
   193231       if (devinfo->is_haswell) {
   193232          return 14;
   193233       } else {
   193234          return 14;
   193235       }
   193236    case 6: return 14;
   193237    case 5: return 0;
   193238    case 4:
   193239       if (devinfo->is_g4x) {
   193240          return 0;
   193241       } else {
   193242          return 0;
   193243       }
   193244    default:
   193245       unreachable("Invalid hardware generation");
   193246    }
   193247 }
   193248 
   193249 
   193250 
   193251 /* SF_OUTPUT_ATTRIBUTE_DETAIL::Constant Source */
   193252 
   193253 
   193254 #define GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_ConstantSource_bits  2
   193255 #define GEN9_SF_OUTPUT_ATTRIBUTE_DETAIL_ConstantSource_bits  2
   193256 #define GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_ConstantSource_bits  2
   193257 #define GEN75_SF_OUTPUT_ATTRIBUTE_DETAIL_ConstantSource_bits  2
   193258 #define GEN7_SF_OUTPUT_ATTRIBUTE_DETAIL_ConstantSource_bits  2
   193259 #define GEN6_SF_OUTPUT_ATTRIBUTE_DETAIL_ConstantSource_bits  2
   193260 
   193261 static inline uint32_t ATTRIBUTE_PURE
   193262 SF_OUTPUT_ATTRIBUTE_DETAIL_ConstantSource_bits(const struct gen_device_info *devinfo)
   193263 {
   193264    switch (devinfo->gen) {
   193265    case 10: return 2;
   193266    case 9: return 2;
   193267    case 8: return 2;
   193268    case 7:
   193269       if (devinfo->is_haswell) {
   193270          return 2;
   193271       } else {
   193272          return 2;
   193273       }
   193274    case 6: return 2;
   193275    case 5: return 0;
   193276    case 4:
   193277       if (devinfo->is_g4x) {
   193278          return 0;
   193279       } else {
   193280          return 0;
   193281       }
   193282    default:
   193283       unreachable("Invalid hardware generation");
   193284    }
   193285 }
   193286 
   193287 
   193288 
   193289 #define GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_ConstantSource_start  9
   193290 #define GEN9_SF_OUTPUT_ATTRIBUTE_DETAIL_ConstantSource_start  9
   193291 #define GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_ConstantSource_start  9
   193292 #define GEN75_SF_OUTPUT_ATTRIBUTE_DETAIL_ConstantSource_start  9
   193293 #define GEN7_SF_OUTPUT_ATTRIBUTE_DETAIL_ConstantSource_start  9
   193294 #define GEN6_SF_OUTPUT_ATTRIBUTE_DETAIL_ConstantSource_start  9
   193295 
   193296 static inline uint32_t ATTRIBUTE_PURE
   193297 SF_OUTPUT_ATTRIBUTE_DETAIL_ConstantSource_start(const struct gen_device_info *devinfo)
   193298 {
   193299    switch (devinfo->gen) {
   193300    case 10: return 9;
   193301    case 9: return 9;
   193302    case 8: return 9;
   193303    case 7:
   193304       if (devinfo->is_haswell) {
   193305          return 9;
   193306       } else {
   193307          return 9;
   193308       }
   193309    case 6: return 9;
   193310    case 5: return 0;
   193311    case 4:
   193312       if (devinfo->is_g4x) {
   193313          return 0;
   193314       } else {
   193315          return 0;
   193316       }
   193317    default:
   193318       unreachable("Invalid hardware generation");
   193319    }
   193320 }
   193321 
   193322 
   193323 
   193324 /* SF_OUTPUT_ATTRIBUTE_DETAIL::Source Attribute */
   193325 
   193326 
   193327 #define GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_SourceAttribute_bits  5
   193328 #define GEN9_SF_OUTPUT_ATTRIBUTE_DETAIL_SourceAttribute_bits  5
   193329 #define GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_SourceAttribute_bits  5
   193330 #define GEN75_SF_OUTPUT_ATTRIBUTE_DETAIL_SourceAttribute_bits  5
   193331 #define GEN7_SF_OUTPUT_ATTRIBUTE_DETAIL_SourceAttribute_bits  5
   193332 #define GEN6_SF_OUTPUT_ATTRIBUTE_DETAIL_SourceAttribute_bits  5
   193333 
   193334 static inline uint32_t ATTRIBUTE_PURE
   193335 SF_OUTPUT_ATTRIBUTE_DETAIL_SourceAttribute_bits(const struct gen_device_info *devinfo)
   193336 {
   193337    switch (devinfo->gen) {
   193338    case 10: return 5;
   193339    case 9: return 5;
   193340    case 8: return 5;
   193341    case 7:
   193342       if (devinfo->is_haswell) {
   193343          return 5;
   193344       } else {
   193345          return 5;
   193346       }
   193347    case 6: return 5;
   193348    case 5: return 0;
   193349    case 4:
   193350       if (devinfo->is_g4x) {
   193351          return 0;
   193352       } else {
   193353          return 0;
   193354       }
   193355    default:
   193356       unreachable("Invalid hardware generation");
   193357    }
   193358 }
   193359 
   193360 
   193361 
   193362 #define GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_SourceAttribute_start  0
   193363 #define GEN9_SF_OUTPUT_ATTRIBUTE_DETAIL_SourceAttribute_start  0
   193364 #define GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_SourceAttribute_start  0
   193365 #define GEN75_SF_OUTPUT_ATTRIBUTE_DETAIL_SourceAttribute_start  0
   193366 #define GEN7_SF_OUTPUT_ATTRIBUTE_DETAIL_SourceAttribute_start  0
   193367 #define GEN6_SF_OUTPUT_ATTRIBUTE_DETAIL_SourceAttribute_start  0
   193368 
   193369 static inline uint32_t ATTRIBUTE_PURE
   193370 SF_OUTPUT_ATTRIBUTE_DETAIL_SourceAttribute_start(const struct gen_device_info *devinfo)
   193371 {
   193372    switch (devinfo->gen) {
   193373    case 10: return 0;
   193374    case 9: return 0;
   193375    case 8: return 0;
   193376    case 7:
   193377       if (devinfo->is_haswell) {
   193378          return 0;
   193379       } else {
   193380          return 0;
   193381       }
   193382    case 6: return 0;
   193383    case 5: return 0;
   193384    case 4:
   193385       if (devinfo->is_g4x) {
   193386          return 0;
   193387       } else {
   193388          return 0;
   193389       }
   193390    default:
   193391       unreachable("Invalid hardware generation");
   193392    }
   193393 }
   193394 
   193395 
   193396 
   193397 /* SF_OUTPUT_ATTRIBUTE_DETAIL::Swizzle Control Mode */
   193398 
   193399 
   193400 #define GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleControlMode_bits  1
   193401 #define GEN9_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleControlMode_bits  1
   193402 #define GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleControlMode_bits  1
   193403 #define GEN75_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleControlMode_bits  1
   193404 #define GEN7_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleControlMode_bits  1
   193405 #define GEN6_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleControlMode_bits  1
   193406 
   193407 static inline uint32_t ATTRIBUTE_PURE
   193408 SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleControlMode_bits(const struct gen_device_info *devinfo)
   193409 {
   193410    switch (devinfo->gen) {
   193411    case 10: return 1;
   193412    case 9: return 1;
   193413    case 8: return 1;
   193414    case 7:
   193415       if (devinfo->is_haswell) {
   193416          return 1;
   193417       } else {
   193418          return 1;
   193419       }
   193420    case 6: return 1;
   193421    case 5: return 0;
   193422    case 4:
   193423       if (devinfo->is_g4x) {
   193424          return 0;
   193425       } else {
   193426          return 0;
   193427       }
   193428    default:
   193429       unreachable("Invalid hardware generation");
   193430    }
   193431 }
   193432 
   193433 
   193434 
   193435 #define GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleControlMode_start  11
   193436 #define GEN9_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleControlMode_start  11
   193437 #define GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleControlMode_start  11
   193438 #define GEN75_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleControlMode_start  11
   193439 #define GEN7_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleControlMode_start  11
   193440 #define GEN6_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleControlMode_start  11
   193441 
   193442 static inline uint32_t ATTRIBUTE_PURE
   193443 SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleControlMode_start(const struct gen_device_info *devinfo)
   193444 {
   193445    switch (devinfo->gen) {
   193446    case 10: return 11;
   193447    case 9: return 11;
   193448    case 8: return 11;
   193449    case 7:
   193450       if (devinfo->is_haswell) {
   193451          return 11;
   193452       } else {
   193453          return 11;
   193454       }
   193455    case 6: return 11;
   193456    case 5: return 0;
   193457    case 4:
   193458       if (devinfo->is_g4x) {
   193459          return 0;
   193460       } else {
   193461          return 0;
   193462       }
   193463    default:
   193464       unreachable("Invalid hardware generation");
   193465    }
   193466 }
   193467 
   193468 
   193469 
   193470 /* SF_OUTPUT_ATTRIBUTE_DETAIL::Swizzle Select */
   193471 
   193472 
   193473 #define GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleSelect_bits  2
   193474 #define GEN9_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleSelect_bits  2
   193475 #define GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleSelect_bits  2
   193476 #define GEN75_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleSelect_bits  2
   193477 #define GEN7_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleSelect_bits  2
   193478 #define GEN6_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleSelect_bits  2
   193479 
   193480 static inline uint32_t ATTRIBUTE_PURE
   193481 SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleSelect_bits(const struct gen_device_info *devinfo)
   193482 {
   193483    switch (devinfo->gen) {
   193484    case 10: return 2;
   193485    case 9: return 2;
   193486    case 8: return 2;
   193487    case 7:
   193488       if (devinfo->is_haswell) {
   193489          return 2;
   193490       } else {
   193491          return 2;
   193492       }
   193493    case 6: return 2;
   193494    case 5: return 0;
   193495    case 4:
   193496       if (devinfo->is_g4x) {
   193497          return 0;
   193498       } else {
   193499          return 0;
   193500       }
   193501    default:
   193502       unreachable("Invalid hardware generation");
   193503    }
   193504 }
   193505 
   193506 
   193507 
   193508 #define GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleSelect_start  6
   193509 #define GEN9_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleSelect_start  6
   193510 #define GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleSelect_start  6
   193511 #define GEN75_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleSelect_start  6
   193512 #define GEN7_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleSelect_start  6
   193513 #define GEN6_SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleSelect_start  6
   193514 
   193515 static inline uint32_t ATTRIBUTE_PURE
   193516 SF_OUTPUT_ATTRIBUTE_DETAIL_SwizzleSelect_start(const struct gen_device_info *devinfo)
   193517 {
   193518    switch (devinfo->gen) {
   193519    case 10: return 6;
   193520    case 9: return 6;
   193521    case 8: return 6;
   193522    case 7:
   193523       if (devinfo->is_haswell) {
   193524          return 6;
   193525       } else {
   193526          return 6;
   193527       }
   193528    case 6: return 6;
   193529    case 5: return 0;
   193530    case 4:
   193531       if (devinfo->is_g4x) {
   193532          return 0;
   193533       } else {
   193534          return 0;
   193535       }
   193536    default:
   193537       unreachable("Invalid hardware generation");
   193538    }
   193539 }
   193540 
   193541 
   193542 
   193543 /* SF_STATE */
   193544 
   193545 
   193546 #define GEN5_SF_STATE_length  8
   193547 #define GEN45_SF_STATE_length  8
   193548 #define GEN4_SF_STATE_length  8
   193549 
   193550 static inline uint32_t ATTRIBUTE_PURE
   193551 SF_STATE_length(const struct gen_device_info *devinfo)
   193552 {
   193553    switch (devinfo->gen) {
   193554    case 10: return 0;
   193555    case 9: return 0;
   193556    case 8: return 0;
   193557    case 7:
   193558       if (devinfo->is_haswell) {
   193559          return 0;
   193560       } else {
   193561          return 0;
   193562       }
   193563    case 6: return 0;
   193564    case 5: return 8;
   193565    case 4:
   193566       if (devinfo->is_g4x) {
   193567          return 8;
   193568       } else {
   193569          return 8;
   193570       }
   193571    default:
   193572       unreachable("Invalid hardware generation");
   193573    }
   193574 }
   193575 
   193576 
   193577 
   193578 /* SF_STATE::2x2 Pixel Triangle Filter Disable */
   193579 
   193580 
   193581 #define GEN5_SF_STATE_2x2PixelTriangleFilterDisable_bits  1
   193582 #define GEN45_SF_STATE_2x2PixelTriangleFilterDisable_bits  1
   193583 #define GEN4_SF_STATE_2x2PixelTriangleFilterDisable_bits  1
   193584 
   193585 static inline uint32_t ATTRIBUTE_PURE
   193586 SF_STATE_2x2PixelTriangleFilterDisable_bits(const struct gen_device_info *devinfo)
   193587 {
   193588    switch (devinfo->gen) {
   193589    case 10: return 0;
   193590    case 9: return 0;
   193591    case 8: return 0;
   193592    case 7:
   193593       if (devinfo->is_haswell) {
   193594          return 0;
   193595       } else {
   193596          return 0;
   193597       }
   193598    case 6: return 0;
   193599    case 5: return 1;
   193600    case 4:
   193601       if (devinfo->is_g4x) {
   193602          return 1;
   193603       } else {
   193604          return 1;
   193605       }
   193606    default:
   193607       unreachable("Invalid hardware generation");
   193608    }
   193609 }
   193610 
   193611 
   193612 
   193613 #define GEN5_SF_STATE_2x2PixelTriangleFilterDisable_start  210
   193614 #define GEN45_SF_STATE_2x2PixelTriangleFilterDisable_start  210
   193615 #define GEN4_SF_STATE_2x2PixelTriangleFilterDisable_start  210
   193616 
   193617 static inline uint32_t ATTRIBUTE_PURE
   193618 SF_STATE_2x2PixelTriangleFilterDisable_start(const struct gen_device_info *devinfo)
   193619 {
   193620    switch (devinfo->gen) {
   193621    case 10: return 0;
   193622    case 9: return 0;
   193623    case 8: return 0;
   193624    case 7:
   193625       if (devinfo->is_haswell) {
   193626          return 0;
   193627       } else {
   193628          return 0;
   193629       }
   193630    case 6: return 0;
   193631    case 5: return 210;
   193632    case 4:
   193633       if (devinfo->is_g4x) {
   193634          return 210;
   193635       } else {
   193636          return 210;
   193637       }
   193638    default:
   193639       unreachable("Invalid hardware generation");
   193640    }
   193641 }
   193642 
   193643 
   193644 
   193645 /* SF_STATE::AA Line Distance Mode */
   193646 
   193647 
   193648 #define GEN5_SF_STATE_AALineDistanceMode_bits  1
   193649 #define GEN45_SF_STATE_AALineDistanceMode_bits  1
   193650 
   193651 static inline uint32_t ATTRIBUTE_PURE
   193652 SF_STATE_AALineDistanceMode_bits(const struct gen_device_info *devinfo)
   193653 {
   193654    switch (devinfo->gen) {
   193655    case 10: return 0;
   193656    case 9: return 0;
   193657    case 8: return 0;
   193658    case 7:
   193659       if (devinfo->is_haswell) {
   193660          return 0;
   193661       } else {
   193662          return 0;
   193663       }
   193664    case 6: return 0;
   193665    case 5: return 1;
   193666    case 4:
   193667       if (devinfo->is_g4x) {
   193668          return 1;
   193669       } else {
   193670          return 0;
   193671       }
   193672    default:
   193673       unreachable("Invalid hardware generation");
   193674    }
   193675 }
   193676 
   193677 
   193678 
   193679 #define GEN5_SF_STATE_AALineDistanceMode_start  238
   193680 #define GEN45_SF_STATE_AALineDistanceMode_start  238
   193681 
   193682 static inline uint32_t ATTRIBUTE_PURE
   193683 SF_STATE_AALineDistanceMode_start(const struct gen_device_info *devinfo)
   193684 {
   193685    switch (devinfo->gen) {
   193686    case 10: return 0;
   193687    case 9: return 0;
   193688    case 8: return 0;
   193689    case 7:
   193690       if (devinfo->is_haswell) {
   193691          return 0;
   193692       } else {
   193693          return 0;
   193694       }
   193695    case 6: return 0;
   193696    case 5: return 238;
   193697    case 4:
   193698       if (devinfo->is_g4x) {
   193699          return 238;
   193700       } else {
   193701          return 0;
   193702       }
   193703    default:
   193704       unreachable("Invalid hardware generation");
   193705    }
   193706 }
   193707 
   193708 
   193709 
   193710 /* SF_STATE::Anti-Aliasing Enable */
   193711 
   193712 
   193713 #define GEN5_SF_STATE_AntiAliasingEnable_bits  1
   193714 #define GEN45_SF_STATE_AntiAliasingEnable_bits  1
   193715 #define GEN4_SF_STATE_AntiAliasingEnable_bits  1
   193716 
   193717 static inline uint32_t ATTRIBUTE_PURE
   193718 SF_STATE_AntiAliasingEnable_bits(const struct gen_device_info *devinfo)
   193719 {
   193720    switch (devinfo->gen) {
   193721    case 10: return 0;
   193722    case 9: return 0;
   193723    case 8: return 0;
   193724    case 7:
   193725       if (devinfo->is_haswell) {
   193726          return 0;
   193727       } else {
   193728          return 0;
   193729       }
   193730    case 6: return 0;
   193731    case 5: return 1;
   193732    case 4:
   193733       if (devinfo->is_g4x) {
   193734          return 1;
   193735       } else {
   193736          return 1;
   193737       }
   193738    default:
   193739       unreachable("Invalid hardware generation");
   193740    }
   193741 }
   193742 
   193743 
   193744 
   193745 #define GEN5_SF_STATE_AntiAliasingEnable_start  223
   193746 #define GEN45_SF_STATE_AntiAliasingEnable_start  223
   193747 #define GEN4_SF_STATE_AntiAliasingEnable_start  223
   193748 
   193749 static inline uint32_t ATTRIBUTE_PURE
   193750 SF_STATE_AntiAliasingEnable_start(const struct gen_device_info *devinfo)
   193751 {
   193752    switch (devinfo->gen) {
   193753    case 10: return 0;
   193754    case 9: return 0;
   193755    case 8: return 0;
   193756    case 7:
   193757       if (devinfo->is_haswell) {
   193758          return 0;
   193759       } else {
   193760          return 0;
   193761       }
   193762    case 6: return 0;
   193763    case 5: return 223;
   193764    case 4:
   193765       if (devinfo->is_g4x) {
   193766          return 223;
   193767       } else {
   193768          return 223;
   193769       }
   193770    default:
   193771       unreachable("Invalid hardware generation");
   193772    }
   193773 }
   193774 
   193775 
   193776 
   193777 /* SF_STATE::Binding Table Entry Count */
   193778 
   193779 
   193780 #define GEN5_SF_STATE_BindingTableEntryCount_bits  8
   193781 #define GEN45_SF_STATE_BindingTableEntryCount_bits  8
   193782 #define GEN4_SF_STATE_BindingTableEntryCount_bits  8
   193783 
   193784 static inline uint32_t ATTRIBUTE_PURE
   193785 SF_STATE_BindingTableEntryCount_bits(const struct gen_device_info *devinfo)
   193786 {
   193787    switch (devinfo->gen) {
   193788    case 10: return 0;
   193789    case 9: return 0;
   193790    case 8: return 0;
   193791    case 7:
   193792       if (devinfo->is_haswell) {
   193793          return 0;
   193794       } else {
   193795          return 0;
   193796       }
   193797    case 6: return 0;
   193798    case 5: return 8;
   193799    case 4:
   193800       if (devinfo->is_g4x) {
   193801          return 8;
   193802       } else {
   193803          return 8;
   193804       }
   193805    default:
   193806       unreachable("Invalid hardware generation");
   193807    }
   193808 }
   193809 
   193810 
   193811 
   193812 #define GEN5_SF_STATE_BindingTableEntryCount_start  50
   193813 #define GEN45_SF_STATE_BindingTableEntryCount_start  50
   193814 #define GEN4_SF_STATE_BindingTableEntryCount_start  50
   193815 
   193816 static inline uint32_t ATTRIBUTE_PURE
   193817 SF_STATE_BindingTableEntryCount_start(const struct gen_device_info *devinfo)
   193818 {
   193819    switch (devinfo->gen) {
   193820    case 10: return 0;
   193821    case 9: return 0;
   193822    case 8: return 0;
   193823    case 7:
   193824       if (devinfo->is_haswell) {
   193825          return 0;
   193826       } else {
   193827          return 0;
   193828       }
   193829    case 6: return 0;
   193830    case 5: return 50;
   193831    case 4:
   193832       if (devinfo->is_g4x) {
   193833          return 50;
   193834       } else {
   193835          return 50;
   193836       }
   193837    default:
   193838       unreachable("Invalid hardware generation");
   193839    }
   193840 }
   193841 
   193842 
   193843 
   193844 /* SF_STATE::Constant URB Entry Read Length */
   193845 
   193846 
   193847 #define GEN5_SF_STATE_ConstantURBEntryReadLength_bits  6
   193848 #define GEN45_SF_STATE_ConstantURBEntryReadLength_bits  6
   193849 #define GEN4_SF_STATE_ConstantURBEntryReadLength_bits  6
   193850 
   193851 static inline uint32_t ATTRIBUTE_PURE
   193852 SF_STATE_ConstantURBEntryReadLength_bits(const struct gen_device_info *devinfo)
   193853 {
   193854    switch (devinfo->gen) {
   193855    case 10: return 0;
   193856    case 9: return 0;
   193857    case 8: return 0;
   193858    case 7:
   193859       if (devinfo->is_haswell) {
   193860          return 0;
   193861       } else {
   193862          return 0;
   193863       }
   193864    case 6: return 0;
   193865    case 5: return 6;
   193866    case 4:
   193867       if (devinfo->is_g4x) {
   193868          return 6;
   193869       } else {
   193870          return 6;
   193871       }
   193872    default:
   193873       unreachable("Invalid hardware generation");
   193874    }
   193875 }
   193876 
   193877 
   193878 
   193879 #define GEN5_SF_STATE_ConstantURBEntryReadLength_start  121
   193880 #define GEN45_SF_STATE_ConstantURBEntryReadLength_start  121
   193881 #define GEN4_SF_STATE_ConstantURBEntryReadLength_start  121
   193882 
   193883 static inline uint32_t ATTRIBUTE_PURE
   193884 SF_STATE_ConstantURBEntryReadLength_start(const struct gen_device_info *devinfo)
   193885 {
   193886    switch (devinfo->gen) {
   193887    case 10: return 0;
   193888    case 9: return 0;
   193889    case 8: return 0;
   193890    case 7:
   193891       if (devinfo->is_haswell) {
   193892          return 0;
   193893       } else {
   193894          return 0;
   193895       }
   193896    case 6: return 0;
   193897    case 5: return 121;
   193898    case 4:
   193899       if (devinfo->is_g4x) {
   193900          return 121;
   193901       } else {
   193902          return 121;
   193903       }
   193904    default:
   193905       unreachable("Invalid hardware generation");
   193906    }
   193907 }
   193908 
   193909 
   193910 
   193911 /* SF_STATE::Constant URB Entry Read Offset */
   193912 
   193913 
   193914 #define GEN5_SF_STATE_ConstantURBEntryReadOffset_bits  6
   193915 #define GEN45_SF_STATE_ConstantURBEntryReadOffset_bits  6
   193916 #define GEN4_SF_STATE_ConstantURBEntryReadOffset_bits  6
   193917 
   193918 static inline uint32_t ATTRIBUTE_PURE
   193919 SF_STATE_ConstantURBEntryReadOffset_bits(const struct gen_device_info *devinfo)
   193920 {
   193921    switch (devinfo->gen) {
   193922    case 10: return 0;
   193923    case 9: return 0;
   193924    case 8: return 0;
   193925    case 7:
   193926       if (devinfo->is_haswell) {
   193927          return 0;
   193928       } else {
   193929          return 0;
   193930       }
   193931    case 6: return 0;
   193932    case 5: return 6;
   193933    case 4:
   193934       if (devinfo->is_g4x) {
   193935          return 6;
   193936       } else {
   193937          return 6;
   193938       }
   193939    default:
   193940       unreachable("Invalid hardware generation");
   193941    }
   193942 }
   193943 
   193944 
   193945 
   193946 #define GEN5_SF_STATE_ConstantURBEntryReadOffset_start  114
   193947 #define GEN45_SF_STATE_ConstantURBEntryReadOffset_start  114
   193948 #define GEN4_SF_STATE_ConstantURBEntryReadOffset_start  114
   193949 
   193950 static inline uint32_t ATTRIBUTE_PURE
   193951 SF_STATE_ConstantURBEntryReadOffset_start(const struct gen_device_info *devinfo)
   193952 {
   193953    switch (devinfo->gen) {
   193954    case 10: return 0;
   193955    case 9: return 0;
   193956    case 8: return 0;
   193957    case 7:
   193958       if (devinfo->is_haswell) {
   193959          return 0;
   193960       } else {
   193961          return 0;
   193962       }
   193963    case 6: return 0;
   193964    case 5: return 114;
   193965    case 4:
   193966       if (devinfo->is_g4x) {
   193967          return 114;
   193968       } else {
   193969          return 114;
   193970       }
   193971    default:
   193972       unreachable("Invalid hardware generation");
   193973    }
   193974 }
   193975 
   193976 
   193977 
   193978 /* SF_STATE::Cull Mode */
   193979 
   193980 
   193981 #define GEN5_SF_STATE_CullMode_bits  2
   193982 #define GEN45_SF_STATE_CullMode_bits  2
   193983 #define GEN4_SF_STATE_CullMode_bits  2
   193984 
   193985 static inline uint32_t ATTRIBUTE_PURE
   193986 SF_STATE_CullMode_bits(const struct gen_device_info *devinfo)
   193987 {
   193988    switch (devinfo->gen) {
   193989    case 10: return 0;
   193990    case 9: return 0;
   193991    case 8: return 0;
   193992    case 7:
   193993       if (devinfo->is_haswell) {
   193994          return 0;
   193995       } else {
   193996          return 0;
   193997       }
   193998    case 6: return 0;
   193999    case 5: return 2;
   194000    case 4:
   194001       if (devinfo->is_g4x) {
   194002          return 2;
   194003       } else {
   194004          return 2;
   194005       }
   194006    default:
   194007       unreachable("Invalid hardware generation");
   194008    }
   194009 }
   194010 
   194011 
   194012 
   194013 #define GEN5_SF_STATE_CullMode_start  221
   194014 #define GEN45_SF_STATE_CullMode_start  221
   194015 #define GEN4_SF_STATE_CullMode_start  221
   194016 
   194017 static inline uint32_t ATTRIBUTE_PURE
   194018 SF_STATE_CullMode_start(const struct gen_device_info *devinfo)
   194019 {
   194020    switch (devinfo->gen) {
   194021    case 10: return 0;
   194022    case 9: return 0;
   194023    case 8: return 0;
   194024    case 7:
   194025       if (devinfo->is_haswell) {
   194026          return 0;
   194027       } else {
   194028          return 0;
   194029       }
   194030    case 6: return 0;
   194031    case 5: return 221;
   194032    case 4:
   194033       if (devinfo->is_g4x) {
   194034          return 221;
   194035       } else {
   194036          return 221;
   194037       }
   194038    default:
   194039       unreachable("Invalid hardware generation");
   194040    }
   194041 }
   194042 
   194043 
   194044 
   194045 /* SF_STATE::Destination Origin Horizontal Bias */
   194046 
   194047 
   194048 #define GEN5_SF_STATE_DestinationOriginHorizontalBias_bits  4
   194049 #define GEN45_SF_STATE_DestinationOriginHorizontalBias_bits  4
   194050 #define GEN4_SF_STATE_DestinationOriginHorizontalBias_bits  4
   194051 
   194052 static inline uint32_t ATTRIBUTE_PURE
   194053 SF_STATE_DestinationOriginHorizontalBias_bits(const struct gen_device_info *devinfo)
   194054 {
   194055    switch (devinfo->gen) {
   194056    case 10: return 0;
   194057    case 9: return 0;
   194058    case 8: return 0;
   194059    case 7:
   194060       if (devinfo->is_haswell) {
   194061          return 0;
   194062       } else {
   194063          return 0;
   194064       }
   194065    case 6: return 0;
   194066    case 5: return 4;
   194067    case 4:
   194068       if (devinfo->is_g4x) {
   194069          return 4;
   194070       } else {
   194071          return 4;
   194072       }
   194073    default:
   194074       unreachable("Invalid hardware generation");
   194075    }
   194076 }
   194077 
   194078 
   194079 
   194080 #define GEN5_SF_STATE_DestinationOriginHorizontalBias_start  205
   194081 #define GEN45_SF_STATE_DestinationOriginHorizontalBias_start  205
   194082 #define GEN4_SF_STATE_DestinationOriginHorizontalBias_start  205
   194083 
   194084 static inline uint32_t ATTRIBUTE_PURE
   194085 SF_STATE_DestinationOriginHorizontalBias_start(const struct gen_device_info *devinfo)
   194086 {
   194087    switch (devinfo->gen) {
   194088    case 10: return 0;
   194089    case 9: return 0;
   194090    case 8: return 0;
   194091    case 7:
   194092       if (devinfo->is_haswell) {
   194093          return 0;
   194094       } else {
   194095          return 0;
   194096       }
   194097    case 6: return 0;
   194098    case 5: return 205;
   194099    case 4:
   194100       if (devinfo->is_g4x) {
   194101          return 205;
   194102       } else {
   194103          return 205;
   194104       }
   194105    default:
   194106       unreachable("Invalid hardware generation");
   194107    }
   194108 }
   194109 
   194110 
   194111 
   194112 /* SF_STATE::Destination Origin Vertical Bias */
   194113 
   194114 
   194115 #define GEN5_SF_STATE_DestinationOriginVerticalBias_bits  4
   194116 #define GEN45_SF_STATE_DestinationOriginVerticalBias_bits  4
   194117 #define GEN4_SF_STATE_DestinationOriginVerticalBias_bits  4
   194118 
   194119 static inline uint32_t ATTRIBUTE_PURE
   194120 SF_STATE_DestinationOriginVerticalBias_bits(const struct gen_device_info *devinfo)
   194121 {
   194122    switch (devinfo->gen) {
   194123    case 10: return 0;
   194124    case 9: return 0;
   194125    case 8: return 0;
   194126    case 7:
   194127       if (devinfo->is_haswell) {
   194128          return 0;
   194129       } else {
   194130          return 0;
   194131       }
   194132    case 6: return 0;
   194133    case 5: return 4;
   194134    case 4:
   194135       if (devinfo->is_g4x) {
   194136          return 4;
   194137       } else {
   194138          return 4;
   194139       }
   194140    default:
   194141       unreachable("Invalid hardware generation");
   194142    }
   194143 }
   194144 
   194145 
   194146 
   194147 #define GEN5_SF_STATE_DestinationOriginVerticalBias_start  201
   194148 #define GEN45_SF_STATE_DestinationOriginVerticalBias_start  201
   194149 #define GEN4_SF_STATE_DestinationOriginVerticalBias_start  201
   194150 
   194151 static inline uint32_t ATTRIBUTE_PURE
   194152 SF_STATE_DestinationOriginVerticalBias_start(const struct gen_device_info *devinfo)
   194153 {
   194154    switch (devinfo->gen) {
   194155    case 10: return 0;
   194156    case 9: return 0;
   194157    case 8: return 0;
   194158    case 7:
   194159       if (devinfo->is_haswell) {
   194160          return 0;
   194161       } else {
   194162          return 0;
   194163       }
   194164    case 6: return 0;
   194165    case 5: return 201;
   194166    case 4:
   194167       if (devinfo->is_g4x) {
   194168          return 201;
   194169       } else {
   194170          return 201;
   194171       }
   194172    default:
   194173       unreachable("Invalid hardware generation");
   194174    }
   194175 }
   194176 
   194177 
   194178 
   194179 /* SF_STATE::Dispatch GRF Start Register For URB Data */
   194180 
   194181 
   194182 #define GEN5_SF_STATE_DispatchGRFStartRegisterForURBData_bits  4
   194183 #define GEN45_SF_STATE_DispatchGRFStartRegisterForURBData_bits  4
   194184 #define GEN4_SF_STATE_DispatchGRFStartRegisterForURBData_bits  4
   194185 
   194186 static inline uint32_t ATTRIBUTE_PURE
   194187 SF_STATE_DispatchGRFStartRegisterForURBData_bits(const struct gen_device_info *devinfo)
   194188 {
   194189    switch (devinfo->gen) {
   194190    case 10: return 0;
   194191    case 9: return 0;
   194192    case 8: return 0;
   194193    case 7:
   194194       if (devinfo->is_haswell) {
   194195          return 0;
   194196       } else {
   194197          return 0;
   194198       }
   194199    case 6: return 0;
   194200    case 5: return 4;
   194201    case 4:
   194202       if (devinfo->is_g4x) {
   194203          return 4;
   194204       } else {
   194205          return 4;
   194206       }
   194207    default:
   194208       unreachable("Invalid hardware generation");
   194209    }
   194210 }
   194211 
   194212 
   194213 
   194214 #define GEN5_SF_STATE_DispatchGRFStartRegisterForURBData_start  96
   194215 #define GEN45_SF_STATE_DispatchGRFStartRegisterForURBData_start  96
   194216 #define GEN4_SF_STATE_DispatchGRFStartRegisterForURBData_start  96
   194217 
   194218 static inline uint32_t ATTRIBUTE_PURE
   194219 SF_STATE_DispatchGRFStartRegisterForURBData_start(const struct gen_device_info *devinfo)
   194220 {
   194221    switch (devinfo->gen) {
   194222    case 10: return 0;
   194223    case 9: return 0;
   194224    case 8: return 0;
   194225    case 7:
   194226       if (devinfo->is_haswell) {
   194227          return 0;
   194228       } else {
   194229          return 0;
   194230       }
   194231    case 6: return 0;
   194232    case 5: return 96;
   194233    case 4:
   194234       if (devinfo->is_g4x) {
   194235          return 96;
   194236       } else {
   194237          return 96;
   194238       }
   194239    default:
   194240       unreachable("Invalid hardware generation");
   194241    }
   194242 }
   194243 
   194244 
   194245 
   194246 /* SF_STATE::Fast Scissor Clip Disable */
   194247 
   194248 
   194249 #define GEN5_SF_STATE_FastScissorClipDisable_bits  1
   194250 #define GEN45_SF_STATE_FastScissorClipDisable_bits  1
   194251 #define GEN4_SF_STATE_FastScissorClipDisable_bits  1
   194252 
   194253 static inline uint32_t ATTRIBUTE_PURE
   194254 SF_STATE_FastScissorClipDisable_bits(const struct gen_device_info *devinfo)
   194255 {
   194256    switch (devinfo->gen) {
   194257    case 10: return 0;
   194258    case 9: return 0;
   194259    case 8: return 0;
   194260    case 7:
   194261       if (devinfo->is_haswell) {
   194262          return 0;
   194263       } else {
   194264          return 0;
   194265       }
   194266    case 6: return 0;
   194267    case 5: return 1;
   194268    case 4:
   194269       if (devinfo->is_g4x) {
   194270          return 1;
   194271       } else {
   194272          return 1;
   194273       }
   194274    default:
   194275       unreachable("Invalid hardware generation");
   194276    }
   194277 }
   194278 
   194279 
   194280 
   194281 #define GEN5_SF_STATE_FastScissorClipDisable_start  220
   194282 #define GEN45_SF_STATE_FastScissorClipDisable_start  220
   194283 #define GEN4_SF_STATE_FastScissorClipDisable_start  220
   194284 
   194285 static inline uint32_t ATTRIBUTE_PURE
   194286 SF_STATE_FastScissorClipDisable_start(const struct gen_device_info *devinfo)
   194287 {
   194288    switch (devinfo->gen) {
   194289    case 10: return 0;
   194290    case 9: return 0;
   194291    case 8: return 0;
   194292    case 7:
   194293       if (devinfo->is_haswell) {
   194294          return 0;
   194295       } else {
   194296          return 0;
   194297       }
   194298    case 6: return 0;
   194299    case 5: return 220;
   194300    case 4:
   194301       if (devinfo->is_g4x) {
   194302          return 220;
   194303       } else {
   194304          return 220;
   194305       }
   194306    default:
   194307       unreachable("Invalid hardware generation");
   194308    }
   194309 }
   194310 
   194311 
   194312 
   194313 /* SF_STATE::Floating Point Mode */
   194314 
   194315 
   194316 #define GEN5_SF_STATE_FloatingPointMode_bits  1
   194317 #define GEN45_SF_STATE_FloatingPointMode_bits  1
   194318 #define GEN4_SF_STATE_FloatingPointMode_bits  1
   194319 
   194320 static inline uint32_t ATTRIBUTE_PURE
   194321 SF_STATE_FloatingPointMode_bits(const struct gen_device_info *devinfo)
   194322 {
   194323    switch (devinfo->gen) {
   194324    case 10: return 0;
   194325    case 9: return 0;
   194326    case 8: return 0;
   194327    case 7:
   194328       if (devinfo->is_haswell) {
   194329          return 0;
   194330       } else {
   194331          return 0;
   194332       }
   194333    case 6: return 0;
   194334    case 5: return 1;
   194335    case 4:
   194336       if (devinfo->is_g4x) {
   194337          return 1;
   194338       } else {
   194339          return 1;
   194340       }
   194341    default:
   194342       unreachable("Invalid hardware generation");
   194343    }
   194344 }
   194345 
   194346 
   194347 
   194348 #define GEN5_SF_STATE_FloatingPointMode_start  48
   194349 #define GEN45_SF_STATE_FloatingPointMode_start  48
   194350 #define GEN4_SF_STATE_FloatingPointMode_start  48
   194351 
   194352 static inline uint32_t ATTRIBUTE_PURE
   194353 SF_STATE_FloatingPointMode_start(const struct gen_device_info *devinfo)
   194354 {
   194355    switch (devinfo->gen) {
   194356    case 10: return 0;
   194357    case 9: return 0;
   194358    case 8: return 0;
   194359    case 7:
   194360       if (devinfo->is_haswell) {
   194361          return 0;
   194362       } else {
   194363          return 0;
   194364       }
   194365    case 6: return 0;
   194366    case 5: return 48;
   194367    case 4:
   194368       if (devinfo->is_g4x) {
   194369          return 48;
   194370       } else {
   194371          return 48;
   194372       }
   194373    default:
   194374       unreachable("Invalid hardware generation");
   194375    }
   194376 }
   194377 
   194378 
   194379 
   194380 /* SF_STATE::Front Winding */
   194381 
   194382 
   194383 #define GEN5_SF_STATE_FrontWinding_bits  1
   194384 #define GEN45_SF_STATE_FrontWinding_bits  1
   194385 #define GEN4_SF_STATE_FrontWinding_bits  1
   194386 
   194387 static inline uint32_t ATTRIBUTE_PURE
   194388 SF_STATE_FrontWinding_bits(const struct gen_device_info *devinfo)
   194389 {
   194390    switch (devinfo->gen) {
   194391    case 10: return 0;
   194392    case 9: return 0;
   194393    case 8: return 0;
   194394    case 7:
   194395       if (devinfo->is_haswell) {
   194396          return 0;
   194397       } else {
   194398          return 0;
   194399       }
   194400    case 6: return 0;
   194401    case 5: return 1;
   194402    case 4:
   194403       if (devinfo->is_g4x) {
   194404          return 1;
   194405       } else {
   194406          return 1;
   194407       }
   194408    default:
   194409       unreachable("Invalid hardware generation");
   194410    }
   194411 }
   194412 
   194413 
   194414 
   194415 #define GEN5_SF_STATE_FrontWinding_start  160
   194416 #define GEN45_SF_STATE_FrontWinding_start  160
   194417 #define GEN4_SF_STATE_FrontWinding_start  160
   194418 
   194419 static inline uint32_t ATTRIBUTE_PURE
   194420 SF_STATE_FrontWinding_start(const struct gen_device_info *devinfo)
   194421 {
   194422    switch (devinfo->gen) {
   194423    case 10: return 0;
   194424    case 9: return 0;
   194425    case 8: return 0;
   194426    case 7:
   194427       if (devinfo->is_haswell) {
   194428          return 0;
   194429       } else {
   194430          return 0;
   194431       }
   194432    case 6: return 0;
   194433    case 5: return 160;
   194434    case 4:
   194435       if (devinfo->is_g4x) {
   194436          return 160;
   194437       } else {
   194438          return 160;
   194439       }
   194440    default:
   194441       unreachable("Invalid hardware generation");
   194442    }
   194443 }
   194444 
   194445 
   194446 
   194447 /* SF_STATE::GRF Register Count */
   194448 
   194449 
   194450 #define GEN5_SF_STATE_GRFRegisterCount_bits  3
   194451 #define GEN45_SF_STATE_GRFRegisterCount_bits  3
   194452 #define GEN4_SF_STATE_GRFRegisterCount_bits  3
   194453 
   194454 static inline uint32_t ATTRIBUTE_PURE
   194455 SF_STATE_GRFRegisterCount_bits(const struct gen_device_info *devinfo)
   194456 {
   194457    switch (devinfo->gen) {
   194458    case 10: return 0;
   194459    case 9: return 0;
   194460    case 8: return 0;
   194461    case 7:
   194462       if (devinfo->is_haswell) {
   194463          return 0;
   194464       } else {
   194465          return 0;
   194466       }
   194467    case 6: return 0;
   194468    case 5: return 3;
   194469    case 4:
   194470       if (devinfo->is_g4x) {
   194471          return 3;
   194472       } else {
   194473          return 3;
   194474       }
   194475    default:
   194476       unreachable("Invalid hardware generation");
   194477    }
   194478 }
   194479 
   194480 
   194481 
   194482 #define GEN5_SF_STATE_GRFRegisterCount_start  1
   194483 #define GEN45_SF_STATE_GRFRegisterCount_start  1
   194484 #define GEN4_SF_STATE_GRFRegisterCount_start  1
   194485 
   194486 static inline uint32_t ATTRIBUTE_PURE
   194487 SF_STATE_GRFRegisterCount_start(const struct gen_device_info *devinfo)
   194488 {
   194489    switch (devinfo->gen) {
   194490    case 10: return 0;
   194491    case 9: return 0;
   194492    case 8: return 0;
   194493    case 7:
   194494       if (devinfo->is_haswell) {
   194495          return 0;
   194496       } else {
   194497          return 0;
   194498       }
   194499    case 6: return 0;
   194500    case 5: return 1;
   194501    case 4:
   194502       if (devinfo->is_g4x) {
   194503          return 1;
   194504       } else {
   194505          return 1;
   194506       }
   194507    default:
   194508       unreachable("Invalid hardware generation");
   194509    }
   194510 }
   194511 
   194512 
   194513 
   194514 /* SF_STATE::Illegal Opcode Exception Enable */
   194515 
   194516 
   194517 #define GEN5_SF_STATE_IllegalOpcodeExceptionEnable_bits  1
   194518 #define GEN45_SF_STATE_IllegalOpcodeExceptionEnable_bits  1
   194519 #define GEN4_SF_STATE_IllegalOpcodeExceptionEnable_bits  1
   194520 
   194521 static inline uint32_t ATTRIBUTE_PURE
   194522 SF_STATE_IllegalOpcodeExceptionEnable_bits(const struct gen_device_info *devinfo)
   194523 {
   194524    switch (devinfo->gen) {
   194525    case 10: return 0;
   194526    case 9: return 0;
   194527    case 8: return 0;
   194528    case 7:
   194529       if (devinfo->is_haswell) {
   194530          return 0;
   194531       } else {
   194532          return 0;
   194533       }
   194534    case 6: return 0;
   194535    case 5: return 1;
   194536    case 4:
   194537       if (devinfo->is_g4x) {
   194538          return 1;
   194539       } else {
   194540          return 1;
   194541       }
   194542    default:
   194543       unreachable("Invalid hardware generation");
   194544    }
   194545 }
   194546 
   194547 
   194548 
   194549 #define GEN5_SF_STATE_IllegalOpcodeExceptionEnable_start  45
   194550 #define GEN45_SF_STATE_IllegalOpcodeExceptionEnable_start  45
   194551 #define GEN4_SF_STATE_IllegalOpcodeExceptionEnable_start  45
   194552 
   194553 static inline uint32_t ATTRIBUTE_PURE
   194554 SF_STATE_IllegalOpcodeExceptionEnable_start(const struct gen_device_info *devinfo)
   194555 {
   194556    switch (devinfo->gen) {
   194557    case 10: return 0;
   194558    case 9: return 0;
   194559    case 8: return 0;
   194560    case 7:
   194561       if (devinfo->is_haswell) {
   194562          return 0;
   194563       } else {
   194564          return 0;
   194565       }
   194566    case 6: return 0;
   194567    case 5: return 45;
   194568    case 4:
   194569       if (devinfo->is_g4x) {
   194570          return 45;
   194571       } else {
   194572          return 45;
   194573       }
   194574    default:
   194575       unreachable("Invalid hardware generation");
   194576    }
   194577 }
   194578 
   194579 
   194580 
   194581 /* SF_STATE::Kernel Start Pointer */
   194582 
   194583 
   194584 #define GEN5_SF_STATE_KernelStartPointer_bits  26
   194585 #define GEN45_SF_STATE_KernelStartPointer_bits  26
   194586 #define GEN4_SF_STATE_KernelStartPointer_bits  26
   194587 
   194588 static inline uint32_t ATTRIBUTE_PURE
   194589 SF_STATE_KernelStartPointer_bits(const struct gen_device_info *devinfo)
   194590 {
   194591    switch (devinfo->gen) {
   194592    case 10: return 0;
   194593    case 9: return 0;
   194594    case 8: return 0;
   194595    case 7:
   194596       if (devinfo->is_haswell) {
   194597          return 0;
   194598       } else {
   194599          return 0;
   194600       }
   194601    case 6: return 0;
   194602    case 5: return 26;
   194603    case 4:
   194604       if (devinfo->is_g4x) {
   194605          return 26;
   194606       } else {
   194607          return 26;
   194608       }
   194609    default:
   194610       unreachable("Invalid hardware generation");
   194611    }
   194612 }
   194613 
   194614 
   194615 
   194616 #define GEN5_SF_STATE_KernelStartPointer_start  6
   194617 #define GEN45_SF_STATE_KernelStartPointer_start  6
   194618 #define GEN4_SF_STATE_KernelStartPointer_start  6
   194619 
   194620 static inline uint32_t ATTRIBUTE_PURE
   194621 SF_STATE_KernelStartPointer_start(const struct gen_device_info *devinfo)
   194622 {
   194623    switch (devinfo->gen) {
   194624    case 10: return 0;
   194625    case 9: return 0;
   194626    case 8: return 0;
   194627    case 7:
   194628       if (devinfo->is_haswell) {
   194629          return 0;
   194630       } else {
   194631          return 0;
   194632       }
   194633    case 6: return 0;
   194634    case 5: return 6;
   194635    case 4:
   194636       if (devinfo->is_g4x) {
   194637          return 6;
   194638       } else {
   194639          return 6;
   194640       }
   194641    default:
   194642       unreachable("Invalid hardware generation");
   194643    }
   194644 }
   194645 
   194646 
   194647 
   194648 /* SF_STATE::Last Pixel Enable */
   194649 
   194650 
   194651 #define GEN5_SF_STATE_LastPixelEnable_bits  1
   194652 #define GEN45_SF_STATE_LastPixelEnable_bits  1
   194653 #define GEN4_SF_STATE_LastPixelEnable_bits  1
   194654 
   194655 static inline uint32_t ATTRIBUTE_PURE
   194656 SF_STATE_LastPixelEnable_bits(const struct gen_device_info *devinfo)
   194657 {
   194658    switch (devinfo->gen) {
   194659    case 10: return 0;
   194660    case 9: return 0;
   194661    case 8: return 0;
   194662    case 7:
   194663       if (devinfo->is_haswell) {
   194664          return 0;
   194665       } else {
   194666          return 0;
   194667       }
   194668    case 6: return 0;
   194669    case 5: return 1;
   194670    case 4:
   194671       if (devinfo->is_g4x) {
   194672          return 1;
   194673       } else {
   194674          return 1;
   194675       }
   194676    default:
   194677       unreachable("Invalid hardware generation");
   194678    }
   194679 }
   194680 
   194681 
   194682 
   194683 #define GEN5_SF_STATE_LastPixelEnable_start  255
   194684 #define GEN45_SF_STATE_LastPixelEnable_start  255
   194685 #define GEN4_SF_STATE_LastPixelEnable_start  255
   194686 
   194687 static inline uint32_t ATTRIBUTE_PURE
   194688 SF_STATE_LastPixelEnable_start(const struct gen_device_info *devinfo)
   194689 {
   194690    switch (devinfo->gen) {
   194691    case 10: return 0;
   194692    case 9: return 0;
   194693    case 8: return 0;
   194694    case 7:
   194695       if (devinfo->is_haswell) {
   194696          return 0;
   194697       } else {
   194698          return 0;
   194699       }
   194700    case 6: return 0;
   194701    case 5: return 255;
   194702    case 4:
   194703       if (devinfo->is_g4x) {
   194704          return 255;
   194705       } else {
   194706          return 255;
   194707       }
   194708    default:
   194709       unreachable("Invalid hardware generation");
   194710    }
   194711 }
   194712 
   194713 
   194714 
   194715 /* SF_STATE::Line End Cap Antialiasing Region Width */
   194716 
   194717 
   194718 #define GEN5_SF_STATE_LineEndCapAntialiasingRegionWidth_bits  2
   194719 #define GEN45_SF_STATE_LineEndCapAntialiasingRegionWidth_bits  2
   194720 #define GEN4_SF_STATE_LineEndCapAntialiasingRegionWidth_bits  2
   194721 
   194722 static inline uint32_t ATTRIBUTE_PURE
   194723 SF_STATE_LineEndCapAntialiasingRegionWidth_bits(const struct gen_device_info *devinfo)
   194724 {
   194725    switch (devinfo->gen) {
   194726    case 10: return 0;
   194727    case 9: return 0;
   194728    case 8: return 0;
   194729    case 7:
   194730       if (devinfo->is_haswell) {
   194731          return 0;
   194732       } else {
   194733          return 0;
   194734       }
   194735    case 6: return 0;
   194736    case 5: return 2;
   194737    case 4:
   194738       if (devinfo->is_g4x) {
   194739          return 2;
   194740       } else {
   194741          return 2;
   194742       }
   194743    default:
   194744       unreachable("Invalid hardware generation");
   194745    }
   194746 }
   194747 
   194748 
   194749 
   194750 #define GEN5_SF_STATE_LineEndCapAntialiasingRegionWidth_start  214
   194751 #define GEN45_SF_STATE_LineEndCapAntialiasingRegionWidth_start  214
   194752 #define GEN4_SF_STATE_LineEndCapAntialiasingRegionWidth_start  214
   194753 
   194754 static inline uint32_t ATTRIBUTE_PURE
   194755 SF_STATE_LineEndCapAntialiasingRegionWidth_start(const struct gen_device_info *devinfo)
   194756 {
   194757    switch (devinfo->gen) {
   194758    case 10: return 0;
   194759    case 9: return 0;
   194760    case 8: return 0;
   194761    case 7:
   194762       if (devinfo->is_haswell) {
   194763          return 0;
   194764       } else {
   194765          return 0;
   194766       }
   194767    case 6: return 0;
   194768    case 5: return 214;
   194769    case 4:
   194770       if (devinfo->is_g4x) {
   194771          return 214;
   194772       } else {
   194773          return 214;
   194774       }
   194775    default:
   194776       unreachable("Invalid hardware generation");
   194777    }
   194778 }
   194779 
   194780 
   194781 
   194782 /* SF_STATE::Line Strip/List Provoking Vertex Select */
   194783 
   194784 
   194785 #define GEN5_SF_STATE_LineStripListProvokingVertexSelect_bits  2
   194786 #define GEN45_SF_STATE_LineStripListProvokingVertexSelect_bits  2
   194787 #define GEN4_SF_STATE_LineStripListProvokingVertexSelect_bits  2
   194788 
   194789 static inline uint32_t ATTRIBUTE_PURE
   194790 SF_STATE_LineStripListProvokingVertexSelect_bits(const struct gen_device_info *devinfo)
   194791 {
   194792    switch (devinfo->gen) {
   194793    case 10: return 0;
   194794    case 9: return 0;
   194795    case 8: return 0;
   194796    case 7:
   194797       if (devinfo->is_haswell) {
   194798          return 0;
   194799       } else {
   194800          return 0;
   194801       }
   194802    case 6: return 0;
   194803    case 5: return 2;
   194804    case 4:
   194805       if (devinfo->is_g4x) {
   194806          return 2;
   194807       } else {
   194808          return 2;
   194809       }
   194810    default:
   194811       unreachable("Invalid hardware generation");
   194812    }
   194813 }
   194814 
   194815 
   194816 
   194817 #define GEN5_SF_STATE_LineStripListProvokingVertexSelect_start  251
   194818 #define GEN45_SF_STATE_LineStripListProvokingVertexSelect_start  251
   194819 #define GEN4_SF_STATE_LineStripListProvokingVertexSelect_start  251
   194820 
   194821 static inline uint32_t ATTRIBUTE_PURE
   194822 SF_STATE_LineStripListProvokingVertexSelect_start(const struct gen_device_info *devinfo)
   194823 {
   194824    switch (devinfo->gen) {
   194825    case 10: return 0;
   194826    case 9: return 0;
   194827    case 8: return 0;
   194828    case 7:
   194829       if (devinfo->is_haswell) {
   194830          return 0;
   194831       } else {
   194832          return 0;
   194833       }
   194834    case 6: return 0;
   194835    case 5: return 251;
   194836    case 4:
   194837       if (devinfo->is_g4x) {
   194838          return 251;
   194839       } else {
   194840          return 251;
   194841       }
   194842    default:
   194843       unreachable("Invalid hardware generation");
   194844    }
   194845 }
   194846 
   194847 
   194848 
   194849 /* SF_STATE::Line Width */
   194850 
   194851 
   194852 #define GEN5_SF_STATE_LineWidth_bits  4
   194853 #define GEN45_SF_STATE_LineWidth_bits  4
   194854 #define GEN4_SF_STATE_LineWidth_bits  4
   194855 
   194856 static inline uint32_t ATTRIBUTE_PURE
   194857 SF_STATE_LineWidth_bits(const struct gen_device_info *devinfo)
   194858 {
   194859    switch (devinfo->gen) {
   194860    case 10: return 0;
   194861    case 9: return 0;
   194862    case 8: return 0;
   194863    case 7:
   194864       if (devinfo->is_haswell) {
   194865          return 0;
   194866       } else {
   194867          return 0;
   194868       }
   194869    case 6: return 0;
   194870    case 5: return 4;
   194871    case 4:
   194872       if (devinfo->is_g4x) {
   194873          return 4;
   194874       } else {
   194875          return 4;
   194876       }
   194877    default:
   194878       unreachable("Invalid hardware generation");
   194879    }
   194880 }
   194881 
   194882 
   194883 
   194884 #define GEN5_SF_STATE_LineWidth_start  216
   194885 #define GEN45_SF_STATE_LineWidth_start  216
   194886 #define GEN4_SF_STATE_LineWidth_start  216
   194887 
   194888 static inline uint32_t ATTRIBUTE_PURE
   194889 SF_STATE_LineWidth_start(const struct gen_device_info *devinfo)
   194890 {
   194891    switch (devinfo->gen) {
   194892    case 10: return 0;
   194893    case 9: return 0;
   194894    case 8: return 0;
   194895    case 7:
   194896       if (devinfo->is_haswell) {
   194897          return 0;
   194898       } else {
   194899          return 0;
   194900       }
   194901    case 6: return 0;
   194902    case 5: return 216;
   194903    case 4:
   194904       if (devinfo->is_g4x) {
   194905          return 216;
   194906       } else {
   194907          return 216;
   194908       }
   194909    default:
   194910       unreachable("Invalid hardware generation");
   194911    }
   194912 }
   194913 
   194914 
   194915 
   194916 /* SF_STATE::Mask Stack Exception Enable */
   194917 
   194918 
   194919 #define GEN5_SF_STATE_MaskStackExceptionEnable_bits  1
   194920 #define GEN45_SF_STATE_MaskStackExceptionEnable_bits  1
   194921 #define GEN4_SF_STATE_MaskStackExceptionEnable_bits  1
   194922 
   194923 static inline uint32_t ATTRIBUTE_PURE
   194924 SF_STATE_MaskStackExceptionEnable_bits(const struct gen_device_info *devinfo)
   194925 {
   194926    switch (devinfo->gen) {
   194927    case 10: return 0;
   194928    case 9: return 0;
   194929    case 8: return 0;
   194930    case 7:
   194931       if (devinfo->is_haswell) {
   194932          return 0;
   194933       } else {
   194934          return 0;
   194935       }
   194936    case 6: return 0;
   194937    case 5: return 1;
   194938    case 4:
   194939       if (devinfo->is_g4x) {
   194940          return 1;
   194941       } else {
   194942          return 1;
   194943       }
   194944    default:
   194945       unreachable("Invalid hardware generation");
   194946    }
   194947 }
   194948 
   194949 
   194950 
   194951 #define GEN5_SF_STATE_MaskStackExceptionEnable_start  43
   194952 #define GEN45_SF_STATE_MaskStackExceptionEnable_start  43
   194953 #define GEN4_SF_STATE_MaskStackExceptionEnable_start  43
   194954 
   194955 static inline uint32_t ATTRIBUTE_PURE
   194956 SF_STATE_MaskStackExceptionEnable_start(const struct gen_device_info *devinfo)
   194957 {
   194958    switch (devinfo->gen) {
   194959    case 10: return 0;
   194960    case 9: return 0;
   194961    case 8: return 0;
   194962    case 7:
   194963       if (devinfo->is_haswell) {
   194964          return 0;
   194965       } else {
   194966          return 0;
   194967       }
   194968    case 6: return 0;
   194969    case 5: return 43;
   194970    case 4:
   194971       if (devinfo->is_g4x) {
   194972          return 43;
   194973       } else {
   194974          return 43;
   194975       }
   194976    default:
   194977       unreachable("Invalid hardware generation");
   194978    }
   194979 }
   194980 
   194981 
   194982 
   194983 /* SF_STATE::Maximum Number of Threads */
   194984 
   194985 
   194986 #define GEN5_SF_STATE_MaximumNumberofThreads_bits  6
   194987 #define GEN45_SF_STATE_MaximumNumberofThreads_bits  6
   194988 #define GEN4_SF_STATE_MaximumNumberofThreads_bits  6
   194989 
   194990 static inline uint32_t ATTRIBUTE_PURE
   194991 SF_STATE_MaximumNumberofThreads_bits(const struct gen_device_info *devinfo)
   194992 {
   194993    switch (devinfo->gen) {
   194994    case 10: return 0;
   194995    case 9: return 0;
   194996    case 8: return 0;
   194997    case 7:
   194998       if (devinfo->is_haswell) {
   194999          return 0;
   195000       } else {
   195001          return 0;
   195002       }
   195003    case 6: return 0;
   195004    case 5: return 6;
   195005    case 4:
   195006       if (devinfo->is_g4x) {
   195007          return 6;
   195008       } else {
   195009          return 6;
   195010       }
   195011    default:
   195012       unreachable("Invalid hardware generation");
   195013    }
   195014 }
   195015 
   195016 
   195017 
   195018 #define GEN5_SF_STATE_MaximumNumberofThreads_start  153
   195019 #define GEN45_SF_STATE_MaximumNumberofThreads_start  153
   195020 #define GEN4_SF_STATE_MaximumNumberofThreads_start  153
   195021 
   195022 static inline uint32_t ATTRIBUTE_PURE
   195023 SF_STATE_MaximumNumberofThreads_start(const struct gen_device_info *devinfo)
   195024 {
   195025    switch (devinfo->gen) {
   195026    case 10: return 0;
   195027    case 9: return 0;
   195028    case 8: return 0;
   195029    case 7:
   195030       if (devinfo->is_haswell) {
   195031          return 0;
   195032       } else {
   195033          return 0;
   195034       }
   195035    case 6: return 0;
   195036    case 5: return 153;
   195037    case 4:
   195038       if (devinfo->is_g4x) {
   195039          return 153;
   195040       } else {
   195041          return 153;
   195042       }
   195043    default:
   195044       unreachable("Invalid hardware generation");
   195045    }
   195046 }
   195047 
   195048 
   195049 
   195050 /* SF_STATE::Number of URB Entries */
   195051 
   195052 
   195053 #define GEN5_SF_STATE_NumberofURBEntries_bits  8
   195054 #define GEN45_SF_STATE_NumberofURBEntries_bits  8
   195055 #define GEN4_SF_STATE_NumberofURBEntries_bits  8
   195056 
   195057 static inline uint32_t ATTRIBUTE_PURE
   195058 SF_STATE_NumberofURBEntries_bits(const struct gen_device_info *devinfo)
   195059 {
   195060    switch (devinfo->gen) {
   195061    case 10: return 0;
   195062    case 9: return 0;
   195063    case 8: return 0;
   195064    case 7:
   195065       if (devinfo->is_haswell) {
   195066          return 0;
   195067       } else {
   195068          return 0;
   195069       }
   195070    case 6: return 0;
   195071    case 5: return 8;
   195072    case 4:
   195073       if (devinfo->is_g4x) {
   195074          return 8;
   195075       } else {
   195076          return 8;
   195077       }
   195078    default:
   195079       unreachable("Invalid hardware generation");
   195080    }
   195081 }
   195082 
   195083 
   195084 
   195085 #define GEN5_SF_STATE_NumberofURBEntries_start  139
   195086 #define GEN45_SF_STATE_NumberofURBEntries_start  139
   195087 #define GEN4_SF_STATE_NumberofURBEntries_start  139
   195088 
   195089 static inline uint32_t ATTRIBUTE_PURE
   195090 SF_STATE_NumberofURBEntries_start(const struct gen_device_info *devinfo)
   195091 {
   195092    switch (devinfo->gen) {
   195093    case 10: return 0;
   195094    case 9: return 0;
   195095    case 8: return 0;
   195096    case 7:
   195097       if (devinfo->is_haswell) {
   195098          return 0;
   195099       } else {
   195100          return 0;
   195101       }
   195102    case 6: return 0;
   195103    case 5: return 139;
   195104    case 4:
   195105       if (devinfo->is_g4x) {
   195106          return 139;
   195107       } else {
   195108          return 139;
   195109       }
   195110    default:
   195111       unreachable("Invalid hardware generation");
   195112    }
   195113 }
   195114 
   195115 
   195116 
   195117 /* SF_STATE::Per-Thread Scratch Space */
   195118 
   195119 
   195120 #define GEN5_SF_STATE_PerThreadScratchSpace_bits  4
   195121 #define GEN45_SF_STATE_PerThreadScratchSpace_bits  4
   195122 #define GEN4_SF_STATE_PerThreadScratchSpace_bits  4
   195123 
   195124 static inline uint32_t ATTRIBUTE_PURE
   195125 SF_STATE_PerThreadScratchSpace_bits(const struct gen_device_info *devinfo)
   195126 {
   195127    switch (devinfo->gen) {
   195128    case 10: return 0;
   195129    case 9: return 0;
   195130    case 8: return 0;
   195131    case 7:
   195132       if (devinfo->is_haswell) {
   195133          return 0;
   195134       } else {
   195135          return 0;
   195136       }
   195137    case 6: return 0;
   195138    case 5: return 4;
   195139    case 4:
   195140       if (devinfo->is_g4x) {
   195141          return 4;
   195142       } else {
   195143          return 4;
   195144       }
   195145    default:
   195146       unreachable("Invalid hardware generation");
   195147    }
   195148 }
   195149 
   195150 
   195151 
   195152 #define GEN5_SF_STATE_PerThreadScratchSpace_start  64
   195153 #define GEN45_SF_STATE_PerThreadScratchSpace_start  64
   195154 #define GEN4_SF_STATE_PerThreadScratchSpace_start  64
   195155 
   195156 static inline uint32_t ATTRIBUTE_PURE
   195157 SF_STATE_PerThreadScratchSpace_start(const struct gen_device_info *devinfo)
   195158 {
   195159    switch (devinfo->gen) {
   195160    case 10: return 0;
   195161    case 9: return 0;
   195162    case 8: return 0;
   195163    case 7:
   195164       if (devinfo->is_haswell) {
   195165          return 0;
   195166       } else {
   195167          return 0;
   195168       }
   195169    case 6: return 0;
   195170    case 5: return 64;
   195171    case 4:
   195172       if (devinfo->is_g4x) {
   195173          return 64;
   195174       } else {
   195175          return 64;
   195176       }
   195177    default:
   195178       unreachable("Invalid hardware generation");
   195179    }
   195180 }
   195181 
   195182 
   195183 
   195184 /* SF_STATE::Point Rasterization Rule */
   195185 
   195186 
   195187 #define GEN5_SF_STATE_PointRasterizationRule_bits  2
   195188 #define GEN45_SF_STATE_PointRasterizationRule_bits  2
   195189 #define GEN4_SF_STATE_PointRasterizationRule_bits  2
   195190 
   195191 static inline uint32_t ATTRIBUTE_PURE
   195192 SF_STATE_PointRasterizationRule_bits(const struct gen_device_info *devinfo)
   195193 {
   195194    switch (devinfo->gen) {
   195195    case 10: return 0;
   195196    case 9: return 0;
   195197    case 8: return 0;
   195198    case 7:
   195199       if (devinfo->is_haswell) {
   195200          return 0;
   195201       } else {
   195202          return 0;
   195203       }
   195204    case 6: return 0;
   195205    case 5: return 2;
   195206    case 4:
   195207       if (devinfo->is_g4x) {
   195208          return 2;
   195209       } else {
   195210          return 2;
   195211       }
   195212    default:
   195213       unreachable("Invalid hardware generation");
   195214    }
   195215 }
   195216 
   195217 
   195218 
   195219 #define GEN5_SF_STATE_PointRasterizationRule_start  212
   195220 #define GEN45_SF_STATE_PointRasterizationRule_start  212
   195221 #define GEN4_SF_STATE_PointRasterizationRule_start  212
   195222 
   195223 static inline uint32_t ATTRIBUTE_PURE
   195224 SF_STATE_PointRasterizationRule_start(const struct gen_device_info *devinfo)
   195225 {
   195226    switch (devinfo->gen) {
   195227    case 10: return 0;
   195228    case 9: return 0;
   195229    case 8: return 0;
   195230    case 7:
   195231       if (devinfo->is_haswell) {
   195232          return 0;
   195233       } else {
   195234          return 0;
   195235       }
   195236    case 6: return 0;
   195237    case 5: return 212;
   195238    case 4:
   195239       if (devinfo->is_g4x) {
   195240          return 212;
   195241       } else {
   195242          return 212;
   195243       }
   195244    default:
   195245       unreachable("Invalid hardware generation");
   195246    }
   195247 }
   195248 
   195249 
   195250 
   195251 /* SF_STATE::Point Width */
   195252 
   195253 
   195254 #define GEN5_SF_STATE_PointWidth_bits  11
   195255 #define GEN45_SF_STATE_PointWidth_bits  11
   195256 #define GEN4_SF_STATE_PointWidth_bits  11
   195257 
   195258 static inline uint32_t ATTRIBUTE_PURE
   195259 SF_STATE_PointWidth_bits(const struct gen_device_info *devinfo)
   195260 {
   195261    switch (devinfo->gen) {
   195262    case 10: return 0;
   195263    case 9: return 0;
   195264    case 8: return 0;
   195265    case 7:
   195266       if (devinfo->is_haswell) {
   195267          return 0;
   195268       } else {
   195269          return 0;
   195270       }
   195271    case 6: return 0;
   195272    case 5: return 11;
   195273    case 4:
   195274       if (devinfo->is_g4x) {
   195275          return 11;
   195276       } else {
   195277          return 11;
   195278       }
   195279    default:
   195280       unreachable("Invalid hardware generation");
   195281    }
   195282 }
   195283 
   195284 
   195285 
   195286 #define GEN5_SF_STATE_PointWidth_start  224
   195287 #define GEN45_SF_STATE_PointWidth_start  224
   195288 #define GEN4_SF_STATE_PointWidth_start  224
   195289 
   195290 static inline uint32_t ATTRIBUTE_PURE
   195291 SF_STATE_PointWidth_start(const struct gen_device_info *devinfo)
   195292 {
   195293    switch (devinfo->gen) {
   195294    case 10: return 0;
   195295    case 9: return 0;
   195296    case 8: return 0;
   195297    case 7:
   195298       if (devinfo->is_haswell) {
   195299          return 0;
   195300       } else {
   195301          return 0;
   195302       }
   195303    case 6: return 0;
   195304    case 5: return 224;
   195305    case 4:
   195306       if (devinfo->is_g4x) {
   195307          return 224;
   195308       } else {
   195309          return 224;
   195310       }
   195311    default:
   195312       unreachable("Invalid hardware generation");
   195313    }
   195314 }
   195315 
   195316 
   195317 
   195318 /* SF_STATE::Point Width Source */
   195319 
   195320 
   195321 #define GEN5_SF_STATE_PointWidthSource_bits  1
   195322 #define GEN45_SF_STATE_PointWidthSource_bits  1
   195323 #define GEN4_SF_STATE_PointWidthSource_bits  1
   195324 
   195325 static inline uint32_t ATTRIBUTE_PURE
   195326 SF_STATE_PointWidthSource_bits(const struct gen_device_info *devinfo)
   195327 {
   195328    switch (devinfo->gen) {
   195329    case 10: return 0;
   195330    case 9: return 0;
   195331    case 8: return 0;
   195332    case 7:
   195333       if (devinfo->is_haswell) {
   195334          return 0;
   195335       } else {
   195336          return 0;
   195337       }
   195338    case 6: return 0;
   195339    case 5: return 1;
   195340    case 4:
   195341       if (devinfo->is_g4x) {
   195342          return 1;
   195343       } else {
   195344          return 1;
   195345       }
   195346    default:
   195347       unreachable("Invalid hardware generation");
   195348    }
   195349 }
   195350 
   195351 
   195352 
   195353 #define GEN5_SF_STATE_PointWidthSource_start  235
   195354 #define GEN45_SF_STATE_PointWidthSource_start  235
   195355 #define GEN4_SF_STATE_PointWidthSource_start  235
   195356 
   195357 static inline uint32_t ATTRIBUTE_PURE
   195358 SF_STATE_PointWidthSource_start(const struct gen_device_info *devinfo)
   195359 {
   195360    switch (devinfo->gen) {
   195361    case 10: return 0;
   195362    case 9: return 0;
   195363    case 8: return 0;
   195364    case 7:
   195365       if (devinfo->is_haswell) {
   195366          return 0;
   195367       } else {
   195368          return 0;
   195369       }
   195370    case 6: return 0;
   195371    case 5: return 235;
   195372    case 4:
   195373       if (devinfo->is_g4x) {
   195374          return 235;
   195375       } else {
   195376          return 235;
   195377       }
   195378    default:
   195379       unreachable("Invalid hardware generation");
   195380    }
   195381 }
   195382 
   195383 
   195384 
   195385 /* SF_STATE::Scissor Rectangle Enable */
   195386 
   195387 
   195388 #define GEN5_SF_STATE_ScissorRectangleEnable_bits  1
   195389 #define GEN45_SF_STATE_ScissorRectangleEnable_bits  1
   195390 #define GEN4_SF_STATE_ScissorRectangleEnable_bits  1
   195391 
   195392 static inline uint32_t ATTRIBUTE_PURE
   195393 SF_STATE_ScissorRectangleEnable_bits(const struct gen_device_info *devinfo)
   195394 {
   195395    switch (devinfo->gen) {
   195396    case 10: return 0;
   195397    case 9: return 0;
   195398    case 8: return 0;
   195399    case 7:
   195400       if (devinfo->is_haswell) {
   195401          return 0;
   195402       } else {
   195403          return 0;
   195404       }
   195405    case 6: return 0;
   195406    case 5: return 1;
   195407    case 4:
   195408       if (devinfo->is_g4x) {
   195409          return 1;
   195410       } else {
   195411          return 1;
   195412       }
   195413    default:
   195414       unreachable("Invalid hardware generation");
   195415    }
   195416 }
   195417 
   195418 
   195419 
   195420 #define GEN5_SF_STATE_ScissorRectangleEnable_start  209
   195421 #define GEN45_SF_STATE_ScissorRectangleEnable_start  209
   195422 #define GEN4_SF_STATE_ScissorRectangleEnable_start  209
   195423 
   195424 static inline uint32_t ATTRIBUTE_PURE
   195425 SF_STATE_ScissorRectangleEnable_start(const struct gen_device_info *devinfo)
   195426 {
   195427    switch (devinfo->gen) {
   195428    case 10: return 0;
   195429    case 9: return 0;
   195430    case 8: return 0;
   195431    case 7:
   195432       if (devinfo->is_haswell) {
   195433          return 0;
   195434       } else {
   195435          return 0;
   195436       }
   195437    case 6: return 0;
   195438    case 5: return 209;
   195439    case 4:
   195440       if (devinfo->is_g4x) {
   195441          return 209;
   195442       } else {
   195443          return 209;
   195444       }
   195445    default:
   195446       unreachable("Invalid hardware generation");
   195447    }
   195448 }
   195449 
   195450 
   195451 
   195452 /* SF_STATE::Scratch Space Base Pointer */
   195453 
   195454 
   195455 #define GEN5_SF_STATE_ScratchSpaceBasePointer_bits  22
   195456 #define GEN45_SF_STATE_ScratchSpaceBasePointer_bits  22
   195457 #define GEN4_SF_STATE_ScratchSpaceBasePointer_bits  22
   195458 
   195459 static inline uint32_t ATTRIBUTE_PURE
   195460 SF_STATE_ScratchSpaceBasePointer_bits(const struct gen_device_info *devinfo)
   195461 {
   195462    switch (devinfo->gen) {
   195463    case 10: return 0;
   195464    case 9: return 0;
   195465    case 8: return 0;
   195466    case 7:
   195467       if (devinfo->is_haswell) {
   195468          return 0;
   195469       } else {
   195470          return 0;
   195471       }
   195472    case 6: return 0;
   195473    case 5: return 22;
   195474    case 4:
   195475       if (devinfo->is_g4x) {
   195476          return 22;
   195477       } else {
   195478          return 22;
   195479       }
   195480    default:
   195481       unreachable("Invalid hardware generation");
   195482    }
   195483 }
   195484 
   195485 
   195486 
   195487 #define GEN5_SF_STATE_ScratchSpaceBasePointer_start  74
   195488 #define GEN45_SF_STATE_ScratchSpaceBasePointer_start  74
   195489 #define GEN4_SF_STATE_ScratchSpaceBasePointer_start  74
   195490 
   195491 static inline uint32_t ATTRIBUTE_PURE
   195492 SF_STATE_ScratchSpaceBasePointer_start(const struct gen_device_info *devinfo)
   195493 {
   195494    switch (devinfo->gen) {
   195495    case 10: return 0;
   195496    case 9: return 0;
   195497    case 8: return 0;
   195498    case 7:
   195499       if (devinfo->is_haswell) {
   195500          return 0;
   195501       } else {
   195502          return 0;
   195503       }
   195504    case 6: return 0;
   195505    case 5: return 74;
   195506    case 4:
   195507       if (devinfo->is_g4x) {
   195508          return 74;
   195509       } else {
   195510          return 74;
   195511       }
   195512    default:
   195513       unreachable("Invalid hardware generation");
   195514    }
   195515 }
   195516 
   195517 
   195518 
   195519 /* SF_STATE::Setup Viewport State Offset */
   195520 
   195521 
   195522 #define GEN5_SF_STATE_SetupViewportStateOffset_bits  27
   195523 #define GEN45_SF_STATE_SetupViewportStateOffset_bits  27
   195524 #define GEN4_SF_STATE_SetupViewportStateOffset_bits  27
   195525 
   195526 static inline uint32_t ATTRIBUTE_PURE
   195527 SF_STATE_SetupViewportStateOffset_bits(const struct gen_device_info *devinfo)
   195528 {
   195529    switch (devinfo->gen) {
   195530    case 10: return 0;
   195531    case 9: return 0;
   195532    case 8: return 0;
   195533    case 7:
   195534       if (devinfo->is_haswell) {
   195535          return 0;
   195536       } else {
   195537          return 0;
   195538       }
   195539    case 6: return 0;
   195540    case 5: return 27;
   195541    case 4:
   195542       if (devinfo->is_g4x) {
   195543          return 27;
   195544       } else {
   195545          return 27;
   195546       }
   195547    default:
   195548       unreachable("Invalid hardware generation");
   195549    }
   195550 }
   195551 
   195552 
   195553 
   195554 #define GEN5_SF_STATE_SetupViewportStateOffset_start  165
   195555 #define GEN45_SF_STATE_SetupViewportStateOffset_start  165
   195556 #define GEN4_SF_STATE_SetupViewportStateOffset_start  165
   195557 
   195558 static inline uint32_t ATTRIBUTE_PURE
   195559 SF_STATE_SetupViewportStateOffset_start(const struct gen_device_info *devinfo)
   195560 {
   195561    switch (devinfo->gen) {
   195562    case 10: return 0;
   195563    case 9: return 0;
   195564    case 8: return 0;
   195565    case 7:
   195566       if (devinfo->is_haswell) {
   195567          return 0;
   195568       } else {
   195569          return 0;
   195570       }
   195571    case 6: return 0;
   195572    case 5: return 165;
   195573    case 4:
   195574       if (devinfo->is_g4x) {
   195575          return 165;
   195576       } else {
   195577          return 165;
   195578       }
   195579    default:
   195580       unreachable("Invalid hardware generation");
   195581    }
   195582 }
   195583 
   195584 
   195585 
   195586 /* SF_STATE::Single Program Flow */
   195587 
   195588 
   195589 #define GEN5_SF_STATE_SingleProgramFlow_bits  1
   195590 #define GEN45_SF_STATE_SingleProgramFlow_bits  1
   195591 #define GEN4_SF_STATE_SingleProgramFlow_bits  1
   195592 
   195593 static inline uint32_t ATTRIBUTE_PURE
   195594 SF_STATE_SingleProgramFlow_bits(const struct gen_device_info *devinfo)
   195595 {
   195596    switch (devinfo->gen) {
   195597    case 10: return 0;
   195598    case 9: return 0;
   195599    case 8: return 0;
   195600    case 7:
   195601       if (devinfo->is_haswell) {
   195602          return 0;
   195603       } else {
   195604          return 0;
   195605       }
   195606    case 6: return 0;
   195607    case 5: return 1;
   195608    case 4:
   195609       if (devinfo->is_g4x) {
   195610          return 1;
   195611       } else {
   195612          return 1;
   195613       }
   195614    default:
   195615       unreachable("Invalid hardware generation");
   195616    }
   195617 }
   195618 
   195619 
   195620 
   195621 #define GEN5_SF_STATE_SingleProgramFlow_start  63
   195622 #define GEN45_SF_STATE_SingleProgramFlow_start  63
   195623 #define GEN4_SF_STATE_SingleProgramFlow_start  63
   195624 
   195625 static inline uint32_t ATTRIBUTE_PURE
   195626 SF_STATE_SingleProgramFlow_start(const struct gen_device_info *devinfo)
   195627 {
   195628    switch (devinfo->gen) {
   195629    case 10: return 0;
   195630    case 9: return 0;
   195631    case 8: return 0;
   195632    case 7:
   195633       if (devinfo->is_haswell) {
   195634          return 0;
   195635       } else {
   195636          return 0;
   195637       }
   195638    case 6: return 0;
   195639    case 5: return 63;
   195640    case 4:
   195641       if (devinfo->is_g4x) {
   195642          return 63;
   195643       } else {
   195644          return 63;
   195645       }
   195646    default:
   195647       unreachable("Invalid hardware generation");
   195648    }
   195649 }
   195650 
   195651 
   195652 
   195653 /* SF_STATE::Software  Exception Enable */
   195654 
   195655 
   195656 #define GEN5_SF_STATE_SoftwareExceptionEnable_bits  1
   195657 #define GEN45_SF_STATE_SoftwareExceptionEnable_bits  1
   195658 #define GEN4_SF_STATE_SoftwareExceptionEnable_bits  1
   195659 
   195660 static inline uint32_t ATTRIBUTE_PURE
   195661 SF_STATE_SoftwareExceptionEnable_bits(const struct gen_device_info *devinfo)
   195662 {
   195663    switch (devinfo->gen) {
   195664    case 10: return 0;
   195665    case 9: return 0;
   195666    case 8: return 0;
   195667    case 7:
   195668       if (devinfo->is_haswell) {
   195669          return 0;
   195670       } else {
   195671          return 0;
   195672       }
   195673    case 6: return 0;
   195674    case 5: return 1;
   195675    case 4:
   195676       if (devinfo->is_g4x) {
   195677          return 1;
   195678       } else {
   195679          return 1;
   195680       }
   195681    default:
   195682       unreachable("Invalid hardware generation");
   195683    }
   195684 }
   195685 
   195686 
   195687 
   195688 #define GEN5_SF_STATE_SoftwareExceptionEnable_start  39
   195689 #define GEN45_SF_STATE_SoftwareExceptionEnable_start  39
   195690 #define GEN4_SF_STATE_SoftwareExceptionEnable_start  39
   195691 
   195692 static inline uint32_t ATTRIBUTE_PURE
   195693 SF_STATE_SoftwareExceptionEnable_start(const struct gen_device_info *devinfo)
   195694 {
   195695    switch (devinfo->gen) {
   195696    case 10: return 0;
   195697    case 9: return 0;
   195698    case 8: return 0;
   195699    case 7:
   195700       if (devinfo->is_haswell) {
   195701          return 0;
   195702       } else {
   195703          return 0;
   195704       }
   195705    case 6: return 0;
   195706    case 5: return 39;
   195707    case 4:
   195708       if (devinfo->is_g4x) {
   195709          return 39;
   195710       } else {
   195711          return 39;
   195712       }
   195713    default:
   195714       unreachable("Invalid hardware generation");
   195715    }
   195716 }
   195717 
   195718 
   195719 
   195720 /* SF_STATE::Sprite Point Enable */
   195721 
   195722 
   195723 #define GEN5_SF_STATE_SpritePointEnable_bits  1
   195724 #define GEN45_SF_STATE_SpritePointEnable_bits  1
   195725 #define GEN4_SF_STATE_SpritePointEnable_bits  1
   195726 
   195727 static inline uint32_t ATTRIBUTE_PURE
   195728 SF_STATE_SpritePointEnable_bits(const struct gen_device_info *devinfo)
   195729 {
   195730    switch (devinfo->gen) {
   195731    case 10: return 0;
   195732    case 9: return 0;
   195733    case 8: return 0;
   195734    case 7:
   195735       if (devinfo->is_haswell) {
   195736          return 0;
   195737       } else {
   195738          return 0;
   195739       }
   195740    case 6: return 0;
   195741    case 5: return 1;
   195742    case 4:
   195743       if (devinfo->is_g4x) {
   195744          return 1;
   195745       } else {
   195746          return 1;
   195747       }
   195748    default:
   195749       unreachable("Invalid hardware generation");
   195750    }
   195751 }
   195752 
   195753 
   195754 
   195755 #define GEN5_SF_STATE_SpritePointEnable_start  237
   195756 #define GEN45_SF_STATE_SpritePointEnable_start  237
   195757 #define GEN4_SF_STATE_SpritePointEnable_start  237
   195758 
   195759 static inline uint32_t ATTRIBUTE_PURE
   195760 SF_STATE_SpritePointEnable_start(const struct gen_device_info *devinfo)
   195761 {
   195762    switch (devinfo->gen) {
   195763    case 10: return 0;
   195764    case 9: return 0;
   195765    case 8: return 0;
   195766    case 7:
   195767       if (devinfo->is_haswell) {
   195768          return 0;
   195769       } else {
   195770          return 0;
   195771       }
   195772    case 6: return 0;
   195773    case 5: return 237;
   195774    case 4:
   195775       if (devinfo->is_g4x) {
   195776          return 237;
   195777       } else {
   195778          return 237;
   195779       }
   195780    default:
   195781       unreachable("Invalid hardware generation");
   195782    }
   195783 }
   195784 
   195785 
   195786 
   195787 /* SF_STATE::Statistics Enable */
   195788 
   195789 
   195790 #define GEN45_SF_STATE_StatisticsEnable_bits  1
   195791 
   195792 static inline uint32_t ATTRIBUTE_PURE
   195793 SF_STATE_StatisticsEnable_bits(const struct gen_device_info *devinfo)
   195794 {
   195795    switch (devinfo->gen) {
   195796    case 10: return 0;
   195797    case 9: return 0;
   195798    case 8: return 0;
   195799    case 7:
   195800       if (devinfo->is_haswell) {
   195801          return 0;
   195802       } else {
   195803          return 0;
   195804       }
   195805    case 6: return 0;
   195806    case 5: return 0;
   195807    case 4:
   195808       if (devinfo->is_g4x) {
   195809          return 1;
   195810       } else {
   195811          return 0;
   195812       }
   195813    default:
   195814       unreachable("Invalid hardware generation");
   195815    }
   195816 }
   195817 
   195818 
   195819 
   195820 #define GEN45_SF_STATE_StatisticsEnable_start  138
   195821 
   195822 static inline uint32_t ATTRIBUTE_PURE
   195823 SF_STATE_StatisticsEnable_start(const struct gen_device_info *devinfo)
   195824 {
   195825    switch (devinfo->gen) {
   195826    case 10: return 0;
   195827    case 9: return 0;
   195828    case 8: return 0;
   195829    case 7:
   195830       if (devinfo->is_haswell) {
   195831          return 0;
   195832       } else {
   195833          return 0;
   195834       }
   195835    case 6: return 0;
   195836    case 5: return 0;
   195837    case 4:
   195838       if (devinfo->is_g4x) {
   195839          return 138;
   195840       } else {
   195841          return 0;
   195842       }
   195843    default:
   195844       unreachable("Invalid hardware generation");
   195845    }
   195846 }
   195847 
   195848 
   195849 
   195850 /* SF_STATE::Thread Priority */
   195851 
   195852 
   195853 #define GEN5_SF_STATE_ThreadPriority_bits  1
   195854 #define GEN45_SF_STATE_ThreadPriority_bits  1
   195855 #define GEN4_SF_STATE_ThreadPriority_bits  1
   195856 
   195857 static inline uint32_t ATTRIBUTE_PURE
   195858 SF_STATE_ThreadPriority_bits(const struct gen_device_info *devinfo)
   195859 {
   195860    switch (devinfo->gen) {
   195861    case 10: return 0;
   195862    case 9: return 0;
   195863    case 8: return 0;
   195864    case 7:
   195865       if (devinfo->is_haswell) {
   195866          return 0;
   195867       } else {
   195868          return 0;
   195869       }
   195870    case 6: return 0;
   195871    case 5: return 1;
   195872    case 4:
   195873       if (devinfo->is_g4x) {
   195874          return 1;
   195875       } else {
   195876          return 1;
   195877       }
   195878    default:
   195879       unreachable("Invalid hardware generation");
   195880    }
   195881 }
   195882 
   195883 
   195884 
   195885 #define GEN5_SF_STATE_ThreadPriority_start  49
   195886 #define GEN45_SF_STATE_ThreadPriority_start  49
   195887 #define GEN4_SF_STATE_ThreadPriority_start  49
   195888 
   195889 static inline uint32_t ATTRIBUTE_PURE
   195890 SF_STATE_ThreadPriority_start(const struct gen_device_info *devinfo)
   195891 {
   195892    switch (devinfo->gen) {
   195893    case 10: return 0;
   195894    case 9: return 0;
   195895    case 8: return 0;
   195896    case 7:
   195897       if (devinfo->is_haswell) {
   195898          return 0;
   195899       } else {
   195900          return 0;
   195901       }
   195902    case 6: return 0;
   195903    case 5: return 49;
   195904    case 4:
   195905       if (devinfo->is_g4x) {
   195906          return 49;
   195907       } else {
   195908          return 49;
   195909       }
   195910    default:
   195911       unreachable("Invalid hardware generation");
   195912    }
   195913 }
   195914 
   195915 
   195916 
   195917 /* SF_STATE::Triangle Fan Provoking Vertex Select */
   195918 
   195919 
   195920 #define GEN5_SF_STATE_TriangleFanProvokingVertexSelect_bits  2
   195921 #define GEN45_SF_STATE_TriangleFanProvokingVertexSelect_bits  2
   195922 #define GEN4_SF_STATE_TriangleFanProvokingVertexSelect_bits  2
   195923 
   195924 static inline uint32_t ATTRIBUTE_PURE
   195925 SF_STATE_TriangleFanProvokingVertexSelect_bits(const struct gen_device_info *devinfo)
   195926 {
   195927    switch (devinfo->gen) {
   195928    case 10: return 0;
   195929    case 9: return 0;
   195930    case 8: return 0;
   195931    case 7:
   195932       if (devinfo->is_haswell) {
   195933          return 0;
   195934       } else {
   195935          return 0;
   195936       }
   195937    case 6: return 0;
   195938    case 5: return 2;
   195939    case 4:
   195940       if (devinfo->is_g4x) {
   195941          return 2;
   195942       } else {
   195943          return 2;
   195944       }
   195945    default:
   195946       unreachable("Invalid hardware generation");
   195947    }
   195948 }
   195949 
   195950 
   195951 
   195952 #define GEN5_SF_STATE_TriangleFanProvokingVertexSelect_start  249
   195953 #define GEN45_SF_STATE_TriangleFanProvokingVertexSelect_start  249
   195954 #define GEN4_SF_STATE_TriangleFanProvokingVertexSelect_start  249
   195955 
   195956 static inline uint32_t ATTRIBUTE_PURE
   195957 SF_STATE_TriangleFanProvokingVertexSelect_start(const struct gen_device_info *devinfo)
   195958 {
   195959    switch (devinfo->gen) {
   195960    case 10: return 0;
   195961    case 9: return 0;
   195962    case 8: return 0;
   195963    case 7:
   195964       if (devinfo->is_haswell) {
   195965          return 0;
   195966       } else {
   195967          return 0;
   195968       }
   195969    case 6: return 0;
   195970    case 5: return 249;
   195971    case 4:
   195972       if (devinfo->is_g4x) {
   195973          return 249;
   195974       } else {
   195975          return 249;
   195976       }
   195977    default:
   195978       unreachable("Invalid hardware generation");
   195979    }
   195980 }
   195981 
   195982 
   195983 
   195984 /* SF_STATE::Triangle Strip/List Provoking Vertex Select */
   195985 
   195986 
   195987 #define GEN5_SF_STATE_TriangleStripListProvokingVertexSelect_bits  2
   195988 #define GEN45_SF_STATE_TriangleStripListProvokingVertexSelect_bits  2
   195989 #define GEN4_SF_STATE_TriangleStripListProvokingVertexSelect_bits  2
   195990 
   195991 static inline uint32_t ATTRIBUTE_PURE
   195992 SF_STATE_TriangleStripListProvokingVertexSelect_bits(const struct gen_device_info *devinfo)
   195993 {
   195994    switch (devinfo->gen) {
   195995    case 10: return 0;
   195996    case 9: return 0;
   195997    case 8: return 0;
   195998    case 7:
   195999       if (devinfo->is_haswell) {
   196000          return 0;
   196001       } else {
   196002          return 0;
   196003       }
   196004    case 6: return 0;
   196005    case 5: return 2;
   196006    case 4:
   196007       if (devinfo->is_g4x) {
   196008          return 2;
   196009       } else {
   196010          return 2;
   196011       }
   196012    default:
   196013       unreachable("Invalid hardware generation");
   196014    }
   196015 }
   196016 
   196017 
   196018 
   196019 #define GEN5_SF_STATE_TriangleStripListProvokingVertexSelect_start  253
   196020 #define GEN45_SF_STATE_TriangleStripListProvokingVertexSelect_start  253
   196021 #define GEN4_SF_STATE_TriangleStripListProvokingVertexSelect_start  253
   196022 
   196023 static inline uint32_t ATTRIBUTE_PURE
   196024 SF_STATE_TriangleStripListProvokingVertexSelect_start(const struct gen_device_info *devinfo)
   196025 {
   196026    switch (devinfo->gen) {
   196027    case 10: return 0;
   196028    case 9: return 0;
   196029    case 8: return 0;
   196030    case 7:
   196031       if (devinfo->is_haswell) {
   196032          return 0;
   196033       } else {
   196034          return 0;
   196035       }
   196036    case 6: return 0;
   196037    case 5: return 253;
   196038    case 4:
   196039       if (devinfo->is_g4x) {
   196040          return 253;
   196041       } else {
   196042          return 253;
   196043       }
   196044    default:
   196045       unreachable("Invalid hardware generation");
   196046    }
   196047 }
   196048 
   196049 
   196050 
   196051 /* SF_STATE::URB Entry Allocation Size */
   196052 
   196053 
   196054 #define GEN5_SF_STATE_URBEntryAllocationSize_bits  5
   196055 #define GEN45_SF_STATE_URBEntryAllocationSize_bits  5
   196056 #define GEN4_SF_STATE_URBEntryAllocationSize_bits  5
   196057 
   196058 static inline uint32_t ATTRIBUTE_PURE
   196059 SF_STATE_URBEntryAllocationSize_bits(const struct gen_device_info *devinfo)
   196060 {
   196061    switch (devinfo->gen) {
   196062    case 10: return 0;
   196063    case 9: return 0;
   196064    case 8: return 0;
   196065    case 7:
   196066       if (devinfo->is_haswell) {
   196067          return 0;
   196068       } else {
   196069          return 0;
   196070       }
   196071    case 6: return 0;
   196072    case 5: return 5;
   196073    case 4:
   196074       if (devinfo->is_g4x) {
   196075          return 5;
   196076       } else {
   196077          return 5;
   196078       }
   196079    default:
   196080       unreachable("Invalid hardware generation");
   196081    }
   196082 }
   196083 
   196084 
   196085 
   196086 #define GEN5_SF_STATE_URBEntryAllocationSize_start  147
   196087 #define GEN45_SF_STATE_URBEntryAllocationSize_start  147
   196088 #define GEN4_SF_STATE_URBEntryAllocationSize_start  147
   196089 
   196090 static inline uint32_t ATTRIBUTE_PURE
   196091 SF_STATE_URBEntryAllocationSize_start(const struct gen_device_info *devinfo)
   196092 {
   196093    switch (devinfo->gen) {
   196094    case 10: return 0;
   196095    case 9: return 0;
   196096    case 8: return 0;
   196097    case 7:
   196098       if (devinfo->is_haswell) {
   196099          return 0;
   196100       } else {
   196101          return 0;
   196102       }
   196103    case 6: return 0;
   196104    case 5: return 147;
   196105    case 4:
   196106       if (devinfo->is_g4x) {
   196107          return 147;
   196108       } else {
   196109          return 147;
   196110       }
   196111    default:
   196112       unreachable("Invalid hardware generation");
   196113    }
   196114 }
   196115 
   196116 
   196117 
   196118 /* SF_STATE::Vertex Sub Pixel Precision Select */
   196119 
   196120 
   196121 #define GEN5_SF_STATE_VertexSubPixelPrecisionSelect_bits  1
   196122 #define GEN45_SF_STATE_VertexSubPixelPrecisionSelect_bits  1
   196123 #define GEN4_SF_STATE_VertexSubPixelPrecisionSelect_bits  1
   196124 
   196125 static inline uint32_t ATTRIBUTE_PURE
   196126 SF_STATE_VertexSubPixelPrecisionSelect_bits(const struct gen_device_info *devinfo)
   196127 {
   196128    switch (devinfo->gen) {
   196129    case 10: return 0;
   196130    case 9: return 0;
   196131    case 8: return 0;
   196132    case 7:
   196133       if (devinfo->is_haswell) {
   196134          return 0;
   196135       } else {
   196136          return 0;
   196137       }
   196138    case 6: return 0;
   196139    case 5: return 1;
   196140    case 4:
   196141       if (devinfo->is_g4x) {
   196142          return 1;
   196143       } else {
   196144          return 1;
   196145       }
   196146    default:
   196147       unreachable("Invalid hardware generation");
   196148    }
   196149 }
   196150 
   196151 
   196152 
   196153 #define GEN5_SF_STATE_VertexSubPixelPrecisionSelect_start  236
   196154 #define GEN45_SF_STATE_VertexSubPixelPrecisionSelect_start  236
   196155 #define GEN4_SF_STATE_VertexSubPixelPrecisionSelect_start  236
   196156 
   196157 static inline uint32_t ATTRIBUTE_PURE
   196158 SF_STATE_VertexSubPixelPrecisionSelect_start(const struct gen_device_info *devinfo)
   196159 {
   196160    switch (devinfo->gen) {
   196161    case 10: return 0;
   196162    case 9: return 0;
   196163    case 8: return 0;
   196164    case 7:
   196165       if (devinfo->is_haswell) {
   196166          return 0;
   196167       } else {
   196168          return 0;
   196169       }
   196170    case 6: return 0;
   196171    case 5: return 236;
   196172    case 4:
   196173       if (devinfo->is_g4x) {
   196174          return 236;
   196175       } else {
   196176          return 236;
   196177       }
   196178    default:
   196179       unreachable("Invalid hardware generation");
   196180    }
   196181 }
   196182 
   196183 
   196184 
   196185 /* SF_STATE::Vertex URB Entry Read Length */
   196186 
   196187 
   196188 #define GEN5_SF_STATE_VertexURBEntryReadLength_bits  6
   196189 #define GEN45_SF_STATE_VertexURBEntryReadLength_bits  6
   196190 #define GEN4_SF_STATE_VertexURBEntryReadLength_bits  6
   196191 
   196192 static inline uint32_t ATTRIBUTE_PURE
   196193 SF_STATE_VertexURBEntryReadLength_bits(const struct gen_device_info *devinfo)
   196194 {
   196195    switch (devinfo->gen) {
   196196    case 10: return 0;
   196197    case 9: return 0;
   196198    case 8: return 0;
   196199    case 7:
   196200       if (devinfo->is_haswell) {
   196201          return 0;
   196202       } else {
   196203          return 0;
   196204       }
   196205    case 6: return 0;
   196206    case 5: return 6;
   196207    case 4:
   196208       if (devinfo->is_g4x) {
   196209          return 6;
   196210       } else {
   196211          return 6;
   196212       }
   196213    default:
   196214       unreachable("Invalid hardware generation");
   196215    }
   196216 }
   196217 
   196218 
   196219 
   196220 #define GEN5_SF_STATE_VertexURBEntryReadLength_start  107
   196221 #define GEN45_SF_STATE_VertexURBEntryReadLength_start  107
   196222 #define GEN4_SF_STATE_VertexURBEntryReadLength_start  107
   196223 
   196224 static inline uint32_t ATTRIBUTE_PURE
   196225 SF_STATE_VertexURBEntryReadLength_start(const struct gen_device_info *devinfo)
   196226 {
   196227    switch (devinfo->gen) {
   196228    case 10: return 0;
   196229    case 9: return 0;
   196230    case 8: return 0;
   196231    case 7:
   196232       if (devinfo->is_haswell) {
   196233          return 0;
   196234       } else {
   196235          return 0;
   196236       }
   196237    case 6: return 0;
   196238    case 5: return 107;
   196239    case 4:
   196240       if (devinfo->is_g4x) {
   196241          return 107;
   196242       } else {
   196243          return 107;
   196244       }
   196245    default:
   196246       unreachable("Invalid hardware generation");
   196247    }
   196248 }
   196249 
   196250 
   196251 
   196252 /* SF_STATE::Vertex URB Entry Read Offset */
   196253 
   196254 
   196255 #define GEN5_SF_STATE_VertexURBEntryReadOffset_bits  6
   196256 #define GEN45_SF_STATE_VertexURBEntryReadOffset_bits  6
   196257 #define GEN4_SF_STATE_VertexURBEntryReadOffset_bits  6
   196258 
   196259 static inline uint32_t ATTRIBUTE_PURE
   196260 SF_STATE_VertexURBEntryReadOffset_bits(const struct gen_device_info *devinfo)
   196261 {
   196262    switch (devinfo->gen) {
   196263    case 10: return 0;
   196264    case 9: return 0;
   196265    case 8: return 0;
   196266    case 7:
   196267       if (devinfo->is_haswell) {
   196268          return 0;
   196269       } else {
   196270          return 0;
   196271       }
   196272    case 6: return 0;
   196273    case 5: return 6;
   196274    case 4:
   196275       if (devinfo->is_g4x) {
   196276          return 6;
   196277       } else {
   196278          return 6;
   196279       }
   196280    default:
   196281       unreachable("Invalid hardware generation");
   196282    }
   196283 }
   196284 
   196285 
   196286 
   196287 #define GEN5_SF_STATE_VertexURBEntryReadOffset_start  100
   196288 #define GEN45_SF_STATE_VertexURBEntryReadOffset_start  100
   196289 #define GEN4_SF_STATE_VertexURBEntryReadOffset_start  100
   196290 
   196291 static inline uint32_t ATTRIBUTE_PURE
   196292 SF_STATE_VertexURBEntryReadOffset_start(const struct gen_device_info *devinfo)
   196293 {
   196294    switch (devinfo->gen) {
   196295    case 10: return 0;
   196296    case 9: return 0;
   196297    case 8: return 0;
   196298    case 7:
   196299       if (devinfo->is_haswell) {
   196300          return 0;
   196301       } else {
   196302          return 0;
   196303       }
   196304    case 6: return 0;
   196305    case 5: return 100;
   196306    case 4:
   196307       if (devinfo->is_g4x) {
   196308          return 100;
   196309       } else {
   196310          return 100;
   196311       }
   196312    default:
   196313       unreachable("Invalid hardware generation");
   196314    }
   196315 }
   196316 
   196317 
   196318 
   196319 /* SF_STATE::Viewport Transform Enable */
   196320 
   196321 
   196322 #define GEN5_SF_STATE_ViewportTransformEnable_bits  1
   196323 #define GEN45_SF_STATE_ViewportTransformEnable_bits  1
   196324 #define GEN4_SF_STATE_ViewportTransformEnable_bits  1
   196325 
   196326 static inline uint32_t ATTRIBUTE_PURE
   196327 SF_STATE_ViewportTransformEnable_bits(const struct gen_device_info *devinfo)
   196328 {
   196329    switch (devinfo->gen) {
   196330    case 10: return 0;
   196331    case 9: return 0;
   196332    case 8: return 0;
   196333    case 7:
   196334       if (devinfo->is_haswell) {
   196335          return 0;
   196336       } else {
   196337          return 0;
   196338       }
   196339    case 6: return 0;
   196340    case 5: return 1;
   196341    case 4:
   196342       if (devinfo->is_g4x) {
   196343          return 1;
   196344       } else {
   196345          return 1;
   196346       }
   196347    default:
   196348       unreachable("Invalid hardware generation");
   196349    }
   196350 }
   196351 
   196352 
   196353 
   196354 #define GEN5_SF_STATE_ViewportTransformEnable_start  161
   196355 #define GEN45_SF_STATE_ViewportTransformEnable_start  161
   196356 #define GEN4_SF_STATE_ViewportTransformEnable_start  161
   196357 
   196358 static inline uint32_t ATTRIBUTE_PURE
   196359 SF_STATE_ViewportTransformEnable_start(const struct gen_device_info *devinfo)
   196360 {
   196361    switch (devinfo->gen) {
   196362    case 10: return 0;
   196363    case 9: return 0;
   196364    case 8: return 0;
   196365    case 7:
   196366       if (devinfo->is_haswell) {
   196367          return 0;
   196368       } else {
   196369          return 0;
   196370       }
   196371    case 6: return 0;
   196372    case 5: return 161;
   196373    case 4:
   196374       if (devinfo->is_g4x) {
   196375          return 161;
   196376       } else {
   196377          return 161;
   196378       }
   196379    default:
   196380       unreachable("Invalid hardware generation");
   196381    }
   196382 }
   196383 
   196384 
   196385 
   196386 /* SF_STATE::Zero Pixel Triangle Filter Disable */
   196387 
   196388 
   196389 #define GEN5_SF_STATE_ZeroPixelTriangleFilterDisable_bits  1
   196390 #define GEN45_SF_STATE_ZeroPixelTriangleFilterDisable_bits  1
   196391 #define GEN4_SF_STATE_ZeroPixelTriangleFilterDisable_bits  1
   196392 
   196393 static inline uint32_t ATTRIBUTE_PURE
   196394 SF_STATE_ZeroPixelTriangleFilterDisable_bits(const struct gen_device_info *devinfo)
   196395 {
   196396    switch (devinfo->gen) {
   196397    case 10: return 0;
   196398    case 9: return 0;
   196399    case 8: return 0;
   196400    case 7:
   196401       if (devinfo->is_haswell) {
   196402          return 0;
   196403       } else {
   196404          return 0;
   196405       }
   196406    case 6: return 0;
   196407    case 5: return 1;
   196408    case 4:
   196409       if (devinfo->is_g4x) {
   196410          return 1;
   196411       } else {
   196412          return 1;
   196413       }
   196414    default:
   196415       unreachable("Invalid hardware generation");
   196416    }
   196417 }
   196418 
   196419 
   196420 
   196421 #define GEN5_SF_STATE_ZeroPixelTriangleFilterDisable_start  211
   196422 #define GEN45_SF_STATE_ZeroPixelTriangleFilterDisable_start  211
   196423 #define GEN4_SF_STATE_ZeroPixelTriangleFilterDisable_start  211
   196424 
   196425 static inline uint32_t ATTRIBUTE_PURE
   196426 SF_STATE_ZeroPixelTriangleFilterDisable_start(const struct gen_device_info *devinfo)
   196427 {
   196428    switch (devinfo->gen) {
   196429    case 10: return 0;
   196430    case 9: return 0;
   196431    case 8: return 0;
   196432    case 7:
   196433       if (devinfo->is_haswell) {
   196434          return 0;
   196435       } else {
   196436          return 0;
   196437       }
   196438    case 6: return 0;
   196439    case 5: return 211;
   196440    case 4:
   196441       if (devinfo->is_g4x) {
   196442          return 211;
   196443       } else {
   196444          return 211;
   196445       }
   196446    default:
   196447       unreachable("Invalid hardware generation");
   196448    }
   196449 }
   196450 
   196451 
   196452 
   196453 /* SF_VIEWPORT */
   196454 
   196455 
   196456 #define GEN6_SF_VIEWPORT_length  8
   196457 #define GEN5_SF_VIEWPORT_length  8
   196458 #define GEN45_SF_VIEWPORT_length  8
   196459 #define GEN4_SF_VIEWPORT_length  8
   196460 
   196461 static inline uint32_t ATTRIBUTE_PURE
   196462 SF_VIEWPORT_length(const struct gen_device_info *devinfo)
   196463 {
   196464    switch (devinfo->gen) {
   196465    case 10: return 0;
   196466    case 9: return 0;
   196467    case 8: return 0;
   196468    case 7:
   196469       if (devinfo->is_haswell) {
   196470          return 0;
   196471       } else {
   196472          return 0;
   196473       }
   196474    case 6: return 8;
   196475    case 5: return 8;
   196476    case 4:
   196477       if (devinfo->is_g4x) {
   196478          return 8;
   196479       } else {
   196480          return 8;
   196481       }
   196482    default:
   196483       unreachable("Invalid hardware generation");
   196484    }
   196485 }
   196486 
   196487 
   196488 
   196489 /* SF_VIEWPORT::Scissor Rectangle */
   196490 
   196491 
   196492 #define GEN5_SF_VIEWPORT_ScissorRectangle_bits  64
   196493 #define GEN45_SF_VIEWPORT_ScissorRectangle_bits  64
   196494 #define GEN4_SF_VIEWPORT_ScissorRectangle_bits  64
   196495 
   196496 static inline uint32_t ATTRIBUTE_PURE
   196497 SF_VIEWPORT_ScissorRectangle_bits(const struct gen_device_info *devinfo)
   196498 {
   196499    switch (devinfo->gen) {
   196500    case 10: return 0;
   196501    case 9: return 0;
   196502    case 8: return 0;
   196503    case 7:
   196504       if (devinfo->is_haswell) {
   196505          return 0;
   196506       } else {
   196507          return 0;
   196508       }
   196509    case 6: return 0;
   196510    case 5: return 64;
   196511    case 4:
   196512       if (devinfo->is_g4x) {
   196513          return 64;
   196514       } else {
   196515          return 64;
   196516       }
   196517    default:
   196518       unreachable("Invalid hardware generation");
   196519    }
   196520 }
   196521 
   196522 
   196523 
   196524 #define GEN5_SF_VIEWPORT_ScissorRectangle_start  192
   196525 #define GEN45_SF_VIEWPORT_ScissorRectangle_start  192
   196526 #define GEN4_SF_VIEWPORT_ScissorRectangle_start  192
   196527 
   196528 static inline uint32_t ATTRIBUTE_PURE
   196529 SF_VIEWPORT_ScissorRectangle_start(const struct gen_device_info *devinfo)
   196530 {
   196531    switch (devinfo->gen) {
   196532    case 10: return 0;
   196533    case 9: return 0;
   196534    case 8: return 0;
   196535    case 7:
   196536       if (devinfo->is_haswell) {
   196537          return 0;
   196538       } else {
   196539          return 0;
   196540       }
   196541    case 6: return 0;
   196542    case 5: return 192;
   196543    case 4:
   196544       if (devinfo->is_g4x) {
   196545          return 192;
   196546       } else {
   196547          return 192;
   196548       }
   196549    default:
   196550       unreachable("Invalid hardware generation");
   196551    }
   196552 }
   196553 
   196554 
   196555 
   196556 /* SF_VIEWPORT::Viewport Matrix Element m00 */
   196557 
   196558 
   196559 #define GEN6_SF_VIEWPORT_ViewportMatrixElementm00_bits  32
   196560 #define GEN5_SF_VIEWPORT_ViewportMatrixElementm00_bits  32
   196561 #define GEN45_SF_VIEWPORT_ViewportMatrixElementm00_bits  32
   196562 #define GEN4_SF_VIEWPORT_ViewportMatrixElementm00_bits  32
   196563 
   196564 static inline uint32_t ATTRIBUTE_PURE
   196565 SF_VIEWPORT_ViewportMatrixElementm00_bits(const struct gen_device_info *devinfo)
   196566 {
   196567    switch (devinfo->gen) {
   196568    case 10: return 0;
   196569    case 9: return 0;
   196570    case 8: return 0;
   196571    case 7:
   196572       if (devinfo->is_haswell) {
   196573          return 0;
   196574       } else {
   196575          return 0;
   196576       }
   196577    case 6: return 32;
   196578    case 5: return 32;
   196579    case 4:
   196580       if (devinfo->is_g4x) {
   196581          return 32;
   196582       } else {
   196583          return 32;
   196584       }
   196585    default:
   196586       unreachable("Invalid hardware generation");
   196587    }
   196588 }
   196589 
   196590 
   196591 
   196592 #define GEN6_SF_VIEWPORT_ViewportMatrixElementm00_start  0
   196593 #define GEN5_SF_VIEWPORT_ViewportMatrixElementm00_start  0
   196594 #define GEN45_SF_VIEWPORT_ViewportMatrixElementm00_start  0
   196595 #define GEN4_SF_VIEWPORT_ViewportMatrixElementm00_start  0
   196596 
   196597 static inline uint32_t ATTRIBUTE_PURE
   196598 SF_VIEWPORT_ViewportMatrixElementm00_start(const struct gen_device_info *devinfo)
   196599 {
   196600    switch (devinfo->gen) {
   196601    case 10: return 0;
   196602    case 9: return 0;
   196603    case 8: return 0;
   196604    case 7:
   196605       if (devinfo->is_haswell) {
   196606          return 0;
   196607       } else {
   196608          return 0;
   196609       }
   196610    case 6: return 0;
   196611    case 5: return 0;
   196612    case 4:
   196613       if (devinfo->is_g4x) {
   196614          return 0;
   196615       } else {
   196616          return 0;
   196617       }
   196618    default:
   196619       unreachable("Invalid hardware generation");
   196620    }
   196621 }
   196622 
   196623 
   196624 
   196625 /* SF_VIEWPORT::Viewport Matrix Element m11 */
   196626 
   196627 
   196628 #define GEN6_SF_VIEWPORT_ViewportMatrixElementm11_bits  32
   196629 #define GEN5_SF_VIEWPORT_ViewportMatrixElementm11_bits  32
   196630 #define GEN45_SF_VIEWPORT_ViewportMatrixElementm11_bits  32
   196631 #define GEN4_SF_VIEWPORT_ViewportMatrixElementm11_bits  32
   196632 
   196633 static inline uint32_t ATTRIBUTE_PURE
   196634 SF_VIEWPORT_ViewportMatrixElementm11_bits(const struct gen_device_info *devinfo)
   196635 {
   196636    switch (devinfo->gen) {
   196637    case 10: return 0;
   196638    case 9: return 0;
   196639    case 8: return 0;
   196640    case 7:
   196641       if (devinfo->is_haswell) {
   196642          return 0;
   196643       } else {
   196644          return 0;
   196645       }
   196646    case 6: return 32;
   196647    case 5: return 32;
   196648    case 4:
   196649       if (devinfo->is_g4x) {
   196650          return 32;
   196651       } else {
   196652          return 32;
   196653       }
   196654    default:
   196655       unreachable("Invalid hardware generation");
   196656    }
   196657 }
   196658 
   196659 
   196660 
   196661 #define GEN6_SF_VIEWPORT_ViewportMatrixElementm11_start  32
   196662 #define GEN5_SF_VIEWPORT_ViewportMatrixElementm11_start  32
   196663 #define GEN45_SF_VIEWPORT_ViewportMatrixElementm11_start  32
   196664 #define GEN4_SF_VIEWPORT_ViewportMatrixElementm11_start  32
   196665 
   196666 static inline uint32_t ATTRIBUTE_PURE
   196667 SF_VIEWPORT_ViewportMatrixElementm11_start(const struct gen_device_info *devinfo)
   196668 {
   196669    switch (devinfo->gen) {
   196670    case 10: return 0;
   196671    case 9: return 0;
   196672    case 8: return 0;
   196673    case 7:
   196674       if (devinfo->is_haswell) {
   196675          return 0;
   196676       } else {
   196677          return 0;
   196678       }
   196679    case 6: return 32;
   196680    case 5: return 32;
   196681    case 4:
   196682       if (devinfo->is_g4x) {
   196683          return 32;
   196684       } else {
   196685          return 32;
   196686       }
   196687    default:
   196688       unreachable("Invalid hardware generation");
   196689    }
   196690 }
   196691 
   196692 
   196693 
   196694 /* SF_VIEWPORT::Viewport Matrix Element m22 */
   196695 
   196696 
   196697 #define GEN6_SF_VIEWPORT_ViewportMatrixElementm22_bits  32
   196698 #define GEN5_SF_VIEWPORT_ViewportMatrixElementm22_bits  32
   196699 #define GEN45_SF_VIEWPORT_ViewportMatrixElementm22_bits  32
   196700 #define GEN4_SF_VIEWPORT_ViewportMatrixElementm22_bits  32
   196701 
   196702 static inline uint32_t ATTRIBUTE_PURE
   196703 SF_VIEWPORT_ViewportMatrixElementm22_bits(const struct gen_device_info *devinfo)
   196704 {
   196705    switch (devinfo->gen) {
   196706    case 10: return 0;
   196707    case 9: return 0;
   196708    case 8: return 0;
   196709    case 7:
   196710       if (devinfo->is_haswell) {
   196711          return 0;
   196712       } else {
   196713          return 0;
   196714       }
   196715    case 6: return 32;
   196716    case 5: return 32;
   196717    case 4:
   196718       if (devinfo->is_g4x) {
   196719          return 32;
   196720       } else {
   196721          return 32;
   196722       }
   196723    default:
   196724       unreachable("Invalid hardware generation");
   196725    }
   196726 }
   196727 
   196728 
   196729 
   196730 #define GEN6_SF_VIEWPORT_ViewportMatrixElementm22_start  64
   196731 #define GEN5_SF_VIEWPORT_ViewportMatrixElementm22_start  64
   196732 #define GEN45_SF_VIEWPORT_ViewportMatrixElementm22_start  64
   196733 #define GEN4_SF_VIEWPORT_ViewportMatrixElementm22_start  64
   196734 
   196735 static inline uint32_t ATTRIBUTE_PURE
   196736 SF_VIEWPORT_ViewportMatrixElementm22_start(const struct gen_device_info *devinfo)
   196737 {
   196738    switch (devinfo->gen) {
   196739    case 10: return 0;
   196740    case 9: return 0;
   196741    case 8: return 0;
   196742    case 7:
   196743       if (devinfo->is_haswell) {
   196744          return 0;
   196745       } else {
   196746          return 0;
   196747       }
   196748    case 6: return 64;
   196749    case 5: return 64;
   196750    case 4:
   196751       if (devinfo->is_g4x) {
   196752          return 64;
   196753       } else {
   196754          return 64;
   196755       }
   196756    default:
   196757       unreachable("Invalid hardware generation");
   196758    }
   196759 }
   196760 
   196761 
   196762 
   196763 /* SF_VIEWPORT::Viewport Matrix Element m30 */
   196764 
   196765 
   196766 #define GEN6_SF_VIEWPORT_ViewportMatrixElementm30_bits  32
   196767 #define GEN5_SF_VIEWPORT_ViewportMatrixElementm30_bits  32
   196768 #define GEN45_SF_VIEWPORT_ViewportMatrixElementm30_bits  32
   196769 #define GEN4_SF_VIEWPORT_ViewportMatrixElementm30_bits  32
   196770 
   196771 static inline uint32_t ATTRIBUTE_PURE
   196772 SF_VIEWPORT_ViewportMatrixElementm30_bits(const struct gen_device_info *devinfo)
   196773 {
   196774    switch (devinfo->gen) {
   196775    case 10: return 0;
   196776    case 9: return 0;
   196777    case 8: return 0;
   196778    case 7:
   196779       if (devinfo->is_haswell) {
   196780          return 0;
   196781       } else {
   196782          return 0;
   196783       }
   196784    case 6: return 32;
   196785    case 5: return 32;
   196786    case 4:
   196787       if (devinfo->is_g4x) {
   196788          return 32;
   196789       } else {
   196790          return 32;
   196791       }
   196792    default:
   196793       unreachable("Invalid hardware generation");
   196794    }
   196795 }
   196796 
   196797 
   196798 
   196799 #define GEN6_SF_VIEWPORT_ViewportMatrixElementm30_start  96
   196800 #define GEN5_SF_VIEWPORT_ViewportMatrixElementm30_start  96
   196801 #define GEN45_SF_VIEWPORT_ViewportMatrixElementm30_start  96
   196802 #define GEN4_SF_VIEWPORT_ViewportMatrixElementm30_start  96
   196803 
   196804 static inline uint32_t ATTRIBUTE_PURE
   196805 SF_VIEWPORT_ViewportMatrixElementm30_start(const struct gen_device_info *devinfo)
   196806 {
   196807    switch (devinfo->gen) {
   196808    case 10: return 0;
   196809    case 9: return 0;
   196810    case 8: return 0;
   196811    case 7:
   196812       if (devinfo->is_haswell) {
   196813          return 0;
   196814       } else {
   196815          return 0;
   196816       }
   196817    case 6: return 96;
   196818    case 5: return 96;
   196819    case 4:
   196820       if (devinfo->is_g4x) {
   196821          return 96;
   196822       } else {
   196823          return 96;
   196824       }
   196825    default:
   196826       unreachable("Invalid hardware generation");
   196827    }
   196828 }
   196829 
   196830 
   196831 
   196832 /* SF_VIEWPORT::Viewport Matrix Element m31 */
   196833 
   196834 
   196835 #define GEN6_SF_VIEWPORT_ViewportMatrixElementm31_bits  32
   196836 #define GEN5_SF_VIEWPORT_ViewportMatrixElementm31_bits  32
   196837 #define GEN45_SF_VIEWPORT_ViewportMatrixElementm31_bits  32
   196838 #define GEN4_SF_VIEWPORT_ViewportMatrixElementm31_bits  32
   196839 
   196840 static inline uint32_t ATTRIBUTE_PURE
   196841 SF_VIEWPORT_ViewportMatrixElementm31_bits(const struct gen_device_info *devinfo)
   196842 {
   196843    switch (devinfo->gen) {
   196844    case 10: return 0;
   196845    case 9: return 0;
   196846    case 8: return 0;
   196847    case 7:
   196848       if (devinfo->is_haswell) {
   196849          return 0;
   196850       } else {
   196851          return 0;
   196852       }
   196853    case 6: return 32;
   196854    case 5: return 32;
   196855    case 4:
   196856       if (devinfo->is_g4x) {
   196857          return 32;
   196858       } else {
   196859          return 32;
   196860       }
   196861    default:
   196862       unreachable("Invalid hardware generation");
   196863    }
   196864 }
   196865 
   196866 
   196867 
   196868 #define GEN6_SF_VIEWPORT_ViewportMatrixElementm31_start  128
   196869 #define GEN5_SF_VIEWPORT_ViewportMatrixElementm31_start  128
   196870 #define GEN45_SF_VIEWPORT_ViewportMatrixElementm31_start  128
   196871 #define GEN4_SF_VIEWPORT_ViewportMatrixElementm31_start  128
   196872 
   196873 static inline uint32_t ATTRIBUTE_PURE
   196874 SF_VIEWPORT_ViewportMatrixElementm31_start(const struct gen_device_info *devinfo)
   196875 {
   196876    switch (devinfo->gen) {
   196877    case 10: return 0;
   196878    case 9: return 0;
   196879    case 8: return 0;
   196880    case 7:
   196881       if (devinfo->is_haswell) {
   196882          return 0;
   196883       } else {
   196884          return 0;
   196885       }
   196886    case 6: return 128;
   196887    case 5: return 128;
   196888    case 4:
   196889       if (devinfo->is_g4x) {
   196890          return 128;
   196891       } else {
   196892          return 128;
   196893       }
   196894    default:
   196895       unreachable("Invalid hardware generation");
   196896    }
   196897 }
   196898 
   196899 
   196900 
   196901 /* SF_VIEWPORT::Viewport Matrix Element m32 */
   196902 
   196903 
   196904 #define GEN6_SF_VIEWPORT_ViewportMatrixElementm32_bits  32
   196905 #define GEN5_SF_VIEWPORT_ViewportMatrixElementm32_bits  32
   196906 #define GEN45_SF_VIEWPORT_ViewportMatrixElementm32_bits  32
   196907 #define GEN4_SF_VIEWPORT_ViewportMatrixElementm32_bits  32
   196908 
   196909 static inline uint32_t ATTRIBUTE_PURE
   196910 SF_VIEWPORT_ViewportMatrixElementm32_bits(const struct gen_device_info *devinfo)
   196911 {
   196912    switch (devinfo->gen) {
   196913    case 10: return 0;
   196914    case 9: return 0;
   196915    case 8: return 0;
   196916    case 7:
   196917       if (devinfo->is_haswell) {
   196918          return 0;
   196919       } else {
   196920          return 0;
   196921       }
   196922    case 6: return 32;
   196923    case 5: return 32;
   196924    case 4:
   196925       if (devinfo->is_g4x) {
   196926          return 32;
   196927       } else {
   196928          return 32;
   196929       }
   196930    default:
   196931       unreachable("Invalid hardware generation");
   196932    }
   196933 }
   196934 
   196935 
   196936 
   196937 #define GEN6_SF_VIEWPORT_ViewportMatrixElementm32_start  160
   196938 #define GEN5_SF_VIEWPORT_ViewportMatrixElementm32_start  160
   196939 #define GEN45_SF_VIEWPORT_ViewportMatrixElementm32_start  160
   196940 #define GEN4_SF_VIEWPORT_ViewportMatrixElementm32_start  160
   196941 
   196942 static inline uint32_t ATTRIBUTE_PURE
   196943 SF_VIEWPORT_ViewportMatrixElementm32_start(const struct gen_device_info *devinfo)
   196944 {
   196945    switch (devinfo->gen) {
   196946    case 10: return 0;
   196947    case 9: return 0;
   196948    case 8: return 0;
   196949    case 7:
   196950       if (devinfo->is_haswell) {
   196951          return 0;
   196952       } else {
   196953          return 0;
   196954       }
   196955    case 6: return 160;
   196956    case 5: return 160;
   196957    case 4:
   196958       if (devinfo->is_g4x) {
   196959          return 160;
   196960       } else {
   196961          return 160;
   196962       }
   196963    default:
   196964       unreachable("Invalid hardware generation");
   196965    }
   196966 }
   196967 
   196968 
   196969 
   196970 /* SLICE_COMMON_ECO_CHICKEN1 */
   196971 
   196972 
   196973 #define GEN9_SLICE_COMMON_ECO_CHICKEN1_length  1
   196974 
   196975 static inline uint32_t ATTRIBUTE_PURE
   196976 SLICE_COMMON_ECO_CHICKEN1_length(const struct gen_device_info *devinfo)
   196977 {
   196978    switch (devinfo->gen) {
   196979    case 10: return 0;
   196980    case 9: return 1;
   196981    case 8: return 0;
   196982    case 7:
   196983       if (devinfo->is_haswell) {
   196984          return 0;
   196985       } else {
   196986          return 0;
   196987       }
   196988    case 6: return 0;
   196989    case 5: return 0;
   196990    case 4:
   196991       if (devinfo->is_g4x) {
   196992          return 0;
   196993       } else {
   196994          return 0;
   196995       }
   196996    default:
   196997       unreachable("Invalid hardware generation");
   196998    }
   196999 }
   197000 
   197001 
   197002 
   197003 /* SLICE_COMMON_ECO_CHICKEN1::GLK Barrier Mode */
   197004 
   197005 
   197006 #define GEN9_SLICE_COMMON_ECO_CHICKEN1_GLKBarrierMode_bits  1
   197007 
   197008 static inline uint32_t ATTRIBUTE_PURE
   197009 SLICE_COMMON_ECO_CHICKEN1_GLKBarrierMode_bits(const struct gen_device_info *devinfo)
   197010 {
   197011    switch (devinfo->gen) {
   197012    case 10: return 0;
   197013    case 9: return 1;
   197014    case 8: return 0;
   197015    case 7:
   197016       if (devinfo->is_haswell) {
   197017          return 0;
   197018       } else {
   197019          return 0;
   197020       }
   197021    case 6: return 0;
   197022    case 5: return 0;
   197023    case 4:
   197024       if (devinfo->is_g4x) {
   197025          return 0;
   197026       } else {
   197027          return 0;
   197028       }
   197029    default:
   197030       unreachable("Invalid hardware generation");
   197031    }
   197032 }
   197033 
   197034 
   197035 
   197036 #define GEN9_SLICE_COMMON_ECO_CHICKEN1_GLKBarrierMode_start  7
   197037 
   197038 static inline uint32_t ATTRIBUTE_PURE
   197039 SLICE_COMMON_ECO_CHICKEN1_GLKBarrierMode_start(const struct gen_device_info *devinfo)
   197040 {
   197041    switch (devinfo->gen) {
   197042    case 10: return 0;
   197043    case 9: return 7;
   197044    case 8: return 0;
   197045    case 7:
   197046       if (devinfo->is_haswell) {
   197047          return 0;
   197048       } else {
   197049          return 0;
   197050       }
   197051    case 6: return 0;
   197052    case 5: return 0;
   197053    case 4:
   197054       if (devinfo->is_g4x) {
   197055          return 0;
   197056       } else {
   197057          return 0;
   197058       }
   197059    default:
   197060       unreachable("Invalid hardware generation");
   197061    }
   197062 }
   197063 
   197064 
   197065 
   197066 /* SLICE_COMMON_ECO_CHICKEN1::GLK Barrier Mode Mask */
   197067 
   197068 
   197069 #define GEN9_SLICE_COMMON_ECO_CHICKEN1_GLKBarrierModeMask_bits  1
   197070 
   197071 static inline uint32_t ATTRIBUTE_PURE
   197072 SLICE_COMMON_ECO_CHICKEN1_GLKBarrierModeMask_bits(const struct gen_device_info *devinfo)
   197073 {
   197074    switch (devinfo->gen) {
   197075    case 10: return 0;
   197076    case 9: return 1;
   197077    case 8: return 0;
   197078    case 7:
   197079       if (devinfo->is_haswell) {
   197080          return 0;
   197081       } else {
   197082          return 0;
   197083       }
   197084    case 6: return 0;
   197085    case 5: return 0;
   197086    case 4:
   197087       if (devinfo->is_g4x) {
   197088          return 0;
   197089       } else {
   197090          return 0;
   197091       }
   197092    default:
   197093       unreachable("Invalid hardware generation");
   197094    }
   197095 }
   197096 
   197097 
   197098 
   197099 #define GEN9_SLICE_COMMON_ECO_CHICKEN1_GLKBarrierModeMask_start  23
   197100 
   197101 static inline uint32_t ATTRIBUTE_PURE
   197102 SLICE_COMMON_ECO_CHICKEN1_GLKBarrierModeMask_start(const struct gen_device_info *devinfo)
   197103 {
   197104    switch (devinfo->gen) {
   197105    case 10: return 0;
   197106    case 9: return 23;
   197107    case 8: return 0;
   197108    case 7:
   197109       if (devinfo->is_haswell) {
   197110          return 0;
   197111       } else {
   197112          return 0;
   197113       }
   197114    case 6: return 0;
   197115    case 5: return 0;
   197116    case 4:
   197117       if (devinfo->is_g4x) {
   197118          return 0;
   197119       } else {
   197120          return 0;
   197121       }
   197122    default:
   197123       unreachable("Invalid hardware generation");
   197124    }
   197125 }
   197126 
   197127 
   197128 
   197129 /* SO_DECL */
   197130 
   197131 
   197132 #define GEN10_SO_DECL_length  1
   197133 #define GEN9_SO_DECL_length  1
   197134 #define GEN8_SO_DECL_length  1
   197135 #define GEN75_SO_DECL_length  1
   197136 #define GEN7_SO_DECL_length  1
   197137 
   197138 static inline uint32_t ATTRIBUTE_PURE
   197139 SO_DECL_length(const struct gen_device_info *devinfo)
   197140 {
   197141    switch (devinfo->gen) {
   197142    case 10: return 1;
   197143    case 9: return 1;
   197144    case 8: return 1;
   197145    case 7:
   197146       if (devinfo->is_haswell) {
   197147          return 1;
   197148       } else {
   197149          return 1;
   197150       }
   197151    case 6: return 0;
   197152    case 5: return 0;
   197153    case 4:
   197154       if (devinfo->is_g4x) {
   197155          return 0;
   197156       } else {
   197157          return 0;
   197158       }
   197159    default:
   197160       unreachable("Invalid hardware generation");
   197161    }
   197162 }
   197163 
   197164 
   197165 
   197166 /* SO_DECL::Component Mask */
   197167 
   197168 
   197169 #define GEN10_SO_DECL_ComponentMask_bits  4
   197170 #define GEN9_SO_DECL_ComponentMask_bits  4
   197171 #define GEN8_SO_DECL_ComponentMask_bits  4
   197172 #define GEN75_SO_DECL_ComponentMask_bits  4
   197173 #define GEN7_SO_DECL_ComponentMask_bits  4
   197174 
   197175 static inline uint32_t ATTRIBUTE_PURE
   197176 SO_DECL_ComponentMask_bits(const struct gen_device_info *devinfo)
   197177 {
   197178    switch (devinfo->gen) {
   197179    case 10: return 4;
   197180    case 9: return 4;
   197181    case 8: return 4;
   197182    case 7:
   197183       if (devinfo->is_haswell) {
   197184          return 4;
   197185       } else {
   197186          return 4;
   197187       }
   197188    case 6: return 0;
   197189    case 5: return 0;
   197190    case 4:
   197191       if (devinfo->is_g4x) {
   197192          return 0;
   197193       } else {
   197194          return 0;
   197195       }
   197196    default:
   197197       unreachable("Invalid hardware generation");
   197198    }
   197199 }
   197200 
   197201 
   197202 
   197203 #define GEN10_SO_DECL_ComponentMask_start  0
   197204 #define GEN9_SO_DECL_ComponentMask_start  0
   197205 #define GEN8_SO_DECL_ComponentMask_start  0
   197206 #define GEN75_SO_DECL_ComponentMask_start  0
   197207 #define GEN7_SO_DECL_ComponentMask_start  0
   197208 
   197209 static inline uint32_t ATTRIBUTE_PURE
   197210 SO_DECL_ComponentMask_start(const struct gen_device_info *devinfo)
   197211 {
   197212    switch (devinfo->gen) {
   197213    case 10: return 0;
   197214    case 9: return 0;
   197215    case 8: return 0;
   197216    case 7:
   197217       if (devinfo->is_haswell) {
   197218          return 0;
   197219       } else {
   197220          return 0;
   197221       }
   197222    case 6: return 0;
   197223    case 5: return 0;
   197224    case 4:
   197225       if (devinfo->is_g4x) {
   197226          return 0;
   197227       } else {
   197228          return 0;
   197229       }
   197230    default:
   197231       unreachable("Invalid hardware generation");
   197232    }
   197233 }
   197234 
   197235 
   197236 
   197237 /* SO_DECL::Hole Flag */
   197238 
   197239 
   197240 #define GEN10_SO_DECL_HoleFlag_bits  1
   197241 #define GEN9_SO_DECL_HoleFlag_bits  1
   197242 #define GEN8_SO_DECL_HoleFlag_bits  1
   197243 #define GEN75_SO_DECL_HoleFlag_bits  1
   197244 #define GEN7_SO_DECL_HoleFlag_bits  1
   197245 
   197246 static inline uint32_t ATTRIBUTE_PURE
   197247 SO_DECL_HoleFlag_bits(const struct gen_device_info *devinfo)
   197248 {
   197249    switch (devinfo->gen) {
   197250    case 10: return 1;
   197251    case 9: return 1;
   197252    case 8: return 1;
   197253    case 7:
   197254       if (devinfo->is_haswell) {
   197255          return 1;
   197256       } else {
   197257          return 1;
   197258       }
   197259    case 6: return 0;
   197260    case 5: return 0;
   197261    case 4:
   197262       if (devinfo->is_g4x) {
   197263          return 0;
   197264       } else {
   197265          return 0;
   197266       }
   197267    default:
   197268       unreachable("Invalid hardware generation");
   197269    }
   197270 }
   197271 
   197272 
   197273 
   197274 #define GEN10_SO_DECL_HoleFlag_start  11
   197275 #define GEN9_SO_DECL_HoleFlag_start  11
   197276 #define GEN8_SO_DECL_HoleFlag_start  11
   197277 #define GEN75_SO_DECL_HoleFlag_start  11
   197278 #define GEN7_SO_DECL_HoleFlag_start  11
   197279 
   197280 static inline uint32_t ATTRIBUTE_PURE
   197281 SO_DECL_HoleFlag_start(const struct gen_device_info *devinfo)
   197282 {
   197283    switch (devinfo->gen) {
   197284    case 10: return 11;
   197285    case 9: return 11;
   197286    case 8: return 11;
   197287    case 7:
   197288       if (devinfo->is_haswell) {
   197289          return 11;
   197290       } else {
   197291          return 11;
   197292       }
   197293    case 6: return 0;
   197294    case 5: return 0;
   197295    case 4:
   197296       if (devinfo->is_g4x) {
   197297          return 0;
   197298       } else {
   197299          return 0;
   197300       }
   197301    default:
   197302       unreachable("Invalid hardware generation");
   197303    }
   197304 }
   197305 
   197306 
   197307 
   197308 /* SO_DECL::Output Buffer Slot */
   197309 
   197310 
   197311 #define GEN10_SO_DECL_OutputBufferSlot_bits  2
   197312 #define GEN9_SO_DECL_OutputBufferSlot_bits  2
   197313 #define GEN8_SO_DECL_OutputBufferSlot_bits  2
   197314 #define GEN75_SO_DECL_OutputBufferSlot_bits  2
   197315 #define GEN7_SO_DECL_OutputBufferSlot_bits  2
   197316 
   197317 static inline uint32_t ATTRIBUTE_PURE
   197318 SO_DECL_OutputBufferSlot_bits(const struct gen_device_info *devinfo)
   197319 {
   197320    switch (devinfo->gen) {
   197321    case 10: return 2;
   197322    case 9: return 2;
   197323    case 8: return 2;
   197324    case 7:
   197325       if (devinfo->is_haswell) {
   197326          return 2;
   197327       } else {
   197328          return 2;
   197329       }
   197330    case 6: return 0;
   197331    case 5: return 0;
   197332    case 4:
   197333       if (devinfo->is_g4x) {
   197334          return 0;
   197335       } else {
   197336          return 0;
   197337       }
   197338    default:
   197339       unreachable("Invalid hardware generation");
   197340    }
   197341 }
   197342 
   197343 
   197344 
   197345 #define GEN10_SO_DECL_OutputBufferSlot_start  12
   197346 #define GEN9_SO_DECL_OutputBufferSlot_start  12
   197347 #define GEN8_SO_DECL_OutputBufferSlot_start  12
   197348 #define GEN75_SO_DECL_OutputBufferSlot_start  12
   197349 #define GEN7_SO_DECL_OutputBufferSlot_start  12
   197350 
   197351 static inline uint32_t ATTRIBUTE_PURE
   197352 SO_DECL_OutputBufferSlot_start(const struct gen_device_info *devinfo)
   197353 {
   197354    switch (devinfo->gen) {
   197355    case 10: return 12;
   197356    case 9: return 12;
   197357    case 8: return 12;
   197358    case 7:
   197359       if (devinfo->is_haswell) {
   197360          return 12;
   197361       } else {
   197362          return 12;
   197363       }
   197364    case 6: return 0;
   197365    case 5: return 0;
   197366    case 4:
   197367       if (devinfo->is_g4x) {
   197368          return 0;
   197369       } else {
   197370          return 0;
   197371       }
   197372    default:
   197373       unreachable("Invalid hardware generation");
   197374    }
   197375 }
   197376 
   197377 
   197378 
   197379 /* SO_DECL::Register Index */
   197380 
   197381 
   197382 #define GEN10_SO_DECL_RegisterIndex_bits  6
   197383 #define GEN9_SO_DECL_RegisterIndex_bits  6
   197384 #define GEN8_SO_DECL_RegisterIndex_bits  6
   197385 #define GEN75_SO_DECL_RegisterIndex_bits  6
   197386 #define GEN7_SO_DECL_RegisterIndex_bits  6
   197387 
   197388 static inline uint32_t ATTRIBUTE_PURE
   197389 SO_DECL_RegisterIndex_bits(const struct gen_device_info *devinfo)
   197390 {
   197391    switch (devinfo->gen) {
   197392    case 10: return 6;
   197393    case 9: return 6;
   197394    case 8: return 6;
   197395    case 7:
   197396       if (devinfo->is_haswell) {
   197397          return 6;
   197398       } else {
   197399          return 6;
   197400       }
   197401    case 6: return 0;
   197402    case 5: return 0;
   197403    case 4:
   197404       if (devinfo->is_g4x) {
   197405          return 0;
   197406       } else {
   197407          return 0;
   197408       }
   197409    default:
   197410       unreachable("Invalid hardware generation");
   197411    }
   197412 }
   197413 
   197414 
   197415 
   197416 #define GEN10_SO_DECL_RegisterIndex_start  4
   197417 #define GEN9_SO_DECL_RegisterIndex_start  4
   197418 #define GEN8_SO_DECL_RegisterIndex_start  4
   197419 #define GEN75_SO_DECL_RegisterIndex_start  4
   197420 #define GEN7_SO_DECL_RegisterIndex_start  4
   197421 
   197422 static inline uint32_t ATTRIBUTE_PURE
   197423 SO_DECL_RegisterIndex_start(const struct gen_device_info *devinfo)
   197424 {
   197425    switch (devinfo->gen) {
   197426    case 10: return 4;
   197427    case 9: return 4;
   197428    case 8: return 4;
   197429    case 7:
   197430       if (devinfo->is_haswell) {
   197431          return 4;
   197432       } else {
   197433          return 4;
   197434       }
   197435    case 6: return 0;
   197436    case 5: return 0;
   197437    case 4:
   197438       if (devinfo->is_g4x) {
   197439          return 0;
   197440       } else {
   197441          return 0;
   197442       }
   197443    default:
   197444       unreachable("Invalid hardware generation");
   197445    }
   197446 }
   197447 
   197448 
   197449 
   197450 /* SO_DECL_ENTRY */
   197451 
   197452 
   197453 #define GEN10_SO_DECL_ENTRY_length  2
   197454 #define GEN9_SO_DECL_ENTRY_length  2
   197455 #define GEN8_SO_DECL_ENTRY_length  2
   197456 #define GEN75_SO_DECL_ENTRY_length  2
   197457 #define GEN7_SO_DECL_ENTRY_length  2
   197458 
   197459 static inline uint32_t ATTRIBUTE_PURE
   197460 SO_DECL_ENTRY_length(const struct gen_device_info *devinfo)
   197461 {
   197462    switch (devinfo->gen) {
   197463    case 10: return 2;
   197464    case 9: return 2;
   197465    case 8: return 2;
   197466    case 7:
   197467       if (devinfo->is_haswell) {
   197468          return 2;
   197469       } else {
   197470          return 2;
   197471       }
   197472    case 6: return 0;
   197473    case 5: return 0;
   197474    case 4:
   197475       if (devinfo->is_g4x) {
   197476          return 0;
   197477       } else {
   197478          return 0;
   197479       }
   197480    default:
   197481       unreachable("Invalid hardware generation");
   197482    }
   197483 }
   197484 
   197485 
   197486 
   197487 /* SO_DECL_ENTRY::Stream 0 Decl */
   197488 
   197489 
   197490 #define GEN10_SO_DECL_ENTRY_Stream0Decl_bits  16
   197491 #define GEN9_SO_DECL_ENTRY_Stream0Decl_bits  16
   197492 #define GEN8_SO_DECL_ENTRY_Stream0Decl_bits  16
   197493 #define GEN75_SO_DECL_ENTRY_Stream0Decl_bits  16
   197494 #define GEN7_SO_DECL_ENTRY_Stream0Decl_bits  16
   197495 
   197496 static inline uint32_t ATTRIBUTE_PURE
   197497 SO_DECL_ENTRY_Stream0Decl_bits(const struct gen_device_info *devinfo)
   197498 {
   197499    switch (devinfo->gen) {
   197500    case 10: return 16;
   197501    case 9: return 16;
   197502    case 8: return 16;
   197503    case 7:
   197504       if (devinfo->is_haswell) {
   197505          return 16;
   197506       } else {
   197507          return 16;
   197508       }
   197509    case 6: return 0;
   197510    case 5: return 0;
   197511    case 4:
   197512       if (devinfo->is_g4x) {
   197513          return 0;
   197514       } else {
   197515          return 0;
   197516       }
   197517    default:
   197518       unreachable("Invalid hardware generation");
   197519    }
   197520 }
   197521 
   197522 
   197523 
   197524 #define GEN10_SO_DECL_ENTRY_Stream0Decl_start  0
   197525 #define GEN9_SO_DECL_ENTRY_Stream0Decl_start  0
   197526 #define GEN8_SO_DECL_ENTRY_Stream0Decl_start  0
   197527 #define GEN75_SO_DECL_ENTRY_Stream0Decl_start  0
   197528 #define GEN7_SO_DECL_ENTRY_Stream0Decl_start  0
   197529 
   197530 static inline uint32_t ATTRIBUTE_PURE
   197531 SO_DECL_ENTRY_Stream0Decl_start(const struct gen_device_info *devinfo)
   197532 {
   197533    switch (devinfo->gen) {
   197534    case 10: return 0;
   197535    case 9: return 0;
   197536    case 8: return 0;
   197537    case 7:
   197538       if (devinfo->is_haswell) {
   197539          return 0;
   197540       } else {
   197541          return 0;
   197542       }
   197543    case 6: return 0;
   197544    case 5: return 0;
   197545    case 4:
   197546       if (devinfo->is_g4x) {
   197547          return 0;
   197548       } else {
   197549          return 0;
   197550       }
   197551    default:
   197552       unreachable("Invalid hardware generation");
   197553    }
   197554 }
   197555 
   197556 
   197557 
   197558 /* SO_DECL_ENTRY::Stream 1 Decl */
   197559 
   197560 
   197561 #define GEN10_SO_DECL_ENTRY_Stream1Decl_bits  16
   197562 #define GEN9_SO_DECL_ENTRY_Stream1Decl_bits  16
   197563 #define GEN8_SO_DECL_ENTRY_Stream1Decl_bits  16
   197564 #define GEN75_SO_DECL_ENTRY_Stream1Decl_bits  16
   197565 #define GEN7_SO_DECL_ENTRY_Stream1Decl_bits  16
   197566 
   197567 static inline uint32_t ATTRIBUTE_PURE
   197568 SO_DECL_ENTRY_Stream1Decl_bits(const struct gen_device_info *devinfo)
   197569 {
   197570    switch (devinfo->gen) {
   197571    case 10: return 16;
   197572    case 9: return 16;
   197573    case 8: return 16;
   197574    case 7:
   197575       if (devinfo->is_haswell) {
   197576          return 16;
   197577       } else {
   197578          return 16;
   197579       }
   197580    case 6: return 0;
   197581    case 5: return 0;
   197582    case 4:
   197583       if (devinfo->is_g4x) {
   197584          return 0;
   197585       } else {
   197586          return 0;
   197587       }
   197588    default:
   197589       unreachable("Invalid hardware generation");
   197590    }
   197591 }
   197592 
   197593 
   197594 
   197595 #define GEN10_SO_DECL_ENTRY_Stream1Decl_start  16
   197596 #define GEN9_SO_DECL_ENTRY_Stream1Decl_start  16
   197597 #define GEN8_SO_DECL_ENTRY_Stream1Decl_start  16
   197598 #define GEN75_SO_DECL_ENTRY_Stream1Decl_start  16
   197599 #define GEN7_SO_DECL_ENTRY_Stream1Decl_start  16
   197600 
   197601 static inline uint32_t ATTRIBUTE_PURE
   197602 SO_DECL_ENTRY_Stream1Decl_start(const struct gen_device_info *devinfo)
   197603 {
   197604    switch (devinfo->gen) {
   197605    case 10: return 16;
   197606    case 9: return 16;
   197607    case 8: return 16;
   197608    case 7:
   197609       if (devinfo->is_haswell) {
   197610          return 16;
   197611       } else {
   197612          return 16;
   197613       }
   197614    case 6: return 0;
   197615    case 5: return 0;
   197616    case 4:
   197617       if (devinfo->is_g4x) {
   197618          return 0;
   197619       } else {
   197620          return 0;
   197621       }
   197622    default:
   197623       unreachable("Invalid hardware generation");
   197624    }
   197625 }
   197626 
   197627 
   197628 
   197629 /* SO_DECL_ENTRY::Stream 2 Decl */
   197630 
   197631 
   197632 #define GEN10_SO_DECL_ENTRY_Stream2Decl_bits  16
   197633 #define GEN9_SO_DECL_ENTRY_Stream2Decl_bits  16
   197634 #define GEN8_SO_DECL_ENTRY_Stream2Decl_bits  16
   197635 #define GEN75_SO_DECL_ENTRY_Stream2Decl_bits  16
   197636 #define GEN7_SO_DECL_ENTRY_Stream2Decl_bits  16
   197637 
   197638 static inline uint32_t ATTRIBUTE_PURE
   197639 SO_DECL_ENTRY_Stream2Decl_bits(const struct gen_device_info *devinfo)
   197640 {
   197641    switch (devinfo->gen) {
   197642    case 10: return 16;
   197643    case 9: return 16;
   197644    case 8: return 16;
   197645    case 7:
   197646       if (devinfo->is_haswell) {
   197647          return 16;
   197648       } else {
   197649          return 16;
   197650       }
   197651    case 6: return 0;
   197652    case 5: return 0;
   197653    case 4:
   197654       if (devinfo->is_g4x) {
   197655          return 0;
   197656       } else {
   197657          return 0;
   197658       }
   197659    default:
   197660       unreachable("Invalid hardware generation");
   197661    }
   197662 }
   197663 
   197664 
   197665 
   197666 #define GEN10_SO_DECL_ENTRY_Stream2Decl_start  32
   197667 #define GEN9_SO_DECL_ENTRY_Stream2Decl_start  32
   197668 #define GEN8_SO_DECL_ENTRY_Stream2Decl_start  32
   197669 #define GEN75_SO_DECL_ENTRY_Stream2Decl_start  32
   197670 #define GEN7_SO_DECL_ENTRY_Stream2Decl_start  32
   197671 
   197672 static inline uint32_t ATTRIBUTE_PURE
   197673 SO_DECL_ENTRY_Stream2Decl_start(const struct gen_device_info *devinfo)
   197674 {
   197675    switch (devinfo->gen) {
   197676    case 10: return 32;
   197677    case 9: return 32;
   197678    case 8: return 32;
   197679    case 7:
   197680       if (devinfo->is_haswell) {
   197681          return 32;
   197682       } else {
   197683          return 32;
   197684       }
   197685    case 6: return 0;
   197686    case 5: return 0;
   197687    case 4:
   197688       if (devinfo->is_g4x) {
   197689          return 0;
   197690       } else {
   197691          return 0;
   197692       }
   197693    default:
   197694       unreachable("Invalid hardware generation");
   197695    }
   197696 }
   197697 
   197698 
   197699 
   197700 /* SO_DECL_ENTRY::Stream 3 Decl */
   197701 
   197702 
   197703 #define GEN10_SO_DECL_ENTRY_Stream3Decl_bits  16
   197704 #define GEN9_SO_DECL_ENTRY_Stream3Decl_bits  16
   197705 #define GEN8_SO_DECL_ENTRY_Stream3Decl_bits  16
   197706 #define GEN75_SO_DECL_ENTRY_Stream3Decl_bits  16
   197707 #define GEN7_SO_DECL_ENTRY_Stream3Decl_bits  16
   197708 
   197709 static inline uint32_t ATTRIBUTE_PURE
   197710 SO_DECL_ENTRY_Stream3Decl_bits(const struct gen_device_info *devinfo)
   197711 {
   197712    switch (devinfo->gen) {
   197713    case 10: return 16;
   197714    case 9: return 16;
   197715    case 8: return 16;
   197716    case 7:
   197717       if (devinfo->is_haswell) {
   197718          return 16;
   197719       } else {
   197720          return 16;
   197721       }
   197722    case 6: return 0;
   197723    case 5: return 0;
   197724    case 4:
   197725       if (devinfo->is_g4x) {
   197726          return 0;
   197727       } else {
   197728          return 0;
   197729       }
   197730    default:
   197731       unreachable("Invalid hardware generation");
   197732    }
   197733 }
   197734 
   197735 
   197736 
   197737 #define GEN10_SO_DECL_ENTRY_Stream3Decl_start  48
   197738 #define GEN9_SO_DECL_ENTRY_Stream3Decl_start  48
   197739 #define GEN8_SO_DECL_ENTRY_Stream3Decl_start  48
   197740 #define GEN75_SO_DECL_ENTRY_Stream3Decl_start  48
   197741 #define GEN7_SO_DECL_ENTRY_Stream3Decl_start  48
   197742 
   197743 static inline uint32_t ATTRIBUTE_PURE
   197744 SO_DECL_ENTRY_Stream3Decl_start(const struct gen_device_info *devinfo)
   197745 {
   197746    switch (devinfo->gen) {
   197747    case 10: return 48;
   197748    case 9: return 48;
   197749    case 8: return 48;
   197750    case 7:
   197751       if (devinfo->is_haswell) {
   197752          return 48;
   197753       } else {
   197754          return 48;
   197755       }
   197756    case 6: return 0;
   197757    case 5: return 0;
   197758    case 4:
   197759       if (devinfo->is_g4x) {
   197760          return 0;
   197761       } else {
   197762          return 0;
   197763       }
   197764    default:
   197765       unreachable("Invalid hardware generation");
   197766    }
   197767 }
   197768 
   197769 
   197770 
   197771 /* SO_WRITE_OFFSET0 */
   197772 
   197773 
   197774 #define GEN10_SO_WRITE_OFFSET0_length  1
   197775 #define GEN9_SO_WRITE_OFFSET0_length  1
   197776 #define GEN8_SO_WRITE_OFFSET0_length  1
   197777 #define GEN75_SO_WRITE_OFFSET0_length  1
   197778 #define GEN7_SO_WRITE_OFFSET0_length  1
   197779 
   197780 static inline uint32_t ATTRIBUTE_PURE
   197781 SO_WRITE_OFFSET0_length(const struct gen_device_info *devinfo)
   197782 {
   197783    switch (devinfo->gen) {
   197784    case 10: return 1;
   197785    case 9: return 1;
   197786    case 8: return 1;
   197787    case 7:
   197788       if (devinfo->is_haswell) {
   197789          return 1;
   197790       } else {
   197791          return 1;
   197792       }
   197793    case 6: return 0;
   197794    case 5: return 0;
   197795    case 4:
   197796       if (devinfo->is_g4x) {
   197797          return 0;
   197798       } else {
   197799          return 0;
   197800       }
   197801    default:
   197802       unreachable("Invalid hardware generation");
   197803    }
   197804 }
   197805 
   197806 
   197807 
   197808 /* SO_WRITE_OFFSET0::Write Offset */
   197809 
   197810 
   197811 #define GEN10_SO_WRITE_OFFSET0_WriteOffset_bits  30
   197812 #define GEN9_SO_WRITE_OFFSET0_WriteOffset_bits  30
   197813 #define GEN8_SO_WRITE_OFFSET0_WriteOffset_bits  30
   197814 #define GEN75_SO_WRITE_OFFSET0_WriteOffset_bits  30
   197815 #define GEN7_SO_WRITE_OFFSET0_WriteOffset_bits  30
   197816 
   197817 static inline uint32_t ATTRIBUTE_PURE
   197818 SO_WRITE_OFFSET0_WriteOffset_bits(const struct gen_device_info *devinfo)
   197819 {
   197820    switch (devinfo->gen) {
   197821    case 10: return 30;
   197822    case 9: return 30;
   197823    case 8: return 30;
   197824    case 7:
   197825       if (devinfo->is_haswell) {
   197826          return 30;
   197827       } else {
   197828          return 30;
   197829       }
   197830    case 6: return 0;
   197831    case 5: return 0;
   197832    case 4:
   197833       if (devinfo->is_g4x) {
   197834          return 0;
   197835       } else {
   197836          return 0;
   197837       }
   197838    default:
   197839       unreachable("Invalid hardware generation");
   197840    }
   197841 }
   197842 
   197843 
   197844 
   197845 #define GEN10_SO_WRITE_OFFSET0_WriteOffset_start  2
   197846 #define GEN9_SO_WRITE_OFFSET0_WriteOffset_start  2
   197847 #define GEN8_SO_WRITE_OFFSET0_WriteOffset_start  2
   197848 #define GEN75_SO_WRITE_OFFSET0_WriteOffset_start  2
   197849 #define GEN7_SO_WRITE_OFFSET0_WriteOffset_start  2
   197850 
   197851 static inline uint32_t ATTRIBUTE_PURE
   197852 SO_WRITE_OFFSET0_WriteOffset_start(const struct gen_device_info *devinfo)
   197853 {
   197854    switch (devinfo->gen) {
   197855    case 10: return 2;
   197856    case 9: return 2;
   197857    case 8: return 2;
   197858    case 7:
   197859       if (devinfo->is_haswell) {
   197860          return 2;
   197861       } else {
   197862          return 2;
   197863       }
   197864    case 6: return 0;
   197865    case 5: return 0;
   197866    case 4:
   197867       if (devinfo->is_g4x) {
   197868          return 0;
   197869       } else {
   197870          return 0;
   197871       }
   197872    default:
   197873       unreachable("Invalid hardware generation");
   197874    }
   197875 }
   197876 
   197877 
   197878 
   197879 /* SO_WRITE_OFFSET1 */
   197880 
   197881 
   197882 #define GEN10_SO_WRITE_OFFSET1_length  1
   197883 #define GEN9_SO_WRITE_OFFSET1_length  1
   197884 #define GEN8_SO_WRITE_OFFSET1_length  1
   197885 #define GEN75_SO_WRITE_OFFSET1_length  1
   197886 #define GEN7_SO_WRITE_OFFSET1_length  1
   197887 
   197888 static inline uint32_t ATTRIBUTE_PURE
   197889 SO_WRITE_OFFSET1_length(const struct gen_device_info *devinfo)
   197890 {
   197891    switch (devinfo->gen) {
   197892    case 10: return 1;
   197893    case 9: return 1;
   197894    case 8: return 1;
   197895    case 7:
   197896       if (devinfo->is_haswell) {
   197897          return 1;
   197898       } else {
   197899          return 1;
   197900       }
   197901    case 6: return 0;
   197902    case 5: return 0;
   197903    case 4:
   197904       if (devinfo->is_g4x) {
   197905          return 0;
   197906       } else {
   197907          return 0;
   197908       }
   197909    default:
   197910       unreachable("Invalid hardware generation");
   197911    }
   197912 }
   197913 
   197914 
   197915 
   197916 /* SO_WRITE_OFFSET1::Write Offset */
   197917 
   197918 
   197919 #define GEN10_SO_WRITE_OFFSET1_WriteOffset_bits  30
   197920 #define GEN9_SO_WRITE_OFFSET1_WriteOffset_bits  30
   197921 #define GEN8_SO_WRITE_OFFSET1_WriteOffset_bits  30
   197922 #define GEN75_SO_WRITE_OFFSET1_WriteOffset_bits  30
   197923 #define GEN7_SO_WRITE_OFFSET1_WriteOffset_bits  30
   197924 
   197925 static inline uint32_t ATTRIBUTE_PURE
   197926 SO_WRITE_OFFSET1_WriteOffset_bits(const struct gen_device_info *devinfo)
   197927 {
   197928    switch (devinfo->gen) {
   197929    case 10: return 30;
   197930    case 9: return 30;
   197931    case 8: return 30;
   197932    case 7:
   197933       if (devinfo->is_haswell) {
   197934          return 30;
   197935       } else {
   197936          return 30;
   197937       }
   197938    case 6: return 0;
   197939    case 5: return 0;
   197940    case 4:
   197941       if (devinfo->is_g4x) {
   197942          return 0;
   197943       } else {
   197944          return 0;
   197945       }
   197946    default:
   197947       unreachable("Invalid hardware generation");
   197948    }
   197949 }
   197950 
   197951 
   197952 
   197953 #define GEN10_SO_WRITE_OFFSET1_WriteOffset_start  2
   197954 #define GEN9_SO_WRITE_OFFSET1_WriteOffset_start  2
   197955 #define GEN8_SO_WRITE_OFFSET1_WriteOffset_start  2
   197956 #define GEN75_SO_WRITE_OFFSET1_WriteOffset_start  2
   197957 #define GEN7_SO_WRITE_OFFSET1_WriteOffset_start  2
   197958 
   197959 static inline uint32_t ATTRIBUTE_PURE
   197960 SO_WRITE_OFFSET1_WriteOffset_start(const struct gen_device_info *devinfo)
   197961 {
   197962    switch (devinfo->gen) {
   197963    case 10: return 2;
   197964    case 9: return 2;
   197965    case 8: return 2;
   197966    case 7:
   197967       if (devinfo->is_haswell) {
   197968          return 2;
   197969       } else {
   197970          return 2;
   197971       }
   197972    case 6: return 0;
   197973    case 5: return 0;
   197974    case 4:
   197975       if (devinfo->is_g4x) {
   197976          return 0;
   197977       } else {
   197978          return 0;
   197979       }
   197980    default:
   197981       unreachable("Invalid hardware generation");
   197982    }
   197983 }
   197984 
   197985 
   197986 
   197987 /* SO_WRITE_OFFSET2 */
   197988 
   197989 
   197990 #define GEN10_SO_WRITE_OFFSET2_length  1
   197991 #define GEN9_SO_WRITE_OFFSET2_length  1
   197992 #define GEN8_SO_WRITE_OFFSET2_length  1
   197993 #define GEN75_SO_WRITE_OFFSET2_length  1
   197994 #define GEN7_SO_WRITE_OFFSET2_length  1
   197995 
   197996 static inline uint32_t ATTRIBUTE_PURE
   197997 SO_WRITE_OFFSET2_length(const struct gen_device_info *devinfo)
   197998 {
   197999    switch (devinfo->gen) {
   198000    case 10: return 1;
   198001    case 9: return 1;
   198002    case 8: return 1;
   198003    case 7:
   198004       if (devinfo->is_haswell) {
   198005          return 1;
   198006       } else {
   198007          return 1;
   198008       }
   198009    case 6: return 0;
   198010    case 5: return 0;
   198011    case 4:
   198012       if (devinfo->is_g4x) {
   198013          return 0;
   198014       } else {
   198015          return 0;
   198016       }
   198017    default:
   198018       unreachable("Invalid hardware generation");
   198019    }
   198020 }
   198021 
   198022 
   198023 
   198024 /* SO_WRITE_OFFSET2::Write Offset */
   198025 
   198026 
   198027 #define GEN10_SO_WRITE_OFFSET2_WriteOffset_bits  30
   198028 #define GEN9_SO_WRITE_OFFSET2_WriteOffset_bits  30
   198029 #define GEN8_SO_WRITE_OFFSET2_WriteOffset_bits  30
   198030 #define GEN75_SO_WRITE_OFFSET2_WriteOffset_bits  30
   198031 #define GEN7_SO_WRITE_OFFSET2_WriteOffset_bits  30
   198032 
   198033 static inline uint32_t ATTRIBUTE_PURE
   198034 SO_WRITE_OFFSET2_WriteOffset_bits(const struct gen_device_info *devinfo)
   198035 {
   198036    switch (devinfo->gen) {
   198037    case 10: return 30;
   198038    case 9: return 30;
   198039    case 8: return 30;
   198040    case 7:
   198041       if (devinfo->is_haswell) {
   198042          return 30;
   198043       } else {
   198044          return 30;
   198045       }
   198046    case 6: return 0;
   198047    case 5: return 0;
   198048    case 4:
   198049       if (devinfo->is_g4x) {
   198050          return 0;
   198051       } else {
   198052          return 0;
   198053       }
   198054    default:
   198055       unreachable("Invalid hardware generation");
   198056    }
   198057 }
   198058 
   198059 
   198060 
   198061 #define GEN10_SO_WRITE_OFFSET2_WriteOffset_start  2
   198062 #define GEN9_SO_WRITE_OFFSET2_WriteOffset_start  2
   198063 #define GEN8_SO_WRITE_OFFSET2_WriteOffset_start  2
   198064 #define GEN75_SO_WRITE_OFFSET2_WriteOffset_start  2
   198065 #define GEN7_SO_WRITE_OFFSET2_WriteOffset_start  2
   198066 
   198067 static inline uint32_t ATTRIBUTE_PURE
   198068 SO_WRITE_OFFSET2_WriteOffset_start(const struct gen_device_info *devinfo)
   198069 {
   198070    switch (devinfo->gen) {
   198071    case 10: return 2;
   198072    case 9: return 2;
   198073    case 8: return 2;
   198074    case 7:
   198075       if (devinfo->is_haswell) {
   198076          return 2;
   198077       } else {
   198078          return 2;
   198079       }
   198080    case 6: return 0;
   198081    case 5: return 0;
   198082    case 4:
   198083       if (devinfo->is_g4x) {
   198084          return 0;
   198085       } else {
   198086          return 0;
   198087       }
   198088    default:
   198089       unreachable("Invalid hardware generation");
   198090    }
   198091 }
   198092 
   198093 
   198094 
   198095 /* SO_WRITE_OFFSET3 */
   198096 
   198097 
   198098 #define GEN10_SO_WRITE_OFFSET3_length  1
   198099 #define GEN9_SO_WRITE_OFFSET3_length  1
   198100 #define GEN8_SO_WRITE_OFFSET3_length  1
   198101 #define GEN75_SO_WRITE_OFFSET3_length  1
   198102 #define GEN7_SO_WRITE_OFFSET3_length  1
   198103 
   198104 static inline uint32_t ATTRIBUTE_PURE
   198105 SO_WRITE_OFFSET3_length(const struct gen_device_info *devinfo)
   198106 {
   198107    switch (devinfo->gen) {
   198108    case 10: return 1;
   198109    case 9: return 1;
   198110    case 8: return 1;
   198111    case 7:
   198112       if (devinfo->is_haswell) {
   198113          return 1;
   198114       } else {
   198115          return 1;
   198116       }
   198117    case 6: return 0;
   198118    case 5: return 0;
   198119    case 4:
   198120       if (devinfo->is_g4x) {
   198121          return 0;
   198122       } else {
   198123          return 0;
   198124       }
   198125    default:
   198126       unreachable("Invalid hardware generation");
   198127    }
   198128 }
   198129 
   198130 
   198131 
   198132 /* SO_WRITE_OFFSET3::Write Offset */
   198133 
   198134 
   198135 #define GEN10_SO_WRITE_OFFSET3_WriteOffset_bits  30
   198136 #define GEN9_SO_WRITE_OFFSET3_WriteOffset_bits  30
   198137 #define GEN8_SO_WRITE_OFFSET3_WriteOffset_bits  30
   198138 #define GEN75_SO_WRITE_OFFSET3_WriteOffset_bits  30
   198139 #define GEN7_SO_WRITE_OFFSET3_WriteOffset_bits  30
   198140 
   198141 static inline uint32_t ATTRIBUTE_PURE
   198142 SO_WRITE_OFFSET3_WriteOffset_bits(const struct gen_device_info *devinfo)
   198143 {
   198144    switch (devinfo->gen) {
   198145    case 10: return 30;
   198146    case 9: return 30;
   198147    case 8: return 30;
   198148    case 7:
   198149       if (devinfo->is_haswell) {
   198150          return 30;
   198151       } else {
   198152          return 30;
   198153       }
   198154    case 6: return 0;
   198155    case 5: return 0;
   198156    case 4:
   198157       if (devinfo->is_g4x) {
   198158          return 0;
   198159       } else {
   198160          return 0;
   198161       }
   198162    default:
   198163       unreachable("Invalid hardware generation");
   198164    }
   198165 }
   198166 
   198167 
   198168 
   198169 #define GEN10_SO_WRITE_OFFSET3_WriteOffset_start  2
   198170 #define GEN9_SO_WRITE_OFFSET3_WriteOffset_start  2
   198171 #define GEN8_SO_WRITE_OFFSET3_WriteOffset_start  2
   198172 #define GEN75_SO_WRITE_OFFSET3_WriteOffset_start  2
   198173 #define GEN7_SO_WRITE_OFFSET3_WriteOffset_start  2
   198174 
   198175 static inline uint32_t ATTRIBUTE_PURE
   198176 SO_WRITE_OFFSET3_WriteOffset_start(const struct gen_device_info *devinfo)
   198177 {
   198178    switch (devinfo->gen) {
   198179    case 10: return 2;
   198180    case 9: return 2;
   198181    case 8: return 2;
   198182    case 7:
   198183       if (devinfo->is_haswell) {
   198184          return 2;
   198185       } else {
   198186          return 2;
   198187       }
   198188    case 6: return 0;
   198189    case 5: return 0;
   198190    case 4:
   198191       if (devinfo->is_g4x) {
   198192          return 0;
   198193       } else {
   198194          return 0;
   198195       }
   198196    default:
   198197       unreachable("Invalid hardware generation");
   198198    }
   198199 }
   198200 
   198201 
   198202 
   198203 /* STATE_BASE_ADDRESS */
   198204 
   198205 
   198206 #define GEN10_STATE_BASE_ADDRESS_length  22
   198207 #define GEN9_STATE_BASE_ADDRESS_length  19
   198208 #define GEN8_STATE_BASE_ADDRESS_length  16
   198209 #define GEN75_STATE_BASE_ADDRESS_length  10
   198210 #define GEN7_STATE_BASE_ADDRESS_length  10
   198211 #define GEN6_STATE_BASE_ADDRESS_length  10
   198212 #define GEN5_STATE_BASE_ADDRESS_length  8
   198213 #define GEN45_STATE_BASE_ADDRESS_length  6
   198214 #define GEN4_STATE_BASE_ADDRESS_length  6
   198215 
   198216 static inline uint32_t ATTRIBUTE_PURE
   198217 STATE_BASE_ADDRESS_length(const struct gen_device_info *devinfo)
   198218 {
   198219    switch (devinfo->gen) {
   198220    case 10: return 22;
   198221    case 9: return 19;
   198222    case 8: return 16;
   198223    case 7:
   198224       if (devinfo->is_haswell) {
   198225          return 10;
   198226       } else {
   198227          return 10;
   198228       }
   198229    case 6: return 10;
   198230    case 5: return 8;
   198231    case 4:
   198232       if (devinfo->is_g4x) {
   198233          return 6;
   198234       } else {
   198235          return 6;
   198236       }
   198237    default:
   198238       unreachable("Invalid hardware generation");
   198239    }
   198240 }
   198241 
   198242 
   198243 
   198244 /* STATE_BASE_ADDRESS::3D Command Opcode */
   198245 
   198246 
   198247 #define GEN10_STATE_BASE_ADDRESS_3DCommandOpcode_bits  3
   198248 #define GEN9_STATE_BASE_ADDRESS_3DCommandOpcode_bits  3
   198249 #define GEN8_STATE_BASE_ADDRESS_3DCommandOpcode_bits  3
   198250 #define GEN75_STATE_BASE_ADDRESS_3DCommandOpcode_bits  3
   198251 #define GEN7_STATE_BASE_ADDRESS_3DCommandOpcode_bits  3
   198252 #define GEN6_STATE_BASE_ADDRESS_3DCommandOpcode_bits  3
   198253 #define GEN5_STATE_BASE_ADDRESS_3DCommandOpcode_bits  3
   198254 #define GEN45_STATE_BASE_ADDRESS_3DCommandOpcode_bits  3
   198255 #define GEN4_STATE_BASE_ADDRESS_3DCommandOpcode_bits  3
   198256 
   198257 static inline uint32_t ATTRIBUTE_PURE
   198258 STATE_BASE_ADDRESS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   198259 {
   198260    switch (devinfo->gen) {
   198261    case 10: return 3;
   198262    case 9: return 3;
   198263    case 8: return 3;
   198264    case 7:
   198265       if (devinfo->is_haswell) {
   198266          return 3;
   198267       } else {
   198268          return 3;
   198269       }
   198270    case 6: return 3;
   198271    case 5: return 3;
   198272    case 4:
   198273       if (devinfo->is_g4x) {
   198274          return 3;
   198275       } else {
   198276          return 3;
   198277       }
   198278    default:
   198279       unreachable("Invalid hardware generation");
   198280    }
   198281 }
   198282 
   198283 
   198284 
   198285 #define GEN10_STATE_BASE_ADDRESS_3DCommandOpcode_start  24
   198286 #define GEN9_STATE_BASE_ADDRESS_3DCommandOpcode_start  24
   198287 #define GEN8_STATE_BASE_ADDRESS_3DCommandOpcode_start  24
   198288 #define GEN75_STATE_BASE_ADDRESS_3DCommandOpcode_start  24
   198289 #define GEN7_STATE_BASE_ADDRESS_3DCommandOpcode_start  24
   198290 #define GEN6_STATE_BASE_ADDRESS_3DCommandOpcode_start  24
   198291 #define GEN5_STATE_BASE_ADDRESS_3DCommandOpcode_start  24
   198292 #define GEN45_STATE_BASE_ADDRESS_3DCommandOpcode_start  24
   198293 #define GEN4_STATE_BASE_ADDRESS_3DCommandOpcode_start  24
   198294 
   198295 static inline uint32_t ATTRIBUTE_PURE
   198296 STATE_BASE_ADDRESS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   198297 {
   198298    switch (devinfo->gen) {
   198299    case 10: return 24;
   198300    case 9: return 24;
   198301    case 8: return 24;
   198302    case 7:
   198303       if (devinfo->is_haswell) {
   198304          return 24;
   198305       } else {
   198306          return 24;
   198307       }
   198308    case 6: return 24;
   198309    case 5: return 24;
   198310    case 4:
   198311       if (devinfo->is_g4x) {
   198312          return 24;
   198313       } else {
   198314          return 24;
   198315       }
   198316    default:
   198317       unreachable("Invalid hardware generation");
   198318    }
   198319 }
   198320 
   198321 
   198322 
   198323 /* STATE_BASE_ADDRESS::3D Command Sub Opcode */
   198324 
   198325 
   198326 #define GEN10_STATE_BASE_ADDRESS_3DCommandSubOpcode_bits  8
   198327 #define GEN9_STATE_BASE_ADDRESS_3DCommandSubOpcode_bits  8
   198328 #define GEN8_STATE_BASE_ADDRESS_3DCommandSubOpcode_bits  8
   198329 #define GEN75_STATE_BASE_ADDRESS_3DCommandSubOpcode_bits  8
   198330 #define GEN7_STATE_BASE_ADDRESS_3DCommandSubOpcode_bits  8
   198331 #define GEN6_STATE_BASE_ADDRESS_3DCommandSubOpcode_bits  8
   198332 #define GEN5_STATE_BASE_ADDRESS_3DCommandSubOpcode_bits  8
   198333 #define GEN45_STATE_BASE_ADDRESS_3DCommandSubOpcode_bits  8
   198334 #define GEN4_STATE_BASE_ADDRESS_3DCommandSubOpcode_bits  8
   198335 
   198336 static inline uint32_t ATTRIBUTE_PURE
   198337 STATE_BASE_ADDRESS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   198338 {
   198339    switch (devinfo->gen) {
   198340    case 10: return 8;
   198341    case 9: return 8;
   198342    case 8: return 8;
   198343    case 7:
   198344       if (devinfo->is_haswell) {
   198345          return 8;
   198346       } else {
   198347          return 8;
   198348       }
   198349    case 6: return 8;
   198350    case 5: return 8;
   198351    case 4:
   198352       if (devinfo->is_g4x) {
   198353          return 8;
   198354       } else {
   198355          return 8;
   198356       }
   198357    default:
   198358       unreachable("Invalid hardware generation");
   198359    }
   198360 }
   198361 
   198362 
   198363 
   198364 #define GEN10_STATE_BASE_ADDRESS_3DCommandSubOpcode_start  16
   198365 #define GEN9_STATE_BASE_ADDRESS_3DCommandSubOpcode_start  16
   198366 #define GEN8_STATE_BASE_ADDRESS_3DCommandSubOpcode_start  16
   198367 #define GEN75_STATE_BASE_ADDRESS_3DCommandSubOpcode_start  16
   198368 #define GEN7_STATE_BASE_ADDRESS_3DCommandSubOpcode_start  16
   198369 #define GEN6_STATE_BASE_ADDRESS_3DCommandSubOpcode_start  16
   198370 #define GEN5_STATE_BASE_ADDRESS_3DCommandSubOpcode_start  16
   198371 #define GEN45_STATE_BASE_ADDRESS_3DCommandSubOpcode_start  16
   198372 #define GEN4_STATE_BASE_ADDRESS_3DCommandSubOpcode_start  16
   198373 
   198374 static inline uint32_t ATTRIBUTE_PURE
   198375 STATE_BASE_ADDRESS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   198376 {
   198377    switch (devinfo->gen) {
   198378    case 10: return 16;
   198379    case 9: return 16;
   198380    case 8: return 16;
   198381    case 7:
   198382       if (devinfo->is_haswell) {
   198383          return 16;
   198384       } else {
   198385          return 16;
   198386       }
   198387    case 6: return 16;
   198388    case 5: return 16;
   198389    case 4:
   198390       if (devinfo->is_g4x) {
   198391          return 16;
   198392       } else {
   198393          return 16;
   198394       }
   198395    default:
   198396       unreachable("Invalid hardware generation");
   198397    }
   198398 }
   198399 
   198400 
   198401 
   198402 /* STATE_BASE_ADDRESS::Bindless Sampler State Base Address */
   198403 
   198404 
   198405 #define GEN10_STATE_BASE_ADDRESS_BindlessSamplerStateBaseAddress_bits  52
   198406 
   198407 static inline uint32_t ATTRIBUTE_PURE
   198408 STATE_BASE_ADDRESS_BindlessSamplerStateBaseAddress_bits(const struct gen_device_info *devinfo)
   198409 {
   198410    switch (devinfo->gen) {
   198411    case 10: return 52;
   198412    case 9: return 0;
   198413    case 8: return 0;
   198414    case 7:
   198415       if (devinfo->is_haswell) {
   198416          return 0;
   198417       } else {
   198418          return 0;
   198419       }
   198420    case 6: return 0;
   198421    case 5: return 0;
   198422    case 4:
   198423       if (devinfo->is_g4x) {
   198424          return 0;
   198425       } else {
   198426          return 0;
   198427       }
   198428    default:
   198429       unreachable("Invalid hardware generation");
   198430    }
   198431 }
   198432 
   198433 
   198434 
   198435 #define GEN10_STATE_BASE_ADDRESS_BindlessSamplerStateBaseAddress_start  620
   198436 
   198437 static inline uint32_t ATTRIBUTE_PURE
   198438 STATE_BASE_ADDRESS_BindlessSamplerStateBaseAddress_start(const struct gen_device_info *devinfo)
   198439 {
   198440    switch (devinfo->gen) {
   198441    case 10: return 620;
   198442    case 9: return 0;
   198443    case 8: return 0;
   198444    case 7:
   198445       if (devinfo->is_haswell) {
   198446          return 0;
   198447       } else {
   198448          return 0;
   198449       }
   198450    case 6: return 0;
   198451    case 5: return 0;
   198452    case 4:
   198453       if (devinfo->is_g4x) {
   198454          return 0;
   198455       } else {
   198456          return 0;
   198457       }
   198458    default:
   198459       unreachable("Invalid hardware generation");
   198460    }
   198461 }
   198462 
   198463 
   198464 
   198465 /* STATE_BASE_ADDRESS::Bindless Sampler State Base Address Modify Enable */
   198466 
   198467 
   198468 #define GEN10_STATE_BASE_ADDRESS_BindlessSamplerStateBaseAddressModifyEnable_bits  1
   198469 
   198470 static inline uint32_t ATTRIBUTE_PURE
   198471 STATE_BASE_ADDRESS_BindlessSamplerStateBaseAddressModifyEnable_bits(const struct gen_device_info *devinfo)
   198472 {
   198473    switch (devinfo->gen) {
   198474    case 10: return 1;
   198475    case 9: return 0;
   198476    case 8: return 0;
   198477    case 7:
   198478       if (devinfo->is_haswell) {
   198479          return 0;
   198480       } else {
   198481          return 0;
   198482       }
   198483    case 6: return 0;
   198484    case 5: return 0;
   198485    case 4:
   198486       if (devinfo->is_g4x) {
   198487          return 0;
   198488       } else {
   198489          return 0;
   198490       }
   198491    default:
   198492       unreachable("Invalid hardware generation");
   198493    }
   198494 }
   198495 
   198496 
   198497 
   198498 #define GEN10_STATE_BASE_ADDRESS_BindlessSamplerStateBaseAddressModifyEnable_start  608
   198499 
   198500 static inline uint32_t ATTRIBUTE_PURE
   198501 STATE_BASE_ADDRESS_BindlessSamplerStateBaseAddressModifyEnable_start(const struct gen_device_info *devinfo)
   198502 {
   198503    switch (devinfo->gen) {
   198504    case 10: return 608;
   198505    case 9: return 0;
   198506    case 8: return 0;
   198507    case 7:
   198508       if (devinfo->is_haswell) {
   198509          return 0;
   198510       } else {
   198511          return 0;
   198512       }
   198513    case 6: return 0;
   198514    case 5: return 0;
   198515    case 4:
   198516       if (devinfo->is_g4x) {
   198517          return 0;
   198518       } else {
   198519          return 0;
   198520       }
   198521    default:
   198522       unreachable("Invalid hardware generation");
   198523    }
   198524 }
   198525 
   198526 
   198527 
   198528 /* STATE_BASE_ADDRESS::Bindless Sampler State Buffer Size */
   198529 
   198530 
   198531 #define GEN10_STATE_BASE_ADDRESS_BindlessSamplerStateBufferSize_bits  20
   198532 
   198533 static inline uint32_t ATTRIBUTE_PURE
   198534 STATE_BASE_ADDRESS_BindlessSamplerStateBufferSize_bits(const struct gen_device_info *devinfo)
   198535 {
   198536    switch (devinfo->gen) {
   198537    case 10: return 20;
   198538    case 9: return 0;
   198539    case 8: return 0;
   198540    case 7:
   198541       if (devinfo->is_haswell) {
   198542          return 0;
   198543       } else {
   198544          return 0;
   198545       }
   198546    case 6: return 0;
   198547    case 5: return 0;
   198548    case 4:
   198549       if (devinfo->is_g4x) {
   198550          return 0;
   198551       } else {
   198552          return 0;
   198553       }
   198554    default:
   198555       unreachable("Invalid hardware generation");
   198556    }
   198557 }
   198558 
   198559 
   198560 
   198561 #define GEN10_STATE_BASE_ADDRESS_BindlessSamplerStateBufferSize_start  684
   198562 
   198563 static inline uint32_t ATTRIBUTE_PURE
   198564 STATE_BASE_ADDRESS_BindlessSamplerStateBufferSize_start(const struct gen_device_info *devinfo)
   198565 {
   198566    switch (devinfo->gen) {
   198567    case 10: return 684;
   198568    case 9: return 0;
   198569    case 8: return 0;
   198570    case 7:
   198571       if (devinfo->is_haswell) {
   198572          return 0;
   198573       } else {
   198574          return 0;
   198575       }
   198576    case 6: return 0;
   198577    case 5: return 0;
   198578    case 4:
   198579       if (devinfo->is_g4x) {
   198580          return 0;
   198581       } else {
   198582          return 0;
   198583       }
   198584    default:
   198585       unreachable("Invalid hardware generation");
   198586    }
   198587 }
   198588 
   198589 
   198590 
   198591 /* STATE_BASE_ADDRESS::Bindless Sampler State Memory Object Control State */
   198592 
   198593 
   198594 #define GEN10_STATE_BASE_ADDRESS_BindlessSamplerStateMemoryObjectControlState_bits  7
   198595 
   198596 static inline uint32_t ATTRIBUTE_PURE
   198597 STATE_BASE_ADDRESS_BindlessSamplerStateMemoryObjectControlState_bits(const struct gen_device_info *devinfo)
   198598 {
   198599    switch (devinfo->gen) {
   198600    case 10: return 7;
   198601    case 9: return 0;
   198602    case 8: return 0;
   198603    case 7:
   198604       if (devinfo->is_haswell) {
   198605          return 0;
   198606       } else {
   198607          return 0;
   198608       }
   198609    case 6: return 0;
   198610    case 5: return 0;
   198611    case 4:
   198612       if (devinfo->is_g4x) {
   198613          return 0;
   198614       } else {
   198615          return 0;
   198616       }
   198617    default:
   198618       unreachable("Invalid hardware generation");
   198619    }
   198620 }
   198621 
   198622 
   198623 
   198624 #define GEN10_STATE_BASE_ADDRESS_BindlessSamplerStateMemoryObjectControlState_start  612
   198625 
   198626 static inline uint32_t ATTRIBUTE_PURE
   198627 STATE_BASE_ADDRESS_BindlessSamplerStateMemoryObjectControlState_start(const struct gen_device_info *devinfo)
   198628 {
   198629    switch (devinfo->gen) {
   198630    case 10: return 612;
   198631    case 9: return 0;
   198632    case 8: return 0;
   198633    case 7:
   198634       if (devinfo->is_haswell) {
   198635          return 0;
   198636       } else {
   198637          return 0;
   198638       }
   198639    case 6: return 0;
   198640    case 5: return 0;
   198641    case 4:
   198642       if (devinfo->is_g4x) {
   198643          return 0;
   198644       } else {
   198645          return 0;
   198646       }
   198647    default:
   198648       unreachable("Invalid hardware generation");
   198649    }
   198650 }
   198651 
   198652 
   198653 
   198654 /* STATE_BASE_ADDRESS::Bindless Surface State Base Address */
   198655 
   198656 
   198657 #define GEN10_STATE_BASE_ADDRESS_BindlessSurfaceStateBaseAddress_bits  52
   198658 #define GEN9_STATE_BASE_ADDRESS_BindlessSurfaceStateBaseAddress_bits  52
   198659 
   198660 static inline uint32_t ATTRIBUTE_PURE
   198661 STATE_BASE_ADDRESS_BindlessSurfaceStateBaseAddress_bits(const struct gen_device_info *devinfo)
   198662 {
   198663    switch (devinfo->gen) {
   198664    case 10: return 52;
   198665    case 9: return 52;
   198666    case 8: return 0;
   198667    case 7:
   198668       if (devinfo->is_haswell) {
   198669          return 0;
   198670       } else {
   198671          return 0;
   198672       }
   198673    case 6: return 0;
   198674    case 5: return 0;
   198675    case 4:
   198676       if (devinfo->is_g4x) {
   198677          return 0;
   198678       } else {
   198679          return 0;
   198680       }
   198681    default:
   198682       unreachable("Invalid hardware generation");
   198683    }
   198684 }
   198685 
   198686 
   198687 
   198688 #define GEN10_STATE_BASE_ADDRESS_BindlessSurfaceStateBaseAddress_start  524
   198689 #define GEN9_STATE_BASE_ADDRESS_BindlessSurfaceStateBaseAddress_start  524
   198690 
   198691 static inline uint32_t ATTRIBUTE_PURE
   198692 STATE_BASE_ADDRESS_BindlessSurfaceStateBaseAddress_start(const struct gen_device_info *devinfo)
   198693 {
   198694    switch (devinfo->gen) {
   198695    case 10: return 524;
   198696    case 9: return 524;
   198697    case 8: return 0;
   198698    case 7:
   198699       if (devinfo->is_haswell) {
   198700          return 0;
   198701       } else {
   198702          return 0;
   198703       }
   198704    case 6: return 0;
   198705    case 5: return 0;
   198706    case 4:
   198707       if (devinfo->is_g4x) {
   198708          return 0;
   198709       } else {
   198710          return 0;
   198711       }
   198712    default:
   198713       unreachable("Invalid hardware generation");
   198714    }
   198715 }
   198716 
   198717 
   198718 
   198719 /* STATE_BASE_ADDRESS::Bindless Surface State Base Address Modify Enable */
   198720 
   198721 
   198722 #define GEN10_STATE_BASE_ADDRESS_BindlessSurfaceStateBaseAddressModifyEnable_bits  1
   198723 #define GEN9_STATE_BASE_ADDRESS_BindlessSurfaceStateBaseAddressModifyEnable_bits  1
   198724 
   198725 static inline uint32_t ATTRIBUTE_PURE
   198726 STATE_BASE_ADDRESS_BindlessSurfaceStateBaseAddressModifyEnable_bits(const struct gen_device_info *devinfo)
   198727 {
   198728    switch (devinfo->gen) {
   198729    case 10: return 1;
   198730    case 9: return 1;
   198731    case 8: return 0;
   198732    case 7:
   198733       if (devinfo->is_haswell) {
   198734          return 0;
   198735       } else {
   198736          return 0;
   198737       }
   198738    case 6: return 0;
   198739    case 5: return 0;
   198740    case 4:
   198741       if (devinfo->is_g4x) {
   198742          return 0;
   198743       } else {
   198744          return 0;
   198745       }
   198746    default:
   198747       unreachable("Invalid hardware generation");
   198748    }
   198749 }
   198750 
   198751 
   198752 
   198753 #define GEN10_STATE_BASE_ADDRESS_BindlessSurfaceStateBaseAddressModifyEnable_start  512
   198754 #define GEN9_STATE_BASE_ADDRESS_BindlessSurfaceStateBaseAddressModifyEnable_start  512
   198755 
   198756 static inline uint32_t ATTRIBUTE_PURE
   198757 STATE_BASE_ADDRESS_BindlessSurfaceStateBaseAddressModifyEnable_start(const struct gen_device_info *devinfo)
   198758 {
   198759    switch (devinfo->gen) {
   198760    case 10: return 512;
   198761    case 9: return 512;
   198762    case 8: return 0;
   198763    case 7:
   198764       if (devinfo->is_haswell) {
   198765          return 0;
   198766       } else {
   198767          return 0;
   198768       }
   198769    case 6: return 0;
   198770    case 5: return 0;
   198771    case 4:
   198772       if (devinfo->is_g4x) {
   198773          return 0;
   198774       } else {
   198775          return 0;
   198776       }
   198777    default:
   198778       unreachable("Invalid hardware generation");
   198779    }
   198780 }
   198781 
   198782 
   198783 
   198784 /* STATE_BASE_ADDRESS::Bindless Surface State Memory Object Control State */
   198785 
   198786 
   198787 #define GEN10_STATE_BASE_ADDRESS_BindlessSurfaceStateMemoryObjectControlState_bits  7
   198788 #define GEN9_STATE_BASE_ADDRESS_BindlessSurfaceStateMemoryObjectControlState_bits  7
   198789 
   198790 static inline uint32_t ATTRIBUTE_PURE
   198791 STATE_BASE_ADDRESS_BindlessSurfaceStateMemoryObjectControlState_bits(const struct gen_device_info *devinfo)
   198792 {
   198793    switch (devinfo->gen) {
   198794    case 10: return 7;
   198795    case 9: return 7;
   198796    case 8: return 0;
   198797    case 7:
   198798       if (devinfo->is_haswell) {
   198799          return 0;
   198800       } else {
   198801          return 0;
   198802       }
   198803    case 6: return 0;
   198804    case 5: return 0;
   198805    case 4:
   198806       if (devinfo->is_g4x) {
   198807          return 0;
   198808       } else {
   198809          return 0;
   198810       }
   198811    default:
   198812       unreachable("Invalid hardware generation");
   198813    }
   198814 }
   198815 
   198816 
   198817 
   198818 #define GEN10_STATE_BASE_ADDRESS_BindlessSurfaceStateMemoryObjectControlState_start  516
   198819 #define GEN9_STATE_BASE_ADDRESS_BindlessSurfaceStateMemoryObjectControlState_start  516
   198820 
   198821 static inline uint32_t ATTRIBUTE_PURE
   198822 STATE_BASE_ADDRESS_BindlessSurfaceStateMemoryObjectControlState_start(const struct gen_device_info *devinfo)
   198823 {
   198824    switch (devinfo->gen) {
   198825    case 10: return 516;
   198826    case 9: return 516;
   198827    case 8: return 0;
   198828    case 7:
   198829       if (devinfo->is_haswell) {
   198830          return 0;
   198831       } else {
   198832          return 0;
   198833       }
   198834    case 6: return 0;
   198835    case 5: return 0;
   198836    case 4:
   198837       if (devinfo->is_g4x) {
   198838          return 0;
   198839       } else {
   198840          return 0;
   198841       }
   198842    default:
   198843       unreachable("Invalid hardware generation");
   198844    }
   198845 }
   198846 
   198847 
   198848 
   198849 /* STATE_BASE_ADDRESS::Bindless Surface State Size */
   198850 
   198851 
   198852 #define GEN10_STATE_BASE_ADDRESS_BindlessSurfaceStateSize_bits  20
   198853 #define GEN9_STATE_BASE_ADDRESS_BindlessSurfaceStateSize_bits  20
   198854 
   198855 static inline uint32_t ATTRIBUTE_PURE
   198856 STATE_BASE_ADDRESS_BindlessSurfaceStateSize_bits(const struct gen_device_info *devinfo)
   198857 {
   198858    switch (devinfo->gen) {
   198859    case 10: return 20;
   198860    case 9: return 20;
   198861    case 8: return 0;
   198862    case 7:
   198863       if (devinfo->is_haswell) {
   198864          return 0;
   198865       } else {
   198866          return 0;
   198867       }
   198868    case 6: return 0;
   198869    case 5: return 0;
   198870    case 4:
   198871       if (devinfo->is_g4x) {
   198872          return 0;
   198873       } else {
   198874          return 0;
   198875       }
   198876    default:
   198877       unreachable("Invalid hardware generation");
   198878    }
   198879 }
   198880 
   198881 
   198882 
   198883 #define GEN10_STATE_BASE_ADDRESS_BindlessSurfaceStateSize_start  588
   198884 #define GEN9_STATE_BASE_ADDRESS_BindlessSurfaceStateSize_start  588
   198885 
   198886 static inline uint32_t ATTRIBUTE_PURE
   198887 STATE_BASE_ADDRESS_BindlessSurfaceStateSize_start(const struct gen_device_info *devinfo)
   198888 {
   198889    switch (devinfo->gen) {
   198890    case 10: return 588;
   198891    case 9: return 588;
   198892    case 8: return 0;
   198893    case 7:
   198894       if (devinfo->is_haswell) {
   198895          return 0;
   198896       } else {
   198897          return 0;
   198898       }
   198899    case 6: return 0;
   198900    case 5: return 0;
   198901    case 4:
   198902       if (devinfo->is_g4x) {
   198903          return 0;
   198904       } else {
   198905          return 0;
   198906       }
   198907    default:
   198908       unreachable("Invalid hardware generation");
   198909    }
   198910 }
   198911 
   198912 
   198913 
   198914 /* STATE_BASE_ADDRESS::Command SubType */
   198915 
   198916 
   198917 #define GEN10_STATE_BASE_ADDRESS_CommandSubType_bits  2
   198918 #define GEN9_STATE_BASE_ADDRESS_CommandSubType_bits  2
   198919 #define GEN8_STATE_BASE_ADDRESS_CommandSubType_bits  2
   198920 #define GEN75_STATE_BASE_ADDRESS_CommandSubType_bits  2
   198921 #define GEN7_STATE_BASE_ADDRESS_CommandSubType_bits  2
   198922 #define GEN6_STATE_BASE_ADDRESS_CommandSubType_bits  2
   198923 #define GEN5_STATE_BASE_ADDRESS_CommandSubType_bits  2
   198924 #define GEN45_STATE_BASE_ADDRESS_CommandSubType_bits  2
   198925 #define GEN4_STATE_BASE_ADDRESS_CommandSubType_bits  2
   198926 
   198927 static inline uint32_t ATTRIBUTE_PURE
   198928 STATE_BASE_ADDRESS_CommandSubType_bits(const struct gen_device_info *devinfo)
   198929 {
   198930    switch (devinfo->gen) {
   198931    case 10: return 2;
   198932    case 9: return 2;
   198933    case 8: return 2;
   198934    case 7:
   198935       if (devinfo->is_haswell) {
   198936          return 2;
   198937       } else {
   198938          return 2;
   198939       }
   198940    case 6: return 2;
   198941    case 5: return 2;
   198942    case 4:
   198943       if (devinfo->is_g4x) {
   198944          return 2;
   198945       } else {
   198946          return 2;
   198947       }
   198948    default:
   198949       unreachable("Invalid hardware generation");
   198950    }
   198951 }
   198952 
   198953 
   198954 
   198955 #define GEN10_STATE_BASE_ADDRESS_CommandSubType_start  27
   198956 #define GEN9_STATE_BASE_ADDRESS_CommandSubType_start  27
   198957 #define GEN8_STATE_BASE_ADDRESS_CommandSubType_start  27
   198958 #define GEN75_STATE_BASE_ADDRESS_CommandSubType_start  27
   198959 #define GEN7_STATE_BASE_ADDRESS_CommandSubType_start  27
   198960 #define GEN6_STATE_BASE_ADDRESS_CommandSubType_start  27
   198961 #define GEN5_STATE_BASE_ADDRESS_CommandSubType_start  27
   198962 #define GEN45_STATE_BASE_ADDRESS_CommandSubType_start  27
   198963 #define GEN4_STATE_BASE_ADDRESS_CommandSubType_start  27
   198964 
   198965 static inline uint32_t ATTRIBUTE_PURE
   198966 STATE_BASE_ADDRESS_CommandSubType_start(const struct gen_device_info *devinfo)
   198967 {
   198968    switch (devinfo->gen) {
   198969    case 10: return 27;
   198970    case 9: return 27;
   198971    case 8: return 27;
   198972    case 7:
   198973       if (devinfo->is_haswell) {
   198974          return 27;
   198975       } else {
   198976          return 27;
   198977       }
   198978    case 6: return 27;
   198979    case 5: return 27;
   198980    case 4:
   198981       if (devinfo->is_g4x) {
   198982          return 27;
   198983       } else {
   198984          return 27;
   198985       }
   198986    default:
   198987       unreachable("Invalid hardware generation");
   198988    }
   198989 }
   198990 
   198991 
   198992 
   198993 /* STATE_BASE_ADDRESS::Command Type */
   198994 
   198995 
   198996 #define GEN10_STATE_BASE_ADDRESS_CommandType_bits  3
   198997 #define GEN9_STATE_BASE_ADDRESS_CommandType_bits  3
   198998 #define GEN8_STATE_BASE_ADDRESS_CommandType_bits  3
   198999 #define GEN75_STATE_BASE_ADDRESS_CommandType_bits  3
   199000 #define GEN7_STATE_BASE_ADDRESS_CommandType_bits  3
   199001 #define GEN6_STATE_BASE_ADDRESS_CommandType_bits  3
   199002 #define GEN5_STATE_BASE_ADDRESS_CommandType_bits  3
   199003 #define GEN45_STATE_BASE_ADDRESS_CommandType_bits  3
   199004 #define GEN4_STATE_BASE_ADDRESS_CommandType_bits  3
   199005 
   199006 static inline uint32_t ATTRIBUTE_PURE
   199007 STATE_BASE_ADDRESS_CommandType_bits(const struct gen_device_info *devinfo)
   199008 {
   199009    switch (devinfo->gen) {
   199010    case 10: return 3;
   199011    case 9: return 3;
   199012    case 8: return 3;
   199013    case 7:
   199014       if (devinfo->is_haswell) {
   199015          return 3;
   199016       } else {
   199017          return 3;
   199018       }
   199019    case 6: return 3;
   199020    case 5: return 3;
   199021    case 4:
   199022       if (devinfo->is_g4x) {
   199023          return 3;
   199024       } else {
   199025          return 3;
   199026       }
   199027    default:
   199028       unreachable("Invalid hardware generation");
   199029    }
   199030 }
   199031 
   199032 
   199033 
   199034 #define GEN10_STATE_BASE_ADDRESS_CommandType_start  29
   199035 #define GEN9_STATE_BASE_ADDRESS_CommandType_start  29
   199036 #define GEN8_STATE_BASE_ADDRESS_CommandType_start  29
   199037 #define GEN75_STATE_BASE_ADDRESS_CommandType_start  29
   199038 #define GEN7_STATE_BASE_ADDRESS_CommandType_start  29
   199039 #define GEN6_STATE_BASE_ADDRESS_CommandType_start  29
   199040 #define GEN5_STATE_BASE_ADDRESS_CommandType_start  29
   199041 #define GEN45_STATE_BASE_ADDRESS_CommandType_start  29
   199042 #define GEN4_STATE_BASE_ADDRESS_CommandType_start  29
   199043 
   199044 static inline uint32_t ATTRIBUTE_PURE
   199045 STATE_BASE_ADDRESS_CommandType_start(const struct gen_device_info *devinfo)
   199046 {
   199047    switch (devinfo->gen) {
   199048    case 10: return 29;
   199049    case 9: return 29;
   199050    case 8: return 29;
   199051    case 7:
   199052       if (devinfo->is_haswell) {
   199053          return 29;
   199054       } else {
   199055          return 29;
   199056       }
   199057    case 6: return 29;
   199058    case 5: return 29;
   199059    case 4:
   199060       if (devinfo->is_g4x) {
   199061          return 29;
   199062       } else {
   199063          return 29;
   199064       }
   199065    default:
   199066       unreachable("Invalid hardware generation");
   199067    }
   199068 }
   199069 
   199070 
   199071 
   199072 /* STATE_BASE_ADDRESS::DWord Length */
   199073 
   199074 
   199075 #define GEN10_STATE_BASE_ADDRESS_DWordLength_bits  8
   199076 #define GEN9_STATE_BASE_ADDRESS_DWordLength_bits  8
   199077 #define GEN8_STATE_BASE_ADDRESS_DWordLength_bits  8
   199078 #define GEN75_STATE_BASE_ADDRESS_DWordLength_bits  8
   199079 #define GEN7_STATE_BASE_ADDRESS_DWordLength_bits  8
   199080 #define GEN6_STATE_BASE_ADDRESS_DWordLength_bits  8
   199081 #define GEN5_STATE_BASE_ADDRESS_DWordLength_bits  8
   199082 #define GEN45_STATE_BASE_ADDRESS_DWordLength_bits  8
   199083 #define GEN4_STATE_BASE_ADDRESS_DWordLength_bits  8
   199084 
   199085 static inline uint32_t ATTRIBUTE_PURE
   199086 STATE_BASE_ADDRESS_DWordLength_bits(const struct gen_device_info *devinfo)
   199087 {
   199088    switch (devinfo->gen) {
   199089    case 10: return 8;
   199090    case 9: return 8;
   199091    case 8: return 8;
   199092    case 7:
   199093       if (devinfo->is_haswell) {
   199094          return 8;
   199095       } else {
   199096          return 8;
   199097       }
   199098    case 6: return 8;
   199099    case 5: return 8;
   199100    case 4:
   199101       if (devinfo->is_g4x) {
   199102          return 8;
   199103       } else {
   199104          return 8;
   199105       }
   199106    default:
   199107       unreachable("Invalid hardware generation");
   199108    }
   199109 }
   199110 
   199111 
   199112 
   199113 #define GEN10_STATE_BASE_ADDRESS_DWordLength_start  0
   199114 #define GEN9_STATE_BASE_ADDRESS_DWordLength_start  0
   199115 #define GEN8_STATE_BASE_ADDRESS_DWordLength_start  0
   199116 #define GEN75_STATE_BASE_ADDRESS_DWordLength_start  0
   199117 #define GEN7_STATE_BASE_ADDRESS_DWordLength_start  0
   199118 #define GEN6_STATE_BASE_ADDRESS_DWordLength_start  0
   199119 #define GEN5_STATE_BASE_ADDRESS_DWordLength_start  0
   199120 #define GEN45_STATE_BASE_ADDRESS_DWordLength_start  0
   199121 #define GEN4_STATE_BASE_ADDRESS_DWordLength_start  0
   199122 
   199123 static inline uint32_t ATTRIBUTE_PURE
   199124 STATE_BASE_ADDRESS_DWordLength_start(const struct gen_device_info *devinfo)
   199125 {
   199126    switch (devinfo->gen) {
   199127    case 10: return 0;
   199128    case 9: return 0;
   199129    case 8: return 0;
   199130    case 7:
   199131       if (devinfo->is_haswell) {
   199132          return 0;
   199133       } else {
   199134          return 0;
   199135       }
   199136    case 6: return 0;
   199137    case 5: return 0;
   199138    case 4:
   199139       if (devinfo->is_g4x) {
   199140          return 0;
   199141       } else {
   199142          return 0;
   199143       }
   199144    default:
   199145       unreachable("Invalid hardware generation");
   199146    }
   199147 }
   199148 
   199149 
   199150 
   199151 /* STATE_BASE_ADDRESS::Dynamic State Access Upper Bound */
   199152 
   199153 
   199154 #define GEN75_STATE_BASE_ADDRESS_DynamicStateAccessUpperBound_bits  20
   199155 #define GEN7_STATE_BASE_ADDRESS_DynamicStateAccessUpperBound_bits  20
   199156 #define GEN6_STATE_BASE_ADDRESS_DynamicStateAccessUpperBound_bits  20
   199157 
   199158 static inline uint32_t ATTRIBUTE_PURE
   199159 STATE_BASE_ADDRESS_DynamicStateAccessUpperBound_bits(const struct gen_device_info *devinfo)
   199160 {
   199161    switch (devinfo->gen) {
   199162    case 10: return 0;
   199163    case 9: return 0;
   199164    case 8: return 0;
   199165    case 7:
   199166       if (devinfo->is_haswell) {
   199167          return 20;
   199168       } else {
   199169          return 20;
   199170       }
   199171    case 6: return 20;
   199172    case 5: return 0;
   199173    case 4:
   199174       if (devinfo->is_g4x) {
   199175          return 0;
   199176       } else {
   199177          return 0;
   199178       }
   199179    default:
   199180       unreachable("Invalid hardware generation");
   199181    }
   199182 }
   199183 
   199184 
   199185 
   199186 #define GEN75_STATE_BASE_ADDRESS_DynamicStateAccessUpperBound_start  236
   199187 #define GEN7_STATE_BASE_ADDRESS_DynamicStateAccessUpperBound_start  236
   199188 #define GEN6_STATE_BASE_ADDRESS_DynamicStateAccessUpperBound_start  236
   199189 
   199190 static inline uint32_t ATTRIBUTE_PURE
   199191 STATE_BASE_ADDRESS_DynamicStateAccessUpperBound_start(const struct gen_device_info *devinfo)
   199192 {
   199193    switch (devinfo->gen) {
   199194    case 10: return 0;
   199195    case 9: return 0;
   199196    case 8: return 0;
   199197    case 7:
   199198       if (devinfo->is_haswell) {
   199199          return 236;
   199200       } else {
   199201          return 236;
   199202       }
   199203    case 6: return 236;
   199204    case 5: return 0;
   199205    case 4:
   199206       if (devinfo->is_g4x) {
   199207          return 0;
   199208       } else {
   199209          return 0;
   199210       }
   199211    default:
   199212       unreachable("Invalid hardware generation");
   199213    }
   199214 }
   199215 
   199216 
   199217 
   199218 /* STATE_BASE_ADDRESS::Dynamic State Access Upper Bound Modify Enable */
   199219 
   199220 
   199221 #define GEN75_STATE_BASE_ADDRESS_DynamicStateAccessUpperBoundModifyEnable_bits  1
   199222 #define GEN7_STATE_BASE_ADDRESS_DynamicStateAccessUpperBoundModifyEnable_bits  1
   199223 #define GEN6_STATE_BASE_ADDRESS_DynamicStateAccessUpperBoundModifyEnable_bits  1
   199224 
   199225 static inline uint32_t ATTRIBUTE_PURE
   199226 STATE_BASE_ADDRESS_DynamicStateAccessUpperBoundModifyEnable_bits(const struct gen_device_info *devinfo)
   199227 {
   199228    switch (devinfo->gen) {
   199229    case 10: return 0;
   199230    case 9: return 0;
   199231    case 8: return 0;
   199232    case 7:
   199233       if (devinfo->is_haswell) {
   199234          return 1;
   199235       } else {
   199236          return 1;
   199237       }
   199238    case 6: return 1;
   199239    case 5: return 0;
   199240    case 4:
   199241       if (devinfo->is_g4x) {
   199242          return 0;
   199243       } else {
   199244          return 0;
   199245       }
   199246    default:
   199247       unreachable("Invalid hardware generation");
   199248    }
   199249 }
   199250 
   199251 
   199252 
   199253 #define GEN75_STATE_BASE_ADDRESS_DynamicStateAccessUpperBoundModifyEnable_start  224
   199254 #define GEN7_STATE_BASE_ADDRESS_DynamicStateAccessUpperBoundModifyEnable_start  224
   199255 #define GEN6_STATE_BASE_ADDRESS_DynamicStateAccessUpperBoundModifyEnable_start  224
   199256 
   199257 static inline uint32_t ATTRIBUTE_PURE
   199258 STATE_BASE_ADDRESS_DynamicStateAccessUpperBoundModifyEnable_start(const struct gen_device_info *devinfo)
   199259 {
   199260    switch (devinfo->gen) {
   199261    case 10: return 0;
   199262    case 9: return 0;
   199263    case 8: return 0;
   199264    case 7:
   199265       if (devinfo->is_haswell) {
   199266          return 224;
   199267       } else {
   199268          return 224;
   199269       }
   199270    case 6: return 224;
   199271    case 5: return 0;
   199272    case 4:
   199273       if (devinfo->is_g4x) {
   199274          return 0;
   199275       } else {
   199276          return 0;
   199277       }
   199278    default:
   199279       unreachable("Invalid hardware generation");
   199280    }
   199281 }
   199282 
   199283 
   199284 
   199285 /* STATE_BASE_ADDRESS::Dynamic State Base Address */
   199286 
   199287 
   199288 #define GEN10_STATE_BASE_ADDRESS_DynamicStateBaseAddress_bits  52
   199289 #define GEN9_STATE_BASE_ADDRESS_DynamicStateBaseAddress_bits  52
   199290 #define GEN8_STATE_BASE_ADDRESS_DynamicStateBaseAddress_bits  52
   199291 #define GEN75_STATE_BASE_ADDRESS_DynamicStateBaseAddress_bits  20
   199292 #define GEN7_STATE_BASE_ADDRESS_DynamicStateBaseAddress_bits  20
   199293 #define GEN6_STATE_BASE_ADDRESS_DynamicStateBaseAddress_bits  20
   199294 
   199295 static inline uint32_t ATTRIBUTE_PURE
   199296 STATE_BASE_ADDRESS_DynamicStateBaseAddress_bits(const struct gen_device_info *devinfo)
   199297 {
   199298    switch (devinfo->gen) {
   199299    case 10: return 52;
   199300    case 9: return 52;
   199301    case 8: return 52;
   199302    case 7:
   199303       if (devinfo->is_haswell) {
   199304          return 20;
   199305       } else {
   199306          return 20;
   199307       }
   199308    case 6: return 20;
   199309    case 5: return 0;
   199310    case 4:
   199311       if (devinfo->is_g4x) {
   199312          return 0;
   199313       } else {
   199314          return 0;
   199315       }
   199316    default:
   199317       unreachable("Invalid hardware generation");
   199318    }
   199319 }
   199320 
   199321 
   199322 
   199323 #define GEN10_STATE_BASE_ADDRESS_DynamicStateBaseAddress_start  204
   199324 #define GEN9_STATE_BASE_ADDRESS_DynamicStateBaseAddress_start  204
   199325 #define GEN8_STATE_BASE_ADDRESS_DynamicStateBaseAddress_start  204
   199326 #define GEN75_STATE_BASE_ADDRESS_DynamicStateBaseAddress_start  108
   199327 #define GEN7_STATE_BASE_ADDRESS_DynamicStateBaseAddress_start  108
   199328 #define GEN6_STATE_BASE_ADDRESS_DynamicStateBaseAddress_start  108
   199329 
   199330 static inline uint32_t ATTRIBUTE_PURE
   199331 STATE_BASE_ADDRESS_DynamicStateBaseAddress_start(const struct gen_device_info *devinfo)
   199332 {
   199333    switch (devinfo->gen) {
   199334    case 10: return 204;
   199335    case 9: return 204;
   199336    case 8: return 204;
   199337    case 7:
   199338       if (devinfo->is_haswell) {
   199339          return 108;
   199340       } else {
   199341          return 108;
   199342       }
   199343    case 6: return 108;
   199344    case 5: return 0;
   199345    case 4:
   199346       if (devinfo->is_g4x) {
   199347          return 0;
   199348       } else {
   199349          return 0;
   199350       }
   199351    default:
   199352       unreachable("Invalid hardware generation");
   199353    }
   199354 }
   199355 
   199356 
   199357 
   199358 /* STATE_BASE_ADDRESS::Dynamic State Base Address Modify Enable */
   199359 
   199360 
   199361 #define GEN10_STATE_BASE_ADDRESS_DynamicStateBaseAddressModifyEnable_bits  1
   199362 #define GEN9_STATE_BASE_ADDRESS_DynamicStateBaseAddressModifyEnable_bits  1
   199363 #define GEN8_STATE_BASE_ADDRESS_DynamicStateBaseAddressModifyEnable_bits  1
   199364 #define GEN75_STATE_BASE_ADDRESS_DynamicStateBaseAddressModifyEnable_bits  1
   199365 #define GEN7_STATE_BASE_ADDRESS_DynamicStateBaseAddressModifyEnable_bits  1
   199366 #define GEN6_STATE_BASE_ADDRESS_DynamicStateBaseAddressModifyEnable_bits  1
   199367 
   199368 static inline uint32_t ATTRIBUTE_PURE
   199369 STATE_BASE_ADDRESS_DynamicStateBaseAddressModifyEnable_bits(const struct gen_device_info *devinfo)
   199370 {
   199371    switch (devinfo->gen) {
   199372    case 10: return 1;
   199373    case 9: return 1;
   199374    case 8: return 1;
   199375    case 7:
   199376       if (devinfo->is_haswell) {
   199377          return 1;
   199378       } else {
   199379          return 1;
   199380       }
   199381    case 6: return 1;
   199382    case 5: return 0;
   199383    case 4:
   199384       if (devinfo->is_g4x) {
   199385          return 0;
   199386       } else {
   199387          return 0;
   199388       }
   199389    default:
   199390       unreachable("Invalid hardware generation");
   199391    }
   199392 }
   199393 
   199394 
   199395 
   199396 #define GEN10_STATE_BASE_ADDRESS_DynamicStateBaseAddressModifyEnable_start  192
   199397 #define GEN9_STATE_BASE_ADDRESS_DynamicStateBaseAddressModifyEnable_start  192
   199398 #define GEN8_STATE_BASE_ADDRESS_DynamicStateBaseAddressModifyEnable_start  192
   199399 #define GEN75_STATE_BASE_ADDRESS_DynamicStateBaseAddressModifyEnable_start  96
   199400 #define GEN7_STATE_BASE_ADDRESS_DynamicStateBaseAddressModifyEnable_start  96
   199401 #define GEN6_STATE_BASE_ADDRESS_DynamicStateBaseAddressModifyEnable_start  96
   199402 
   199403 static inline uint32_t ATTRIBUTE_PURE
   199404 STATE_BASE_ADDRESS_DynamicStateBaseAddressModifyEnable_start(const struct gen_device_info *devinfo)
   199405 {
   199406    switch (devinfo->gen) {
   199407    case 10: return 192;
   199408    case 9: return 192;
   199409    case 8: return 192;
   199410    case 7:
   199411       if (devinfo->is_haswell) {
   199412          return 96;
   199413       } else {
   199414          return 96;
   199415       }
   199416    case 6: return 96;
   199417    case 5: return 0;
   199418    case 4:
   199419       if (devinfo->is_g4x) {
   199420          return 0;
   199421       } else {
   199422          return 0;
   199423       }
   199424    default:
   199425       unreachable("Invalid hardware generation");
   199426    }
   199427 }
   199428 
   199429 
   199430 
   199431 /* STATE_BASE_ADDRESS::Dynamic State Buffer Size */
   199432 
   199433 
   199434 #define GEN10_STATE_BASE_ADDRESS_DynamicStateBufferSize_bits  20
   199435 #define GEN9_STATE_BASE_ADDRESS_DynamicStateBufferSize_bits  20
   199436 #define GEN8_STATE_BASE_ADDRESS_DynamicStateBufferSize_bits  20
   199437 
   199438 static inline uint32_t ATTRIBUTE_PURE
   199439 STATE_BASE_ADDRESS_DynamicStateBufferSize_bits(const struct gen_device_info *devinfo)
   199440 {
   199441    switch (devinfo->gen) {
   199442    case 10: return 20;
   199443    case 9: return 20;
   199444    case 8: return 20;
   199445    case 7:
   199446       if (devinfo->is_haswell) {
   199447          return 0;
   199448       } else {
   199449          return 0;
   199450       }
   199451    case 6: return 0;
   199452    case 5: return 0;
   199453    case 4:
   199454       if (devinfo->is_g4x) {
   199455          return 0;
   199456       } else {
   199457          return 0;
   199458       }
   199459    default:
   199460       unreachable("Invalid hardware generation");
   199461    }
   199462 }
   199463 
   199464 
   199465 
   199466 #define GEN10_STATE_BASE_ADDRESS_DynamicStateBufferSize_start  428
   199467 #define GEN9_STATE_BASE_ADDRESS_DynamicStateBufferSize_start  428
   199468 #define GEN8_STATE_BASE_ADDRESS_DynamicStateBufferSize_start  428
   199469 
   199470 static inline uint32_t ATTRIBUTE_PURE
   199471 STATE_BASE_ADDRESS_DynamicStateBufferSize_start(const struct gen_device_info *devinfo)
   199472 {
   199473    switch (devinfo->gen) {
   199474    case 10: return 428;
   199475    case 9: return 428;
   199476    case 8: return 428;
   199477    case 7:
   199478       if (devinfo->is_haswell) {
   199479          return 0;
   199480       } else {
   199481          return 0;
   199482       }
   199483    case 6: return 0;
   199484    case 5: return 0;
   199485    case 4:
   199486       if (devinfo->is_g4x) {
   199487          return 0;
   199488       } else {
   199489          return 0;
   199490       }
   199491    default:
   199492       unreachable("Invalid hardware generation");
   199493    }
   199494 }
   199495 
   199496 
   199497 
   199498 /* STATE_BASE_ADDRESS::Dynamic State Buffer Size Modify Enable */
   199499 
   199500 
   199501 #define GEN10_STATE_BASE_ADDRESS_DynamicStateBufferSizeModifyEnable_bits  1
   199502 #define GEN9_STATE_BASE_ADDRESS_DynamicStateBufferSizeModifyEnable_bits  1
   199503 #define GEN8_STATE_BASE_ADDRESS_DynamicStateBufferSizeModifyEnable_bits  1
   199504 
   199505 static inline uint32_t ATTRIBUTE_PURE
   199506 STATE_BASE_ADDRESS_DynamicStateBufferSizeModifyEnable_bits(const struct gen_device_info *devinfo)
   199507 {
   199508    switch (devinfo->gen) {
   199509    case 10: return 1;
   199510    case 9: return 1;
   199511    case 8: return 1;
   199512    case 7:
   199513       if (devinfo->is_haswell) {
   199514          return 0;
   199515       } else {
   199516          return 0;
   199517       }
   199518    case 6: return 0;
   199519    case 5: return 0;
   199520    case 4:
   199521       if (devinfo->is_g4x) {
   199522          return 0;
   199523       } else {
   199524          return 0;
   199525       }
   199526    default:
   199527       unreachable("Invalid hardware generation");
   199528    }
   199529 }
   199530 
   199531 
   199532 
   199533 #define GEN10_STATE_BASE_ADDRESS_DynamicStateBufferSizeModifyEnable_start  416
   199534 #define GEN9_STATE_BASE_ADDRESS_DynamicStateBufferSizeModifyEnable_start  416
   199535 #define GEN8_STATE_BASE_ADDRESS_DynamicStateBufferSizeModifyEnable_start  416
   199536 
   199537 static inline uint32_t ATTRIBUTE_PURE
   199538 STATE_BASE_ADDRESS_DynamicStateBufferSizeModifyEnable_start(const struct gen_device_info *devinfo)
   199539 {
   199540    switch (devinfo->gen) {
   199541    case 10: return 416;
   199542    case 9: return 416;
   199543    case 8: return 416;
   199544    case 7:
   199545       if (devinfo->is_haswell) {
   199546          return 0;
   199547       } else {
   199548          return 0;
   199549       }
   199550    case 6: return 0;
   199551    case 5: return 0;
   199552    case 4:
   199553       if (devinfo->is_g4x) {
   199554          return 0;
   199555       } else {
   199556          return 0;
   199557       }
   199558    default:
   199559       unreachable("Invalid hardware generation");
   199560    }
   199561 }
   199562 
   199563 
   199564 
   199565 /* STATE_BASE_ADDRESS::Dynamic State MOCS */
   199566 
   199567 
   199568 #define GEN6_STATE_BASE_ADDRESS_DynamicStateMOCS_bits  4
   199569 
   199570 static inline uint32_t ATTRIBUTE_PURE
   199571 STATE_BASE_ADDRESS_DynamicStateMOCS_bits(const struct gen_device_info *devinfo)
   199572 {
   199573    switch (devinfo->gen) {
   199574    case 10: return 0;
   199575    case 9: return 0;
   199576    case 8: return 0;
   199577    case 7:
   199578       if (devinfo->is_haswell) {
   199579          return 0;
   199580       } else {
   199581          return 0;
   199582       }
   199583    case 6: return 4;
   199584    case 5: return 0;
   199585    case 4:
   199586       if (devinfo->is_g4x) {
   199587          return 0;
   199588       } else {
   199589          return 0;
   199590       }
   199591    default:
   199592       unreachable("Invalid hardware generation");
   199593    }
   199594 }
   199595 
   199596 
   199597 
   199598 #define GEN6_STATE_BASE_ADDRESS_DynamicStateMOCS_start  104
   199599 
   199600 static inline uint32_t ATTRIBUTE_PURE
   199601 STATE_BASE_ADDRESS_DynamicStateMOCS_start(const struct gen_device_info *devinfo)
   199602 {
   199603    switch (devinfo->gen) {
   199604    case 10: return 0;
   199605    case 9: return 0;
   199606    case 8: return 0;
   199607    case 7:
   199608       if (devinfo->is_haswell) {
   199609          return 0;
   199610       } else {
   199611          return 0;
   199612       }
   199613    case 6: return 104;
   199614    case 5: return 0;
   199615    case 4:
   199616       if (devinfo->is_g4x) {
   199617          return 0;
   199618       } else {
   199619          return 0;
   199620       }
   199621    default:
   199622       unreachable("Invalid hardware generation");
   199623    }
   199624 }
   199625 
   199626 
   199627 
   199628 /* STATE_BASE_ADDRESS::Dynamic State Memory Object Control State */
   199629 
   199630 
   199631 #define GEN10_STATE_BASE_ADDRESS_DynamicStateMemoryObjectControlState_bits  7
   199632 #define GEN9_STATE_BASE_ADDRESS_DynamicStateMemoryObjectControlState_bits  7
   199633 #define GEN8_STATE_BASE_ADDRESS_DynamicStateMemoryObjectControlState_bits  7
   199634 #define GEN75_STATE_BASE_ADDRESS_DynamicStateMemoryObjectControlState_bits  4
   199635 #define GEN7_STATE_BASE_ADDRESS_DynamicStateMemoryObjectControlState_bits  4
   199636 #define GEN6_STATE_BASE_ADDRESS_DynamicStateMemoryObjectControlState_bits  4
   199637 
   199638 static inline uint32_t ATTRIBUTE_PURE
   199639 STATE_BASE_ADDRESS_DynamicStateMemoryObjectControlState_bits(const struct gen_device_info *devinfo)
   199640 {
   199641    switch (devinfo->gen) {
   199642    case 10: return 7;
   199643    case 9: return 7;
   199644    case 8: return 7;
   199645    case 7:
   199646       if (devinfo->is_haswell) {
   199647          return 4;
   199648       } else {
   199649          return 4;
   199650       }
   199651    case 6: return 4;
   199652    case 5: return 0;
   199653    case 4:
   199654       if (devinfo->is_g4x) {
   199655          return 0;
   199656       } else {
   199657          return 0;
   199658       }
   199659    default:
   199660       unreachable("Invalid hardware generation");
   199661    }
   199662 }
   199663 
   199664 
   199665 
   199666 #define GEN10_STATE_BASE_ADDRESS_DynamicStateMemoryObjectControlState_start  196
   199667 #define GEN9_STATE_BASE_ADDRESS_DynamicStateMemoryObjectControlState_start  196
   199668 #define GEN8_STATE_BASE_ADDRESS_DynamicStateMemoryObjectControlState_start  196
   199669 #define GEN75_STATE_BASE_ADDRESS_DynamicStateMemoryObjectControlState_start  104
   199670 #define GEN7_STATE_BASE_ADDRESS_DynamicStateMemoryObjectControlState_start  104
   199671 #define GEN6_STATE_BASE_ADDRESS_DynamicStateMemoryObjectControlState_start  104
   199672 
   199673 static inline uint32_t ATTRIBUTE_PURE
   199674 STATE_BASE_ADDRESS_DynamicStateMemoryObjectControlState_start(const struct gen_device_info *devinfo)
   199675 {
   199676    switch (devinfo->gen) {
   199677    case 10: return 196;
   199678    case 9: return 196;
   199679    case 8: return 196;
   199680    case 7:
   199681       if (devinfo->is_haswell) {
   199682          return 104;
   199683       } else {
   199684          return 104;
   199685       }
   199686    case 6: return 104;
   199687    case 5: return 0;
   199688    case 4:
   199689       if (devinfo->is_g4x) {
   199690          return 0;
   199691       } else {
   199692          return 0;
   199693       }
   199694    default:
   199695       unreachable("Invalid hardware generation");
   199696    }
   199697 }
   199698 
   199699 
   199700 
   199701 /* STATE_BASE_ADDRESS::General State Access Upper Bound */
   199702 
   199703 
   199704 #define GEN75_STATE_BASE_ADDRESS_GeneralStateAccessUpperBound_bits  20
   199705 #define GEN7_STATE_BASE_ADDRESS_GeneralStateAccessUpperBound_bits  20
   199706 #define GEN6_STATE_BASE_ADDRESS_GeneralStateAccessUpperBound_bits  20
   199707 #define GEN5_STATE_BASE_ADDRESS_GeneralStateAccessUpperBound_bits  20
   199708 #define GEN45_STATE_BASE_ADDRESS_GeneralStateAccessUpperBound_bits  20
   199709 #define GEN4_STATE_BASE_ADDRESS_GeneralStateAccessUpperBound_bits  20
   199710 
   199711 static inline uint32_t ATTRIBUTE_PURE
   199712 STATE_BASE_ADDRESS_GeneralStateAccessUpperBound_bits(const struct gen_device_info *devinfo)
   199713 {
   199714    switch (devinfo->gen) {
   199715    case 10: return 0;
   199716    case 9: return 0;
   199717    case 8: return 0;
   199718    case 7:
   199719       if (devinfo->is_haswell) {
   199720          return 20;
   199721       } else {
   199722          return 20;
   199723       }
   199724    case 6: return 20;
   199725    case 5: return 20;
   199726    case 4:
   199727       if (devinfo->is_g4x) {
   199728          return 20;
   199729       } else {
   199730          return 20;
   199731       }
   199732    default:
   199733       unreachable("Invalid hardware generation");
   199734    }
   199735 }
   199736 
   199737 
   199738 
   199739 #define GEN75_STATE_BASE_ADDRESS_GeneralStateAccessUpperBound_start  204
   199740 #define GEN7_STATE_BASE_ADDRESS_GeneralStateAccessUpperBound_start  204
   199741 #define GEN6_STATE_BASE_ADDRESS_GeneralStateAccessUpperBound_start  204
   199742 #define GEN5_STATE_BASE_ADDRESS_GeneralStateAccessUpperBound_start  172
   199743 #define GEN45_STATE_BASE_ADDRESS_GeneralStateAccessUpperBound_start  140
   199744 #define GEN4_STATE_BASE_ADDRESS_GeneralStateAccessUpperBound_start  140
   199745 
   199746 static inline uint32_t ATTRIBUTE_PURE
   199747 STATE_BASE_ADDRESS_GeneralStateAccessUpperBound_start(const struct gen_device_info *devinfo)
   199748 {
   199749    switch (devinfo->gen) {
   199750    case 10: return 0;
   199751    case 9: return 0;
   199752    case 8: return 0;
   199753    case 7:
   199754       if (devinfo->is_haswell) {
   199755          return 204;
   199756       } else {
   199757          return 204;
   199758       }
   199759    case 6: return 204;
   199760    case 5: return 172;
   199761    case 4:
   199762       if (devinfo->is_g4x) {
   199763          return 140;
   199764       } else {
   199765          return 140;
   199766       }
   199767    default:
   199768       unreachable("Invalid hardware generation");
   199769    }
   199770 }
   199771 
   199772 
   199773 
   199774 /* STATE_BASE_ADDRESS::General State Access Upper Bound Modify Enable */
   199775 
   199776 
   199777 #define GEN75_STATE_BASE_ADDRESS_GeneralStateAccessUpperBoundModifyEnable_bits  1
   199778 #define GEN7_STATE_BASE_ADDRESS_GeneralStateAccessUpperBoundModifyEnable_bits  1
   199779 #define GEN6_STATE_BASE_ADDRESS_GeneralStateAccessUpperBoundModifyEnable_bits  1
   199780 #define GEN5_STATE_BASE_ADDRESS_GeneralStateAccessUpperBoundModifyEnable_bits  1
   199781 #define GEN45_STATE_BASE_ADDRESS_GeneralStateAccessUpperBoundModifyEnable_bits  1
   199782 #define GEN4_STATE_BASE_ADDRESS_GeneralStateAccessUpperBoundModifyEnable_bits  1
   199783 
   199784 static inline uint32_t ATTRIBUTE_PURE
   199785 STATE_BASE_ADDRESS_GeneralStateAccessUpperBoundModifyEnable_bits(const struct gen_device_info *devinfo)
   199786 {
   199787    switch (devinfo->gen) {
   199788    case 10: return 0;
   199789    case 9: return 0;
   199790    case 8: return 0;
   199791    case 7:
   199792       if (devinfo->is_haswell) {
   199793          return 1;
   199794       } else {
   199795          return 1;
   199796       }
   199797    case 6: return 1;
   199798    case 5: return 1;
   199799    case 4:
   199800       if (devinfo->is_g4x) {
   199801          return 1;
   199802       } else {
   199803          return 1;
   199804       }
   199805    default:
   199806       unreachable("Invalid hardware generation");
   199807    }
   199808 }
   199809 
   199810 
   199811 
   199812 #define GEN75_STATE_BASE_ADDRESS_GeneralStateAccessUpperBoundModifyEnable_start  192
   199813 #define GEN7_STATE_BASE_ADDRESS_GeneralStateAccessUpperBoundModifyEnable_start  192
   199814 #define GEN6_STATE_BASE_ADDRESS_GeneralStateAccessUpperBoundModifyEnable_start  192
   199815 #define GEN5_STATE_BASE_ADDRESS_GeneralStateAccessUpperBoundModifyEnable_start  160
   199816 #define GEN45_STATE_BASE_ADDRESS_GeneralStateAccessUpperBoundModifyEnable_start  128
   199817 #define GEN4_STATE_BASE_ADDRESS_GeneralStateAccessUpperBoundModifyEnable_start  128
   199818 
   199819 static inline uint32_t ATTRIBUTE_PURE
   199820 STATE_BASE_ADDRESS_GeneralStateAccessUpperBoundModifyEnable_start(const struct gen_device_info *devinfo)
   199821 {
   199822    switch (devinfo->gen) {
   199823    case 10: return 0;
   199824    case 9: return 0;
   199825    case 8: return 0;
   199826    case 7:
   199827       if (devinfo->is_haswell) {
   199828          return 192;
   199829       } else {
   199830          return 192;
   199831       }
   199832    case 6: return 192;
   199833    case 5: return 160;
   199834    case 4:
   199835       if (devinfo->is_g4x) {
   199836          return 128;
   199837       } else {
   199838          return 128;
   199839       }
   199840    default:
   199841       unreachable("Invalid hardware generation");
   199842    }
   199843 }
   199844 
   199845 
   199846 
   199847 /* STATE_BASE_ADDRESS::General State Base Address */
   199848 
   199849 
   199850 #define GEN10_STATE_BASE_ADDRESS_GeneralStateBaseAddress_bits  52
   199851 #define GEN9_STATE_BASE_ADDRESS_GeneralStateBaseAddress_bits  52
   199852 #define GEN8_STATE_BASE_ADDRESS_GeneralStateBaseAddress_bits  52
   199853 #define GEN75_STATE_BASE_ADDRESS_GeneralStateBaseAddress_bits  20
   199854 #define GEN7_STATE_BASE_ADDRESS_GeneralStateBaseAddress_bits  20
   199855 #define GEN6_STATE_BASE_ADDRESS_GeneralStateBaseAddress_bits  20
   199856 #define GEN5_STATE_BASE_ADDRESS_GeneralStateBaseAddress_bits  20
   199857 #define GEN45_STATE_BASE_ADDRESS_GeneralStateBaseAddress_bits  20
   199858 #define GEN4_STATE_BASE_ADDRESS_GeneralStateBaseAddress_bits  20
   199859 
   199860 static inline uint32_t ATTRIBUTE_PURE
   199861 STATE_BASE_ADDRESS_GeneralStateBaseAddress_bits(const struct gen_device_info *devinfo)
   199862 {
   199863    switch (devinfo->gen) {
   199864    case 10: return 52;
   199865    case 9: return 52;
   199866    case 8: return 52;
   199867    case 7:
   199868       if (devinfo->is_haswell) {
   199869          return 20;
   199870       } else {
   199871          return 20;
   199872       }
   199873    case 6: return 20;
   199874    case 5: return 20;
   199875    case 4:
   199876       if (devinfo->is_g4x) {
   199877          return 20;
   199878       } else {
   199879          return 20;
   199880       }
   199881    default:
   199882       unreachable("Invalid hardware generation");
   199883    }
   199884 }
   199885 
   199886 
   199887 
   199888 #define GEN10_STATE_BASE_ADDRESS_GeneralStateBaseAddress_start  44
   199889 #define GEN9_STATE_BASE_ADDRESS_GeneralStateBaseAddress_start  44
   199890 #define GEN8_STATE_BASE_ADDRESS_GeneralStateBaseAddress_start  44
   199891 #define GEN75_STATE_BASE_ADDRESS_GeneralStateBaseAddress_start  44
   199892 #define GEN7_STATE_BASE_ADDRESS_GeneralStateBaseAddress_start  44
   199893 #define GEN6_STATE_BASE_ADDRESS_GeneralStateBaseAddress_start  44
   199894 #define GEN5_STATE_BASE_ADDRESS_GeneralStateBaseAddress_start  44
   199895 #define GEN45_STATE_BASE_ADDRESS_GeneralStateBaseAddress_start  44
   199896 #define GEN4_STATE_BASE_ADDRESS_GeneralStateBaseAddress_start  44
   199897 
   199898 static inline uint32_t ATTRIBUTE_PURE
   199899 STATE_BASE_ADDRESS_GeneralStateBaseAddress_start(const struct gen_device_info *devinfo)
   199900 {
   199901    switch (devinfo->gen) {
   199902    case 10: return 44;
   199903    case 9: return 44;
   199904    case 8: return 44;
   199905    case 7:
   199906       if (devinfo->is_haswell) {
   199907          return 44;
   199908       } else {
   199909          return 44;
   199910       }
   199911    case 6: return 44;
   199912    case 5: return 44;
   199913    case 4:
   199914       if (devinfo->is_g4x) {
   199915          return 44;
   199916       } else {
   199917          return 44;
   199918       }
   199919    default:
   199920       unreachable("Invalid hardware generation");
   199921    }
   199922 }
   199923 
   199924 
   199925 
   199926 /* STATE_BASE_ADDRESS::General State Base Address Modify Enable */
   199927 
   199928 
   199929 #define GEN10_STATE_BASE_ADDRESS_GeneralStateBaseAddressModifyEnable_bits  1
   199930 #define GEN9_STATE_BASE_ADDRESS_GeneralStateBaseAddressModifyEnable_bits  1
   199931 #define GEN8_STATE_BASE_ADDRESS_GeneralStateBaseAddressModifyEnable_bits  1
   199932 #define GEN75_STATE_BASE_ADDRESS_GeneralStateBaseAddressModifyEnable_bits  1
   199933 #define GEN7_STATE_BASE_ADDRESS_GeneralStateBaseAddressModifyEnable_bits  1
   199934 #define GEN6_STATE_BASE_ADDRESS_GeneralStateBaseAddressModifyEnable_bits  1
   199935 #define GEN5_STATE_BASE_ADDRESS_GeneralStateBaseAddressModifyEnable_bits  1
   199936 #define GEN45_STATE_BASE_ADDRESS_GeneralStateBaseAddressModifyEnable_bits  1
   199937 #define GEN4_STATE_BASE_ADDRESS_GeneralStateBaseAddressModifyEnable_bits  1
   199938 
   199939 static inline uint32_t ATTRIBUTE_PURE
   199940 STATE_BASE_ADDRESS_GeneralStateBaseAddressModifyEnable_bits(const struct gen_device_info *devinfo)
   199941 {
   199942    switch (devinfo->gen) {
   199943    case 10: return 1;
   199944    case 9: return 1;
   199945    case 8: return 1;
   199946    case 7:
   199947       if (devinfo->is_haswell) {
   199948          return 1;
   199949       } else {
   199950          return 1;
   199951       }
   199952    case 6: return 1;
   199953    case 5: return 1;
   199954    case 4:
   199955       if (devinfo->is_g4x) {
   199956          return 1;
   199957       } else {
   199958          return 1;
   199959       }
   199960    default:
   199961       unreachable("Invalid hardware generation");
   199962    }
   199963 }
   199964 
   199965 
   199966 
   199967 #define GEN10_STATE_BASE_ADDRESS_GeneralStateBaseAddressModifyEnable_start  32
   199968 #define GEN9_STATE_BASE_ADDRESS_GeneralStateBaseAddressModifyEnable_start  32
   199969 #define GEN8_STATE_BASE_ADDRESS_GeneralStateBaseAddressModifyEnable_start  32
   199970 #define GEN75_STATE_BASE_ADDRESS_GeneralStateBaseAddressModifyEnable_start  32
   199971 #define GEN7_STATE_BASE_ADDRESS_GeneralStateBaseAddressModifyEnable_start  32
   199972 #define GEN6_STATE_BASE_ADDRESS_GeneralStateBaseAddressModifyEnable_start  32
   199973 #define GEN5_STATE_BASE_ADDRESS_GeneralStateBaseAddressModifyEnable_start  32
   199974 #define GEN45_STATE_BASE_ADDRESS_GeneralStateBaseAddressModifyEnable_start  32
   199975 #define GEN4_STATE_BASE_ADDRESS_GeneralStateBaseAddressModifyEnable_start  32
   199976 
   199977 static inline uint32_t ATTRIBUTE_PURE
   199978 STATE_BASE_ADDRESS_GeneralStateBaseAddressModifyEnable_start(const struct gen_device_info *devinfo)
   199979 {
   199980    switch (devinfo->gen) {
   199981    case 10: return 32;
   199982    case 9: return 32;
   199983    case 8: return 32;
   199984    case 7:
   199985       if (devinfo->is_haswell) {
   199986          return 32;
   199987       } else {
   199988          return 32;
   199989       }
   199990    case 6: return 32;
   199991    case 5: return 32;
   199992    case 4:
   199993       if (devinfo->is_g4x) {
   199994          return 32;
   199995       } else {
   199996          return 32;
   199997       }
   199998    default:
   199999       unreachable("Invalid hardware generation");
   200000    }
   200001 }
   200002 
   200003 
   200004 
   200005 /* STATE_BASE_ADDRESS::General State Buffer Size */
   200006 
   200007 
   200008 #define GEN10_STATE_BASE_ADDRESS_GeneralStateBufferSize_bits  20
   200009 #define GEN9_STATE_BASE_ADDRESS_GeneralStateBufferSize_bits  20
   200010 #define GEN8_STATE_BASE_ADDRESS_GeneralStateBufferSize_bits  20
   200011 
   200012 static inline uint32_t ATTRIBUTE_PURE
   200013 STATE_BASE_ADDRESS_GeneralStateBufferSize_bits(const struct gen_device_info *devinfo)
   200014 {
   200015    switch (devinfo->gen) {
   200016    case 10: return 20;
   200017    case 9: return 20;
   200018    case 8: return 20;
   200019    case 7:
   200020       if (devinfo->is_haswell) {
   200021          return 0;
   200022       } else {
   200023          return 0;
   200024       }
   200025    case 6: return 0;
   200026    case 5: return 0;
   200027    case 4:
   200028       if (devinfo->is_g4x) {
   200029          return 0;
   200030       } else {
   200031          return 0;
   200032       }
   200033    default:
   200034       unreachable("Invalid hardware generation");
   200035    }
   200036 }
   200037 
   200038 
   200039 
   200040 #define GEN10_STATE_BASE_ADDRESS_GeneralStateBufferSize_start  396
   200041 #define GEN9_STATE_BASE_ADDRESS_GeneralStateBufferSize_start  396
   200042 #define GEN8_STATE_BASE_ADDRESS_GeneralStateBufferSize_start  396
   200043 
   200044 static inline uint32_t ATTRIBUTE_PURE
   200045 STATE_BASE_ADDRESS_GeneralStateBufferSize_start(const struct gen_device_info *devinfo)
   200046 {
   200047    switch (devinfo->gen) {
   200048    case 10: return 396;
   200049    case 9: return 396;
   200050    case 8: return 396;
   200051    case 7:
   200052       if (devinfo->is_haswell) {
   200053          return 0;
   200054       } else {
   200055          return 0;
   200056       }
   200057    case 6: return 0;
   200058    case 5: return 0;
   200059    case 4:
   200060       if (devinfo->is_g4x) {
   200061          return 0;
   200062       } else {
   200063          return 0;
   200064       }
   200065    default:
   200066       unreachable("Invalid hardware generation");
   200067    }
   200068 }
   200069 
   200070 
   200071 
   200072 /* STATE_BASE_ADDRESS::General State Buffer Size Modify Enable */
   200073 
   200074 
   200075 #define GEN10_STATE_BASE_ADDRESS_GeneralStateBufferSizeModifyEnable_bits  1
   200076 #define GEN9_STATE_BASE_ADDRESS_GeneralStateBufferSizeModifyEnable_bits  1
   200077 #define GEN8_STATE_BASE_ADDRESS_GeneralStateBufferSizeModifyEnable_bits  1
   200078 
   200079 static inline uint32_t ATTRIBUTE_PURE
   200080 STATE_BASE_ADDRESS_GeneralStateBufferSizeModifyEnable_bits(const struct gen_device_info *devinfo)
   200081 {
   200082    switch (devinfo->gen) {
   200083    case 10: return 1;
   200084    case 9: return 1;
   200085    case 8: return 1;
   200086    case 7:
   200087       if (devinfo->is_haswell) {
   200088          return 0;
   200089       } else {
   200090          return 0;
   200091       }
   200092    case 6: return 0;
   200093    case 5: return 0;
   200094    case 4:
   200095       if (devinfo->is_g4x) {
   200096          return 0;
   200097       } else {
   200098          return 0;
   200099       }
   200100    default:
   200101       unreachable("Invalid hardware generation");
   200102    }
   200103 }
   200104 
   200105 
   200106 
   200107 #define GEN10_STATE_BASE_ADDRESS_GeneralStateBufferSizeModifyEnable_start  384
   200108 #define GEN9_STATE_BASE_ADDRESS_GeneralStateBufferSizeModifyEnable_start  384
   200109 #define GEN8_STATE_BASE_ADDRESS_GeneralStateBufferSizeModifyEnable_start  384
   200110 
   200111 static inline uint32_t ATTRIBUTE_PURE
   200112 STATE_BASE_ADDRESS_GeneralStateBufferSizeModifyEnable_start(const struct gen_device_info *devinfo)
   200113 {
   200114    switch (devinfo->gen) {
   200115    case 10: return 384;
   200116    case 9: return 384;
   200117    case 8: return 384;
   200118    case 7:
   200119       if (devinfo->is_haswell) {
   200120          return 0;
   200121       } else {
   200122          return 0;
   200123       }
   200124    case 6: return 0;
   200125    case 5: return 0;
   200126    case 4:
   200127       if (devinfo->is_g4x) {
   200128          return 0;
   200129       } else {
   200130          return 0;
   200131       }
   200132    default:
   200133       unreachable("Invalid hardware generation");
   200134    }
   200135 }
   200136 
   200137 
   200138 
   200139 /* STATE_BASE_ADDRESS::General State MOCS */
   200140 
   200141 
   200142 #define GEN6_STATE_BASE_ADDRESS_GeneralStateMOCS_bits  4
   200143 
   200144 static inline uint32_t ATTRIBUTE_PURE
   200145 STATE_BASE_ADDRESS_GeneralStateMOCS_bits(const struct gen_device_info *devinfo)
   200146 {
   200147    switch (devinfo->gen) {
   200148    case 10: return 0;
   200149    case 9: return 0;
   200150    case 8: return 0;
   200151    case 7:
   200152       if (devinfo->is_haswell) {
   200153          return 0;
   200154       } else {
   200155          return 0;
   200156       }
   200157    case 6: return 4;
   200158    case 5: return 0;
   200159    case 4:
   200160       if (devinfo->is_g4x) {
   200161          return 0;
   200162       } else {
   200163          return 0;
   200164       }
   200165    default:
   200166       unreachable("Invalid hardware generation");
   200167    }
   200168 }
   200169 
   200170 
   200171 
   200172 #define GEN6_STATE_BASE_ADDRESS_GeneralStateMOCS_start  40
   200173 
   200174 static inline uint32_t ATTRIBUTE_PURE
   200175 STATE_BASE_ADDRESS_GeneralStateMOCS_start(const struct gen_device_info *devinfo)
   200176 {
   200177    switch (devinfo->gen) {
   200178    case 10: return 0;
   200179    case 9: return 0;
   200180    case 8: return 0;
   200181    case 7:
   200182       if (devinfo->is_haswell) {
   200183          return 0;
   200184       } else {
   200185          return 0;
   200186       }
   200187    case 6: return 40;
   200188    case 5: return 0;
   200189    case 4:
   200190       if (devinfo->is_g4x) {
   200191          return 0;
   200192       } else {
   200193          return 0;
   200194       }
   200195    default:
   200196       unreachable("Invalid hardware generation");
   200197    }
   200198 }
   200199 
   200200 
   200201 
   200202 /* STATE_BASE_ADDRESS::General State Memory Object Control State */
   200203 
   200204 
   200205 #define GEN10_STATE_BASE_ADDRESS_GeneralStateMemoryObjectControlState_bits  7
   200206 #define GEN9_STATE_BASE_ADDRESS_GeneralStateMemoryObjectControlState_bits  7
   200207 #define GEN8_STATE_BASE_ADDRESS_GeneralStateMemoryObjectControlState_bits  7
   200208 #define GEN75_STATE_BASE_ADDRESS_GeneralStateMemoryObjectControlState_bits  4
   200209 #define GEN7_STATE_BASE_ADDRESS_GeneralStateMemoryObjectControlState_bits  4
   200210 #define GEN6_STATE_BASE_ADDRESS_GeneralStateMemoryObjectControlState_bits  4
   200211 
   200212 static inline uint32_t ATTRIBUTE_PURE
   200213 STATE_BASE_ADDRESS_GeneralStateMemoryObjectControlState_bits(const struct gen_device_info *devinfo)
   200214 {
   200215    switch (devinfo->gen) {
   200216    case 10: return 7;
   200217    case 9: return 7;
   200218    case 8: return 7;
   200219    case 7:
   200220       if (devinfo->is_haswell) {
   200221          return 4;
   200222       } else {
   200223          return 4;
   200224       }
   200225    case 6: return 4;
   200226    case 5: return 0;
   200227    case 4:
   200228       if (devinfo->is_g4x) {
   200229          return 0;
   200230       } else {
   200231          return 0;
   200232       }
   200233    default:
   200234       unreachable("Invalid hardware generation");
   200235    }
   200236 }
   200237 
   200238 
   200239 
   200240 #define GEN10_STATE_BASE_ADDRESS_GeneralStateMemoryObjectControlState_start  36
   200241 #define GEN9_STATE_BASE_ADDRESS_GeneralStateMemoryObjectControlState_start  36
   200242 #define GEN8_STATE_BASE_ADDRESS_GeneralStateMemoryObjectControlState_start  36
   200243 #define GEN75_STATE_BASE_ADDRESS_GeneralStateMemoryObjectControlState_start  40
   200244 #define GEN7_STATE_BASE_ADDRESS_GeneralStateMemoryObjectControlState_start  40
   200245 #define GEN6_STATE_BASE_ADDRESS_GeneralStateMemoryObjectControlState_start  40
   200246 
   200247 static inline uint32_t ATTRIBUTE_PURE
   200248 STATE_BASE_ADDRESS_GeneralStateMemoryObjectControlState_start(const struct gen_device_info *devinfo)
   200249 {
   200250    switch (devinfo->gen) {
   200251    case 10: return 36;
   200252    case 9: return 36;
   200253    case 8: return 36;
   200254    case 7:
   200255       if (devinfo->is_haswell) {
   200256          return 40;
   200257       } else {
   200258          return 40;
   200259       }
   200260    case 6: return 40;
   200261    case 5: return 0;
   200262    case 4:
   200263       if (devinfo->is_g4x) {
   200264          return 0;
   200265       } else {
   200266          return 0;
   200267       }
   200268    default:
   200269       unreachable("Invalid hardware generation");
   200270    }
   200271 }
   200272 
   200273 
   200274 
   200275 /* STATE_BASE_ADDRESS::Indirect Object Access Upper Bound */
   200276 
   200277 
   200278 #define GEN75_STATE_BASE_ADDRESS_IndirectObjectAccessUpperBound_bits  20
   200279 #define GEN7_STATE_BASE_ADDRESS_IndirectObjectAccessUpperBound_bits  20
   200280 #define GEN6_STATE_BASE_ADDRESS_IndirectObjectAccessUpperBound_bits  20
   200281 #define GEN5_STATE_BASE_ADDRESS_IndirectObjectAccessUpperBound_bits  20
   200282 #define GEN45_STATE_BASE_ADDRESS_IndirectObjectAccessUpperBound_bits  20
   200283 
   200284 static inline uint32_t ATTRIBUTE_PURE
   200285 STATE_BASE_ADDRESS_IndirectObjectAccessUpperBound_bits(const struct gen_device_info *devinfo)
   200286 {
   200287    switch (devinfo->gen) {
   200288    case 10: return 0;
   200289    case 9: return 0;
   200290    case 8: return 0;
   200291    case 7:
   200292       if (devinfo->is_haswell) {
   200293          return 20;
   200294       } else {
   200295          return 20;
   200296       }
   200297    case 6: return 20;
   200298    case 5: return 20;
   200299    case 4:
   200300       if (devinfo->is_g4x) {
   200301          return 20;
   200302       } else {
   200303          return 0;
   200304       }
   200305    default:
   200306       unreachable("Invalid hardware generation");
   200307    }
   200308 }
   200309 
   200310 
   200311 
   200312 #define GEN75_STATE_BASE_ADDRESS_IndirectObjectAccessUpperBound_start  268
   200313 #define GEN7_STATE_BASE_ADDRESS_IndirectObjectAccessUpperBound_start  268
   200314 #define GEN6_STATE_BASE_ADDRESS_IndirectObjectAccessUpperBound_start  268
   200315 #define GEN5_STATE_BASE_ADDRESS_IndirectObjectAccessUpperBound_start  204
   200316 #define GEN45_STATE_BASE_ADDRESS_IndirectObjectAccessUpperBound_start  172
   200317 
   200318 static inline uint32_t ATTRIBUTE_PURE
   200319 STATE_BASE_ADDRESS_IndirectObjectAccessUpperBound_start(const struct gen_device_info *devinfo)
   200320 {
   200321    switch (devinfo->gen) {
   200322    case 10: return 0;
   200323    case 9: return 0;
   200324    case 8: return 0;
   200325    case 7:
   200326       if (devinfo->is_haswell) {
   200327          return 268;
   200328       } else {
   200329          return 268;
   200330       }
   200331    case 6: return 268;
   200332    case 5: return 204;
   200333    case 4:
   200334       if (devinfo->is_g4x) {
   200335          return 172;
   200336       } else {
   200337          return 0;
   200338       }
   200339    default:
   200340       unreachable("Invalid hardware generation");
   200341    }
   200342 }
   200343 
   200344 
   200345 
   200346 /* STATE_BASE_ADDRESS::Indirect Object Access Upper Bound Modify Enable */
   200347 
   200348 
   200349 #define GEN75_STATE_BASE_ADDRESS_IndirectObjectAccessUpperBoundModifyEnable_bits  1
   200350 #define GEN7_STATE_BASE_ADDRESS_IndirectObjectAccessUpperBoundModifyEnable_bits  1
   200351 #define GEN6_STATE_BASE_ADDRESS_IndirectObjectAccessUpperBoundModifyEnable_bits  1
   200352 #define GEN5_STATE_BASE_ADDRESS_IndirectObjectAccessUpperBoundModifyEnable_bits  1
   200353 #define GEN45_STATE_BASE_ADDRESS_IndirectObjectAccessUpperBoundModifyEnable_bits  1
   200354 
   200355 static inline uint32_t ATTRIBUTE_PURE
   200356 STATE_BASE_ADDRESS_IndirectObjectAccessUpperBoundModifyEnable_bits(const struct gen_device_info *devinfo)
   200357 {
   200358    switch (devinfo->gen) {
   200359    case 10: return 0;
   200360    case 9: return 0;
   200361    case 8: return 0;
   200362    case 7:
   200363       if (devinfo->is_haswell) {
   200364          return 1;
   200365       } else {
   200366          return 1;
   200367       }
   200368    case 6: return 1;
   200369    case 5: return 1;
   200370    case 4:
   200371       if (devinfo->is_g4x) {
   200372          return 1;
   200373       } else {
   200374          return 0;
   200375       }
   200376    default:
   200377       unreachable("Invalid hardware generation");
   200378    }
   200379 }
   200380 
   200381 
   200382 
   200383 #define GEN75_STATE_BASE_ADDRESS_IndirectObjectAccessUpperBoundModifyEnable_start  256
   200384 #define GEN7_STATE_BASE_ADDRESS_IndirectObjectAccessUpperBoundModifyEnable_start  256
   200385 #define GEN6_STATE_BASE_ADDRESS_IndirectObjectAccessUpperBoundModifyEnable_start  256
   200386 #define GEN5_STATE_BASE_ADDRESS_IndirectObjectAccessUpperBoundModifyEnable_start  192
   200387 #define GEN45_STATE_BASE_ADDRESS_IndirectObjectAccessUpperBoundModifyEnable_start  160
   200388 
   200389 static inline uint32_t ATTRIBUTE_PURE
   200390 STATE_BASE_ADDRESS_IndirectObjectAccessUpperBoundModifyEnable_start(const struct gen_device_info *devinfo)
   200391 {
   200392    switch (devinfo->gen) {
   200393    case 10: return 0;
   200394    case 9: return 0;
   200395    case 8: return 0;
   200396    case 7:
   200397       if (devinfo->is_haswell) {
   200398          return 256;
   200399       } else {
   200400          return 256;
   200401       }
   200402    case 6: return 256;
   200403    case 5: return 192;
   200404    case 4:
   200405       if (devinfo->is_g4x) {
   200406          return 160;
   200407       } else {
   200408          return 0;
   200409       }
   200410    default:
   200411       unreachable("Invalid hardware generation");
   200412    }
   200413 }
   200414 
   200415 
   200416 
   200417 /* STATE_BASE_ADDRESS::Indirect Object Base Address */
   200418 
   200419 
   200420 #define GEN10_STATE_BASE_ADDRESS_IndirectObjectBaseAddress_bits  52
   200421 #define GEN9_STATE_BASE_ADDRESS_IndirectObjectBaseAddress_bits  52
   200422 #define GEN8_STATE_BASE_ADDRESS_IndirectObjectBaseAddress_bits  52
   200423 #define GEN75_STATE_BASE_ADDRESS_IndirectObjectBaseAddress_bits  20
   200424 #define GEN7_STATE_BASE_ADDRESS_IndirectObjectBaseAddress_bits  20
   200425 #define GEN6_STATE_BASE_ADDRESS_IndirectObjectBaseAddress_bits  20
   200426 #define GEN5_STATE_BASE_ADDRESS_IndirectObjectBaseAddress_bits  20
   200427 #define GEN45_STATE_BASE_ADDRESS_IndirectObjectBaseAddress_bits  20
   200428 #define GEN4_STATE_BASE_ADDRESS_IndirectObjectBaseAddress_bits  20
   200429 
   200430 static inline uint32_t ATTRIBUTE_PURE
   200431 STATE_BASE_ADDRESS_IndirectObjectBaseAddress_bits(const struct gen_device_info *devinfo)
   200432 {
   200433    switch (devinfo->gen) {
   200434    case 10: return 52;
   200435    case 9: return 52;
   200436    case 8: return 52;
   200437    case 7:
   200438       if (devinfo->is_haswell) {
   200439          return 20;
   200440       } else {
   200441          return 20;
   200442       }
   200443    case 6: return 20;
   200444    case 5: return 20;
   200445    case 4:
   200446       if (devinfo->is_g4x) {
   200447          return 20;
   200448       } else {
   200449          return 20;
   200450       }
   200451    default:
   200452       unreachable("Invalid hardware generation");
   200453    }
   200454 }
   200455 
   200456 
   200457 
   200458 #define GEN10_STATE_BASE_ADDRESS_IndirectObjectBaseAddress_start  268
   200459 #define GEN9_STATE_BASE_ADDRESS_IndirectObjectBaseAddress_start  268
   200460 #define GEN8_STATE_BASE_ADDRESS_IndirectObjectBaseAddress_start  268
   200461 #define GEN75_STATE_BASE_ADDRESS_IndirectObjectBaseAddress_start  140
   200462 #define GEN7_STATE_BASE_ADDRESS_IndirectObjectBaseAddress_start  140
   200463 #define GEN6_STATE_BASE_ADDRESS_IndirectObjectBaseAddress_start  140
   200464 #define GEN5_STATE_BASE_ADDRESS_IndirectObjectBaseAddress_start  108
   200465 #define GEN45_STATE_BASE_ADDRESS_IndirectObjectBaseAddress_start  108
   200466 #define GEN4_STATE_BASE_ADDRESS_IndirectObjectBaseAddress_start  108
   200467 
   200468 static inline uint32_t ATTRIBUTE_PURE
   200469 STATE_BASE_ADDRESS_IndirectObjectBaseAddress_start(const struct gen_device_info *devinfo)
   200470 {
   200471    switch (devinfo->gen) {
   200472    case 10: return 268;
   200473    case 9: return 268;
   200474    case 8: return 268;
   200475    case 7:
   200476       if (devinfo->is_haswell) {
   200477          return 140;
   200478       } else {
   200479          return 140;
   200480       }
   200481    case 6: return 140;
   200482    case 5: return 108;
   200483    case 4:
   200484       if (devinfo->is_g4x) {
   200485          return 108;
   200486       } else {
   200487          return 108;
   200488       }
   200489    default:
   200490       unreachable("Invalid hardware generation");
   200491    }
   200492 }
   200493 
   200494 
   200495 
   200496 /* STATE_BASE_ADDRESS::Indirect Object Base Address Modify Enable */
   200497 
   200498 
   200499 #define GEN10_STATE_BASE_ADDRESS_IndirectObjectBaseAddressModifyEnable_bits  1
   200500 #define GEN9_STATE_BASE_ADDRESS_IndirectObjectBaseAddressModifyEnable_bits  1
   200501 #define GEN8_STATE_BASE_ADDRESS_IndirectObjectBaseAddressModifyEnable_bits  1
   200502 #define GEN75_STATE_BASE_ADDRESS_IndirectObjectBaseAddressModifyEnable_bits  1
   200503 #define GEN7_STATE_BASE_ADDRESS_IndirectObjectBaseAddressModifyEnable_bits  1
   200504 #define GEN6_STATE_BASE_ADDRESS_IndirectObjectBaseAddressModifyEnable_bits  1
   200505 #define GEN5_STATE_BASE_ADDRESS_IndirectObjectBaseAddressModifyEnable_bits  1
   200506 #define GEN45_STATE_BASE_ADDRESS_IndirectObjectBaseAddressModifyEnable_bits  1
   200507 #define GEN4_STATE_BASE_ADDRESS_IndirectObjectBaseAddressModifyEnable_bits  1
   200508 
   200509 static inline uint32_t ATTRIBUTE_PURE
   200510 STATE_BASE_ADDRESS_IndirectObjectBaseAddressModifyEnable_bits(const struct gen_device_info *devinfo)
   200511 {
   200512    switch (devinfo->gen) {
   200513    case 10: return 1;
   200514    case 9: return 1;
   200515    case 8: return 1;
   200516    case 7:
   200517       if (devinfo->is_haswell) {
   200518          return 1;
   200519       } else {
   200520          return 1;
   200521       }
   200522    case 6: return 1;
   200523    case 5: return 1;
   200524    case 4:
   200525       if (devinfo->is_g4x) {
   200526          return 1;
   200527       } else {
   200528          return 1;
   200529       }
   200530    default:
   200531       unreachable("Invalid hardware generation");
   200532    }
   200533 }
   200534 
   200535 
   200536 
   200537 #define GEN10_STATE_BASE_ADDRESS_IndirectObjectBaseAddressModifyEnable_start  256
   200538 #define GEN9_STATE_BASE_ADDRESS_IndirectObjectBaseAddressModifyEnable_start  256
   200539 #define GEN8_STATE_BASE_ADDRESS_IndirectObjectBaseAddressModifyEnable_start  256
   200540 #define GEN75_STATE_BASE_ADDRESS_IndirectObjectBaseAddressModifyEnable_start  128
   200541 #define GEN7_STATE_BASE_ADDRESS_IndirectObjectBaseAddressModifyEnable_start  128
   200542 #define GEN6_STATE_BASE_ADDRESS_IndirectObjectBaseAddressModifyEnable_start  128
   200543 #define GEN5_STATE_BASE_ADDRESS_IndirectObjectBaseAddressModifyEnable_start  96
   200544 #define GEN45_STATE_BASE_ADDRESS_IndirectObjectBaseAddressModifyEnable_start  96
   200545 #define GEN4_STATE_BASE_ADDRESS_IndirectObjectBaseAddressModifyEnable_start  96
   200546 
   200547 static inline uint32_t ATTRIBUTE_PURE
   200548 STATE_BASE_ADDRESS_IndirectObjectBaseAddressModifyEnable_start(const struct gen_device_info *devinfo)
   200549 {
   200550    switch (devinfo->gen) {
   200551    case 10: return 256;
   200552    case 9: return 256;
   200553    case 8: return 256;
   200554    case 7:
   200555       if (devinfo->is_haswell) {
   200556          return 128;
   200557       } else {
   200558          return 128;
   200559       }
   200560    case 6: return 128;
   200561    case 5: return 96;
   200562    case 4:
   200563       if (devinfo->is_g4x) {
   200564          return 96;
   200565       } else {
   200566          return 96;
   200567       }
   200568    default:
   200569       unreachable("Invalid hardware generation");
   200570    }
   200571 }
   200572 
   200573 
   200574 
   200575 /* STATE_BASE_ADDRESS::Indirect Object Buffer Size */
   200576 
   200577 
   200578 #define GEN10_STATE_BASE_ADDRESS_IndirectObjectBufferSize_bits  20
   200579 #define GEN9_STATE_BASE_ADDRESS_IndirectObjectBufferSize_bits  20
   200580 #define GEN8_STATE_BASE_ADDRESS_IndirectObjectBufferSize_bits  20
   200581 
   200582 static inline uint32_t ATTRIBUTE_PURE
   200583 STATE_BASE_ADDRESS_IndirectObjectBufferSize_bits(const struct gen_device_info *devinfo)
   200584 {
   200585    switch (devinfo->gen) {
   200586    case 10: return 20;
   200587    case 9: return 20;
   200588    case 8: return 20;
   200589    case 7:
   200590       if (devinfo->is_haswell) {
   200591          return 0;
   200592       } else {
   200593          return 0;
   200594       }
   200595    case 6: return 0;
   200596    case 5: return 0;
   200597    case 4:
   200598       if (devinfo->is_g4x) {
   200599          return 0;
   200600       } else {
   200601          return 0;
   200602       }
   200603    default:
   200604       unreachable("Invalid hardware generation");
   200605    }
   200606 }
   200607 
   200608 
   200609 
   200610 #define GEN10_STATE_BASE_ADDRESS_IndirectObjectBufferSize_start  460
   200611 #define GEN9_STATE_BASE_ADDRESS_IndirectObjectBufferSize_start  460
   200612 #define GEN8_STATE_BASE_ADDRESS_IndirectObjectBufferSize_start  460
   200613 
   200614 static inline uint32_t ATTRIBUTE_PURE
   200615 STATE_BASE_ADDRESS_IndirectObjectBufferSize_start(const struct gen_device_info *devinfo)
   200616 {
   200617    switch (devinfo->gen) {
   200618    case 10: return 460;
   200619    case 9: return 460;
   200620    case 8: return 460;
   200621    case 7:
   200622       if (devinfo->is_haswell) {
   200623          return 0;
   200624       } else {
   200625          return 0;
   200626       }
   200627    case 6: return 0;
   200628    case 5: return 0;
   200629    case 4:
   200630       if (devinfo->is_g4x) {
   200631          return 0;
   200632       } else {
   200633          return 0;
   200634       }
   200635    default:
   200636       unreachable("Invalid hardware generation");
   200637    }
   200638 }
   200639 
   200640 
   200641 
   200642 /* STATE_BASE_ADDRESS::Indirect Object Buffer Size Modify Enable */
   200643 
   200644 
   200645 #define GEN10_STATE_BASE_ADDRESS_IndirectObjectBufferSizeModifyEnable_bits  1
   200646 #define GEN9_STATE_BASE_ADDRESS_IndirectObjectBufferSizeModifyEnable_bits  1
   200647 #define GEN8_STATE_BASE_ADDRESS_IndirectObjectBufferSizeModifyEnable_bits  1
   200648 
   200649 static inline uint32_t ATTRIBUTE_PURE
   200650 STATE_BASE_ADDRESS_IndirectObjectBufferSizeModifyEnable_bits(const struct gen_device_info *devinfo)
   200651 {
   200652    switch (devinfo->gen) {
   200653    case 10: return 1;
   200654    case 9: return 1;
   200655    case 8: return 1;
   200656    case 7:
   200657       if (devinfo->is_haswell) {
   200658          return 0;
   200659       } else {
   200660          return 0;
   200661       }
   200662    case 6: return 0;
   200663    case 5: return 0;
   200664    case 4:
   200665       if (devinfo->is_g4x) {
   200666          return 0;
   200667       } else {
   200668          return 0;
   200669       }
   200670    default:
   200671       unreachable("Invalid hardware generation");
   200672    }
   200673 }
   200674 
   200675 
   200676 
   200677 #define GEN10_STATE_BASE_ADDRESS_IndirectObjectBufferSizeModifyEnable_start  448
   200678 #define GEN9_STATE_BASE_ADDRESS_IndirectObjectBufferSizeModifyEnable_start  448
   200679 #define GEN8_STATE_BASE_ADDRESS_IndirectObjectBufferSizeModifyEnable_start  448
   200680 
   200681 static inline uint32_t ATTRIBUTE_PURE
   200682 STATE_BASE_ADDRESS_IndirectObjectBufferSizeModifyEnable_start(const struct gen_device_info *devinfo)
   200683 {
   200684    switch (devinfo->gen) {
   200685    case 10: return 448;
   200686    case 9: return 448;
   200687    case 8: return 448;
   200688    case 7:
   200689       if (devinfo->is_haswell) {
   200690          return 0;
   200691       } else {
   200692          return 0;
   200693       }
   200694    case 6: return 0;
   200695    case 5: return 0;
   200696    case 4:
   200697       if (devinfo->is_g4x) {
   200698          return 0;
   200699       } else {
   200700          return 0;
   200701       }
   200702    default:
   200703       unreachable("Invalid hardware generation");
   200704    }
   200705 }
   200706 
   200707 
   200708 
   200709 /* STATE_BASE_ADDRESS::Indirect Object MOCS */
   200710 
   200711 
   200712 #define GEN6_STATE_BASE_ADDRESS_IndirectObjectMOCS_bits  4
   200713 
   200714 static inline uint32_t ATTRIBUTE_PURE
   200715 STATE_BASE_ADDRESS_IndirectObjectMOCS_bits(const struct gen_device_info *devinfo)
   200716 {
   200717    switch (devinfo->gen) {
   200718    case 10: return 0;
   200719    case 9: return 0;
   200720    case 8: return 0;
   200721    case 7:
   200722       if (devinfo->is_haswell) {
   200723          return 0;
   200724       } else {
   200725          return 0;
   200726       }
   200727    case 6: return 4;
   200728    case 5: return 0;
   200729    case 4:
   200730       if (devinfo->is_g4x) {
   200731          return 0;
   200732       } else {
   200733          return 0;
   200734       }
   200735    default:
   200736       unreachable("Invalid hardware generation");
   200737    }
   200738 }
   200739 
   200740 
   200741 
   200742 #define GEN6_STATE_BASE_ADDRESS_IndirectObjectMOCS_start  136
   200743 
   200744 static inline uint32_t ATTRIBUTE_PURE
   200745 STATE_BASE_ADDRESS_IndirectObjectMOCS_start(const struct gen_device_info *devinfo)
   200746 {
   200747    switch (devinfo->gen) {
   200748    case 10: return 0;
   200749    case 9: return 0;
   200750    case 8: return 0;
   200751    case 7:
   200752       if (devinfo->is_haswell) {
   200753          return 0;
   200754       } else {
   200755          return 0;
   200756       }
   200757    case 6: return 136;
   200758    case 5: return 0;
   200759    case 4:
   200760       if (devinfo->is_g4x) {
   200761          return 0;
   200762       } else {
   200763          return 0;
   200764       }
   200765    default:
   200766       unreachable("Invalid hardware generation");
   200767    }
   200768 }
   200769 
   200770 
   200771 
   200772 /* STATE_BASE_ADDRESS::Indirect Object Memory Object Control State */
   200773 
   200774 
   200775 #define GEN10_STATE_BASE_ADDRESS_IndirectObjectMemoryObjectControlState_bits  7
   200776 #define GEN9_STATE_BASE_ADDRESS_IndirectObjectMemoryObjectControlState_bits  7
   200777 #define GEN8_STATE_BASE_ADDRESS_IndirectObjectMemoryObjectControlState_bits  7
   200778 #define GEN75_STATE_BASE_ADDRESS_IndirectObjectMemoryObjectControlState_bits  4
   200779 #define GEN7_STATE_BASE_ADDRESS_IndirectObjectMemoryObjectControlState_bits  4
   200780 #define GEN6_STATE_BASE_ADDRESS_IndirectObjectMemoryObjectControlState_bits  4
   200781 
   200782 static inline uint32_t ATTRIBUTE_PURE
   200783 STATE_BASE_ADDRESS_IndirectObjectMemoryObjectControlState_bits(const struct gen_device_info *devinfo)
   200784 {
   200785    switch (devinfo->gen) {
   200786    case 10: return 7;
   200787    case 9: return 7;
   200788    case 8: return 7;
   200789    case 7:
   200790       if (devinfo->is_haswell) {
   200791          return 4;
   200792       } else {
   200793          return 4;
   200794       }
   200795    case 6: return 4;
   200796    case 5: return 0;
   200797    case 4:
   200798       if (devinfo->is_g4x) {
   200799          return 0;
   200800       } else {
   200801          return 0;
   200802       }
   200803    default:
   200804       unreachable("Invalid hardware generation");
   200805    }
   200806 }
   200807 
   200808 
   200809 
   200810 #define GEN10_STATE_BASE_ADDRESS_IndirectObjectMemoryObjectControlState_start  260
   200811 #define GEN9_STATE_BASE_ADDRESS_IndirectObjectMemoryObjectControlState_start  260
   200812 #define GEN8_STATE_BASE_ADDRESS_IndirectObjectMemoryObjectControlState_start  260
   200813 #define GEN75_STATE_BASE_ADDRESS_IndirectObjectMemoryObjectControlState_start  136
   200814 #define GEN7_STATE_BASE_ADDRESS_IndirectObjectMemoryObjectControlState_start  136
   200815 #define GEN6_STATE_BASE_ADDRESS_IndirectObjectMemoryObjectControlState_start  136
   200816 
   200817 static inline uint32_t ATTRIBUTE_PURE
   200818 STATE_BASE_ADDRESS_IndirectObjectMemoryObjectControlState_start(const struct gen_device_info *devinfo)
   200819 {
   200820    switch (devinfo->gen) {
   200821    case 10: return 260;
   200822    case 9: return 260;
   200823    case 8: return 260;
   200824    case 7:
   200825       if (devinfo->is_haswell) {
   200826          return 136;
   200827       } else {
   200828          return 136;
   200829       }
   200830    case 6: return 136;
   200831    case 5: return 0;
   200832    case 4:
   200833       if (devinfo->is_g4x) {
   200834          return 0;
   200835       } else {
   200836          return 0;
   200837       }
   200838    default:
   200839       unreachable("Invalid hardware generation");
   200840    }
   200841 }
   200842 
   200843 
   200844 
   200845 /* STATE_BASE_ADDRESS::Instruction Access Upper Bound */
   200846 
   200847 
   200848 #define GEN75_STATE_BASE_ADDRESS_InstructionAccessUpperBound_bits  20
   200849 #define GEN7_STATE_BASE_ADDRESS_InstructionAccessUpperBound_bits  20
   200850 #define GEN6_STATE_BASE_ADDRESS_InstructionAccessUpperBound_bits  20
   200851 #define GEN5_STATE_BASE_ADDRESS_InstructionAccessUpperBound_bits  20
   200852 #define GEN4_STATE_BASE_ADDRESS_InstructionAccessUpperBound_bits  20
   200853 
   200854 static inline uint32_t ATTRIBUTE_PURE
   200855 STATE_BASE_ADDRESS_InstructionAccessUpperBound_bits(const struct gen_device_info *devinfo)
   200856 {
   200857    switch (devinfo->gen) {
   200858    case 10: return 0;
   200859    case 9: return 0;
   200860    case 8: return 0;
   200861    case 7:
   200862       if (devinfo->is_haswell) {
   200863          return 20;
   200864       } else {
   200865          return 20;
   200866       }
   200867    case 6: return 20;
   200868    case 5: return 20;
   200869    case 4:
   200870       if (devinfo->is_g4x) {
   200871          return 0;
   200872       } else {
   200873          return 20;
   200874       }
   200875    default:
   200876       unreachable("Invalid hardware generation");
   200877    }
   200878 }
   200879 
   200880 
   200881 
   200882 #define GEN75_STATE_BASE_ADDRESS_InstructionAccessUpperBound_start  300
   200883 #define GEN7_STATE_BASE_ADDRESS_InstructionAccessUpperBound_start  300
   200884 #define GEN6_STATE_BASE_ADDRESS_InstructionAccessUpperBound_start  300
   200885 #define GEN5_STATE_BASE_ADDRESS_InstructionAccessUpperBound_start  236
   200886 #define GEN4_STATE_BASE_ADDRESS_InstructionAccessUpperBound_start  172
   200887 
   200888 static inline uint32_t ATTRIBUTE_PURE
   200889 STATE_BASE_ADDRESS_InstructionAccessUpperBound_start(const struct gen_device_info *devinfo)
   200890 {
   200891    switch (devinfo->gen) {
   200892    case 10: return 0;
   200893    case 9: return 0;
   200894    case 8: return 0;
   200895    case 7:
   200896       if (devinfo->is_haswell) {
   200897          return 300;
   200898       } else {
   200899          return 300;
   200900       }
   200901    case 6: return 300;
   200902    case 5: return 236;
   200903    case 4:
   200904       if (devinfo->is_g4x) {
   200905          return 0;
   200906       } else {
   200907          return 172;
   200908       }
   200909    default:
   200910       unreachable("Invalid hardware generation");
   200911    }
   200912 }
   200913 
   200914 
   200915 
   200916 /* STATE_BASE_ADDRESS::Instruction Access Upper Bound Modify Enable */
   200917 
   200918 
   200919 #define GEN75_STATE_BASE_ADDRESS_InstructionAccessUpperBoundModifyEnable_bits  1
   200920 #define GEN7_STATE_BASE_ADDRESS_InstructionAccessUpperBoundModifyEnable_bits  1
   200921 #define GEN6_STATE_BASE_ADDRESS_InstructionAccessUpperBoundModifyEnable_bits  1
   200922 #define GEN5_STATE_BASE_ADDRESS_InstructionAccessUpperBoundModifyEnable_bits  1
   200923 #define GEN4_STATE_BASE_ADDRESS_InstructionAccessUpperBoundModifyEnable_bits  1
   200924 
   200925 static inline uint32_t ATTRIBUTE_PURE
   200926 STATE_BASE_ADDRESS_InstructionAccessUpperBoundModifyEnable_bits(const struct gen_device_info *devinfo)
   200927 {
   200928    switch (devinfo->gen) {
   200929    case 10: return 0;
   200930    case 9: return 0;
   200931    case 8: return 0;
   200932    case 7:
   200933       if (devinfo->is_haswell) {
   200934          return 1;
   200935       } else {
   200936          return 1;
   200937       }
   200938    case 6: return 1;
   200939    case 5: return 1;
   200940    case 4:
   200941       if (devinfo->is_g4x) {
   200942          return 0;
   200943       } else {
   200944          return 1;
   200945       }
   200946    default:
   200947       unreachable("Invalid hardware generation");
   200948    }
   200949 }
   200950 
   200951 
   200952 
   200953 #define GEN75_STATE_BASE_ADDRESS_InstructionAccessUpperBoundModifyEnable_start  288
   200954 #define GEN7_STATE_BASE_ADDRESS_InstructionAccessUpperBoundModifyEnable_start  288
   200955 #define GEN6_STATE_BASE_ADDRESS_InstructionAccessUpperBoundModifyEnable_start  288
   200956 #define GEN5_STATE_BASE_ADDRESS_InstructionAccessUpperBoundModifyEnable_start  224
   200957 #define GEN4_STATE_BASE_ADDRESS_InstructionAccessUpperBoundModifyEnable_start  160
   200958 
   200959 static inline uint32_t ATTRIBUTE_PURE
   200960 STATE_BASE_ADDRESS_InstructionAccessUpperBoundModifyEnable_start(const struct gen_device_info *devinfo)
   200961 {
   200962    switch (devinfo->gen) {
   200963    case 10: return 0;
   200964    case 9: return 0;
   200965    case 8: return 0;
   200966    case 7:
   200967       if (devinfo->is_haswell) {
   200968          return 288;
   200969       } else {
   200970          return 288;
   200971       }
   200972    case 6: return 288;
   200973    case 5: return 224;
   200974    case 4:
   200975       if (devinfo->is_g4x) {
   200976          return 0;
   200977       } else {
   200978          return 160;
   200979       }
   200980    default:
   200981       unreachable("Invalid hardware generation");
   200982    }
   200983 }
   200984 
   200985 
   200986 
   200987 /* STATE_BASE_ADDRESS::Instruction Base Address */
   200988 
   200989 
   200990 #define GEN10_STATE_BASE_ADDRESS_InstructionBaseAddress_bits  52
   200991 #define GEN9_STATE_BASE_ADDRESS_InstructionBaseAddress_bits  52
   200992 #define GEN8_STATE_BASE_ADDRESS_InstructionBaseAddress_bits  52
   200993 #define GEN75_STATE_BASE_ADDRESS_InstructionBaseAddress_bits  20
   200994 #define GEN7_STATE_BASE_ADDRESS_InstructionBaseAddress_bits  20
   200995 #define GEN6_STATE_BASE_ADDRESS_InstructionBaseAddress_bits  20
   200996 #define GEN5_STATE_BASE_ADDRESS_InstructionBaseAddress_bits  20
   200997 
   200998 static inline uint32_t ATTRIBUTE_PURE
   200999 STATE_BASE_ADDRESS_InstructionBaseAddress_bits(const struct gen_device_info *devinfo)
   201000 {
   201001    switch (devinfo->gen) {
   201002    case 10: return 52;
   201003    case 9: return 52;
   201004    case 8: return 52;
   201005    case 7:
   201006       if (devinfo->is_haswell) {
   201007          return 20;
   201008       } else {
   201009          return 20;
   201010       }
   201011    case 6: return 20;
   201012    case 5: return 20;
   201013    case 4:
   201014       if (devinfo->is_g4x) {
   201015          return 0;
   201016       } else {
   201017          return 0;
   201018       }
   201019    default:
   201020       unreachable("Invalid hardware generation");
   201021    }
   201022 }
   201023 
   201024 
   201025 
   201026 #define GEN10_STATE_BASE_ADDRESS_InstructionBaseAddress_start  332
   201027 #define GEN9_STATE_BASE_ADDRESS_InstructionBaseAddress_start  332
   201028 #define GEN8_STATE_BASE_ADDRESS_InstructionBaseAddress_start  332
   201029 #define GEN75_STATE_BASE_ADDRESS_InstructionBaseAddress_start  172
   201030 #define GEN7_STATE_BASE_ADDRESS_InstructionBaseAddress_start  172
   201031 #define GEN6_STATE_BASE_ADDRESS_InstructionBaseAddress_start  172
   201032 #define GEN5_STATE_BASE_ADDRESS_InstructionBaseAddress_start  140
   201033 
   201034 static inline uint32_t ATTRIBUTE_PURE
   201035 STATE_BASE_ADDRESS_InstructionBaseAddress_start(const struct gen_device_info *devinfo)
   201036 {
   201037    switch (devinfo->gen) {
   201038    case 10: return 332;
   201039    case 9: return 332;
   201040    case 8: return 332;
   201041    case 7:
   201042       if (devinfo->is_haswell) {
   201043          return 172;
   201044       } else {
   201045          return 172;
   201046       }
   201047    case 6: return 172;
   201048    case 5: return 140;
   201049    case 4:
   201050       if (devinfo->is_g4x) {
   201051          return 0;
   201052       } else {
   201053          return 0;
   201054       }
   201055    default:
   201056       unreachable("Invalid hardware generation");
   201057    }
   201058 }
   201059 
   201060 
   201061 
   201062 /* STATE_BASE_ADDRESS::Instruction Base Address Modify Enable */
   201063 
   201064 
   201065 #define GEN10_STATE_BASE_ADDRESS_InstructionBaseAddressModifyEnable_bits  1
   201066 #define GEN9_STATE_BASE_ADDRESS_InstructionBaseAddressModifyEnable_bits  1
   201067 #define GEN8_STATE_BASE_ADDRESS_InstructionBaseAddressModifyEnable_bits  1
   201068 #define GEN75_STATE_BASE_ADDRESS_InstructionBaseAddressModifyEnable_bits  1
   201069 #define GEN7_STATE_BASE_ADDRESS_InstructionBaseAddressModifyEnable_bits  1
   201070 #define GEN6_STATE_BASE_ADDRESS_InstructionBaseAddressModifyEnable_bits  1
   201071 #define GEN5_STATE_BASE_ADDRESS_InstructionBaseAddressModifyEnable_bits  1
   201072 
   201073 static inline uint32_t ATTRIBUTE_PURE
   201074 STATE_BASE_ADDRESS_InstructionBaseAddressModifyEnable_bits(const struct gen_device_info *devinfo)
   201075 {
   201076    switch (devinfo->gen) {
   201077    case 10: return 1;
   201078    case 9: return 1;
   201079    case 8: return 1;
   201080    case 7:
   201081       if (devinfo->is_haswell) {
   201082          return 1;
   201083       } else {
   201084          return 1;
   201085       }
   201086    case 6: return 1;
   201087    case 5: return 1;
   201088    case 4:
   201089       if (devinfo->is_g4x) {
   201090          return 0;
   201091       } else {
   201092          return 0;
   201093       }
   201094    default:
   201095       unreachable("Invalid hardware generation");
   201096    }
   201097 }
   201098 
   201099 
   201100 
   201101 #define GEN10_STATE_BASE_ADDRESS_InstructionBaseAddressModifyEnable_start  320
   201102 #define GEN9_STATE_BASE_ADDRESS_InstructionBaseAddressModifyEnable_start  320
   201103 #define GEN8_STATE_BASE_ADDRESS_InstructionBaseAddressModifyEnable_start  320
   201104 #define GEN75_STATE_BASE_ADDRESS_InstructionBaseAddressModifyEnable_start  160
   201105 #define GEN7_STATE_BASE_ADDRESS_InstructionBaseAddressModifyEnable_start  160
   201106 #define GEN6_STATE_BASE_ADDRESS_InstructionBaseAddressModifyEnable_start  160
   201107 #define GEN5_STATE_BASE_ADDRESS_InstructionBaseAddressModifyEnable_start  128
   201108 
   201109 static inline uint32_t ATTRIBUTE_PURE
   201110 STATE_BASE_ADDRESS_InstructionBaseAddressModifyEnable_start(const struct gen_device_info *devinfo)
   201111 {
   201112    switch (devinfo->gen) {
   201113    case 10: return 320;
   201114    case 9: return 320;
   201115    case 8: return 320;
   201116    case 7:
   201117       if (devinfo->is_haswell) {
   201118          return 160;
   201119       } else {
   201120          return 160;
   201121       }
   201122    case 6: return 160;
   201123    case 5: return 128;
   201124    case 4:
   201125       if (devinfo->is_g4x) {
   201126          return 0;
   201127       } else {
   201128          return 0;
   201129       }
   201130    default:
   201131       unreachable("Invalid hardware generation");
   201132    }
   201133 }
   201134 
   201135 
   201136 
   201137 /* STATE_BASE_ADDRESS::Instruction Buffer Size */
   201138 
   201139 
   201140 #define GEN10_STATE_BASE_ADDRESS_InstructionBufferSize_bits  20
   201141 #define GEN9_STATE_BASE_ADDRESS_InstructionBufferSize_bits  20
   201142 #define GEN8_STATE_BASE_ADDRESS_InstructionBufferSize_bits  20
   201143 
   201144 static inline uint32_t ATTRIBUTE_PURE
   201145 STATE_BASE_ADDRESS_InstructionBufferSize_bits(const struct gen_device_info *devinfo)
   201146 {
   201147    switch (devinfo->gen) {
   201148    case 10: return 20;
   201149    case 9: return 20;
   201150    case 8: return 20;
   201151    case 7:
   201152       if (devinfo->is_haswell) {
   201153          return 0;
   201154       } else {
   201155          return 0;
   201156       }
   201157    case 6: return 0;
   201158    case 5: return 0;
   201159    case 4:
   201160       if (devinfo->is_g4x) {
   201161          return 0;
   201162       } else {
   201163          return 0;
   201164       }
   201165    default:
   201166       unreachable("Invalid hardware generation");
   201167    }
   201168 }
   201169 
   201170 
   201171 
   201172 #define GEN10_STATE_BASE_ADDRESS_InstructionBufferSize_start  492
   201173 #define GEN9_STATE_BASE_ADDRESS_InstructionBufferSize_start  492
   201174 #define GEN8_STATE_BASE_ADDRESS_InstructionBufferSize_start  492
   201175 
   201176 static inline uint32_t ATTRIBUTE_PURE
   201177 STATE_BASE_ADDRESS_InstructionBufferSize_start(const struct gen_device_info *devinfo)
   201178 {
   201179    switch (devinfo->gen) {
   201180    case 10: return 492;
   201181    case 9: return 492;
   201182    case 8: return 492;
   201183    case 7:
   201184       if (devinfo->is_haswell) {
   201185          return 0;
   201186       } else {
   201187          return 0;
   201188       }
   201189    case 6: return 0;
   201190    case 5: return 0;
   201191    case 4:
   201192       if (devinfo->is_g4x) {
   201193          return 0;
   201194       } else {
   201195          return 0;
   201196       }
   201197    default:
   201198       unreachable("Invalid hardware generation");
   201199    }
   201200 }
   201201 
   201202 
   201203 
   201204 /* STATE_BASE_ADDRESS::Instruction Buffer size Modify Enable */
   201205 
   201206 
   201207 #define GEN10_STATE_BASE_ADDRESS_InstructionBuffersizeModifyEnable_bits  1
   201208 #define GEN9_STATE_BASE_ADDRESS_InstructionBuffersizeModifyEnable_bits  1
   201209 #define GEN8_STATE_BASE_ADDRESS_InstructionBuffersizeModifyEnable_bits  1
   201210 
   201211 static inline uint32_t ATTRIBUTE_PURE
   201212 STATE_BASE_ADDRESS_InstructionBuffersizeModifyEnable_bits(const struct gen_device_info *devinfo)
   201213 {
   201214    switch (devinfo->gen) {
   201215    case 10: return 1;
   201216    case 9: return 1;
   201217    case 8: return 1;
   201218    case 7:
   201219       if (devinfo->is_haswell) {
   201220          return 0;
   201221       } else {
   201222          return 0;
   201223       }
   201224    case 6: return 0;
   201225    case 5: return 0;
   201226    case 4:
   201227       if (devinfo->is_g4x) {
   201228          return 0;
   201229       } else {
   201230          return 0;
   201231       }
   201232    default:
   201233       unreachable("Invalid hardware generation");
   201234    }
   201235 }
   201236 
   201237 
   201238 
   201239 #define GEN10_STATE_BASE_ADDRESS_InstructionBuffersizeModifyEnable_start  480
   201240 #define GEN9_STATE_BASE_ADDRESS_InstructionBuffersizeModifyEnable_start  480
   201241 #define GEN8_STATE_BASE_ADDRESS_InstructionBuffersizeModifyEnable_start  480
   201242 
   201243 static inline uint32_t ATTRIBUTE_PURE
   201244 STATE_BASE_ADDRESS_InstructionBuffersizeModifyEnable_start(const struct gen_device_info *devinfo)
   201245 {
   201246    switch (devinfo->gen) {
   201247    case 10: return 480;
   201248    case 9: return 480;
   201249    case 8: return 480;
   201250    case 7:
   201251       if (devinfo->is_haswell) {
   201252          return 0;
   201253       } else {
   201254          return 0;
   201255       }
   201256    case 6: return 0;
   201257    case 5: return 0;
   201258    case 4:
   201259       if (devinfo->is_g4x) {
   201260          return 0;
   201261       } else {
   201262          return 0;
   201263       }
   201264    default:
   201265       unreachable("Invalid hardware generation");
   201266    }
   201267 }
   201268 
   201269 
   201270 
   201271 /* STATE_BASE_ADDRESS::Instruction MOCS */
   201272 
   201273 
   201274 #define GEN6_STATE_BASE_ADDRESS_InstructionMOCS_bits  4
   201275 
   201276 static inline uint32_t ATTRIBUTE_PURE
   201277 STATE_BASE_ADDRESS_InstructionMOCS_bits(const struct gen_device_info *devinfo)
   201278 {
   201279    switch (devinfo->gen) {
   201280    case 10: return 0;
   201281    case 9: return 0;
   201282    case 8: return 0;
   201283    case 7:
   201284       if (devinfo->is_haswell) {
   201285          return 0;
   201286       } else {
   201287          return 0;
   201288       }
   201289    case 6: return 4;
   201290    case 5: return 0;
   201291    case 4:
   201292       if (devinfo->is_g4x) {
   201293          return 0;
   201294       } else {
   201295          return 0;
   201296       }
   201297    default:
   201298       unreachable("Invalid hardware generation");
   201299    }
   201300 }
   201301 
   201302 
   201303 
   201304 #define GEN6_STATE_BASE_ADDRESS_InstructionMOCS_start  168
   201305 
   201306 static inline uint32_t ATTRIBUTE_PURE
   201307 STATE_BASE_ADDRESS_InstructionMOCS_start(const struct gen_device_info *devinfo)
   201308 {
   201309    switch (devinfo->gen) {
   201310    case 10: return 0;
   201311    case 9: return 0;
   201312    case 8: return 0;
   201313    case 7:
   201314       if (devinfo->is_haswell) {
   201315          return 0;
   201316       } else {
   201317          return 0;
   201318       }
   201319    case 6: return 168;
   201320    case 5: return 0;
   201321    case 4:
   201322       if (devinfo->is_g4x) {
   201323          return 0;
   201324       } else {
   201325          return 0;
   201326       }
   201327    default:
   201328       unreachable("Invalid hardware generation");
   201329    }
   201330 }
   201331 
   201332 
   201333 
   201334 /* STATE_BASE_ADDRESS::Instruction Memory Object Control State */
   201335 
   201336 
   201337 #define GEN10_STATE_BASE_ADDRESS_InstructionMemoryObjectControlState_bits  7
   201338 #define GEN9_STATE_BASE_ADDRESS_InstructionMemoryObjectControlState_bits  7
   201339 #define GEN8_STATE_BASE_ADDRESS_InstructionMemoryObjectControlState_bits  7
   201340 #define GEN75_STATE_BASE_ADDRESS_InstructionMemoryObjectControlState_bits  4
   201341 #define GEN7_STATE_BASE_ADDRESS_InstructionMemoryObjectControlState_bits  4
   201342 #define GEN6_STATE_BASE_ADDRESS_InstructionMemoryObjectControlState_bits  4
   201343 
   201344 static inline uint32_t ATTRIBUTE_PURE
   201345 STATE_BASE_ADDRESS_InstructionMemoryObjectControlState_bits(const struct gen_device_info *devinfo)
   201346 {
   201347    switch (devinfo->gen) {
   201348    case 10: return 7;
   201349    case 9: return 7;
   201350    case 8: return 7;
   201351    case 7:
   201352       if (devinfo->is_haswell) {
   201353          return 4;
   201354       } else {
   201355          return 4;
   201356       }
   201357    case 6: return 4;
   201358    case 5: return 0;
   201359    case 4:
   201360       if (devinfo->is_g4x) {
   201361          return 0;
   201362       } else {
   201363          return 0;
   201364       }
   201365    default:
   201366       unreachable("Invalid hardware generation");
   201367    }
   201368 }
   201369 
   201370 
   201371 
   201372 #define GEN10_STATE_BASE_ADDRESS_InstructionMemoryObjectControlState_start  324
   201373 #define GEN9_STATE_BASE_ADDRESS_InstructionMemoryObjectControlState_start  324
   201374 #define GEN8_STATE_BASE_ADDRESS_InstructionMemoryObjectControlState_start  324
   201375 #define GEN75_STATE_BASE_ADDRESS_InstructionMemoryObjectControlState_start  168
   201376 #define GEN7_STATE_BASE_ADDRESS_InstructionMemoryObjectControlState_start  168
   201377 #define GEN6_STATE_BASE_ADDRESS_InstructionMemoryObjectControlState_start  168
   201378 
   201379 static inline uint32_t ATTRIBUTE_PURE
   201380 STATE_BASE_ADDRESS_InstructionMemoryObjectControlState_start(const struct gen_device_info *devinfo)
   201381 {
   201382    switch (devinfo->gen) {
   201383    case 10: return 324;
   201384    case 9: return 324;
   201385    case 8: return 324;
   201386    case 7:
   201387       if (devinfo->is_haswell) {
   201388          return 168;
   201389       } else {
   201390          return 168;
   201391       }
   201392    case 6: return 168;
   201393    case 5: return 0;
   201394    case 4:
   201395       if (devinfo->is_g4x) {
   201396          return 0;
   201397       } else {
   201398          return 0;
   201399       }
   201400    default:
   201401       unreachable("Invalid hardware generation");
   201402    }
   201403 }
   201404 
   201405 
   201406 
   201407 /* STATE_BASE_ADDRESS::Stateless Data Port Access Force Write Thru */
   201408 
   201409 
   201410 #define GEN7_STATE_BASE_ADDRESS_StatelessDataPortAccessForceWriteThru_bits  1
   201411 #define GEN6_STATE_BASE_ADDRESS_StatelessDataPortAccessForceWriteThru_bits  1
   201412 
   201413 static inline uint32_t ATTRIBUTE_PURE
   201414 STATE_BASE_ADDRESS_StatelessDataPortAccessForceWriteThru_bits(const struct gen_device_info *devinfo)
   201415 {
   201416    switch (devinfo->gen) {
   201417    case 10: return 0;
   201418    case 9: return 0;
   201419    case 8: return 0;
   201420    case 7:
   201421       if (devinfo->is_haswell) {
   201422          return 0;
   201423       } else {
   201424          return 1;
   201425       }
   201426    case 6: return 1;
   201427    case 5: return 0;
   201428    case 4:
   201429       if (devinfo->is_g4x) {
   201430          return 0;
   201431       } else {
   201432          return 0;
   201433       }
   201434    default:
   201435       unreachable("Invalid hardware generation");
   201436    }
   201437 }
   201438 
   201439 
   201440 
   201441 #define GEN7_STATE_BASE_ADDRESS_StatelessDataPortAccessForceWriteThru_start  35
   201442 #define GEN6_STATE_BASE_ADDRESS_StatelessDataPortAccessForceWriteThru_start  35
   201443 
   201444 static inline uint32_t ATTRIBUTE_PURE
   201445 STATE_BASE_ADDRESS_StatelessDataPortAccessForceWriteThru_start(const struct gen_device_info *devinfo)
   201446 {
   201447    switch (devinfo->gen) {
   201448    case 10: return 0;
   201449    case 9: return 0;
   201450    case 8: return 0;
   201451    case 7:
   201452       if (devinfo->is_haswell) {
   201453          return 0;
   201454       } else {
   201455          return 35;
   201456       }
   201457    case 6: return 35;
   201458    case 5: return 0;
   201459    case 4:
   201460       if (devinfo->is_g4x) {
   201461          return 0;
   201462       } else {
   201463          return 0;
   201464       }
   201465    default:
   201466       unreachable("Invalid hardware generation");
   201467    }
   201468 }
   201469 
   201470 
   201471 
   201472 /* STATE_BASE_ADDRESS::Stateless Data Port Access MOCS */
   201473 
   201474 
   201475 #define GEN6_STATE_BASE_ADDRESS_StatelessDataPortAccessMOCS_bits  4
   201476 
   201477 static inline uint32_t ATTRIBUTE_PURE
   201478 STATE_BASE_ADDRESS_StatelessDataPortAccessMOCS_bits(const struct gen_device_info *devinfo)
   201479 {
   201480    switch (devinfo->gen) {
   201481    case 10: return 0;
   201482    case 9: return 0;
   201483    case 8: return 0;
   201484    case 7:
   201485       if (devinfo->is_haswell) {
   201486          return 0;
   201487       } else {
   201488          return 0;
   201489       }
   201490    case 6: return 4;
   201491    case 5: return 0;
   201492    case 4:
   201493       if (devinfo->is_g4x) {
   201494          return 0;
   201495       } else {
   201496          return 0;
   201497       }
   201498    default:
   201499       unreachable("Invalid hardware generation");
   201500    }
   201501 }
   201502 
   201503 
   201504 
   201505 #define GEN6_STATE_BASE_ADDRESS_StatelessDataPortAccessMOCS_start  36
   201506 
   201507 static inline uint32_t ATTRIBUTE_PURE
   201508 STATE_BASE_ADDRESS_StatelessDataPortAccessMOCS_start(const struct gen_device_info *devinfo)
   201509 {
   201510    switch (devinfo->gen) {
   201511    case 10: return 0;
   201512    case 9: return 0;
   201513    case 8: return 0;
   201514    case 7:
   201515       if (devinfo->is_haswell) {
   201516          return 0;
   201517       } else {
   201518          return 0;
   201519       }
   201520    case 6: return 36;
   201521    case 5: return 0;
   201522    case 4:
   201523       if (devinfo->is_g4x) {
   201524          return 0;
   201525       } else {
   201526          return 0;
   201527       }
   201528    default:
   201529       unreachable("Invalid hardware generation");
   201530    }
   201531 }
   201532 
   201533 
   201534 
   201535 /* STATE_BASE_ADDRESS::Stateless Data Port Access Memory Object Control State */
   201536 
   201537 
   201538 #define GEN10_STATE_BASE_ADDRESS_StatelessDataPortAccessMemoryObjectControlState_bits  7
   201539 #define GEN9_STATE_BASE_ADDRESS_StatelessDataPortAccessMemoryObjectControlState_bits  7
   201540 #define GEN8_STATE_BASE_ADDRESS_StatelessDataPortAccessMemoryObjectControlState_bits  7
   201541 #define GEN75_STATE_BASE_ADDRESS_StatelessDataPortAccessMemoryObjectControlState_bits  4
   201542 #define GEN7_STATE_BASE_ADDRESS_StatelessDataPortAccessMemoryObjectControlState_bits  4
   201543 #define GEN6_STATE_BASE_ADDRESS_StatelessDataPortAccessMemoryObjectControlState_bits  4
   201544 
   201545 static inline uint32_t ATTRIBUTE_PURE
   201546 STATE_BASE_ADDRESS_StatelessDataPortAccessMemoryObjectControlState_bits(const struct gen_device_info *devinfo)
   201547 {
   201548    switch (devinfo->gen) {
   201549    case 10: return 7;
   201550    case 9: return 7;
   201551    case 8: return 7;
   201552    case 7:
   201553       if (devinfo->is_haswell) {
   201554          return 4;
   201555       } else {
   201556          return 4;
   201557       }
   201558    case 6: return 4;
   201559    case 5: return 0;
   201560    case 4:
   201561       if (devinfo->is_g4x) {
   201562          return 0;
   201563       } else {
   201564          return 0;
   201565       }
   201566    default:
   201567       unreachable("Invalid hardware generation");
   201568    }
   201569 }
   201570 
   201571 
   201572 
   201573 #define GEN10_STATE_BASE_ADDRESS_StatelessDataPortAccessMemoryObjectControlState_start  112
   201574 #define GEN9_STATE_BASE_ADDRESS_StatelessDataPortAccessMemoryObjectControlState_start  112
   201575 #define GEN8_STATE_BASE_ADDRESS_StatelessDataPortAccessMemoryObjectControlState_start  112
   201576 #define GEN75_STATE_BASE_ADDRESS_StatelessDataPortAccessMemoryObjectControlState_start  36
   201577 #define GEN7_STATE_BASE_ADDRESS_StatelessDataPortAccessMemoryObjectControlState_start  36
   201578 #define GEN6_STATE_BASE_ADDRESS_StatelessDataPortAccessMemoryObjectControlState_start  36
   201579 
   201580 static inline uint32_t ATTRIBUTE_PURE
   201581 STATE_BASE_ADDRESS_StatelessDataPortAccessMemoryObjectControlState_start(const struct gen_device_info *devinfo)
   201582 {
   201583    switch (devinfo->gen) {
   201584    case 10: return 112;
   201585    case 9: return 112;
   201586    case 8: return 112;
   201587    case 7:
   201588       if (devinfo->is_haswell) {
   201589          return 36;
   201590       } else {
   201591          return 36;
   201592       }
   201593    case 6: return 36;
   201594    case 5: return 0;
   201595    case 4:
   201596       if (devinfo->is_g4x) {
   201597          return 0;
   201598       } else {
   201599          return 0;
   201600       }
   201601    default:
   201602       unreachable("Invalid hardware generation");
   201603    }
   201604 }
   201605 
   201606 
   201607 
   201608 /* STATE_BASE_ADDRESS::Surface State Base Address */
   201609 
   201610 
   201611 #define GEN10_STATE_BASE_ADDRESS_SurfaceStateBaseAddress_bits  52
   201612 #define GEN9_STATE_BASE_ADDRESS_SurfaceStateBaseAddress_bits  52
   201613 #define GEN8_STATE_BASE_ADDRESS_SurfaceStateBaseAddress_bits  52
   201614 #define GEN75_STATE_BASE_ADDRESS_SurfaceStateBaseAddress_bits  20
   201615 #define GEN7_STATE_BASE_ADDRESS_SurfaceStateBaseAddress_bits  20
   201616 #define GEN6_STATE_BASE_ADDRESS_SurfaceStateBaseAddress_bits  20
   201617 #define GEN5_STATE_BASE_ADDRESS_SurfaceStateBaseAddress_bits  20
   201618 #define GEN45_STATE_BASE_ADDRESS_SurfaceStateBaseAddress_bits  20
   201619 #define GEN4_STATE_BASE_ADDRESS_SurfaceStateBaseAddress_bits  20
   201620 
   201621 static inline uint32_t ATTRIBUTE_PURE
   201622 STATE_BASE_ADDRESS_SurfaceStateBaseAddress_bits(const struct gen_device_info *devinfo)
   201623 {
   201624    switch (devinfo->gen) {
   201625    case 10: return 52;
   201626    case 9: return 52;
   201627    case 8: return 52;
   201628    case 7:
   201629       if (devinfo->is_haswell) {
   201630          return 20;
   201631       } else {
   201632          return 20;
   201633       }
   201634    case 6: return 20;
   201635    case 5: return 20;
   201636    case 4:
   201637       if (devinfo->is_g4x) {
   201638          return 20;
   201639       } else {
   201640          return 20;
   201641       }
   201642    default:
   201643       unreachable("Invalid hardware generation");
   201644    }
   201645 }
   201646 
   201647 
   201648 
   201649 #define GEN10_STATE_BASE_ADDRESS_SurfaceStateBaseAddress_start  140
   201650 #define GEN9_STATE_BASE_ADDRESS_SurfaceStateBaseAddress_start  140
   201651 #define GEN8_STATE_BASE_ADDRESS_SurfaceStateBaseAddress_start  140
   201652 #define GEN75_STATE_BASE_ADDRESS_SurfaceStateBaseAddress_start  76
   201653 #define GEN7_STATE_BASE_ADDRESS_SurfaceStateBaseAddress_start  76
   201654 #define GEN6_STATE_BASE_ADDRESS_SurfaceStateBaseAddress_start  76
   201655 #define GEN5_STATE_BASE_ADDRESS_SurfaceStateBaseAddress_start  76
   201656 #define GEN45_STATE_BASE_ADDRESS_SurfaceStateBaseAddress_start  76
   201657 #define GEN4_STATE_BASE_ADDRESS_SurfaceStateBaseAddress_start  76
   201658 
   201659 static inline uint32_t ATTRIBUTE_PURE
   201660 STATE_BASE_ADDRESS_SurfaceStateBaseAddress_start(const struct gen_device_info *devinfo)
   201661 {
   201662    switch (devinfo->gen) {
   201663    case 10: return 140;
   201664    case 9: return 140;
   201665    case 8: return 140;
   201666    case 7:
   201667       if (devinfo->is_haswell) {
   201668          return 76;
   201669       } else {
   201670          return 76;
   201671       }
   201672    case 6: return 76;
   201673    case 5: return 76;
   201674    case 4:
   201675       if (devinfo->is_g4x) {
   201676          return 76;
   201677       } else {
   201678          return 76;
   201679       }
   201680    default:
   201681       unreachable("Invalid hardware generation");
   201682    }
   201683 }
   201684 
   201685 
   201686 
   201687 /* STATE_BASE_ADDRESS::Surface State Base Address Modify Enable */
   201688 
   201689 
   201690 #define GEN10_STATE_BASE_ADDRESS_SurfaceStateBaseAddressModifyEnable_bits  1
   201691 #define GEN9_STATE_BASE_ADDRESS_SurfaceStateBaseAddressModifyEnable_bits  1
   201692 #define GEN8_STATE_BASE_ADDRESS_SurfaceStateBaseAddressModifyEnable_bits  1
   201693 #define GEN75_STATE_BASE_ADDRESS_SurfaceStateBaseAddressModifyEnable_bits  1
   201694 #define GEN7_STATE_BASE_ADDRESS_SurfaceStateBaseAddressModifyEnable_bits  1
   201695 #define GEN6_STATE_BASE_ADDRESS_SurfaceStateBaseAddressModifyEnable_bits  1
   201696 #define GEN5_STATE_BASE_ADDRESS_SurfaceStateBaseAddressModifyEnable_bits  1
   201697 #define GEN45_STATE_BASE_ADDRESS_SurfaceStateBaseAddressModifyEnable_bits  1
   201698 #define GEN4_STATE_BASE_ADDRESS_SurfaceStateBaseAddressModifyEnable_bits  1
   201699 
   201700 static inline uint32_t ATTRIBUTE_PURE
   201701 STATE_BASE_ADDRESS_SurfaceStateBaseAddressModifyEnable_bits(const struct gen_device_info *devinfo)
   201702 {
   201703    switch (devinfo->gen) {
   201704    case 10: return 1;
   201705    case 9: return 1;
   201706    case 8: return 1;
   201707    case 7:
   201708       if (devinfo->is_haswell) {
   201709          return 1;
   201710       } else {
   201711          return 1;
   201712       }
   201713    case 6: return 1;
   201714    case 5: return 1;
   201715    case 4:
   201716       if (devinfo->is_g4x) {
   201717          return 1;
   201718       } else {
   201719          return 1;
   201720       }
   201721    default:
   201722       unreachable("Invalid hardware generation");
   201723    }
   201724 }
   201725 
   201726 
   201727 
   201728 #define GEN10_STATE_BASE_ADDRESS_SurfaceStateBaseAddressModifyEnable_start  128
   201729 #define GEN9_STATE_BASE_ADDRESS_SurfaceStateBaseAddressModifyEnable_start  128
   201730 #define GEN8_STATE_BASE_ADDRESS_SurfaceStateBaseAddressModifyEnable_start  128
   201731 #define GEN75_STATE_BASE_ADDRESS_SurfaceStateBaseAddressModifyEnable_start  64
   201732 #define GEN7_STATE_BASE_ADDRESS_SurfaceStateBaseAddressModifyEnable_start  64
   201733 #define GEN6_STATE_BASE_ADDRESS_SurfaceStateBaseAddressModifyEnable_start  64
   201734 #define GEN5_STATE_BASE_ADDRESS_SurfaceStateBaseAddressModifyEnable_start  64
   201735 #define GEN45_STATE_BASE_ADDRESS_SurfaceStateBaseAddressModifyEnable_start  64
   201736 #define GEN4_STATE_BASE_ADDRESS_SurfaceStateBaseAddressModifyEnable_start  64
   201737 
   201738 static inline uint32_t ATTRIBUTE_PURE
   201739 STATE_BASE_ADDRESS_SurfaceStateBaseAddressModifyEnable_start(const struct gen_device_info *devinfo)
   201740 {
   201741    switch (devinfo->gen) {
   201742    case 10: return 128;
   201743    case 9: return 128;
   201744    case 8: return 128;
   201745    case 7:
   201746       if (devinfo->is_haswell) {
   201747          return 64;
   201748       } else {
   201749          return 64;
   201750       }
   201751    case 6: return 64;
   201752    case 5: return 64;
   201753    case 4:
   201754       if (devinfo->is_g4x) {
   201755          return 64;
   201756       } else {
   201757          return 64;
   201758       }
   201759    default:
   201760       unreachable("Invalid hardware generation");
   201761    }
   201762 }
   201763 
   201764 
   201765 
   201766 /* STATE_BASE_ADDRESS::Surface State MOCS */
   201767 
   201768 
   201769 #define GEN6_STATE_BASE_ADDRESS_SurfaceStateMOCS_bits  4
   201770 
   201771 static inline uint32_t ATTRIBUTE_PURE
   201772 STATE_BASE_ADDRESS_SurfaceStateMOCS_bits(const struct gen_device_info *devinfo)
   201773 {
   201774    switch (devinfo->gen) {
   201775    case 10: return 0;
   201776    case 9: return 0;
   201777    case 8: return 0;
   201778    case 7:
   201779       if (devinfo->is_haswell) {
   201780          return 0;
   201781       } else {
   201782          return 0;
   201783       }
   201784    case 6: return 4;
   201785    case 5: return 0;
   201786    case 4:
   201787       if (devinfo->is_g4x) {
   201788          return 0;
   201789       } else {
   201790          return 0;
   201791       }
   201792    default:
   201793       unreachable("Invalid hardware generation");
   201794    }
   201795 }
   201796 
   201797 
   201798 
   201799 #define GEN6_STATE_BASE_ADDRESS_SurfaceStateMOCS_start  72
   201800 
   201801 static inline uint32_t ATTRIBUTE_PURE
   201802 STATE_BASE_ADDRESS_SurfaceStateMOCS_start(const struct gen_device_info *devinfo)
   201803 {
   201804    switch (devinfo->gen) {
   201805    case 10: return 0;
   201806    case 9: return 0;
   201807    case 8: return 0;
   201808    case 7:
   201809       if (devinfo->is_haswell) {
   201810          return 0;
   201811       } else {
   201812          return 0;
   201813       }
   201814    case 6: return 72;
   201815    case 5: return 0;
   201816    case 4:
   201817       if (devinfo->is_g4x) {
   201818          return 0;
   201819       } else {
   201820          return 0;
   201821       }
   201822    default:
   201823       unreachable("Invalid hardware generation");
   201824    }
   201825 }
   201826 
   201827 
   201828 
   201829 /* STATE_BASE_ADDRESS::Surface State Memory Object Control State */
   201830 
   201831 
   201832 #define GEN10_STATE_BASE_ADDRESS_SurfaceStateMemoryObjectControlState_bits  7
   201833 #define GEN9_STATE_BASE_ADDRESS_SurfaceStateMemoryObjectControlState_bits  7
   201834 #define GEN8_STATE_BASE_ADDRESS_SurfaceStateMemoryObjectControlState_bits  7
   201835 #define GEN75_STATE_BASE_ADDRESS_SurfaceStateMemoryObjectControlState_bits  4
   201836 #define GEN7_STATE_BASE_ADDRESS_SurfaceStateMemoryObjectControlState_bits  4
   201837 #define GEN6_STATE_BASE_ADDRESS_SurfaceStateMemoryObjectControlState_bits  4
   201838 
   201839 static inline uint32_t ATTRIBUTE_PURE
   201840 STATE_BASE_ADDRESS_SurfaceStateMemoryObjectControlState_bits(const struct gen_device_info *devinfo)
   201841 {
   201842    switch (devinfo->gen) {
   201843    case 10: return 7;
   201844    case 9: return 7;
   201845    case 8: return 7;
   201846    case 7:
   201847       if (devinfo->is_haswell) {
   201848          return 4;
   201849       } else {
   201850          return 4;
   201851       }
   201852    case 6: return 4;
   201853    case 5: return 0;
   201854    case 4:
   201855       if (devinfo->is_g4x) {
   201856          return 0;
   201857       } else {
   201858          return 0;
   201859       }
   201860    default:
   201861       unreachable("Invalid hardware generation");
   201862    }
   201863 }
   201864 
   201865 
   201866 
   201867 #define GEN10_STATE_BASE_ADDRESS_SurfaceStateMemoryObjectControlState_start  132
   201868 #define GEN9_STATE_BASE_ADDRESS_SurfaceStateMemoryObjectControlState_start  132
   201869 #define GEN8_STATE_BASE_ADDRESS_SurfaceStateMemoryObjectControlState_start  132
   201870 #define GEN75_STATE_BASE_ADDRESS_SurfaceStateMemoryObjectControlState_start  72
   201871 #define GEN7_STATE_BASE_ADDRESS_SurfaceStateMemoryObjectControlState_start  72
   201872 #define GEN6_STATE_BASE_ADDRESS_SurfaceStateMemoryObjectControlState_start  72
   201873 
   201874 static inline uint32_t ATTRIBUTE_PURE
   201875 STATE_BASE_ADDRESS_SurfaceStateMemoryObjectControlState_start(const struct gen_device_info *devinfo)
   201876 {
   201877    switch (devinfo->gen) {
   201878    case 10: return 132;
   201879    case 9: return 132;
   201880    case 8: return 132;
   201881    case 7:
   201882       if (devinfo->is_haswell) {
   201883          return 72;
   201884       } else {
   201885          return 72;
   201886       }
   201887    case 6: return 72;
   201888    case 5: return 0;
   201889    case 4:
   201890       if (devinfo->is_g4x) {
   201891          return 0;
   201892       } else {
   201893          return 0;
   201894       }
   201895    default:
   201896       unreachable("Invalid hardware generation");
   201897    }
   201898 }
   201899 
   201900 
   201901 
   201902 /* STATE_PREFETCH */
   201903 
   201904 
   201905 #define GEN9_STATE_PREFETCH_length  2
   201906 #define GEN8_STATE_PREFETCH_length  2
   201907 #define GEN75_STATE_PREFETCH_length  2
   201908 #define GEN7_STATE_PREFETCH_length  2
   201909 #define GEN6_STATE_PREFETCH_length  2
   201910 
   201911 static inline uint32_t ATTRIBUTE_PURE
   201912 STATE_PREFETCH_length(const struct gen_device_info *devinfo)
   201913 {
   201914    switch (devinfo->gen) {
   201915    case 10: return 0;
   201916    case 9: return 2;
   201917    case 8: return 2;
   201918    case 7:
   201919       if (devinfo->is_haswell) {
   201920          return 2;
   201921       } else {
   201922          return 2;
   201923       }
   201924    case 6: return 2;
   201925    case 5: return 0;
   201926    case 4:
   201927       if (devinfo->is_g4x) {
   201928          return 0;
   201929       } else {
   201930          return 0;
   201931       }
   201932    default:
   201933       unreachable("Invalid hardware generation");
   201934    }
   201935 }
   201936 
   201937 
   201938 
   201939 /* STATE_PREFETCH::3D Command Opcode */
   201940 
   201941 
   201942 #define GEN9_STATE_PREFETCH_3DCommandOpcode_bits  3
   201943 #define GEN8_STATE_PREFETCH_3DCommandOpcode_bits  3
   201944 #define GEN75_STATE_PREFETCH_3DCommandOpcode_bits  3
   201945 #define GEN7_STATE_PREFETCH_3DCommandOpcode_bits  3
   201946 #define GEN6_STATE_PREFETCH_3DCommandOpcode_bits  3
   201947 
   201948 static inline uint32_t ATTRIBUTE_PURE
   201949 STATE_PREFETCH_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   201950 {
   201951    switch (devinfo->gen) {
   201952    case 10: return 0;
   201953    case 9: return 3;
   201954    case 8: return 3;
   201955    case 7:
   201956       if (devinfo->is_haswell) {
   201957          return 3;
   201958       } else {
   201959          return 3;
   201960       }
   201961    case 6: return 3;
   201962    case 5: return 0;
   201963    case 4:
   201964       if (devinfo->is_g4x) {
   201965          return 0;
   201966       } else {
   201967          return 0;
   201968       }
   201969    default:
   201970       unreachable("Invalid hardware generation");
   201971    }
   201972 }
   201973 
   201974 
   201975 
   201976 #define GEN9_STATE_PREFETCH_3DCommandOpcode_start  24
   201977 #define GEN8_STATE_PREFETCH_3DCommandOpcode_start  24
   201978 #define GEN75_STATE_PREFETCH_3DCommandOpcode_start  24
   201979 #define GEN7_STATE_PREFETCH_3DCommandOpcode_start  24
   201980 #define GEN6_STATE_PREFETCH_3DCommandOpcode_start  24
   201981 
   201982 static inline uint32_t ATTRIBUTE_PURE
   201983 STATE_PREFETCH_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   201984 {
   201985    switch (devinfo->gen) {
   201986    case 10: return 0;
   201987    case 9: return 24;
   201988    case 8: return 24;
   201989    case 7:
   201990       if (devinfo->is_haswell) {
   201991          return 24;
   201992       } else {
   201993          return 24;
   201994       }
   201995    case 6: return 24;
   201996    case 5: return 0;
   201997    case 4:
   201998       if (devinfo->is_g4x) {
   201999          return 0;
   202000       } else {
   202001          return 0;
   202002       }
   202003    default:
   202004       unreachable("Invalid hardware generation");
   202005    }
   202006 }
   202007 
   202008 
   202009 
   202010 /* STATE_PREFETCH::3D Command Sub Opcode */
   202011 
   202012 
   202013 #define GEN9_STATE_PREFETCH_3DCommandSubOpcode_bits  8
   202014 #define GEN8_STATE_PREFETCH_3DCommandSubOpcode_bits  8
   202015 #define GEN75_STATE_PREFETCH_3DCommandSubOpcode_bits  8
   202016 #define GEN7_STATE_PREFETCH_3DCommandSubOpcode_bits  8
   202017 #define GEN6_STATE_PREFETCH_3DCommandSubOpcode_bits  8
   202018 
   202019 static inline uint32_t ATTRIBUTE_PURE
   202020 STATE_PREFETCH_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   202021 {
   202022    switch (devinfo->gen) {
   202023    case 10: return 0;
   202024    case 9: return 8;
   202025    case 8: return 8;
   202026    case 7:
   202027       if (devinfo->is_haswell) {
   202028          return 8;
   202029       } else {
   202030          return 8;
   202031       }
   202032    case 6: return 8;
   202033    case 5: return 0;
   202034    case 4:
   202035       if (devinfo->is_g4x) {
   202036          return 0;
   202037       } else {
   202038          return 0;
   202039       }
   202040    default:
   202041       unreachable("Invalid hardware generation");
   202042    }
   202043 }
   202044 
   202045 
   202046 
   202047 #define GEN9_STATE_PREFETCH_3DCommandSubOpcode_start  16
   202048 #define GEN8_STATE_PREFETCH_3DCommandSubOpcode_start  16
   202049 #define GEN75_STATE_PREFETCH_3DCommandSubOpcode_start  16
   202050 #define GEN7_STATE_PREFETCH_3DCommandSubOpcode_start  16
   202051 #define GEN6_STATE_PREFETCH_3DCommandSubOpcode_start  16
   202052 
   202053 static inline uint32_t ATTRIBUTE_PURE
   202054 STATE_PREFETCH_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   202055 {
   202056    switch (devinfo->gen) {
   202057    case 10: return 0;
   202058    case 9: return 16;
   202059    case 8: return 16;
   202060    case 7:
   202061       if (devinfo->is_haswell) {
   202062          return 16;
   202063       } else {
   202064          return 16;
   202065       }
   202066    case 6: return 16;
   202067    case 5: return 0;
   202068    case 4:
   202069       if (devinfo->is_g4x) {
   202070          return 0;
   202071       } else {
   202072          return 0;
   202073       }
   202074    default:
   202075       unreachable("Invalid hardware generation");
   202076    }
   202077 }
   202078 
   202079 
   202080 
   202081 /* STATE_PREFETCH::Command SubType */
   202082 
   202083 
   202084 #define GEN9_STATE_PREFETCH_CommandSubType_bits  2
   202085 #define GEN8_STATE_PREFETCH_CommandSubType_bits  2
   202086 #define GEN75_STATE_PREFETCH_CommandSubType_bits  2
   202087 #define GEN7_STATE_PREFETCH_CommandSubType_bits  2
   202088 #define GEN6_STATE_PREFETCH_CommandSubType_bits  2
   202089 
   202090 static inline uint32_t ATTRIBUTE_PURE
   202091 STATE_PREFETCH_CommandSubType_bits(const struct gen_device_info *devinfo)
   202092 {
   202093    switch (devinfo->gen) {
   202094    case 10: return 0;
   202095    case 9: return 2;
   202096    case 8: return 2;
   202097    case 7:
   202098       if (devinfo->is_haswell) {
   202099          return 2;
   202100       } else {
   202101          return 2;
   202102       }
   202103    case 6: return 2;
   202104    case 5: return 0;
   202105    case 4:
   202106       if (devinfo->is_g4x) {
   202107          return 0;
   202108       } else {
   202109          return 0;
   202110       }
   202111    default:
   202112       unreachable("Invalid hardware generation");
   202113    }
   202114 }
   202115 
   202116 
   202117 
   202118 #define GEN9_STATE_PREFETCH_CommandSubType_start  27
   202119 #define GEN8_STATE_PREFETCH_CommandSubType_start  27
   202120 #define GEN75_STATE_PREFETCH_CommandSubType_start  27
   202121 #define GEN7_STATE_PREFETCH_CommandSubType_start  27
   202122 #define GEN6_STATE_PREFETCH_CommandSubType_start  27
   202123 
   202124 static inline uint32_t ATTRIBUTE_PURE
   202125 STATE_PREFETCH_CommandSubType_start(const struct gen_device_info *devinfo)
   202126 {
   202127    switch (devinfo->gen) {
   202128    case 10: return 0;
   202129    case 9: return 27;
   202130    case 8: return 27;
   202131    case 7:
   202132       if (devinfo->is_haswell) {
   202133          return 27;
   202134       } else {
   202135          return 27;
   202136       }
   202137    case 6: return 27;
   202138    case 5: return 0;
   202139    case 4:
   202140       if (devinfo->is_g4x) {
   202141          return 0;
   202142       } else {
   202143          return 0;
   202144       }
   202145    default:
   202146       unreachable("Invalid hardware generation");
   202147    }
   202148 }
   202149 
   202150 
   202151 
   202152 /* STATE_PREFETCH::Command Type */
   202153 
   202154 
   202155 #define GEN9_STATE_PREFETCH_CommandType_bits  3
   202156 #define GEN8_STATE_PREFETCH_CommandType_bits  3
   202157 #define GEN75_STATE_PREFETCH_CommandType_bits  3
   202158 #define GEN7_STATE_PREFETCH_CommandType_bits  3
   202159 #define GEN6_STATE_PREFETCH_CommandType_bits  3
   202160 
   202161 static inline uint32_t ATTRIBUTE_PURE
   202162 STATE_PREFETCH_CommandType_bits(const struct gen_device_info *devinfo)
   202163 {
   202164    switch (devinfo->gen) {
   202165    case 10: return 0;
   202166    case 9: return 3;
   202167    case 8: return 3;
   202168    case 7:
   202169       if (devinfo->is_haswell) {
   202170          return 3;
   202171       } else {
   202172          return 3;
   202173       }
   202174    case 6: return 3;
   202175    case 5: return 0;
   202176    case 4:
   202177       if (devinfo->is_g4x) {
   202178          return 0;
   202179       } else {
   202180          return 0;
   202181       }
   202182    default:
   202183       unreachable("Invalid hardware generation");
   202184    }
   202185 }
   202186 
   202187 
   202188 
   202189 #define GEN9_STATE_PREFETCH_CommandType_start  29
   202190 #define GEN8_STATE_PREFETCH_CommandType_start  29
   202191 #define GEN75_STATE_PREFETCH_CommandType_start  29
   202192 #define GEN7_STATE_PREFETCH_CommandType_start  29
   202193 #define GEN6_STATE_PREFETCH_CommandType_start  29
   202194 
   202195 static inline uint32_t ATTRIBUTE_PURE
   202196 STATE_PREFETCH_CommandType_start(const struct gen_device_info *devinfo)
   202197 {
   202198    switch (devinfo->gen) {
   202199    case 10: return 0;
   202200    case 9: return 29;
   202201    case 8: return 29;
   202202    case 7:
   202203       if (devinfo->is_haswell) {
   202204          return 29;
   202205       } else {
   202206          return 29;
   202207       }
   202208    case 6: return 29;
   202209    case 5: return 0;
   202210    case 4:
   202211       if (devinfo->is_g4x) {
   202212          return 0;
   202213       } else {
   202214          return 0;
   202215       }
   202216    default:
   202217       unreachable("Invalid hardware generation");
   202218    }
   202219 }
   202220 
   202221 
   202222 
   202223 /* STATE_PREFETCH::DWord Length */
   202224 
   202225 
   202226 #define GEN9_STATE_PREFETCH_DWordLength_bits  8
   202227 #define GEN8_STATE_PREFETCH_DWordLength_bits  8
   202228 #define GEN75_STATE_PREFETCH_DWordLength_bits  8
   202229 #define GEN7_STATE_PREFETCH_DWordLength_bits  8
   202230 #define GEN6_STATE_PREFETCH_DWordLength_bits  8
   202231 
   202232 static inline uint32_t ATTRIBUTE_PURE
   202233 STATE_PREFETCH_DWordLength_bits(const struct gen_device_info *devinfo)
   202234 {
   202235    switch (devinfo->gen) {
   202236    case 10: return 0;
   202237    case 9: return 8;
   202238    case 8: return 8;
   202239    case 7:
   202240       if (devinfo->is_haswell) {
   202241          return 8;
   202242       } else {
   202243          return 8;
   202244       }
   202245    case 6: return 8;
   202246    case 5: return 0;
   202247    case 4:
   202248       if (devinfo->is_g4x) {
   202249          return 0;
   202250       } else {
   202251          return 0;
   202252       }
   202253    default:
   202254       unreachable("Invalid hardware generation");
   202255    }
   202256 }
   202257 
   202258 
   202259 
   202260 #define GEN9_STATE_PREFETCH_DWordLength_start  0
   202261 #define GEN8_STATE_PREFETCH_DWordLength_start  0
   202262 #define GEN75_STATE_PREFETCH_DWordLength_start  0
   202263 #define GEN7_STATE_PREFETCH_DWordLength_start  0
   202264 #define GEN6_STATE_PREFETCH_DWordLength_start  0
   202265 
   202266 static inline uint32_t ATTRIBUTE_PURE
   202267 STATE_PREFETCH_DWordLength_start(const struct gen_device_info *devinfo)
   202268 {
   202269    switch (devinfo->gen) {
   202270    case 10: return 0;
   202271    case 9: return 0;
   202272    case 8: return 0;
   202273    case 7:
   202274       if (devinfo->is_haswell) {
   202275          return 0;
   202276       } else {
   202277          return 0;
   202278       }
   202279    case 6: return 0;
   202280    case 5: return 0;
   202281    case 4:
   202282       if (devinfo->is_g4x) {
   202283          return 0;
   202284       } else {
   202285          return 0;
   202286       }
   202287    default:
   202288       unreachable("Invalid hardware generation");
   202289    }
   202290 }
   202291 
   202292 
   202293 
   202294 /* STATE_PREFETCH::Prefetch Count */
   202295 
   202296 
   202297 #define GEN9_STATE_PREFETCH_PrefetchCount_bits  3
   202298 #define GEN8_STATE_PREFETCH_PrefetchCount_bits  3
   202299 #define GEN75_STATE_PREFETCH_PrefetchCount_bits  3
   202300 #define GEN7_STATE_PREFETCH_PrefetchCount_bits  3
   202301 #define GEN6_STATE_PREFETCH_PrefetchCount_bits  3
   202302 
   202303 static inline uint32_t ATTRIBUTE_PURE
   202304 STATE_PREFETCH_PrefetchCount_bits(const struct gen_device_info *devinfo)
   202305 {
   202306    switch (devinfo->gen) {
   202307    case 10: return 0;
   202308    case 9: return 3;
   202309    case 8: return 3;
   202310    case 7:
   202311       if (devinfo->is_haswell) {
   202312          return 3;
   202313       } else {
   202314          return 3;
   202315       }
   202316    case 6: return 3;
   202317    case 5: return 0;
   202318    case 4:
   202319       if (devinfo->is_g4x) {
   202320          return 0;
   202321       } else {
   202322          return 0;
   202323       }
   202324    default:
   202325       unreachable("Invalid hardware generation");
   202326    }
   202327 }
   202328 
   202329 
   202330 
   202331 #define GEN9_STATE_PREFETCH_PrefetchCount_start  32
   202332 #define GEN8_STATE_PREFETCH_PrefetchCount_start  32
   202333 #define GEN75_STATE_PREFETCH_PrefetchCount_start  32
   202334 #define GEN7_STATE_PREFETCH_PrefetchCount_start  32
   202335 #define GEN6_STATE_PREFETCH_PrefetchCount_start  32
   202336 
   202337 static inline uint32_t ATTRIBUTE_PURE
   202338 STATE_PREFETCH_PrefetchCount_start(const struct gen_device_info *devinfo)
   202339 {
   202340    switch (devinfo->gen) {
   202341    case 10: return 0;
   202342    case 9: return 32;
   202343    case 8: return 32;
   202344    case 7:
   202345       if (devinfo->is_haswell) {
   202346          return 32;
   202347       } else {
   202348          return 32;
   202349       }
   202350    case 6: return 32;
   202351    case 5: return 0;
   202352    case 4:
   202353       if (devinfo->is_g4x) {
   202354          return 0;
   202355       } else {
   202356          return 0;
   202357       }
   202358    default:
   202359       unreachable("Invalid hardware generation");
   202360    }
   202361 }
   202362 
   202363 
   202364 
   202365 /* STATE_PREFETCH::Prefetch Pointer */
   202366 
   202367 
   202368 #define GEN9_STATE_PREFETCH_PrefetchPointer_bits  26
   202369 #define GEN8_STATE_PREFETCH_PrefetchPointer_bits  26
   202370 #define GEN75_STATE_PREFETCH_PrefetchPointer_bits  26
   202371 #define GEN7_STATE_PREFETCH_PrefetchPointer_bits  26
   202372 #define GEN6_STATE_PREFETCH_PrefetchPointer_bits  26
   202373 
   202374 static inline uint32_t ATTRIBUTE_PURE
   202375 STATE_PREFETCH_PrefetchPointer_bits(const struct gen_device_info *devinfo)
   202376 {
   202377    switch (devinfo->gen) {
   202378    case 10: return 0;
   202379    case 9: return 26;
   202380    case 8: return 26;
   202381    case 7:
   202382       if (devinfo->is_haswell) {
   202383          return 26;
   202384       } else {
   202385          return 26;
   202386       }
   202387    case 6: return 26;
   202388    case 5: return 0;
   202389    case 4:
   202390       if (devinfo->is_g4x) {
   202391          return 0;
   202392       } else {
   202393          return 0;
   202394       }
   202395    default:
   202396       unreachable("Invalid hardware generation");
   202397    }
   202398 }
   202399 
   202400 
   202401 
   202402 #define GEN9_STATE_PREFETCH_PrefetchPointer_start  38
   202403 #define GEN8_STATE_PREFETCH_PrefetchPointer_start  38
   202404 #define GEN75_STATE_PREFETCH_PrefetchPointer_start  38
   202405 #define GEN7_STATE_PREFETCH_PrefetchPointer_start  38
   202406 #define GEN6_STATE_PREFETCH_PrefetchPointer_start  38
   202407 
   202408 static inline uint32_t ATTRIBUTE_PURE
   202409 STATE_PREFETCH_PrefetchPointer_start(const struct gen_device_info *devinfo)
   202410 {
   202411    switch (devinfo->gen) {
   202412    case 10: return 0;
   202413    case 9: return 38;
   202414    case 8: return 38;
   202415    case 7:
   202416       if (devinfo->is_haswell) {
   202417          return 38;
   202418       } else {
   202419          return 38;
   202420       }
   202421    case 6: return 38;
   202422    case 5: return 0;
   202423    case 4:
   202424       if (devinfo->is_g4x) {
   202425          return 0;
   202426       } else {
   202427          return 0;
   202428       }
   202429    default:
   202430       unreachable("Invalid hardware generation");
   202431    }
   202432 }
   202433 
   202434 
   202435 
   202436 /* STATE_SIP */
   202437 
   202438 
   202439 #define GEN10_STATE_SIP_length  3
   202440 #define GEN9_STATE_SIP_length  3
   202441 #define GEN8_STATE_SIP_length  3
   202442 #define GEN75_STATE_SIP_length  2
   202443 #define GEN7_STATE_SIP_length  2
   202444 #define GEN6_STATE_SIP_length  2
   202445 #define GEN5_STATE_SIP_length  2
   202446 #define GEN45_STATE_SIP_length  2
   202447 #define GEN4_STATE_SIP_length  2
   202448 
   202449 static inline uint32_t ATTRIBUTE_PURE
   202450 STATE_SIP_length(const struct gen_device_info *devinfo)
   202451 {
   202452    switch (devinfo->gen) {
   202453    case 10: return 3;
   202454    case 9: return 3;
   202455    case 8: return 3;
   202456    case 7:
   202457       if (devinfo->is_haswell) {
   202458          return 2;
   202459       } else {
   202460          return 2;
   202461       }
   202462    case 6: return 2;
   202463    case 5: return 2;
   202464    case 4:
   202465       if (devinfo->is_g4x) {
   202466          return 2;
   202467       } else {
   202468          return 2;
   202469       }
   202470    default:
   202471       unreachable("Invalid hardware generation");
   202472    }
   202473 }
   202474 
   202475 
   202476 
   202477 /* STATE_SIP::3D Command Opcode */
   202478 
   202479 
   202480 #define GEN10_STATE_SIP_3DCommandOpcode_bits  3
   202481 #define GEN9_STATE_SIP_3DCommandOpcode_bits  3
   202482 #define GEN8_STATE_SIP_3DCommandOpcode_bits  3
   202483 #define GEN75_STATE_SIP_3DCommandOpcode_bits  3
   202484 #define GEN7_STATE_SIP_3DCommandOpcode_bits  3
   202485 #define GEN6_STATE_SIP_3DCommandOpcode_bits  3
   202486 #define GEN5_STATE_SIP_3DCommandOpcode_bits  3
   202487 #define GEN45_STATE_SIP_3DCommandOpcode_bits  3
   202488 #define GEN4_STATE_SIP_3DCommandOpcode_bits  3
   202489 
   202490 static inline uint32_t ATTRIBUTE_PURE
   202491 STATE_SIP_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   202492 {
   202493    switch (devinfo->gen) {
   202494    case 10: return 3;
   202495    case 9: return 3;
   202496    case 8: return 3;
   202497    case 7:
   202498       if (devinfo->is_haswell) {
   202499          return 3;
   202500       } else {
   202501          return 3;
   202502       }
   202503    case 6: return 3;
   202504    case 5: return 3;
   202505    case 4:
   202506       if (devinfo->is_g4x) {
   202507          return 3;
   202508       } else {
   202509          return 3;
   202510       }
   202511    default:
   202512       unreachable("Invalid hardware generation");
   202513    }
   202514 }
   202515 
   202516 
   202517 
   202518 #define GEN10_STATE_SIP_3DCommandOpcode_start  24
   202519 #define GEN9_STATE_SIP_3DCommandOpcode_start  24
   202520 #define GEN8_STATE_SIP_3DCommandOpcode_start  24
   202521 #define GEN75_STATE_SIP_3DCommandOpcode_start  24
   202522 #define GEN7_STATE_SIP_3DCommandOpcode_start  24
   202523 #define GEN6_STATE_SIP_3DCommandOpcode_start  24
   202524 #define GEN5_STATE_SIP_3DCommandOpcode_start  24
   202525 #define GEN45_STATE_SIP_3DCommandOpcode_start  24
   202526 #define GEN4_STATE_SIP_3DCommandOpcode_start  24
   202527 
   202528 static inline uint32_t ATTRIBUTE_PURE
   202529 STATE_SIP_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   202530 {
   202531    switch (devinfo->gen) {
   202532    case 10: return 24;
   202533    case 9: return 24;
   202534    case 8: return 24;
   202535    case 7:
   202536       if (devinfo->is_haswell) {
   202537          return 24;
   202538       } else {
   202539          return 24;
   202540       }
   202541    case 6: return 24;
   202542    case 5: return 24;
   202543    case 4:
   202544       if (devinfo->is_g4x) {
   202545          return 24;
   202546       } else {
   202547          return 24;
   202548       }
   202549    default:
   202550       unreachable("Invalid hardware generation");
   202551    }
   202552 }
   202553 
   202554 
   202555 
   202556 /* STATE_SIP::3D Command Sub Opcode */
   202557 
   202558 
   202559 #define GEN10_STATE_SIP_3DCommandSubOpcode_bits  8
   202560 #define GEN9_STATE_SIP_3DCommandSubOpcode_bits  8
   202561 #define GEN8_STATE_SIP_3DCommandSubOpcode_bits  8
   202562 #define GEN75_STATE_SIP_3DCommandSubOpcode_bits  8
   202563 #define GEN7_STATE_SIP_3DCommandSubOpcode_bits  8
   202564 #define GEN6_STATE_SIP_3DCommandSubOpcode_bits  8
   202565 #define GEN5_STATE_SIP_3DCommandSubOpcode_bits  8
   202566 #define GEN45_STATE_SIP_3DCommandSubOpcode_bits  8
   202567 #define GEN4_STATE_SIP_3DCommandSubOpcode_bits  8
   202568 
   202569 static inline uint32_t ATTRIBUTE_PURE
   202570 STATE_SIP_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   202571 {
   202572    switch (devinfo->gen) {
   202573    case 10: return 8;
   202574    case 9: return 8;
   202575    case 8: return 8;
   202576    case 7:
   202577       if (devinfo->is_haswell) {
   202578          return 8;
   202579       } else {
   202580          return 8;
   202581       }
   202582    case 6: return 8;
   202583    case 5: return 8;
   202584    case 4:
   202585       if (devinfo->is_g4x) {
   202586          return 8;
   202587       } else {
   202588          return 8;
   202589       }
   202590    default:
   202591       unreachable("Invalid hardware generation");
   202592    }
   202593 }
   202594 
   202595 
   202596 
   202597 #define GEN10_STATE_SIP_3DCommandSubOpcode_start  16
   202598 #define GEN9_STATE_SIP_3DCommandSubOpcode_start  16
   202599 #define GEN8_STATE_SIP_3DCommandSubOpcode_start  16
   202600 #define GEN75_STATE_SIP_3DCommandSubOpcode_start  16
   202601 #define GEN7_STATE_SIP_3DCommandSubOpcode_start  16
   202602 #define GEN6_STATE_SIP_3DCommandSubOpcode_start  16
   202603 #define GEN5_STATE_SIP_3DCommandSubOpcode_start  16
   202604 #define GEN45_STATE_SIP_3DCommandSubOpcode_start  16
   202605 #define GEN4_STATE_SIP_3DCommandSubOpcode_start  16
   202606 
   202607 static inline uint32_t ATTRIBUTE_PURE
   202608 STATE_SIP_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   202609 {
   202610    switch (devinfo->gen) {
   202611    case 10: return 16;
   202612    case 9: return 16;
   202613    case 8: return 16;
   202614    case 7:
   202615       if (devinfo->is_haswell) {
   202616          return 16;
   202617       } else {
   202618          return 16;
   202619       }
   202620    case 6: return 16;
   202621    case 5: return 16;
   202622    case 4:
   202623       if (devinfo->is_g4x) {
   202624          return 16;
   202625       } else {
   202626          return 16;
   202627       }
   202628    default:
   202629       unreachable("Invalid hardware generation");
   202630    }
   202631 }
   202632 
   202633 
   202634 
   202635 /* STATE_SIP::Command SubType */
   202636 
   202637 
   202638 #define GEN10_STATE_SIP_CommandSubType_bits  2
   202639 #define GEN9_STATE_SIP_CommandSubType_bits  2
   202640 #define GEN8_STATE_SIP_CommandSubType_bits  2
   202641 #define GEN75_STATE_SIP_CommandSubType_bits  2
   202642 #define GEN7_STATE_SIP_CommandSubType_bits  2
   202643 #define GEN6_STATE_SIP_CommandSubType_bits  2
   202644 #define GEN5_STATE_SIP_CommandSubType_bits  2
   202645 #define GEN45_STATE_SIP_CommandSubType_bits  2
   202646 #define GEN4_STATE_SIP_CommandSubType_bits  2
   202647 
   202648 static inline uint32_t ATTRIBUTE_PURE
   202649 STATE_SIP_CommandSubType_bits(const struct gen_device_info *devinfo)
   202650 {
   202651    switch (devinfo->gen) {
   202652    case 10: return 2;
   202653    case 9: return 2;
   202654    case 8: return 2;
   202655    case 7:
   202656       if (devinfo->is_haswell) {
   202657          return 2;
   202658       } else {
   202659          return 2;
   202660       }
   202661    case 6: return 2;
   202662    case 5: return 2;
   202663    case 4:
   202664       if (devinfo->is_g4x) {
   202665          return 2;
   202666       } else {
   202667          return 2;
   202668       }
   202669    default:
   202670       unreachable("Invalid hardware generation");
   202671    }
   202672 }
   202673 
   202674 
   202675 
   202676 #define GEN10_STATE_SIP_CommandSubType_start  27
   202677 #define GEN9_STATE_SIP_CommandSubType_start  27
   202678 #define GEN8_STATE_SIP_CommandSubType_start  27
   202679 #define GEN75_STATE_SIP_CommandSubType_start  27
   202680 #define GEN7_STATE_SIP_CommandSubType_start  27
   202681 #define GEN6_STATE_SIP_CommandSubType_start  27
   202682 #define GEN5_STATE_SIP_CommandSubType_start  27
   202683 #define GEN45_STATE_SIP_CommandSubType_start  27
   202684 #define GEN4_STATE_SIP_CommandSubType_start  27
   202685 
   202686 static inline uint32_t ATTRIBUTE_PURE
   202687 STATE_SIP_CommandSubType_start(const struct gen_device_info *devinfo)
   202688 {
   202689    switch (devinfo->gen) {
   202690    case 10: return 27;
   202691    case 9: return 27;
   202692    case 8: return 27;
   202693    case 7:
   202694       if (devinfo->is_haswell) {
   202695          return 27;
   202696       } else {
   202697          return 27;
   202698       }
   202699    case 6: return 27;
   202700    case 5: return 27;
   202701    case 4:
   202702       if (devinfo->is_g4x) {
   202703          return 27;
   202704       } else {
   202705          return 27;
   202706       }
   202707    default:
   202708       unreachable("Invalid hardware generation");
   202709    }
   202710 }
   202711 
   202712 
   202713 
   202714 /* STATE_SIP::Command Type */
   202715 
   202716 
   202717 #define GEN10_STATE_SIP_CommandType_bits  3
   202718 #define GEN9_STATE_SIP_CommandType_bits  3
   202719 #define GEN8_STATE_SIP_CommandType_bits  3
   202720 #define GEN75_STATE_SIP_CommandType_bits  3
   202721 #define GEN7_STATE_SIP_CommandType_bits  3
   202722 #define GEN6_STATE_SIP_CommandType_bits  3
   202723 #define GEN5_STATE_SIP_CommandType_bits  3
   202724 #define GEN45_STATE_SIP_CommandType_bits  3
   202725 #define GEN4_STATE_SIP_CommandType_bits  3
   202726 
   202727 static inline uint32_t ATTRIBUTE_PURE
   202728 STATE_SIP_CommandType_bits(const struct gen_device_info *devinfo)
   202729 {
   202730    switch (devinfo->gen) {
   202731    case 10: return 3;
   202732    case 9: return 3;
   202733    case 8: return 3;
   202734    case 7:
   202735       if (devinfo->is_haswell) {
   202736          return 3;
   202737       } else {
   202738          return 3;
   202739       }
   202740    case 6: return 3;
   202741    case 5: return 3;
   202742    case 4:
   202743       if (devinfo->is_g4x) {
   202744          return 3;
   202745       } else {
   202746          return 3;
   202747       }
   202748    default:
   202749       unreachable("Invalid hardware generation");
   202750    }
   202751 }
   202752 
   202753 
   202754 
   202755 #define GEN10_STATE_SIP_CommandType_start  29
   202756 #define GEN9_STATE_SIP_CommandType_start  29
   202757 #define GEN8_STATE_SIP_CommandType_start  29
   202758 #define GEN75_STATE_SIP_CommandType_start  29
   202759 #define GEN7_STATE_SIP_CommandType_start  29
   202760 #define GEN6_STATE_SIP_CommandType_start  29
   202761 #define GEN5_STATE_SIP_CommandType_start  29
   202762 #define GEN45_STATE_SIP_CommandType_start  29
   202763 #define GEN4_STATE_SIP_CommandType_start  29
   202764 
   202765 static inline uint32_t ATTRIBUTE_PURE
   202766 STATE_SIP_CommandType_start(const struct gen_device_info *devinfo)
   202767 {
   202768    switch (devinfo->gen) {
   202769    case 10: return 29;
   202770    case 9: return 29;
   202771    case 8: return 29;
   202772    case 7:
   202773       if (devinfo->is_haswell) {
   202774          return 29;
   202775       } else {
   202776          return 29;
   202777       }
   202778    case 6: return 29;
   202779    case 5: return 29;
   202780    case 4:
   202781       if (devinfo->is_g4x) {
   202782          return 29;
   202783       } else {
   202784          return 29;
   202785       }
   202786    default:
   202787       unreachable("Invalid hardware generation");
   202788    }
   202789 }
   202790 
   202791 
   202792 
   202793 /* STATE_SIP::DWord Length */
   202794 
   202795 
   202796 #define GEN10_STATE_SIP_DWordLength_bits  8
   202797 #define GEN9_STATE_SIP_DWordLength_bits  8
   202798 #define GEN8_STATE_SIP_DWordLength_bits  8
   202799 #define GEN75_STATE_SIP_DWordLength_bits  8
   202800 #define GEN7_STATE_SIP_DWordLength_bits  8
   202801 #define GEN6_STATE_SIP_DWordLength_bits  8
   202802 #define GEN5_STATE_SIP_DWordLength_bits  8
   202803 #define GEN45_STATE_SIP_DWordLength_bits  8
   202804 #define GEN4_STATE_SIP_DWordLength_bits  8
   202805 
   202806 static inline uint32_t ATTRIBUTE_PURE
   202807 STATE_SIP_DWordLength_bits(const struct gen_device_info *devinfo)
   202808 {
   202809    switch (devinfo->gen) {
   202810    case 10: return 8;
   202811    case 9: return 8;
   202812    case 8: return 8;
   202813    case 7:
   202814       if (devinfo->is_haswell) {
   202815          return 8;
   202816       } else {
   202817          return 8;
   202818       }
   202819    case 6: return 8;
   202820    case 5: return 8;
   202821    case 4:
   202822       if (devinfo->is_g4x) {
   202823          return 8;
   202824       } else {
   202825          return 8;
   202826       }
   202827    default:
   202828       unreachable("Invalid hardware generation");
   202829    }
   202830 }
   202831 
   202832 
   202833 
   202834 #define GEN10_STATE_SIP_DWordLength_start  0
   202835 #define GEN9_STATE_SIP_DWordLength_start  0
   202836 #define GEN8_STATE_SIP_DWordLength_start  0
   202837 #define GEN75_STATE_SIP_DWordLength_start  0
   202838 #define GEN7_STATE_SIP_DWordLength_start  0
   202839 #define GEN6_STATE_SIP_DWordLength_start  0
   202840 #define GEN5_STATE_SIP_DWordLength_start  0
   202841 #define GEN45_STATE_SIP_DWordLength_start  0
   202842 #define GEN4_STATE_SIP_DWordLength_start  0
   202843 
   202844 static inline uint32_t ATTRIBUTE_PURE
   202845 STATE_SIP_DWordLength_start(const struct gen_device_info *devinfo)
   202846 {
   202847    switch (devinfo->gen) {
   202848    case 10: return 0;
   202849    case 9: return 0;
   202850    case 8: return 0;
   202851    case 7:
   202852       if (devinfo->is_haswell) {
   202853          return 0;
   202854       } else {
   202855          return 0;
   202856       }
   202857    case 6: return 0;
   202858    case 5: return 0;
   202859    case 4:
   202860       if (devinfo->is_g4x) {
   202861          return 0;
   202862       } else {
   202863          return 0;
   202864       }
   202865    default:
   202866       unreachable("Invalid hardware generation");
   202867    }
   202868 }
   202869 
   202870 
   202871 
   202872 /* STATE_SIP::System Instruction Pointer */
   202873 
   202874 
   202875 #define GEN10_STATE_SIP_SystemInstructionPointer_bits  60
   202876 #define GEN9_STATE_SIP_SystemInstructionPointer_bits  60
   202877 #define GEN8_STATE_SIP_SystemInstructionPointer_bits  60
   202878 #define GEN75_STATE_SIP_SystemInstructionPointer_bits  28
   202879 #define GEN7_STATE_SIP_SystemInstructionPointer_bits  28
   202880 #define GEN6_STATE_SIP_SystemInstructionPointer_bits  28
   202881 #define GEN5_STATE_SIP_SystemInstructionPointer_bits  28
   202882 #define GEN45_STATE_SIP_SystemInstructionPointer_bits  28
   202883 #define GEN4_STATE_SIP_SystemInstructionPointer_bits  28
   202884 
   202885 static inline uint32_t ATTRIBUTE_PURE
   202886 STATE_SIP_SystemInstructionPointer_bits(const struct gen_device_info *devinfo)
   202887 {
   202888    switch (devinfo->gen) {
   202889    case 10: return 60;
   202890    case 9: return 60;
   202891    case 8: return 60;
   202892    case 7:
   202893       if (devinfo->is_haswell) {
   202894          return 28;
   202895       } else {
   202896          return 28;
   202897       }
   202898    case 6: return 28;
   202899    case 5: return 28;
   202900    case 4:
   202901       if (devinfo->is_g4x) {
   202902          return 28;
   202903       } else {
   202904          return 28;
   202905       }
   202906    default:
   202907       unreachable("Invalid hardware generation");
   202908    }
   202909 }
   202910 
   202911 
   202912 
   202913 #define GEN10_STATE_SIP_SystemInstructionPointer_start  36
   202914 #define GEN9_STATE_SIP_SystemInstructionPointer_start  36
   202915 #define GEN8_STATE_SIP_SystemInstructionPointer_start  36
   202916 #define GEN75_STATE_SIP_SystemInstructionPointer_start  36
   202917 #define GEN7_STATE_SIP_SystemInstructionPointer_start  36
   202918 #define GEN6_STATE_SIP_SystemInstructionPointer_start  36
   202919 #define GEN5_STATE_SIP_SystemInstructionPointer_start  36
   202920 #define GEN45_STATE_SIP_SystemInstructionPointer_start  36
   202921 #define GEN4_STATE_SIP_SystemInstructionPointer_start  36
   202922 
   202923 static inline uint32_t ATTRIBUTE_PURE
   202924 STATE_SIP_SystemInstructionPointer_start(const struct gen_device_info *devinfo)
   202925 {
   202926    switch (devinfo->gen) {
   202927    case 10: return 36;
   202928    case 9: return 36;
   202929    case 8: return 36;
   202930    case 7:
   202931       if (devinfo->is_haswell) {
   202932          return 36;
   202933       } else {
   202934          return 36;
   202935       }
   202936    case 6: return 36;
   202937    case 5: return 36;
   202938    case 4:
   202939       if (devinfo->is_g4x) {
   202940          return 36;
   202941       } else {
   202942          return 36;
   202943       }
   202944    default:
   202945       unreachable("Invalid hardware generation");
   202946    }
   202947 }
   202948 
   202949 
   202950 
   202951 /* SWTESS_BASE_ADDRESS */
   202952 
   202953 
   202954 #define GEN8_SWTESS_BASE_ADDRESS_length  2
   202955 #define GEN75_SWTESS_BASE_ADDRESS_length  2
   202956 #define GEN7_SWTESS_BASE_ADDRESS_length  2
   202957 
   202958 static inline uint32_t ATTRIBUTE_PURE
   202959 SWTESS_BASE_ADDRESS_length(const struct gen_device_info *devinfo)
   202960 {
   202961    switch (devinfo->gen) {
   202962    case 10: return 0;
   202963    case 9: return 0;
   202964    case 8: return 2;
   202965    case 7:
   202966       if (devinfo->is_haswell) {
   202967          return 2;
   202968       } else {
   202969          return 2;
   202970       }
   202971    case 6: return 0;
   202972    case 5: return 0;
   202973    case 4:
   202974       if (devinfo->is_g4x) {
   202975          return 0;
   202976       } else {
   202977          return 0;
   202978       }
   202979    default:
   202980       unreachable("Invalid hardware generation");
   202981    }
   202982 }
   202983 
   202984 
   202985 
   202986 /* SWTESS_BASE_ADDRESS::3D Command Opcode */
   202987 
   202988 
   202989 #define GEN8_SWTESS_BASE_ADDRESS_3DCommandOpcode_bits  3
   202990 #define GEN75_SWTESS_BASE_ADDRESS_3DCommandOpcode_bits  3
   202991 #define GEN7_SWTESS_BASE_ADDRESS_3DCommandOpcode_bits  3
   202992 
   202993 static inline uint32_t ATTRIBUTE_PURE
   202994 SWTESS_BASE_ADDRESS_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   202995 {
   202996    switch (devinfo->gen) {
   202997    case 10: return 0;
   202998    case 9: return 0;
   202999    case 8: return 3;
   203000    case 7:
   203001       if (devinfo->is_haswell) {
   203002          return 3;
   203003       } else {
   203004          return 3;
   203005       }
   203006    case 6: return 0;
   203007    case 5: return 0;
   203008    case 4:
   203009       if (devinfo->is_g4x) {
   203010          return 0;
   203011       } else {
   203012          return 0;
   203013       }
   203014    default:
   203015       unreachable("Invalid hardware generation");
   203016    }
   203017 }
   203018 
   203019 
   203020 
   203021 #define GEN8_SWTESS_BASE_ADDRESS_3DCommandOpcode_start  24
   203022 #define GEN75_SWTESS_BASE_ADDRESS_3DCommandOpcode_start  24
   203023 #define GEN7_SWTESS_BASE_ADDRESS_3DCommandOpcode_start  24
   203024 
   203025 static inline uint32_t ATTRIBUTE_PURE
   203026 SWTESS_BASE_ADDRESS_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   203027 {
   203028    switch (devinfo->gen) {
   203029    case 10: return 0;
   203030    case 9: return 0;
   203031    case 8: return 24;
   203032    case 7:
   203033       if (devinfo->is_haswell) {
   203034          return 24;
   203035       } else {
   203036          return 24;
   203037       }
   203038    case 6: return 0;
   203039    case 5: return 0;
   203040    case 4:
   203041       if (devinfo->is_g4x) {
   203042          return 0;
   203043       } else {
   203044          return 0;
   203045       }
   203046    default:
   203047       unreachable("Invalid hardware generation");
   203048    }
   203049 }
   203050 
   203051 
   203052 
   203053 /* SWTESS_BASE_ADDRESS::3D Command Sub Opcode */
   203054 
   203055 
   203056 #define GEN8_SWTESS_BASE_ADDRESS_3DCommandSubOpcode_bits  8
   203057 #define GEN75_SWTESS_BASE_ADDRESS_3DCommandSubOpcode_bits  8
   203058 #define GEN7_SWTESS_BASE_ADDRESS_3DCommandSubOpcode_bits  8
   203059 
   203060 static inline uint32_t ATTRIBUTE_PURE
   203061 SWTESS_BASE_ADDRESS_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   203062 {
   203063    switch (devinfo->gen) {
   203064    case 10: return 0;
   203065    case 9: return 0;
   203066    case 8: return 8;
   203067    case 7:
   203068       if (devinfo->is_haswell) {
   203069          return 8;
   203070       } else {
   203071          return 8;
   203072       }
   203073    case 6: return 0;
   203074    case 5: return 0;
   203075    case 4:
   203076       if (devinfo->is_g4x) {
   203077          return 0;
   203078       } else {
   203079          return 0;
   203080       }
   203081    default:
   203082       unreachable("Invalid hardware generation");
   203083    }
   203084 }
   203085 
   203086 
   203087 
   203088 #define GEN8_SWTESS_BASE_ADDRESS_3DCommandSubOpcode_start  16
   203089 #define GEN75_SWTESS_BASE_ADDRESS_3DCommandSubOpcode_start  16
   203090 #define GEN7_SWTESS_BASE_ADDRESS_3DCommandSubOpcode_start  16
   203091 
   203092 static inline uint32_t ATTRIBUTE_PURE
   203093 SWTESS_BASE_ADDRESS_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   203094 {
   203095    switch (devinfo->gen) {
   203096    case 10: return 0;
   203097    case 9: return 0;
   203098    case 8: return 16;
   203099    case 7:
   203100       if (devinfo->is_haswell) {
   203101          return 16;
   203102       } else {
   203103          return 16;
   203104       }
   203105    case 6: return 0;
   203106    case 5: return 0;
   203107    case 4:
   203108       if (devinfo->is_g4x) {
   203109          return 0;
   203110       } else {
   203111          return 0;
   203112       }
   203113    default:
   203114       unreachable("Invalid hardware generation");
   203115    }
   203116 }
   203117 
   203118 
   203119 
   203120 /* SWTESS_BASE_ADDRESS::Command SubType */
   203121 
   203122 
   203123 #define GEN8_SWTESS_BASE_ADDRESS_CommandSubType_bits  2
   203124 #define GEN75_SWTESS_BASE_ADDRESS_CommandSubType_bits  2
   203125 #define GEN7_SWTESS_BASE_ADDRESS_CommandSubType_bits  2
   203126 
   203127 static inline uint32_t ATTRIBUTE_PURE
   203128 SWTESS_BASE_ADDRESS_CommandSubType_bits(const struct gen_device_info *devinfo)
   203129 {
   203130    switch (devinfo->gen) {
   203131    case 10: return 0;
   203132    case 9: return 0;
   203133    case 8: return 2;
   203134    case 7:
   203135       if (devinfo->is_haswell) {
   203136          return 2;
   203137       } else {
   203138          return 2;
   203139       }
   203140    case 6: return 0;
   203141    case 5: return 0;
   203142    case 4:
   203143       if (devinfo->is_g4x) {
   203144          return 0;
   203145       } else {
   203146          return 0;
   203147       }
   203148    default:
   203149       unreachable("Invalid hardware generation");
   203150    }
   203151 }
   203152 
   203153 
   203154 
   203155 #define GEN8_SWTESS_BASE_ADDRESS_CommandSubType_start  27
   203156 #define GEN75_SWTESS_BASE_ADDRESS_CommandSubType_start  27
   203157 #define GEN7_SWTESS_BASE_ADDRESS_CommandSubType_start  27
   203158 
   203159 static inline uint32_t ATTRIBUTE_PURE
   203160 SWTESS_BASE_ADDRESS_CommandSubType_start(const struct gen_device_info *devinfo)
   203161 {
   203162    switch (devinfo->gen) {
   203163    case 10: return 0;
   203164    case 9: return 0;
   203165    case 8: return 27;
   203166    case 7:
   203167       if (devinfo->is_haswell) {
   203168          return 27;
   203169       } else {
   203170          return 27;
   203171       }
   203172    case 6: return 0;
   203173    case 5: return 0;
   203174    case 4:
   203175       if (devinfo->is_g4x) {
   203176          return 0;
   203177       } else {
   203178          return 0;
   203179       }
   203180    default:
   203181       unreachable("Invalid hardware generation");
   203182    }
   203183 }
   203184 
   203185 
   203186 
   203187 /* SWTESS_BASE_ADDRESS::Command Type */
   203188 
   203189 
   203190 #define GEN8_SWTESS_BASE_ADDRESS_CommandType_bits  3
   203191 #define GEN75_SWTESS_BASE_ADDRESS_CommandType_bits  3
   203192 #define GEN7_SWTESS_BASE_ADDRESS_CommandType_bits  3
   203193 
   203194 static inline uint32_t ATTRIBUTE_PURE
   203195 SWTESS_BASE_ADDRESS_CommandType_bits(const struct gen_device_info *devinfo)
   203196 {
   203197    switch (devinfo->gen) {
   203198    case 10: return 0;
   203199    case 9: return 0;
   203200    case 8: return 3;
   203201    case 7:
   203202       if (devinfo->is_haswell) {
   203203          return 3;
   203204       } else {
   203205          return 3;
   203206       }
   203207    case 6: return 0;
   203208    case 5: return 0;
   203209    case 4:
   203210       if (devinfo->is_g4x) {
   203211          return 0;
   203212       } else {
   203213          return 0;
   203214       }
   203215    default:
   203216       unreachable("Invalid hardware generation");
   203217    }
   203218 }
   203219 
   203220 
   203221 
   203222 #define GEN8_SWTESS_BASE_ADDRESS_CommandType_start  29
   203223 #define GEN75_SWTESS_BASE_ADDRESS_CommandType_start  29
   203224 #define GEN7_SWTESS_BASE_ADDRESS_CommandType_start  29
   203225 
   203226 static inline uint32_t ATTRIBUTE_PURE
   203227 SWTESS_BASE_ADDRESS_CommandType_start(const struct gen_device_info *devinfo)
   203228 {
   203229    switch (devinfo->gen) {
   203230    case 10: return 0;
   203231    case 9: return 0;
   203232    case 8: return 29;
   203233    case 7:
   203234       if (devinfo->is_haswell) {
   203235          return 29;
   203236       } else {
   203237          return 29;
   203238       }
   203239    case 6: return 0;
   203240    case 5: return 0;
   203241    case 4:
   203242       if (devinfo->is_g4x) {
   203243          return 0;
   203244       } else {
   203245          return 0;
   203246       }
   203247    default:
   203248       unreachable("Invalid hardware generation");
   203249    }
   203250 }
   203251 
   203252 
   203253 
   203254 /* SWTESS_BASE_ADDRESS::DWord Length */
   203255 
   203256 
   203257 #define GEN8_SWTESS_BASE_ADDRESS_DWordLength_bits  8
   203258 #define GEN75_SWTESS_BASE_ADDRESS_DWordLength_bits  8
   203259 #define GEN7_SWTESS_BASE_ADDRESS_DWordLength_bits  8
   203260 
   203261 static inline uint32_t ATTRIBUTE_PURE
   203262 SWTESS_BASE_ADDRESS_DWordLength_bits(const struct gen_device_info *devinfo)
   203263 {
   203264    switch (devinfo->gen) {
   203265    case 10: return 0;
   203266    case 9: return 0;
   203267    case 8: return 8;
   203268    case 7:
   203269       if (devinfo->is_haswell) {
   203270          return 8;
   203271       } else {
   203272          return 8;
   203273       }
   203274    case 6: return 0;
   203275    case 5: return 0;
   203276    case 4:
   203277       if (devinfo->is_g4x) {
   203278          return 0;
   203279       } else {
   203280          return 0;
   203281       }
   203282    default:
   203283       unreachable("Invalid hardware generation");
   203284    }
   203285 }
   203286 
   203287 
   203288 
   203289 #define GEN8_SWTESS_BASE_ADDRESS_DWordLength_start  0
   203290 #define GEN75_SWTESS_BASE_ADDRESS_DWordLength_start  0
   203291 #define GEN7_SWTESS_BASE_ADDRESS_DWordLength_start  0
   203292 
   203293 static inline uint32_t ATTRIBUTE_PURE
   203294 SWTESS_BASE_ADDRESS_DWordLength_start(const struct gen_device_info *devinfo)
   203295 {
   203296    switch (devinfo->gen) {
   203297    case 10: return 0;
   203298    case 9: return 0;
   203299    case 8: return 0;
   203300    case 7:
   203301       if (devinfo->is_haswell) {
   203302          return 0;
   203303       } else {
   203304          return 0;
   203305       }
   203306    case 6: return 0;
   203307    case 5: return 0;
   203308    case 4:
   203309       if (devinfo->is_g4x) {
   203310          return 0;
   203311       } else {
   203312          return 0;
   203313       }
   203314    default:
   203315       unreachable("Invalid hardware generation");
   203316    }
   203317 }
   203318 
   203319 
   203320 
   203321 /* SWTESS_BASE_ADDRESS::SW Tessellation Base Address */
   203322 
   203323 
   203324 #define GEN8_SWTESS_BASE_ADDRESS_SWTessellationBaseAddress_bits  36
   203325 #define GEN75_SWTESS_BASE_ADDRESS_SWTessellationBaseAddress_bits  20
   203326 #define GEN7_SWTESS_BASE_ADDRESS_SWTessellationBaseAddress_bits  20
   203327 
   203328 static inline uint32_t ATTRIBUTE_PURE
   203329 SWTESS_BASE_ADDRESS_SWTessellationBaseAddress_bits(const struct gen_device_info *devinfo)
   203330 {
   203331    switch (devinfo->gen) {
   203332    case 10: return 0;
   203333    case 9: return 0;
   203334    case 8: return 36;
   203335    case 7:
   203336       if (devinfo->is_haswell) {
   203337          return 20;
   203338       } else {
   203339          return 20;
   203340       }
   203341    case 6: return 0;
   203342    case 5: return 0;
   203343    case 4:
   203344       if (devinfo->is_g4x) {
   203345          return 0;
   203346       } else {
   203347          return 0;
   203348       }
   203349    default:
   203350       unreachable("Invalid hardware generation");
   203351    }
   203352 }
   203353 
   203354 
   203355 
   203356 #define GEN8_SWTESS_BASE_ADDRESS_SWTessellationBaseAddress_start  44
   203357 #define GEN75_SWTESS_BASE_ADDRESS_SWTessellationBaseAddress_start  44
   203358 #define GEN7_SWTESS_BASE_ADDRESS_SWTessellationBaseAddress_start  44
   203359 
   203360 static inline uint32_t ATTRIBUTE_PURE
   203361 SWTESS_BASE_ADDRESS_SWTessellationBaseAddress_start(const struct gen_device_info *devinfo)
   203362 {
   203363    switch (devinfo->gen) {
   203364    case 10: return 0;
   203365    case 9: return 0;
   203366    case 8: return 44;
   203367    case 7:
   203368       if (devinfo->is_haswell) {
   203369          return 44;
   203370       } else {
   203371          return 44;
   203372       }
   203373    case 6: return 0;
   203374    case 5: return 0;
   203375    case 4:
   203376       if (devinfo->is_g4x) {
   203377          return 0;
   203378       } else {
   203379          return 0;
   203380       }
   203381    default:
   203382       unreachable("Invalid hardware generation");
   203383    }
   203384 }
   203385 
   203386 
   203387 
   203388 /* SWTESS_BASE_ADDRESS::SW Tessellation Memory Object Control State */
   203389 
   203390 
   203391 #define GEN8_SWTESS_BASE_ADDRESS_SWTessellationMemoryObjectControlState_bits  4
   203392 #define GEN75_SWTESS_BASE_ADDRESS_SWTessellationMemoryObjectControlState_bits  4
   203393 #define GEN7_SWTESS_BASE_ADDRESS_SWTessellationMemoryObjectControlState_bits  4
   203394 
   203395 static inline uint32_t ATTRIBUTE_PURE
   203396 SWTESS_BASE_ADDRESS_SWTessellationMemoryObjectControlState_bits(const struct gen_device_info *devinfo)
   203397 {
   203398    switch (devinfo->gen) {
   203399    case 10: return 0;
   203400    case 9: return 0;
   203401    case 8: return 4;
   203402    case 7:
   203403       if (devinfo->is_haswell) {
   203404          return 4;
   203405       } else {
   203406          return 4;
   203407       }
   203408    case 6: return 0;
   203409    case 5: return 0;
   203410    case 4:
   203411       if (devinfo->is_g4x) {
   203412          return 0;
   203413       } else {
   203414          return 0;
   203415       }
   203416    default:
   203417       unreachable("Invalid hardware generation");
   203418    }
   203419 }
   203420 
   203421 
   203422 
   203423 #define GEN8_SWTESS_BASE_ADDRESS_SWTessellationMemoryObjectControlState_start  40
   203424 #define GEN75_SWTESS_BASE_ADDRESS_SWTessellationMemoryObjectControlState_start  40
   203425 #define GEN7_SWTESS_BASE_ADDRESS_SWTessellationMemoryObjectControlState_start  40
   203426 
   203427 static inline uint32_t ATTRIBUTE_PURE
   203428 SWTESS_BASE_ADDRESS_SWTessellationMemoryObjectControlState_start(const struct gen_device_info *devinfo)
   203429 {
   203430    switch (devinfo->gen) {
   203431    case 10: return 0;
   203432    case 9: return 0;
   203433    case 8: return 40;
   203434    case 7:
   203435       if (devinfo->is_haswell) {
   203436          return 40;
   203437       } else {
   203438          return 40;
   203439       }
   203440    case 6: return 0;
   203441    case 5: return 0;
   203442    case 4:
   203443       if (devinfo->is_g4x) {
   203444          return 0;
   203445       } else {
   203446          return 0;
   203447       }
   203448    default:
   203449       unreachable("Invalid hardware generation");
   203450    }
   203451 }
   203452 
   203453 
   203454 
   203455 /* URB_FENCE */
   203456 
   203457 
   203458 #define GEN5_URB_FENCE_length  3
   203459 #define GEN45_URB_FENCE_length  3
   203460 #define GEN4_URB_FENCE_length  3
   203461 
   203462 static inline uint32_t ATTRIBUTE_PURE
   203463 URB_FENCE_length(const struct gen_device_info *devinfo)
   203464 {
   203465    switch (devinfo->gen) {
   203466    case 10: return 0;
   203467    case 9: return 0;
   203468    case 8: return 0;
   203469    case 7:
   203470       if (devinfo->is_haswell) {
   203471          return 0;
   203472       } else {
   203473          return 0;
   203474       }
   203475    case 6: return 0;
   203476    case 5: return 3;
   203477    case 4:
   203478       if (devinfo->is_g4x) {
   203479          return 3;
   203480       } else {
   203481          return 3;
   203482       }
   203483    default:
   203484       unreachable("Invalid hardware generation");
   203485    }
   203486 }
   203487 
   203488 
   203489 
   203490 /* URB_FENCE::3D Command Opcode */
   203491 
   203492 
   203493 #define GEN5_URB_FENCE_3DCommandOpcode_bits  3
   203494 #define GEN45_URB_FENCE_3DCommandOpcode_bits  3
   203495 #define GEN4_URB_FENCE_3DCommandOpcode_bits  3
   203496 
   203497 static inline uint32_t ATTRIBUTE_PURE
   203498 URB_FENCE_3DCommandOpcode_bits(const struct gen_device_info *devinfo)
   203499 {
   203500    switch (devinfo->gen) {
   203501    case 10: return 0;
   203502    case 9: return 0;
   203503    case 8: return 0;
   203504    case 7:
   203505       if (devinfo->is_haswell) {
   203506          return 0;
   203507       } else {
   203508          return 0;
   203509       }
   203510    case 6: return 0;
   203511    case 5: return 3;
   203512    case 4:
   203513       if (devinfo->is_g4x) {
   203514          return 3;
   203515       } else {
   203516          return 3;
   203517       }
   203518    default:
   203519       unreachable("Invalid hardware generation");
   203520    }
   203521 }
   203522 
   203523 
   203524 
   203525 #define GEN5_URB_FENCE_3DCommandOpcode_start  24
   203526 #define GEN45_URB_FENCE_3DCommandOpcode_start  24
   203527 #define GEN4_URB_FENCE_3DCommandOpcode_start  24
   203528 
   203529 static inline uint32_t ATTRIBUTE_PURE
   203530 URB_FENCE_3DCommandOpcode_start(const struct gen_device_info *devinfo)
   203531 {
   203532    switch (devinfo->gen) {
   203533    case 10: return 0;
   203534    case 9: return 0;
   203535    case 8: return 0;
   203536    case 7:
   203537       if (devinfo->is_haswell) {
   203538          return 0;
   203539       } else {
   203540          return 0;
   203541       }
   203542    case 6: return 0;
   203543    case 5: return 24;
   203544    case 4:
   203545       if (devinfo->is_g4x) {
   203546          return 24;
   203547       } else {
   203548          return 24;
   203549       }
   203550    default:
   203551       unreachable("Invalid hardware generation");
   203552    }
   203553 }
   203554 
   203555 
   203556 
   203557 /* URB_FENCE::3D Command Sub Opcode */
   203558 
   203559 
   203560 #define GEN5_URB_FENCE_3DCommandSubOpcode_bits  8
   203561 #define GEN45_URB_FENCE_3DCommandSubOpcode_bits  8
   203562 #define GEN4_URB_FENCE_3DCommandSubOpcode_bits  8
   203563 
   203564 static inline uint32_t ATTRIBUTE_PURE
   203565 URB_FENCE_3DCommandSubOpcode_bits(const struct gen_device_info *devinfo)
   203566 {
   203567    switch (devinfo->gen) {
   203568    case 10: return 0;
   203569    case 9: return 0;
   203570    case 8: return 0;
   203571    case 7:
   203572       if (devinfo->is_haswell) {
   203573          return 0;
   203574       } else {
   203575          return 0;
   203576       }
   203577    case 6: return 0;
   203578    case 5: return 8;
   203579    case 4:
   203580       if (devinfo->is_g4x) {
   203581          return 8;
   203582       } else {
   203583          return 8;
   203584       }
   203585    default:
   203586       unreachable("Invalid hardware generation");
   203587    }
   203588 }
   203589 
   203590 
   203591 
   203592 #define GEN5_URB_FENCE_3DCommandSubOpcode_start  16
   203593 #define GEN45_URB_FENCE_3DCommandSubOpcode_start  16
   203594 #define GEN4_URB_FENCE_3DCommandSubOpcode_start  16
   203595 
   203596 static inline uint32_t ATTRIBUTE_PURE
   203597 URB_FENCE_3DCommandSubOpcode_start(const struct gen_device_info *devinfo)
   203598 {
   203599    switch (devinfo->gen) {
   203600    case 10: return 0;
   203601    case 9: return 0;
   203602    case 8: return 0;
   203603    case 7:
   203604       if (devinfo->is_haswell) {
   203605          return 0;
   203606       } else {
   203607          return 0;
   203608       }
   203609    case 6: return 0;
   203610    case 5: return 16;
   203611    case 4:
   203612       if (devinfo->is_g4x) {
   203613          return 16;
   203614       } else {
   203615          return 16;
   203616       }
   203617    default:
   203618       unreachable("Invalid hardware generation");
   203619    }
   203620 }
   203621 
   203622 
   203623 
   203624 /* URB_FENCE::CLIP Fence */
   203625 
   203626 
   203627 #define GEN5_URB_FENCE_CLIPFence_bits  10
   203628 #define GEN45_URB_FENCE_CLIPFence_bits  10
   203629 #define GEN4_URB_FENCE_CLIPFence_bits  10
   203630 
   203631 static inline uint32_t ATTRIBUTE_PURE
   203632 URB_FENCE_CLIPFence_bits(const struct gen_device_info *devinfo)
   203633 {
   203634    switch (devinfo->gen) {
   203635    case 10: return 0;
   203636    case 9: return 0;
   203637    case 8: return 0;
   203638    case 7:
   203639       if (devinfo->is_haswell) {
   203640          return 0;
   203641       } else {
   203642          return 0;
   203643       }
   203644    case 6: return 0;
   203645    case 5: return 10;
   203646    case 4:
   203647       if (devinfo->is_g4x) {
   203648          return 10;
   203649       } else {
   203650          return 10;
   203651       }
   203652    default:
   203653       unreachable("Invalid hardware generation");
   203654    }
   203655 }
   203656 
   203657 
   203658 
   203659 #define GEN5_URB_FENCE_CLIPFence_start  52
   203660 #define GEN45_URB_FENCE_CLIPFence_start  52
   203661 #define GEN4_URB_FENCE_CLIPFence_start  52
   203662 
   203663 static inline uint32_t ATTRIBUTE_PURE
   203664 URB_FENCE_CLIPFence_start(const struct gen_device_info *devinfo)
   203665 {
   203666    switch (devinfo->gen) {
   203667    case 10: return 0;
   203668    case 9: return 0;
   203669    case 8: return 0;
   203670    case 7:
   203671       if (devinfo->is_haswell) {
   203672          return 0;
   203673       } else {
   203674          return 0;
   203675       }
   203676    case 6: return 0;
   203677    case 5: return 52;
   203678    case 4:
   203679       if (devinfo->is_g4x) {
   203680          return 52;
   203681       } else {
   203682          return 52;
   203683       }
   203684    default:
   203685       unreachable("Invalid hardware generation");
   203686    }
   203687 }
   203688 
   203689 
   203690 
   203691 /* URB_FENCE::CLIP Unit URB Reallocation Request */
   203692 
   203693 
   203694 #define GEN5_URB_FENCE_CLIPUnitURBReallocationRequest_bits  1
   203695 #define GEN45_URB_FENCE_CLIPUnitURBReallocationRequest_bits  1
   203696 #define GEN4_URB_FENCE_CLIPUnitURBReallocationRequest_bits  1
   203697 
   203698 static inline uint32_t ATTRIBUTE_PURE
   203699 URB_FENCE_CLIPUnitURBReallocationRequest_bits(const struct gen_device_info *devinfo)
   203700 {
   203701    switch (devinfo->gen) {
   203702    case 10: return 0;
   203703    case 9: return 0;
   203704    case 8: return 0;
   203705    case 7:
   203706       if (devinfo->is_haswell) {
   203707          return 0;
   203708       } else {
   203709          return 0;
   203710       }
   203711    case 6: return 0;
   203712    case 5: return 1;
   203713    case 4:
   203714       if (devinfo->is_g4x) {
   203715          return 1;
   203716       } else {
   203717          return 1;
   203718       }
   203719    default:
   203720       unreachable("Invalid hardware generation");
   203721    }
   203722 }
   203723 
   203724 
   203725 
   203726 #define GEN5_URB_FENCE_CLIPUnitURBReallocationRequest_start  10
   203727 #define GEN45_URB_FENCE_CLIPUnitURBReallocationRequest_start  10
   203728 #define GEN4_URB_FENCE_CLIPUnitURBReallocationRequest_start  10
   203729 
   203730 static inline uint32_t ATTRIBUTE_PURE
   203731 URB_FENCE_CLIPUnitURBReallocationRequest_start(const struct gen_device_info *devinfo)
   203732 {
   203733    switch (devinfo->gen) {
   203734    case 10: return 0;
   203735    case 9: return 0;
   203736    case 8: return 0;
   203737    case 7:
   203738       if (devinfo->is_haswell) {
   203739          return 0;
   203740       } else {
   203741          return 0;
   203742       }
   203743    case 6: return 0;
   203744    case 5: return 10;
   203745    case 4:
   203746       if (devinfo->is_g4x) {
   203747          return 10;
   203748       } else {
   203749          return 10;
   203750       }
   203751    default:
   203752       unreachable("Invalid hardware generation");
   203753    }
   203754 }
   203755 
   203756 
   203757 
   203758 /* URB_FENCE::CS Fence */
   203759 
   203760 
   203761 #define GEN5_URB_FENCE_CSFence_bits  11
   203762 #define GEN45_URB_FENCE_CSFence_bits  11
   203763 #define GEN4_URB_FENCE_CSFence_bits  11
   203764 
   203765 static inline uint32_t ATTRIBUTE_PURE
   203766 URB_FENCE_CSFence_bits(const struct gen_device_info *devinfo)
   203767 {
   203768    switch (devinfo->gen) {
   203769    case 10: return 0;
   203770    case 9: return 0;
   203771    case 8: return 0;
   203772    case 7:
   203773       if (devinfo->is_haswell) {
   203774          return 0;
   203775       } else {
   203776          return 0;
   203777       }
   203778    case 6: return 0;
   203779    case 5: return 11;
   203780    case 4:
   203781       if (devinfo->is_g4x) {
   203782          return 11;
   203783       } else {
   203784          return 11;
   203785       }
   203786    default:
   203787       unreachable("Invalid hardware generation");
   203788    }
   203789 }
   203790 
   203791 
   203792 
   203793 #define GEN5_URB_FENCE_CSFence_start  84
   203794 #define GEN45_URB_FENCE_CSFence_start  84
   203795 #define GEN4_URB_FENCE_CSFence_start  84
   203796 
   203797 static inline uint32_t ATTRIBUTE_PURE
   203798 URB_FENCE_CSFence_start(const struct gen_device_info *devinfo)
   203799 {
   203800    switch (devinfo->gen) {
   203801    case 10: return 0;
   203802    case 9: return 0;
   203803    case 8: return 0;
   203804    case 7:
   203805       if (devinfo->is_haswell) {
   203806          return 0;
   203807       } else {
   203808          return 0;
   203809       }
   203810    case 6: return 0;
   203811    case 5: return 84;
   203812    case 4:
   203813       if (devinfo->is_g4x) {
   203814          return 84;
   203815       } else {
   203816          return 84;
   203817       }
   203818    default:
   203819       unreachable("Invalid hardware generation");
   203820    }
   203821 }
   203822 
   203823 
   203824 
   203825 /* URB_FENCE::CS Unit URB Reallocation Request */
   203826 
   203827 
   203828 #define GEN5_URB_FENCE_CSUnitURBReallocationRequest_bits  1
   203829 #define GEN45_URB_FENCE_CSUnitURBReallocationRequest_bits  1
   203830 #define GEN4_URB_FENCE_CSUnitURBReallocationRequest_bits  1
   203831 
   203832 static inline uint32_t ATTRIBUTE_PURE
   203833 URB_FENCE_CSUnitURBReallocationRequest_bits(const struct gen_device_info *devinfo)
   203834 {
   203835    switch (devinfo->gen) {
   203836    case 10: return 0;
   203837    case 9: return 0;
   203838    case 8: return 0;
   203839    case 7:
   203840       if (devinfo->is_haswell) {
   203841          return 0;
   203842       } else {
   203843          return 0;
   203844       }
   203845    case 6: return 0;
   203846    case 5: return 1;
   203847    case 4:
   203848       if (devinfo->is_g4x) {
   203849          return 1;
   203850       } else {
   203851          return 1;
   203852       }
   203853    default:
   203854       unreachable("Invalid hardware generation");
   203855    }
   203856 }
   203857 
   203858 
   203859 
   203860 #define GEN5_URB_FENCE_CSUnitURBReallocationRequest_start  13
   203861 #define GEN45_URB_FENCE_CSUnitURBReallocationRequest_start  13
   203862 #define GEN4_URB_FENCE_CSUnitURBReallocationRequest_start  13
   203863 
   203864 static inline uint32_t ATTRIBUTE_PURE
   203865 URB_FENCE_CSUnitURBReallocationRequest_start(const struct gen_device_info *devinfo)
   203866 {
   203867    switch (devinfo->gen) {
   203868    case 10: return 0;
   203869    case 9: return 0;
   203870    case 8: return 0;
   203871    case 7:
   203872       if (devinfo->is_haswell) {
   203873          return 0;
   203874       } else {
   203875          return 0;
   203876       }
   203877    case 6: return 0;
   203878    case 5: return 13;
   203879    case 4:
   203880       if (devinfo->is_g4x) {
   203881          return 13;
   203882       } else {
   203883          return 13;
   203884       }
   203885    default:
   203886       unreachable("Invalid hardware generation");
   203887    }
   203888 }
   203889 
   203890 
   203891 
   203892 /* URB_FENCE::Command SubType */
   203893 
   203894 
   203895 #define GEN5_URB_FENCE_CommandSubType_bits  2
   203896 #define GEN45_URB_FENCE_CommandSubType_bits  2
   203897 #define GEN4_URB_FENCE_CommandSubType_bits  2
   203898 
   203899 static inline uint32_t ATTRIBUTE_PURE
   203900 URB_FENCE_CommandSubType_bits(const struct gen_device_info *devinfo)
   203901 {
   203902    switch (devinfo->gen) {
   203903    case 10: return 0;
   203904    case 9: return 0;
   203905    case 8: return 0;
   203906    case 7:
   203907       if (devinfo->is_haswell) {
   203908          return 0;
   203909       } else {
   203910          return 0;
   203911       }
   203912    case 6: return 0;
   203913    case 5: return 2;
   203914    case 4:
   203915       if (devinfo->is_g4x) {
   203916          return 2;
   203917       } else {
   203918          return 2;
   203919       }
   203920    default:
   203921       unreachable("Invalid hardware generation");
   203922    }
   203923 }
   203924 
   203925 
   203926 
   203927 #define GEN5_URB_FENCE_CommandSubType_start  27
   203928 #define GEN45_URB_FENCE_CommandSubType_start  27
   203929 #define GEN4_URB_FENCE_CommandSubType_start  27
   203930 
   203931 static inline uint32_t ATTRIBUTE_PURE
   203932 URB_FENCE_CommandSubType_start(const struct gen_device_info *devinfo)
   203933 {
   203934    switch (devinfo->gen) {
   203935    case 10: return 0;
   203936    case 9: return 0;
   203937    case 8: return 0;
   203938    case 7:
   203939       if (devinfo->is_haswell) {
   203940          return 0;
   203941       } else {
   203942          return 0;
   203943       }
   203944    case 6: return 0;
   203945    case 5: return 27;
   203946    case 4:
   203947       if (devinfo->is_g4x) {
   203948          return 27;
   203949       } else {
   203950          return 27;
   203951       }
   203952    default:
   203953       unreachable("Invalid hardware generation");
   203954    }
   203955 }
   203956 
   203957 
   203958 
   203959 /* URB_FENCE::Command Type */
   203960 
   203961 
   203962 #define GEN5_URB_FENCE_CommandType_bits  3
   203963 #define GEN45_URB_FENCE_CommandType_bits  3
   203964 #define GEN4_URB_FENCE_CommandType_bits  3
   203965 
   203966 static inline uint32_t ATTRIBUTE_PURE
   203967 URB_FENCE_CommandType_bits(const struct gen_device_info *devinfo)
   203968 {
   203969    switch (devinfo->gen) {
   203970    case 10: return 0;
   203971    case 9: return 0;
   203972    case 8: return 0;
   203973    case 7:
   203974       if (devinfo->is_haswell) {
   203975          return 0;
   203976       } else {
   203977          return 0;
   203978       }
   203979    case 6: return 0;
   203980    case 5: return 3;
   203981    case 4:
   203982       if (devinfo->is_g4x) {
   203983          return 3;
   203984       } else {
   203985          return 3;
   203986       }
   203987    default:
   203988       unreachable("Invalid hardware generation");
   203989    }
   203990 }
   203991 
   203992 
   203993 
   203994 #define GEN5_URB_FENCE_CommandType_start  29
   203995 #define GEN45_URB_FENCE_CommandType_start  29
   203996 #define GEN4_URB_FENCE_CommandType_start  29
   203997 
   203998 static inline uint32_t ATTRIBUTE_PURE
   203999 URB_FENCE_CommandType_start(const struct gen_device_info *devinfo)
   204000 {
   204001    switch (devinfo->gen) {
   204002    case 10: return 0;
   204003    case 9: return 0;
   204004    case 8: return 0;
   204005    case 7:
   204006       if (devinfo->is_haswell) {
   204007          return 0;
   204008       } else {
   204009          return 0;
   204010       }
   204011    case 6: return 0;
   204012    case 5: return 29;
   204013    case 4:
   204014       if (devinfo->is_g4x) {
   204015          return 29;
   204016       } else {
   204017          return 29;
   204018       }
   204019    default:
   204020       unreachable("Invalid hardware generation");
   204021    }
   204022 }
   204023 
   204024 
   204025 
   204026 /* URB_FENCE::DWord Length */
   204027 
   204028 
   204029 #define GEN5_URB_FENCE_DWordLength_bits  8
   204030 #define GEN45_URB_FENCE_DWordLength_bits  8
   204031 #define GEN4_URB_FENCE_DWordLength_bits  8
   204032 
   204033 static inline uint32_t ATTRIBUTE_PURE
   204034 URB_FENCE_DWordLength_bits(const struct gen_device_info *devinfo)
   204035 {
   204036    switch (devinfo->gen) {
   204037    case 10: return 0;
   204038    case 9: return 0;
   204039    case 8: return 0;
   204040    case 7:
   204041       if (devinfo->is_haswell) {
   204042          return 0;
   204043       } else {
   204044          return 0;
   204045       }
   204046    case 6: return 0;
   204047    case 5: return 8;
   204048    case 4:
   204049       if (devinfo->is_g4x) {
   204050          return 8;
   204051       } else {
   204052          return 8;
   204053       }
   204054    default:
   204055       unreachable("Invalid hardware generation");
   204056    }
   204057 }
   204058 
   204059 
   204060 
   204061 #define GEN5_URB_FENCE_DWordLength_start  0
   204062 #define GEN45_URB_FENCE_DWordLength_start  0
   204063 #define GEN4_URB_FENCE_DWordLength_start  0
   204064 
   204065 static inline uint32_t ATTRIBUTE_PURE
   204066 URB_FENCE_DWordLength_start(const struct gen_device_info *devinfo)
   204067 {
   204068    switch (devinfo->gen) {
   204069    case 10: return 0;
   204070    case 9: return 0;
   204071    case 8: return 0;
   204072    case 7:
   204073       if (devinfo->is_haswell) {
   204074          return 0;
   204075       } else {
   204076          return 0;
   204077       }
   204078    case 6: return 0;
   204079    case 5: return 0;
   204080    case 4:
   204081       if (devinfo->is_g4x) {
   204082          return 0;
   204083       } else {
   204084          return 0;
   204085       }
   204086    default:
   204087       unreachable("Invalid hardware generation");
   204088    }
   204089 }
   204090 
   204091 
   204092 
   204093 /* URB_FENCE::GS Fence */
   204094 
   204095 
   204096 #define GEN5_URB_FENCE_GSFence_bits  10
   204097 #define GEN45_URB_FENCE_GSFence_bits  10
   204098 #define GEN4_URB_FENCE_GSFence_bits  10
   204099 
   204100 static inline uint32_t ATTRIBUTE_PURE
   204101 URB_FENCE_GSFence_bits(const struct gen_device_info *devinfo)
   204102 {
   204103    switch (devinfo->gen) {
   204104    case 10: return 0;
   204105    case 9: return 0;
   204106    case 8: return 0;
   204107    case 7:
   204108       if (devinfo->is_haswell) {
   204109          return 0;
   204110       } else {
   204111          return 0;
   204112       }
   204113    case 6: return 0;
   204114    case 5: return 10;
   204115    case 4:
   204116       if (devinfo->is_g4x) {
   204117          return 10;
   204118       } else {
   204119          return 10;
   204120       }
   204121    default:
   204122       unreachable("Invalid hardware generation");
   204123    }
   204124 }
   204125 
   204126 
   204127 
   204128 #define GEN5_URB_FENCE_GSFence_start  42
   204129 #define GEN45_URB_FENCE_GSFence_start  42
   204130 #define GEN4_URB_FENCE_GSFence_start  42
   204131 
   204132 static inline uint32_t ATTRIBUTE_PURE
   204133 URB_FENCE_GSFence_start(const struct gen_device_info *devinfo)
   204134 {
   204135    switch (devinfo->gen) {
   204136    case 10: return 0;
   204137    case 9: return 0;
   204138    case 8: return 0;
   204139    case 7:
   204140       if (devinfo->is_haswell) {
   204141          return 0;
   204142       } else {
   204143          return 0;
   204144       }
   204145    case 6: return 0;
   204146    case 5: return 42;
   204147    case 4:
   204148       if (devinfo->is_g4x) {
   204149          return 42;
   204150       } else {
   204151          return 42;
   204152       }
   204153    default:
   204154       unreachable("Invalid hardware generation");
   204155    }
   204156 }
   204157 
   204158 
   204159 
   204160 /* URB_FENCE::GS Unit URB Reallocation Request */
   204161 
   204162 
   204163 #define GEN5_URB_FENCE_GSUnitURBReallocationRequest_bits  1
   204164 #define GEN45_URB_FENCE_GSUnitURBReallocationRequest_bits  1
   204165 #define GEN4_URB_FENCE_GSUnitURBReallocationRequest_bits  1
   204166 
   204167 static inline uint32_t ATTRIBUTE_PURE
   204168 URB_FENCE_GSUnitURBReallocationRequest_bits(const struct gen_device_info *devinfo)
   204169 {
   204170    switch (devinfo->gen) {
   204171    case 10: return 0;
   204172    case 9: return 0;
   204173    case 8: return 0;
   204174    case 7:
   204175       if (devinfo->is_haswell) {
   204176          return 0;
   204177       } else {
   204178          return 0;
   204179       }
   204180    case 6: return 0;
   204181    case 5: return 1;
   204182    case 4:
   204183       if (devinfo->is_g4x) {
   204184          return 1;
   204185       } else {
   204186          return 1;
   204187       }
   204188    default:
   204189       unreachable("Invalid hardware generation");
   204190    }
   204191 }
   204192 
   204193 
   204194 
   204195 #define GEN5_URB_FENCE_GSUnitURBReallocationRequest_start  9
   204196 #define GEN45_URB_FENCE_GSUnitURBReallocationRequest_start  9
   204197 #define GEN4_URB_FENCE_GSUnitURBReallocationRequest_start  9
   204198 
   204199 static inline uint32_t ATTRIBUTE_PURE
   204200 URB_FENCE_GSUnitURBReallocationRequest_start(const struct gen_device_info *devinfo)
   204201 {
   204202    switch (devinfo->gen) {
   204203    case 10: return 0;
   204204    case 9: return 0;
   204205    case 8: return 0;
   204206    case 7:
   204207       if (devinfo->is_haswell) {
   204208          return 0;
   204209       } else {
   204210          return 0;
   204211       }
   204212    case 6: return 0;
   204213    case 5: return 9;
   204214    case 4:
   204215       if (devinfo->is_g4x) {
   204216          return 9;
   204217       } else {
   204218          return 9;
   204219       }
   204220    default:
   204221       unreachable("Invalid hardware generation");
   204222    }
   204223 }
   204224 
   204225 
   204226 
   204227 /* URB_FENCE::SF Fence */
   204228 
   204229 
   204230 #define GEN5_URB_FENCE_SFFence_bits  10
   204231 #define GEN45_URB_FENCE_SFFence_bits  10
   204232 #define GEN4_URB_FENCE_SFFence_bits  10
   204233 
   204234 static inline uint32_t ATTRIBUTE_PURE
   204235 URB_FENCE_SFFence_bits(const struct gen_device_info *devinfo)
   204236 {
   204237    switch (devinfo->gen) {
   204238    case 10: return 0;
   204239    case 9: return 0;
   204240    case 8: return 0;
   204241    case 7:
   204242       if (devinfo->is_haswell) {
   204243          return 0;
   204244       } else {
   204245          return 0;
   204246       }
   204247    case 6: return 0;
   204248    case 5: return 10;
   204249    case 4:
   204250       if (devinfo->is_g4x) {
   204251          return 10;
   204252       } else {
   204253          return 10;
   204254       }
   204255    default:
   204256       unreachable("Invalid hardware generation");
   204257    }
   204258 }
   204259 
   204260 
   204261 
   204262 #define GEN5_URB_FENCE_SFFence_start  64
   204263 #define GEN45_URB_FENCE_SFFence_start  64
   204264 #define GEN4_URB_FENCE_SFFence_start  64
   204265 
   204266 static inline uint32_t ATTRIBUTE_PURE
   204267 URB_FENCE_SFFence_start(const struct gen_device_info *devinfo)
   204268 {
   204269    switch (devinfo->gen) {
   204270    case 10: return 0;
   204271    case 9: return 0;
   204272    case 8: return 0;
   204273    case 7:
   204274       if (devinfo->is_haswell) {
   204275          return 0;
   204276       } else {
   204277          return 0;
   204278       }
   204279    case 6: return 0;
   204280    case 5: return 64;
   204281    case 4:
   204282       if (devinfo->is_g4x) {
   204283          return 64;
   204284       } else {
   204285          return 64;
   204286       }
   204287    default:
   204288       unreachable("Invalid hardware generation");
   204289    }
   204290 }
   204291 
   204292 
   204293 
   204294 /* URB_FENCE::SF Unit URB Reallocation Request */
   204295 
   204296 
   204297 #define GEN5_URB_FENCE_SFUnitURBReallocationRequest_bits  1
   204298 #define GEN45_URB_FENCE_SFUnitURBReallocationRequest_bits  1
   204299 #define GEN4_URB_FENCE_SFUnitURBReallocationRequest_bits  1
   204300 
   204301 static inline uint32_t ATTRIBUTE_PURE
   204302 URB_FENCE_SFUnitURBReallocationRequest_bits(const struct gen_device_info *devinfo)
   204303 {
   204304    switch (devinfo->gen) {
   204305    case 10: return 0;
   204306    case 9: return 0;
   204307    case 8: return 0;
   204308    case 7:
   204309       if (devinfo->is_haswell) {
   204310          return 0;
   204311       } else {
   204312          return 0;
   204313       }
   204314    case 6: return 0;
   204315    case 5: return 1;
   204316    case 4:
   204317       if (devinfo->is_g4x) {
   204318          return 1;
   204319       } else {
   204320          return 1;
   204321       }
   204322    default:
   204323       unreachable("Invalid hardware generation");
   204324    }
   204325 }
   204326 
   204327 
   204328 
   204329 #define GEN5_URB_FENCE_SFUnitURBReallocationRequest_start  11
   204330 #define GEN45_URB_FENCE_SFUnitURBReallocationRequest_start  11
   204331 #define GEN4_URB_FENCE_SFUnitURBReallocationRequest_start  11
   204332 
   204333 static inline uint32_t ATTRIBUTE_PURE
   204334 URB_FENCE_SFUnitURBReallocationRequest_start(const struct gen_device_info *devinfo)
   204335 {
   204336    switch (devinfo->gen) {
   204337    case 10: return 0;
   204338    case 9: return 0;
   204339    case 8: return 0;
   204340    case 7:
   204341       if (devinfo->is_haswell) {
   204342          return 0;
   204343       } else {
   204344          return 0;
   204345       }
   204346    case 6: return 0;
   204347    case 5: return 11;
   204348    case 4:
   204349       if (devinfo->is_g4x) {
   204350          return 11;
   204351       } else {
   204352          return 11;
   204353       }
   204354    default:
   204355       unreachable("Invalid hardware generation");
   204356    }
   204357 }
   204358 
   204359 
   204360 
   204361 /* URB_FENCE::VFE Fence */
   204362 
   204363 
   204364 #define GEN5_URB_FENCE_VFEFence_bits  10
   204365 #define GEN45_URB_FENCE_VFEFence_bits  10
   204366 #define GEN4_URB_FENCE_VFEFence_bits  10
   204367 
   204368 static inline uint32_t ATTRIBUTE_PURE
   204369 URB_FENCE_VFEFence_bits(const struct gen_device_info *devinfo)
   204370 {
   204371    switch (devinfo->gen) {
   204372    case 10: return 0;
   204373    case 9: return 0;
   204374    case 8: return 0;
   204375    case 7:
   204376       if (devinfo->is_haswell) {
   204377          return 0;
   204378       } else {
   204379          return 0;
   204380       }
   204381    case 6: return 0;
   204382    case 5: return 10;
   204383    case 4:
   204384       if (devinfo->is_g4x) {
   204385          return 10;
   204386       } else {
   204387          return 10;
   204388       }
   204389    default:
   204390       unreachable("Invalid hardware generation");
   204391    }
   204392 }
   204393 
   204394 
   204395 
   204396 #define GEN5_URB_FENCE_VFEFence_start  74
   204397 #define GEN45_URB_FENCE_VFEFence_start  74
   204398 #define GEN4_URB_FENCE_VFEFence_start  74
   204399 
   204400 static inline uint32_t ATTRIBUTE_PURE
   204401 URB_FENCE_VFEFence_start(const struct gen_device_info *devinfo)
   204402 {
   204403    switch (devinfo->gen) {
   204404    case 10: return 0;
   204405    case 9: return 0;
   204406    case 8: return 0;
   204407    case 7:
   204408       if (devinfo->is_haswell) {
   204409          return 0;
   204410       } else {
   204411          return 0;
   204412       }
   204413    case 6: return 0;
   204414    case 5: return 74;
   204415    case 4:
   204416       if (devinfo->is_g4x) {
   204417          return 74;
   204418       } else {
   204419          return 74;
   204420       }
   204421    default:
   204422       unreachable("Invalid hardware generation");
   204423    }
   204424 }
   204425 
   204426 
   204427 
   204428 /* URB_FENCE::VFE Unit URB Reallocation Request */
   204429 
   204430 
   204431 #define GEN5_URB_FENCE_VFEUnitURBReallocationRequest_bits  1
   204432 #define GEN45_URB_FENCE_VFEUnitURBReallocationRequest_bits  1
   204433 #define GEN4_URB_FENCE_VFEUnitURBReallocationRequest_bits  1
   204434 
   204435 static inline uint32_t ATTRIBUTE_PURE
   204436 URB_FENCE_VFEUnitURBReallocationRequest_bits(const struct gen_device_info *devinfo)
   204437 {
   204438    switch (devinfo->gen) {
   204439    case 10: return 0;
   204440    case 9: return 0;
   204441    case 8: return 0;
   204442    case 7:
   204443       if (devinfo->is_haswell) {
   204444          return 0;
   204445       } else {
   204446          return 0;
   204447       }
   204448    case 6: return 0;
   204449    case 5: return 1;
   204450    case 4:
   204451       if (devinfo->is_g4x) {
   204452          return 1;
   204453       } else {
   204454          return 1;
   204455       }
   204456    default:
   204457       unreachable("Invalid hardware generation");
   204458    }
   204459 }
   204460 
   204461 
   204462 
   204463 #define GEN5_URB_FENCE_VFEUnitURBReallocationRequest_start  12
   204464 #define GEN45_URB_FENCE_VFEUnitURBReallocationRequest_start  12
   204465 #define GEN4_URB_FENCE_VFEUnitURBReallocationRequest_start  12
   204466 
   204467 static inline uint32_t ATTRIBUTE_PURE
   204468 URB_FENCE_VFEUnitURBReallocationRequest_start(const struct gen_device_info *devinfo)
   204469 {
   204470    switch (devinfo->gen) {
   204471    case 10: return 0;
   204472    case 9: return 0;
   204473    case 8: return 0;
   204474    case 7:
   204475       if (devinfo->is_haswell) {
   204476          return 0;
   204477       } else {
   204478          return 0;
   204479       }
   204480    case 6: return 0;
   204481    case 5: return 12;
   204482    case 4:
   204483       if (devinfo->is_g4x) {
   204484          return 12;
   204485       } else {
   204486          return 12;
   204487       }
   204488    default:
   204489       unreachable("Invalid hardware generation");
   204490    }
   204491 }
   204492 
   204493 
   204494 
   204495 /* URB_FENCE::VS Fence */
   204496 
   204497 
   204498 #define GEN5_URB_FENCE_VSFence_bits  10
   204499 #define GEN45_URB_FENCE_VSFence_bits  10
   204500 #define GEN4_URB_FENCE_VSFence_bits  10
   204501 
   204502 static inline uint32_t ATTRIBUTE_PURE
   204503 URB_FENCE_VSFence_bits(const struct gen_device_info *devinfo)
   204504 {
   204505    switch (devinfo->gen) {
   204506    case 10: return 0;
   204507    case 9: return 0;
   204508    case 8: return 0;
   204509    case 7:
   204510       if (devinfo->is_haswell) {
   204511          return 0;
   204512       } else {
   204513          return 0;
   204514       }
   204515    case 6: return 0;
   204516    case 5: return 10;
   204517    case 4:
   204518       if (devinfo->is_g4x) {
   204519          return 10;
   204520       } else {
   204521          return 10;
   204522       }
   204523    default:
   204524       unreachable("Invalid hardware generation");
   204525    }
   204526 }
   204527 
   204528 
   204529 
   204530 #define GEN5_URB_FENCE_VSFence_start  32
   204531 #define GEN45_URB_FENCE_VSFence_start  32
   204532 #define GEN4_URB_FENCE_VSFence_start  32
   204533 
   204534 static inline uint32_t ATTRIBUTE_PURE
   204535 URB_FENCE_VSFence_start(const struct gen_device_info *devinfo)
   204536 {
   204537    switch (devinfo->gen) {
   204538    case 10: return 0;
   204539    case 9: return 0;
   204540    case 8: return 0;
   204541    case 7:
   204542       if (devinfo->is_haswell) {
   204543          return 0;
   204544       } else {
   204545          return 0;
   204546       }
   204547    case 6: return 0;
   204548    case 5: return 32;
   204549    case 4:
   204550       if (devinfo->is_g4x) {
   204551          return 32;
   204552       } else {
   204553          return 32;
   204554       }
   204555    default:
   204556       unreachable("Invalid hardware generation");
   204557    }
   204558 }
   204559 
   204560 
   204561 
   204562 /* URB_FENCE::VS Unit URB Reallocation Request */
   204563 
   204564 
   204565 #define GEN5_URB_FENCE_VSUnitURBReallocationRequest_bits  1
   204566 #define GEN45_URB_FENCE_VSUnitURBReallocationRequest_bits  1
   204567 #define GEN4_URB_FENCE_VSUnitURBReallocationRequest_bits  1
   204568 
   204569 static inline uint32_t ATTRIBUTE_PURE
   204570 URB_FENCE_VSUnitURBReallocationRequest_bits(const struct gen_device_info *devinfo)
   204571 {
   204572    switch (devinfo->gen) {
   204573    case 10: return 0;
   204574    case 9: return 0;
   204575    case 8: return 0;
   204576    case 7:
   204577       if (devinfo->is_haswell) {
   204578          return 0;
   204579       } else {
   204580          return 0;
   204581       }
   204582    case 6: return 0;
   204583    case 5: return 1;
   204584    case 4:
   204585       if (devinfo->is_g4x) {
   204586          return 1;
   204587       } else {
   204588          return 1;
   204589       }
   204590    default:
   204591       unreachable("Invalid hardware generation");
   204592    }
   204593 }
   204594 
   204595 
   204596 
   204597 #define GEN5_URB_FENCE_VSUnitURBReallocationRequest_start  8
   204598 #define GEN45_URB_FENCE_VSUnitURBReallocationRequest_start  8
   204599 #define GEN4_URB_FENCE_VSUnitURBReallocationRequest_start  8
   204600 
   204601 static inline uint32_t ATTRIBUTE_PURE
   204602 URB_FENCE_VSUnitURBReallocationRequest_start(const struct gen_device_info *devinfo)
   204603 {
   204604    switch (devinfo->gen) {
   204605    case 10: return 0;
   204606    case 9: return 0;
   204607    case 8: return 0;
   204608    case 7:
   204609       if (devinfo->is_haswell) {
   204610          return 0;
   204611       } else {
   204612          return 0;
   204613       }
   204614    case 6: return 0;
   204615    case 5: return 8;
   204616    case 4:
   204617       if (devinfo->is_g4x) {
   204618          return 8;
   204619       } else {
   204620          return 8;
   204621       }
   204622    default:
   204623       unreachable("Invalid hardware generation");
   204624    }
   204625 }
   204626 
   204627 
   204628 
   204629 /* VCS2_RING_BUFFER_CTL */
   204630 
   204631 
   204632 #define GEN9_VCS2_RING_BUFFER_CTL_length  1
   204633 #define GEN8_VCS2_RING_BUFFER_CTL_length  1
   204634 
   204635 static inline uint32_t ATTRIBUTE_PURE
   204636 VCS2_RING_BUFFER_CTL_length(const struct gen_device_info *devinfo)
   204637 {
   204638    switch (devinfo->gen) {
   204639    case 10: return 0;
   204640    case 9: return 1;
   204641    case 8: return 1;
   204642    case 7:
   204643       if (devinfo->is_haswell) {
   204644          return 0;
   204645       } else {
   204646          return 0;
   204647       }
   204648    case 6: return 0;
   204649    case 5: return 0;
   204650    case 4:
   204651       if (devinfo->is_g4x) {
   204652          return 0;
   204653       } else {
   204654          return 0;
   204655       }
   204656    default:
   204657       unreachable("Invalid hardware generation");
   204658    }
   204659 }
   204660 
   204661 
   204662 
   204663 /* VCS2_RING_BUFFER_CTL::Automatic Report Head Pointer */
   204664 
   204665 
   204666 #define GEN9_VCS2_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits  2
   204667 #define GEN8_VCS2_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits  2
   204668 
   204669 static inline uint32_t ATTRIBUTE_PURE
   204670 VCS2_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits(const struct gen_device_info *devinfo)
   204671 {
   204672    switch (devinfo->gen) {
   204673    case 10: return 0;
   204674    case 9: return 2;
   204675    case 8: return 2;
   204676    case 7:
   204677       if (devinfo->is_haswell) {
   204678          return 0;
   204679       } else {
   204680          return 0;
   204681       }
   204682    case 6: return 0;
   204683    case 5: return 0;
   204684    case 4:
   204685       if (devinfo->is_g4x) {
   204686          return 0;
   204687       } else {
   204688          return 0;
   204689       }
   204690    default:
   204691       unreachable("Invalid hardware generation");
   204692    }
   204693 }
   204694 
   204695 
   204696 
   204697 #define GEN9_VCS2_RING_BUFFER_CTL_AutomaticReportHeadPointer_start  1
   204698 #define GEN8_VCS2_RING_BUFFER_CTL_AutomaticReportHeadPointer_start  1
   204699 
   204700 static inline uint32_t ATTRIBUTE_PURE
   204701 VCS2_RING_BUFFER_CTL_AutomaticReportHeadPointer_start(const struct gen_device_info *devinfo)
   204702 {
   204703    switch (devinfo->gen) {
   204704    case 10: return 0;
   204705    case 9: return 1;
   204706    case 8: return 1;
   204707    case 7:
   204708       if (devinfo->is_haswell) {
   204709          return 0;
   204710       } else {
   204711          return 0;
   204712       }
   204713    case 6: return 0;
   204714    case 5: return 0;
   204715    case 4:
   204716       if (devinfo->is_g4x) {
   204717          return 0;
   204718       } else {
   204719          return 0;
   204720       }
   204721    default:
   204722       unreachable("Invalid hardware generation");
   204723    }
   204724 }
   204725 
   204726 
   204727 
   204728 /* VCS2_RING_BUFFER_CTL::Buffer Length (in pages - 1) */
   204729 
   204730 
   204731 #define GEN9_VCS2_RING_BUFFER_CTL_BufferLengthinpages1_bits  9
   204732 #define GEN8_VCS2_RING_BUFFER_CTL_BufferLengthinpages1_bits  9
   204733 
   204734 static inline uint32_t ATTRIBUTE_PURE
   204735 VCS2_RING_BUFFER_CTL_BufferLengthinpages1_bits(const struct gen_device_info *devinfo)
   204736 {
   204737    switch (devinfo->gen) {
   204738    case 10: return 0;
   204739    case 9: return 9;
   204740    case 8: return 9;
   204741    case 7:
   204742       if (devinfo->is_haswell) {
   204743          return 0;
   204744       } else {
   204745          return 0;
   204746       }
   204747    case 6: return 0;
   204748    case 5: return 0;
   204749    case 4:
   204750       if (devinfo->is_g4x) {
   204751          return 0;
   204752       } else {
   204753          return 0;
   204754       }
   204755    default:
   204756       unreachable("Invalid hardware generation");
   204757    }
   204758 }
   204759 
   204760 
   204761 
   204762 #define GEN9_VCS2_RING_BUFFER_CTL_BufferLengthinpages1_start  12
   204763 #define GEN8_VCS2_RING_BUFFER_CTL_BufferLengthinpages1_start  12
   204764 
   204765 static inline uint32_t ATTRIBUTE_PURE
   204766 VCS2_RING_BUFFER_CTL_BufferLengthinpages1_start(const struct gen_device_info *devinfo)
   204767 {
   204768    switch (devinfo->gen) {
   204769    case 10: return 0;
   204770    case 9: return 12;
   204771    case 8: return 12;
   204772    case 7:
   204773       if (devinfo->is_haswell) {
   204774          return 0;
   204775       } else {
   204776          return 0;
   204777       }
   204778    case 6: return 0;
   204779    case 5: return 0;
   204780    case 4:
   204781       if (devinfo->is_g4x) {
   204782          return 0;
   204783       } else {
   204784          return 0;
   204785       }
   204786    default:
   204787       unreachable("Invalid hardware generation");
   204788    }
   204789 }
   204790 
   204791 
   204792 
   204793 /* VCS2_RING_BUFFER_CTL::Disable Register Accesses */
   204794 
   204795 
   204796 #define GEN9_VCS2_RING_BUFFER_CTL_DisableRegisterAccesses_bits  1
   204797 #define GEN8_VCS2_RING_BUFFER_CTL_DisableRegisterAccesses_bits  1
   204798 
   204799 static inline uint32_t ATTRIBUTE_PURE
   204800 VCS2_RING_BUFFER_CTL_DisableRegisterAccesses_bits(const struct gen_device_info *devinfo)
   204801 {
   204802    switch (devinfo->gen) {
   204803    case 10: return 0;
   204804    case 9: return 1;
   204805    case 8: return 1;
   204806    case 7:
   204807       if (devinfo->is_haswell) {
   204808          return 0;
   204809       } else {
   204810          return 0;
   204811       }
   204812    case 6: return 0;
   204813    case 5: return 0;
   204814    case 4:
   204815       if (devinfo->is_g4x) {
   204816          return 0;
   204817       } else {
   204818          return 0;
   204819       }
   204820    default:
   204821       unreachable("Invalid hardware generation");
   204822    }
   204823 }
   204824 
   204825 
   204826 
   204827 #define GEN9_VCS2_RING_BUFFER_CTL_DisableRegisterAccesses_start  8
   204828 #define GEN8_VCS2_RING_BUFFER_CTL_DisableRegisterAccesses_start  8
   204829 
   204830 static inline uint32_t ATTRIBUTE_PURE
   204831 VCS2_RING_BUFFER_CTL_DisableRegisterAccesses_start(const struct gen_device_info *devinfo)
   204832 {
   204833    switch (devinfo->gen) {
   204834    case 10: return 0;
   204835    case 9: return 8;
   204836    case 8: return 8;
   204837    case 7:
   204838       if (devinfo->is_haswell) {
   204839          return 0;
   204840       } else {
   204841          return 0;
   204842       }
   204843    case 6: return 0;
   204844    case 5: return 0;
   204845    case 4:
   204846       if (devinfo->is_g4x) {
   204847          return 0;
   204848       } else {
   204849          return 0;
   204850       }
   204851    default:
   204852       unreachable("Invalid hardware generation");
   204853    }
   204854 }
   204855 
   204856 
   204857 
   204858 /* VCS2_RING_BUFFER_CTL::RBWait */
   204859 
   204860 
   204861 #define GEN9_VCS2_RING_BUFFER_CTL_RBWait_bits  1
   204862 #define GEN8_VCS2_RING_BUFFER_CTL_RBWait_bits  1
   204863 
   204864 static inline uint32_t ATTRIBUTE_PURE
   204865 VCS2_RING_BUFFER_CTL_RBWait_bits(const struct gen_device_info *devinfo)
   204866 {
   204867    switch (devinfo->gen) {
   204868    case 10: return 0;
   204869    case 9: return 1;
   204870    case 8: return 1;
   204871    case 7:
   204872       if (devinfo->is_haswell) {
   204873          return 0;
   204874       } else {
   204875          return 0;
   204876       }
   204877    case 6: return 0;
   204878    case 5: return 0;
   204879    case 4:
   204880       if (devinfo->is_g4x) {
   204881          return 0;
   204882       } else {
   204883          return 0;
   204884       }
   204885    default:
   204886       unreachable("Invalid hardware generation");
   204887    }
   204888 }
   204889 
   204890 
   204891 
   204892 #define GEN9_VCS2_RING_BUFFER_CTL_RBWait_start  11
   204893 #define GEN8_VCS2_RING_BUFFER_CTL_RBWait_start  11
   204894 
   204895 static inline uint32_t ATTRIBUTE_PURE
   204896 VCS2_RING_BUFFER_CTL_RBWait_start(const struct gen_device_info *devinfo)
   204897 {
   204898    switch (devinfo->gen) {
   204899    case 10: return 0;
   204900    case 9: return 11;
   204901    case 8: return 11;
   204902    case 7:
   204903       if (devinfo->is_haswell) {
   204904          return 0;
   204905       } else {
   204906          return 0;
   204907       }
   204908    case 6: return 0;
   204909    case 5: return 0;
   204910    case 4:
   204911       if (devinfo->is_g4x) {
   204912          return 0;
   204913       } else {
   204914          return 0;
   204915       }
   204916    default:
   204917       unreachable("Invalid hardware generation");
   204918    }
   204919 }
   204920 
   204921 
   204922 
   204923 /* VCS2_RING_BUFFER_CTL::Ring Buffer Enable */
   204924 
   204925 
   204926 #define GEN9_VCS2_RING_BUFFER_CTL_RingBufferEnable_bits  1
   204927 #define GEN8_VCS2_RING_BUFFER_CTL_RingBufferEnable_bits  1
   204928 
   204929 static inline uint32_t ATTRIBUTE_PURE
   204930 VCS2_RING_BUFFER_CTL_RingBufferEnable_bits(const struct gen_device_info *devinfo)
   204931 {
   204932    switch (devinfo->gen) {
   204933    case 10: return 0;
   204934    case 9: return 1;
   204935    case 8: return 1;
   204936    case 7:
   204937       if (devinfo->is_haswell) {
   204938          return 0;
   204939       } else {
   204940          return 0;
   204941       }
   204942    case 6: return 0;
   204943    case 5: return 0;
   204944    case 4:
   204945       if (devinfo->is_g4x) {
   204946          return 0;
   204947       } else {
   204948          return 0;
   204949       }
   204950    default:
   204951       unreachable("Invalid hardware generation");
   204952    }
   204953 }
   204954 
   204955 
   204956 
   204957 #define GEN9_VCS2_RING_BUFFER_CTL_RingBufferEnable_start  0
   204958 #define GEN8_VCS2_RING_BUFFER_CTL_RingBufferEnable_start  0
   204959 
   204960 static inline uint32_t ATTRIBUTE_PURE
   204961 VCS2_RING_BUFFER_CTL_RingBufferEnable_start(const struct gen_device_info *devinfo)
   204962 {
   204963    switch (devinfo->gen) {
   204964    case 10: return 0;
   204965    case 9: return 0;
   204966    case 8: return 0;
   204967    case 7:
   204968       if (devinfo->is_haswell) {
   204969          return 0;
   204970       } else {
   204971          return 0;
   204972       }
   204973    case 6: return 0;
   204974    case 5: return 0;
   204975    case 4:
   204976       if (devinfo->is_g4x) {
   204977          return 0;
   204978       } else {
   204979          return 0;
   204980       }
   204981    default:
   204982       unreachable("Invalid hardware generation");
   204983    }
   204984 }
   204985 
   204986 
   204987 
   204988 /* VCS2_RING_BUFFER_CTL::Semaphore Wait */
   204989 
   204990 
   204991 #define GEN9_VCS2_RING_BUFFER_CTL_SemaphoreWait_bits  1
   204992 #define GEN8_VCS2_RING_BUFFER_CTL_SemaphoreWait_bits  1
   204993 
   204994 static inline uint32_t ATTRIBUTE_PURE
   204995 VCS2_RING_BUFFER_CTL_SemaphoreWait_bits(const struct gen_device_info *devinfo)
   204996 {
   204997    switch (devinfo->gen) {
   204998    case 10: return 0;
   204999    case 9: return 1;
   205000    case 8: return 1;
   205001    case 7:
   205002       if (devinfo->is_haswell) {
   205003          return 0;
   205004       } else {
   205005          return 0;
   205006       }
   205007    case 6: return 0;
   205008    case 5: return 0;
   205009    case 4:
   205010       if (devinfo->is_g4x) {
   205011          return 0;
   205012       } else {
   205013          return 0;
   205014       }
   205015    default:
   205016       unreachable("Invalid hardware generation");
   205017    }
   205018 }
   205019 
   205020 
   205021 
   205022 #define GEN9_VCS2_RING_BUFFER_CTL_SemaphoreWait_start  10
   205023 #define GEN8_VCS2_RING_BUFFER_CTL_SemaphoreWait_start  10
   205024 
   205025 static inline uint32_t ATTRIBUTE_PURE
   205026 VCS2_RING_BUFFER_CTL_SemaphoreWait_start(const struct gen_device_info *devinfo)
   205027 {
   205028    switch (devinfo->gen) {
   205029    case 10: return 0;
   205030    case 9: return 10;
   205031    case 8: return 10;
   205032    case 7:
   205033       if (devinfo->is_haswell) {
   205034          return 0;
   205035       } else {
   205036          return 0;
   205037       }
   205038    case 6: return 0;
   205039    case 5: return 0;
   205040    case 4:
   205041       if (devinfo->is_g4x) {
   205042          return 0;
   205043       } else {
   205044          return 0;
   205045       }
   205046    default:
   205047       unreachable("Invalid hardware generation");
   205048    }
   205049 }
   205050 
   205051 
   205052 
   205053 /* VCS_ACTHD_UDW */
   205054 
   205055 
   205056 #define GEN9_VCS_ACTHD_UDW_length  1
   205057 #define GEN8_VCS_ACTHD_UDW_length  1
   205058 
   205059 static inline uint32_t ATTRIBUTE_PURE
   205060 VCS_ACTHD_UDW_length(const struct gen_device_info *devinfo)
   205061 {
   205062    switch (devinfo->gen) {
   205063    case 10: return 0;
   205064    case 9: return 1;
   205065    case 8: return 1;
   205066    case 7:
   205067       if (devinfo->is_haswell) {
   205068          return 0;
   205069       } else {
   205070          return 0;
   205071       }
   205072    case 6: return 0;
   205073    case 5: return 0;
   205074    case 4:
   205075       if (devinfo->is_g4x) {
   205076          return 0;
   205077       } else {
   205078          return 0;
   205079       }
   205080    default:
   205081       unreachable("Invalid hardware generation");
   205082    }
   205083 }
   205084 
   205085 
   205086 
   205087 /* VCS_ACTHD_UDW::Head Pointer Upper DWORD */
   205088 
   205089 
   205090 #define GEN9_VCS_ACTHD_UDW_HeadPointerUpperDWORD_bits  16
   205091 #define GEN8_VCS_ACTHD_UDW_HeadPointerUpperDWORD_bits  16
   205092 
   205093 static inline uint32_t ATTRIBUTE_PURE
   205094 VCS_ACTHD_UDW_HeadPointerUpperDWORD_bits(const struct gen_device_info *devinfo)
   205095 {
   205096    switch (devinfo->gen) {
   205097    case 10: return 0;
   205098    case 9: return 16;
   205099    case 8: return 16;
   205100    case 7:
   205101       if (devinfo->is_haswell) {
   205102          return 0;
   205103       } else {
   205104          return 0;
   205105       }
   205106    case 6: return 0;
   205107    case 5: return 0;
   205108    case 4:
   205109       if (devinfo->is_g4x) {
   205110          return 0;
   205111       } else {
   205112          return 0;
   205113       }
   205114    default:
   205115       unreachable("Invalid hardware generation");
   205116    }
   205117 }
   205118 
   205119 
   205120 
   205121 #define GEN9_VCS_ACTHD_UDW_HeadPointerUpperDWORD_start  0
   205122 #define GEN8_VCS_ACTHD_UDW_HeadPointerUpperDWORD_start  0
   205123 
   205124 static inline uint32_t ATTRIBUTE_PURE
   205125 VCS_ACTHD_UDW_HeadPointerUpperDWORD_start(const struct gen_device_info *devinfo)
   205126 {
   205127    switch (devinfo->gen) {
   205128    case 10: return 0;
   205129    case 9: return 0;
   205130    case 8: return 0;
   205131    case 7:
   205132       if (devinfo->is_haswell) {
   205133          return 0;
   205134       } else {
   205135          return 0;
   205136       }
   205137    case 6: return 0;
   205138    case 5: return 0;
   205139    case 4:
   205140       if (devinfo->is_g4x) {
   205141          return 0;
   205142       } else {
   205143          return 0;
   205144       }
   205145    default:
   205146       unreachable("Invalid hardware generation");
   205147    }
   205148 }
   205149 
   205150 
   205151 
   205152 /* VCS_FAULT_REG */
   205153 
   205154 
   205155 #define GEN75_VCS_FAULT_REG_length  1
   205156 #define GEN7_VCS_FAULT_REG_length  1
   205157 #define GEN6_VCS_FAULT_REG_length  1
   205158 
   205159 static inline uint32_t ATTRIBUTE_PURE
   205160 VCS_FAULT_REG_length(const struct gen_device_info *devinfo)
   205161 {
   205162    switch (devinfo->gen) {
   205163    case 10: return 0;
   205164    case 9: return 0;
   205165    case 8: return 0;
   205166    case 7:
   205167       if (devinfo->is_haswell) {
   205168          return 1;
   205169       } else {
   205170          return 1;
   205171       }
   205172    case 6: return 1;
   205173    case 5: return 0;
   205174    case 4:
   205175       if (devinfo->is_g4x) {
   205176          return 0;
   205177       } else {
   205178          return 0;
   205179       }
   205180    default:
   205181       unreachable("Invalid hardware generation");
   205182    }
   205183 }
   205184 
   205185 
   205186 
   205187 /* VCS_FAULT_REG::Fault Type */
   205188 
   205189 
   205190 #define GEN75_VCS_FAULT_REG_FaultType_bits  2
   205191 #define GEN7_VCS_FAULT_REG_FaultType_bits  2
   205192 #define GEN6_VCS_FAULT_REG_FaultType_bits  2
   205193 
   205194 static inline uint32_t ATTRIBUTE_PURE
   205195 VCS_FAULT_REG_FaultType_bits(const struct gen_device_info *devinfo)
   205196 {
   205197    switch (devinfo->gen) {
   205198    case 10: return 0;
   205199    case 9: return 0;
   205200    case 8: return 0;
   205201    case 7:
   205202       if (devinfo->is_haswell) {
   205203          return 2;
   205204       } else {
   205205          return 2;
   205206       }
   205207    case 6: return 2;
   205208    case 5: return 0;
   205209    case 4:
   205210       if (devinfo->is_g4x) {
   205211          return 0;
   205212       } else {
   205213          return 0;
   205214       }
   205215    default:
   205216       unreachable("Invalid hardware generation");
   205217    }
   205218 }
   205219 
   205220 
   205221 
   205222 #define GEN75_VCS_FAULT_REG_FaultType_start  1
   205223 #define GEN7_VCS_FAULT_REG_FaultType_start  1
   205224 #define GEN6_VCS_FAULT_REG_FaultType_start  1
   205225 
   205226 static inline uint32_t ATTRIBUTE_PURE
   205227 VCS_FAULT_REG_FaultType_start(const struct gen_device_info *devinfo)
   205228 {
   205229    switch (devinfo->gen) {
   205230    case 10: return 0;
   205231    case 9: return 0;
   205232    case 8: return 0;
   205233    case 7:
   205234       if (devinfo->is_haswell) {
   205235          return 1;
   205236       } else {
   205237          return 1;
   205238       }
   205239    case 6: return 1;
   205240    case 5: return 0;
   205241    case 4:
   205242       if (devinfo->is_g4x) {
   205243          return 0;
   205244       } else {
   205245          return 0;
   205246       }
   205247    default:
   205248       unreachable("Invalid hardware generation");
   205249    }
   205250 }
   205251 
   205252 
   205253 
   205254 /* VCS_FAULT_REG::GTTSEL */
   205255 
   205256 
   205257 #define GEN75_VCS_FAULT_REG_GTTSEL_bits  -9
   205258 #define GEN7_VCS_FAULT_REG_GTTSEL_bits  -9
   205259 #define GEN6_VCS_FAULT_REG_GTTSEL_bits  -9
   205260 
   205261 static inline uint32_t ATTRIBUTE_PURE
   205262 VCS_FAULT_REG_GTTSEL_bits(const struct gen_device_info *devinfo)
   205263 {
   205264    switch (devinfo->gen) {
   205265    case 10: return 0;
   205266    case 9: return 0;
   205267    case 8: return 0;
   205268    case 7:
   205269       if (devinfo->is_haswell) {
   205270          return -9;
   205271       } else {
   205272          return -9;
   205273       }
   205274    case 6: return -9;
   205275    case 5: return 0;
   205276    case 4:
   205277       if (devinfo->is_g4x) {
   205278          return 0;
   205279       } else {
   205280          return 0;
   205281       }
   205282    default:
   205283       unreachable("Invalid hardware generation");
   205284    }
   205285 }
   205286 
   205287 
   205288 
   205289 #define GEN75_VCS_FAULT_REG_GTTSEL_start  11
   205290 #define GEN7_VCS_FAULT_REG_GTTSEL_start  11
   205291 #define GEN6_VCS_FAULT_REG_GTTSEL_start  11
   205292 
   205293 static inline uint32_t ATTRIBUTE_PURE
   205294 VCS_FAULT_REG_GTTSEL_start(const struct gen_device_info *devinfo)
   205295 {
   205296    switch (devinfo->gen) {
   205297    case 10: return 0;
   205298    case 9: return 0;
   205299    case 8: return 0;
   205300    case 7:
   205301       if (devinfo->is_haswell) {
   205302          return 11;
   205303       } else {
   205304          return 11;
   205305       }
   205306    case 6: return 11;
   205307    case 5: return 0;
   205308    case 4:
   205309       if (devinfo->is_g4x) {
   205310          return 0;
   205311       } else {
   205312          return 0;
   205313       }
   205314    default:
   205315       unreachable("Invalid hardware generation");
   205316    }
   205317 }
   205318 
   205319 
   205320 
   205321 /* VCS_FAULT_REG::SRCID of Fault */
   205322 
   205323 
   205324 #define GEN75_VCS_FAULT_REG_SRCIDofFault_bits  8
   205325 #define GEN7_VCS_FAULT_REG_SRCIDofFault_bits  8
   205326 #define GEN6_VCS_FAULT_REG_SRCIDofFault_bits  8
   205327 
   205328 static inline uint32_t ATTRIBUTE_PURE
   205329 VCS_FAULT_REG_SRCIDofFault_bits(const struct gen_device_info *devinfo)
   205330 {
   205331    switch (devinfo->gen) {
   205332    case 10: return 0;
   205333    case 9: return 0;
   205334    case 8: return 0;
   205335    case 7:
   205336       if (devinfo->is_haswell) {
   205337          return 8;
   205338       } else {
   205339          return 8;
   205340       }
   205341    case 6: return 8;
   205342    case 5: return 0;
   205343    case 4:
   205344       if (devinfo->is_g4x) {
   205345          return 0;
   205346       } else {
   205347          return 0;
   205348       }
   205349    default:
   205350       unreachable("Invalid hardware generation");
   205351    }
   205352 }
   205353 
   205354 
   205355 
   205356 #define GEN75_VCS_FAULT_REG_SRCIDofFault_start  3
   205357 #define GEN7_VCS_FAULT_REG_SRCIDofFault_start  3
   205358 #define GEN6_VCS_FAULT_REG_SRCIDofFault_start  3
   205359 
   205360 static inline uint32_t ATTRIBUTE_PURE
   205361 VCS_FAULT_REG_SRCIDofFault_start(const struct gen_device_info *devinfo)
   205362 {
   205363    switch (devinfo->gen) {
   205364    case 10: return 0;
   205365    case 9: return 0;
   205366    case 8: return 0;
   205367    case 7:
   205368       if (devinfo->is_haswell) {
   205369          return 3;
   205370       } else {
   205371          return 3;
   205372       }
   205373    case 6: return 3;
   205374    case 5: return 0;
   205375    case 4:
   205376       if (devinfo->is_g4x) {
   205377          return 0;
   205378       } else {
   205379          return 0;
   205380       }
   205381    default:
   205382       unreachable("Invalid hardware generation");
   205383    }
   205384 }
   205385 
   205386 
   205387 
   205388 /* VCS_FAULT_REG::Valid Bit */
   205389 
   205390 
   205391 #define GEN75_VCS_FAULT_REG_ValidBit_bits  1
   205392 #define GEN7_VCS_FAULT_REG_ValidBit_bits  1
   205393 #define GEN6_VCS_FAULT_REG_ValidBit_bits  1
   205394 
   205395 static inline uint32_t ATTRIBUTE_PURE
   205396 VCS_FAULT_REG_ValidBit_bits(const struct gen_device_info *devinfo)
   205397 {
   205398    switch (devinfo->gen) {
   205399    case 10: return 0;
   205400    case 9: return 0;
   205401    case 8: return 0;
   205402    case 7:
   205403       if (devinfo->is_haswell) {
   205404          return 1;
   205405       } else {
   205406          return 1;
   205407       }
   205408    case 6: return 1;
   205409    case 5: return 0;
   205410    case 4:
   205411       if (devinfo->is_g4x) {
   205412          return 0;
   205413       } else {
   205414          return 0;
   205415       }
   205416    default:
   205417       unreachable("Invalid hardware generation");
   205418    }
   205419 }
   205420 
   205421 
   205422 
   205423 #define GEN75_VCS_FAULT_REG_ValidBit_start  0
   205424 #define GEN7_VCS_FAULT_REG_ValidBit_start  0
   205425 #define GEN6_VCS_FAULT_REG_ValidBit_start  0
   205426 
   205427 static inline uint32_t ATTRIBUTE_PURE
   205428 VCS_FAULT_REG_ValidBit_start(const struct gen_device_info *devinfo)
   205429 {
   205430    switch (devinfo->gen) {
   205431    case 10: return 0;
   205432    case 9: return 0;
   205433    case 8: return 0;
   205434    case 7:
   205435       if (devinfo->is_haswell) {
   205436          return 0;
   205437       } else {
   205438          return 0;
   205439       }
   205440    case 6: return 0;
   205441    case 5: return 0;
   205442    case 4:
   205443       if (devinfo->is_g4x) {
   205444          return 0;
   205445       } else {
   205446          return 0;
   205447       }
   205448    default:
   205449       unreachable("Invalid hardware generation");
   205450    }
   205451 }
   205452 
   205453 
   205454 
   205455 /* VCS_FAULT_REG::Virtual Address of Fault */
   205456 
   205457 
   205458 #define GEN75_VCS_FAULT_REG_VirtualAddressofFault_bits  20
   205459 #define GEN7_VCS_FAULT_REG_VirtualAddressofFault_bits  20
   205460 #define GEN6_VCS_FAULT_REG_VirtualAddressofFault_bits  20
   205461 
   205462 static inline uint32_t ATTRIBUTE_PURE
   205463 VCS_FAULT_REG_VirtualAddressofFault_bits(const struct gen_device_info *devinfo)
   205464 {
   205465    switch (devinfo->gen) {
   205466    case 10: return 0;
   205467    case 9: return 0;
   205468    case 8: return 0;
   205469    case 7:
   205470       if (devinfo->is_haswell) {
   205471          return 20;
   205472       } else {
   205473          return 20;
   205474       }
   205475    case 6: return 20;
   205476    case 5: return 0;
   205477    case 4:
   205478       if (devinfo->is_g4x) {
   205479          return 0;
   205480       } else {
   205481          return 0;
   205482       }
   205483    default:
   205484       unreachable("Invalid hardware generation");
   205485    }
   205486 }
   205487 
   205488 
   205489 
   205490 #define GEN75_VCS_FAULT_REG_VirtualAddressofFault_start  12
   205491 #define GEN7_VCS_FAULT_REG_VirtualAddressofFault_start  12
   205492 #define GEN6_VCS_FAULT_REG_VirtualAddressofFault_start  12
   205493 
   205494 static inline uint32_t ATTRIBUTE_PURE
   205495 VCS_FAULT_REG_VirtualAddressofFault_start(const struct gen_device_info *devinfo)
   205496 {
   205497    switch (devinfo->gen) {
   205498    case 10: return 0;
   205499    case 9: return 0;
   205500    case 8: return 0;
   205501    case 7:
   205502       if (devinfo->is_haswell) {
   205503          return 12;
   205504       } else {
   205505          return 12;
   205506       }
   205507    case 6: return 12;
   205508    case 5: return 0;
   205509    case 4:
   205510       if (devinfo->is_g4x) {
   205511          return 0;
   205512       } else {
   205513          return 0;
   205514       }
   205515    default:
   205516       unreachable("Invalid hardware generation");
   205517    }
   205518 }
   205519 
   205520 
   205521 
   205522 /* VCS_INSTDONE */
   205523 
   205524 
   205525 #define GEN10_VCS_INSTDONE_length  1
   205526 #define GEN9_VCS_INSTDONE_length  1
   205527 #define GEN8_VCS_INSTDONE_length  1
   205528 #define GEN75_VCS_INSTDONE_length  1
   205529 #define GEN7_VCS_INSTDONE_length  1
   205530 #define GEN6_VCS_INSTDONE_length  1
   205531 
   205532 static inline uint32_t ATTRIBUTE_PURE
   205533 VCS_INSTDONE_length(const struct gen_device_info *devinfo)
   205534 {
   205535    switch (devinfo->gen) {
   205536    case 10: return 1;
   205537    case 9: return 1;
   205538    case 8: return 1;
   205539    case 7:
   205540       if (devinfo->is_haswell) {
   205541          return 1;
   205542       } else {
   205543          return 1;
   205544       }
   205545    case 6: return 1;
   205546    case 5: return 0;
   205547    case 4:
   205548       if (devinfo->is_g4x) {
   205549          return 0;
   205550       } else {
   205551          return 0;
   205552       }
   205553    default:
   205554       unreachable("Invalid hardware generation");
   205555    }
   205556 }
   205557 
   205558 
   205559 
   205560 /* VCS_INSTDONE::BSP Done */
   205561 
   205562 
   205563 #define GEN10_VCS_INSTDONE_BSPDone_bits  1
   205564 #define GEN9_VCS_INSTDONE_BSPDone_bits  1
   205565 #define GEN8_VCS_INSTDONE_BSPDone_bits  1
   205566 #define GEN75_VCS_INSTDONE_BSPDone_bits  1
   205567 #define GEN7_VCS_INSTDONE_BSPDone_bits  1
   205568 #define GEN6_VCS_INSTDONE_BSPDone_bits  1
   205569 
   205570 static inline uint32_t ATTRIBUTE_PURE
   205571 VCS_INSTDONE_BSPDone_bits(const struct gen_device_info *devinfo)
   205572 {
   205573    switch (devinfo->gen) {
   205574    case 10: return 1;
   205575    case 9: return 1;
   205576    case 8: return 1;
   205577    case 7:
   205578       if (devinfo->is_haswell) {
   205579          return 1;
   205580       } else {
   205581          return 1;
   205582       }
   205583    case 6: return 1;
   205584    case 5: return 0;
   205585    case 4:
   205586       if (devinfo->is_g4x) {
   205587          return 0;
   205588       } else {
   205589          return 0;
   205590       }
   205591    default:
   205592       unreachable("Invalid hardware generation");
   205593    }
   205594 }
   205595 
   205596 
   205597 
   205598 #define GEN10_VCS_INSTDONE_BSPDone_start  6
   205599 #define GEN9_VCS_INSTDONE_BSPDone_start  6
   205600 #define GEN8_VCS_INSTDONE_BSPDone_start  6
   205601 #define GEN75_VCS_INSTDONE_BSPDone_start  6
   205602 #define GEN7_VCS_INSTDONE_BSPDone_start  6
   205603 #define GEN6_VCS_INSTDONE_BSPDone_start  6
   205604 
   205605 static inline uint32_t ATTRIBUTE_PURE
   205606 VCS_INSTDONE_BSPDone_start(const struct gen_device_info *devinfo)
   205607 {
   205608    switch (devinfo->gen) {
   205609    case 10: return 6;
   205610    case 9: return 6;
   205611    case 8: return 6;
   205612    case 7:
   205613       if (devinfo->is_haswell) {
   205614          return 6;
   205615       } else {
   205616          return 6;
   205617       }
   205618    case 6: return 6;
   205619    case 5: return 0;
   205620    case 4:
   205621       if (devinfo->is_g4x) {
   205622          return 0;
   205623       } else {
   205624          return 0;
   205625       }
   205626    default:
   205627       unreachable("Invalid hardware generation");
   205628    }
   205629 }
   205630 
   205631 
   205632 
   205633 /* VCS_INSTDONE::GAC Done */
   205634 
   205635 
   205636 #define GEN10_VCS_INSTDONE_GACDone_bits  1
   205637 #define GEN9_VCS_INSTDONE_GACDone_bits  1
   205638 #define GEN8_VCS_INSTDONE_GACDone_bits  1
   205639 #define GEN75_VCS_INSTDONE_GACDone_bits  1
   205640 #define GEN7_VCS_INSTDONE_GACDone_bits  1
   205641 #define GEN6_VCS_INSTDONE_GACDone_bits  1
   205642 
   205643 static inline uint32_t ATTRIBUTE_PURE
   205644 VCS_INSTDONE_GACDone_bits(const struct gen_device_info *devinfo)
   205645 {
   205646    switch (devinfo->gen) {
   205647    case 10: return 1;
   205648    case 9: return 1;
   205649    case 8: return 1;
   205650    case 7:
   205651       if (devinfo->is_haswell) {
   205652          return 1;
   205653       } else {
   205654          return 1;
   205655       }
   205656    case 6: return 1;
   205657    case 5: return 0;
   205658    case 4:
   205659       if (devinfo->is_g4x) {
   205660          return 0;
   205661       } else {
   205662          return 0;
   205663       }
   205664    default:
   205665       unreachable("Invalid hardware generation");
   205666    }
   205667 }
   205668 
   205669 
   205670 
   205671 #define GEN10_VCS_INSTDONE_GACDone_start  31
   205672 #define GEN9_VCS_INSTDONE_GACDone_start  31
   205673 #define GEN8_VCS_INSTDONE_GACDone_start  31
   205674 #define GEN75_VCS_INSTDONE_GACDone_start  31
   205675 #define GEN7_VCS_INSTDONE_GACDone_start  31
   205676 #define GEN6_VCS_INSTDONE_GACDone_start  31
   205677 
   205678 static inline uint32_t ATTRIBUTE_PURE
   205679 VCS_INSTDONE_GACDone_start(const struct gen_device_info *devinfo)
   205680 {
   205681    switch (devinfo->gen) {
   205682    case 10: return 31;
   205683    case 9: return 31;
   205684    case 8: return 31;
   205685    case 7:
   205686       if (devinfo->is_haswell) {
   205687          return 31;
   205688       } else {
   205689          return 31;
   205690       }
   205691    case 6: return 31;
   205692    case 5: return 0;
   205693    case 4:
   205694       if (devinfo->is_g4x) {
   205695          return 0;
   205696       } else {
   205697          return 0;
   205698       }
   205699    default:
   205700       unreachable("Invalid hardware generation");
   205701    }
   205702 }
   205703 
   205704 
   205705 
   205706 /* VCS_INSTDONE::JPG Done */
   205707 
   205708 
   205709 #define GEN10_VCS_INSTDONE_JPGDone_bits  1
   205710 #define GEN9_VCS_INSTDONE_JPGDone_bits  1
   205711 #define GEN8_VCS_INSTDONE_JPGDone_bits  1
   205712 #define GEN75_VCS_INSTDONE_JPGDone_bits  1
   205713 #define GEN7_VCS_INSTDONE_JPGDone_bits  1
   205714 #define GEN6_VCS_INSTDONE_JPGDone_bits  1
   205715 
   205716 static inline uint32_t ATTRIBUTE_PURE
   205717 VCS_INSTDONE_JPGDone_bits(const struct gen_device_info *devinfo)
   205718 {
   205719    switch (devinfo->gen) {
   205720    case 10: return 1;
   205721    case 9: return 1;
   205722    case 8: return 1;
   205723    case 7:
   205724       if (devinfo->is_haswell) {
   205725          return 1;
   205726       } else {
   205727          return 1;
   205728       }
   205729    case 6: return 1;
   205730    case 5: return 0;
   205731    case 4:
   205732       if (devinfo->is_g4x) {
   205733          return 0;
   205734       } else {
   205735          return 0;
   205736       }
   205737    default:
   205738       unreachable("Invalid hardware generation");
   205739    }
   205740 }
   205741 
   205742 
   205743 
   205744 #define GEN10_VCS_INSTDONE_JPGDone_start  21
   205745 #define GEN9_VCS_INSTDONE_JPGDone_start  21
   205746 #define GEN8_VCS_INSTDONE_JPGDone_start  21
   205747 #define GEN75_VCS_INSTDONE_JPGDone_start  21
   205748 #define GEN7_VCS_INSTDONE_JPGDone_start  21
   205749 #define GEN6_VCS_INSTDONE_JPGDone_start  21
   205750 
   205751 static inline uint32_t ATTRIBUTE_PURE
   205752 VCS_INSTDONE_JPGDone_start(const struct gen_device_info *devinfo)
   205753 {
   205754    switch (devinfo->gen) {
   205755    case 10: return 21;
   205756    case 9: return 21;
   205757    case 8: return 21;
   205758    case 7:
   205759       if (devinfo->is_haswell) {
   205760          return 21;
   205761       } else {
   205762          return 21;
   205763       }
   205764    case 6: return 21;
   205765    case 5: return 0;
   205766    case 4:
   205767       if (devinfo->is_g4x) {
   205768          return 0;
   205769       } else {
   205770          return 0;
   205771       }
   205772    default:
   205773       unreachable("Invalid hardware generation");
   205774    }
   205775 }
   205776 
   205777 
   205778 
   205779 /* VCS_INSTDONE::MPC Done */
   205780 
   205781 
   205782 #define GEN10_VCS_INSTDONE_MPCDone_bits  1
   205783 #define GEN9_VCS_INSTDONE_MPCDone_bits  1
   205784 #define GEN8_VCS_INSTDONE_MPCDone_bits  1
   205785 #define GEN75_VCS_INSTDONE_MPCDone_bits  1
   205786 #define GEN7_VCS_INSTDONE_MPCDone_bits  1
   205787 #define GEN6_VCS_INSTDONE_MPCDone_bits  1
   205788 
   205789 static inline uint32_t ATTRIBUTE_PURE
   205790 VCS_INSTDONE_MPCDone_bits(const struct gen_device_info *devinfo)
   205791 {
   205792    switch (devinfo->gen) {
   205793    case 10: return 1;
   205794    case 9: return 1;
   205795    case 8: return 1;
   205796    case 7:
   205797       if (devinfo->is_haswell) {
   205798          return 1;
   205799       } else {
   205800          return 1;
   205801       }
   205802    case 6: return 1;
   205803    case 5: return 0;
   205804    case 4:
   205805       if (devinfo->is_g4x) {
   205806          return 0;
   205807       } else {
   205808          return 0;
   205809       }
   205810    default:
   205811       unreachable("Invalid hardware generation");
   205812    }
   205813 }
   205814 
   205815 
   205816 
   205817 #define GEN10_VCS_INSTDONE_MPCDone_start  4
   205818 #define GEN9_VCS_INSTDONE_MPCDone_start  4
   205819 #define GEN8_VCS_INSTDONE_MPCDone_start  4
   205820 #define GEN75_VCS_INSTDONE_MPCDone_start  4
   205821 #define GEN7_VCS_INSTDONE_MPCDone_start  4
   205822 #define GEN6_VCS_INSTDONE_MPCDone_start  4
   205823 
   205824 static inline uint32_t ATTRIBUTE_PURE
   205825 VCS_INSTDONE_MPCDone_start(const struct gen_device_info *devinfo)
   205826 {
   205827    switch (devinfo->gen) {
   205828    case 10: return 4;
   205829    case 9: return 4;
   205830    case 8: return 4;
   205831    case 7:
   205832       if (devinfo->is_haswell) {
   205833          return 4;
   205834       } else {
   205835          return 4;
   205836       }
   205837    case 6: return 4;
   205838    case 5: return 0;
   205839    case 4:
   205840       if (devinfo->is_g4x) {
   205841          return 0;
   205842       } else {
   205843          return 0;
   205844       }
   205845    default:
   205846       unreachable("Invalid hardware generation");
   205847    }
   205848 }
   205849 
   205850 
   205851 
   205852 /* VCS_INSTDONE::QRC Done */
   205853 
   205854 
   205855 #define GEN10_VCS_INSTDONE_QRCDone_bits  1
   205856 #define GEN9_VCS_INSTDONE_QRCDone_bits  1
   205857 #define GEN8_VCS_INSTDONE_QRCDone_bits  1
   205858 #define GEN75_VCS_INSTDONE_QRCDone_bits  1
   205859 #define GEN7_VCS_INSTDONE_QRCDone_bits  1
   205860 #define GEN6_VCS_INSTDONE_QRCDone_bits  1
   205861 
   205862 static inline uint32_t ATTRIBUTE_PURE
   205863 VCS_INSTDONE_QRCDone_bits(const struct gen_device_info *devinfo)
   205864 {
   205865    switch (devinfo->gen) {
   205866    case 10: return 1;
   205867    case 9: return 1;
   205868    case 8: return 1;
   205869    case 7:
   205870       if (devinfo->is_haswell) {
   205871          return 1;
   205872       } else {
   205873          return 1;
   205874       }
   205875    case 6: return 1;
   205876    case 5: return 0;
   205877    case 4:
   205878       if (devinfo->is_g4x) {
   205879          return 0;
   205880       } else {
   205881          return 0;
   205882       }
   205883    default:
   205884       unreachable("Invalid hardware generation");
   205885    }
   205886 }
   205887 
   205888 
   205889 
   205890 #define GEN10_VCS_INSTDONE_QRCDone_start  2
   205891 #define GEN9_VCS_INSTDONE_QRCDone_start  2
   205892 #define GEN8_VCS_INSTDONE_QRCDone_start  2
   205893 #define GEN75_VCS_INSTDONE_QRCDone_start  2
   205894 #define GEN7_VCS_INSTDONE_QRCDone_start  2
   205895 #define GEN6_VCS_INSTDONE_QRCDone_start  2
   205896 
   205897 static inline uint32_t ATTRIBUTE_PURE
   205898 VCS_INSTDONE_QRCDone_start(const struct gen_device_info *devinfo)
   205899 {
   205900    switch (devinfo->gen) {
   205901    case 10: return 2;
   205902    case 9: return 2;
   205903    case 8: return 2;
   205904    case 7:
   205905       if (devinfo->is_haswell) {
   205906          return 2;
   205907       } else {
   205908          return 2;
   205909       }
   205910    case 6: return 2;
   205911    case 5: return 0;
   205912    case 4:
   205913       if (devinfo->is_g4x) {
   205914          return 0;
   205915       } else {
   205916          return 0;
   205917       }
   205918    default:
   205919       unreachable("Invalid hardware generation");
   205920    }
   205921 }
   205922 
   205923 
   205924 
   205925 /* VCS_INSTDONE::Reserved */
   205926 
   205927 
   205928 #define GEN10_VCS_INSTDONE_Reserved_bits  1
   205929 #define GEN9_VCS_INSTDONE_Reserved_bits  1
   205930 #define GEN8_VCS_INSTDONE_Reserved_bits  1
   205931 #define GEN75_VCS_INSTDONE_Reserved_bits  1
   205932 
   205933 static inline uint32_t ATTRIBUTE_PURE
   205934 VCS_INSTDONE_Reserved_bits(const struct gen_device_info *devinfo)
   205935 {
   205936    switch (devinfo->gen) {
   205937    case 10: return 1;
   205938    case 9: return 1;
   205939    case 8: return 1;
   205940    case 7:
   205941       if (devinfo->is_haswell) {
   205942          return 1;
   205943       } else {
   205944          return 0;
   205945       }
   205946    case 6: return 0;
   205947    case 5: return 0;
   205948    case 4:
   205949       if (devinfo->is_g4x) {
   205950          return 0;
   205951       } else {
   205952          return 0;
   205953       }
   205954    default:
   205955       unreachable("Invalid hardware generation");
   205956    }
   205957 }
   205958 
   205959 
   205960 
   205961 #define GEN10_VCS_INSTDONE_Reserved_start  29
   205962 #define GEN9_VCS_INSTDONE_Reserved_start  29
   205963 #define GEN8_VCS_INSTDONE_Reserved_start  29
   205964 #define GEN75_VCS_INSTDONE_Reserved_start  29
   205965 
   205966 static inline uint32_t ATTRIBUTE_PURE
   205967 VCS_INSTDONE_Reserved_start(const struct gen_device_info *devinfo)
   205968 {
   205969    switch (devinfo->gen) {
   205970    case 10: return 29;
   205971    case 9: return 29;
   205972    case 8: return 29;
   205973    case 7:
   205974       if (devinfo->is_haswell) {
   205975          return 29;
   205976       } else {
   205977          return 0;
   205978       }
   205979    case 6: return 0;
   205980    case 5: return 0;
   205981    case 4:
   205982       if (devinfo->is_g4x) {
   205983          return 0;
   205984       } else {
   205985          return 0;
   205986       }
   205987    default:
   205988       unreachable("Invalid hardware generation");
   205989    }
   205990 }
   205991 
   205992 
   205993 
   205994 /* VCS_INSTDONE::Ring Enable */
   205995 
   205996 
   205997 #define GEN10_VCS_INSTDONE_RingEnable_bits  1
   205998 #define GEN9_VCS_INSTDONE_RingEnable_bits  1
   205999 #define GEN8_VCS_INSTDONE_RingEnable_bits  1
   206000 #define GEN75_VCS_INSTDONE_RingEnable_bits  1
   206001 #define GEN7_VCS_INSTDONE_RingEnable_bits  1
   206002 #define GEN6_VCS_INSTDONE_RingEnable_bits  1
   206003 
   206004 static inline uint32_t ATTRIBUTE_PURE
   206005 VCS_INSTDONE_RingEnable_bits(const struct gen_device_info *devinfo)
   206006 {
   206007    switch (devinfo->gen) {
   206008    case 10: return 1;
   206009    case 9: return 1;
   206010    case 8: return 1;
   206011    case 7:
   206012       if (devinfo->is_haswell) {
   206013          return 1;
   206014       } else {
   206015          return 1;
   206016       }
   206017    case 6: return 1;
   206018    case 5: return 0;
   206019    case 4:
   206020       if (devinfo->is_g4x) {
   206021          return 0;
   206022       } else {
   206023          return 0;
   206024       }
   206025    default:
   206026       unreachable("Invalid hardware generation");
   206027    }
   206028 }
   206029 
   206030 
   206031 
   206032 #define GEN10_VCS_INSTDONE_RingEnable_start  0
   206033 #define GEN9_VCS_INSTDONE_RingEnable_start  0
   206034 #define GEN8_VCS_INSTDONE_RingEnable_start  0
   206035 #define GEN75_VCS_INSTDONE_RingEnable_start  0
   206036 #define GEN7_VCS_INSTDONE_RingEnable_start  0
   206037 #define GEN6_VCS_INSTDONE_RingEnable_start  0
   206038 
   206039 static inline uint32_t ATTRIBUTE_PURE
   206040 VCS_INSTDONE_RingEnable_start(const struct gen_device_info *devinfo)
   206041 {
   206042    switch (devinfo->gen) {
   206043    case 10: return 0;
   206044    case 9: return 0;
   206045    case 8: return 0;
   206046    case 7:
   206047       if (devinfo->is_haswell) {
   206048          return 0;
   206049       } else {
   206050          return 0;
   206051       }
   206052    case 6: return 0;
   206053    case 5: return 0;
   206054    case 4:
   206055       if (devinfo->is_g4x) {
   206056          return 0;
   206057       } else {
   206058          return 0;
   206059       }
   206060    default:
   206061       unreachable("Invalid hardware generation");
   206062    }
   206063 }
   206064 
   206065 
   206066 
   206067 /* VCS_INSTDONE::SEC Done */
   206068 
   206069 
   206070 #define GEN10_VCS_INSTDONE_SECDone_bits  1
   206071 #define GEN9_VCS_INSTDONE_SECDone_bits  1
   206072 #define GEN8_VCS_INSTDONE_SECDone_bits  1
   206073 #define GEN75_VCS_INSTDONE_SECDone_bits  1
   206074 #define GEN7_VCS_INSTDONE_SECDone_bits  1
   206075 #define GEN6_VCS_INSTDONE_SECDone_bits  1
   206076 
   206077 static inline uint32_t ATTRIBUTE_PURE
   206078 VCS_INSTDONE_SECDone_bits(const struct gen_device_info *devinfo)
   206079 {
   206080    switch (devinfo->gen) {
   206081    case 10: return 1;
   206082    case 9: return 1;
   206083    case 8: return 1;
   206084    case 7:
   206085       if (devinfo->is_haswell) {
   206086          return 1;
   206087       } else {
   206088          return 1;
   206089       }
   206090    case 6: return 1;
   206091    case 5: return 0;
   206092    case 4:
   206093       if (devinfo->is_g4x) {
   206094          return 0;
   206095       } else {
   206096          return 0;
   206097       }
   206098    default:
   206099       unreachable("Invalid hardware generation");
   206100    }
   206101 }
   206102 
   206103 
   206104 
   206105 #define GEN10_VCS_INSTDONE_SECDone_start  3
   206106 #define GEN9_VCS_INSTDONE_SECDone_start  3
   206107 #define GEN8_VCS_INSTDONE_SECDone_start  3
   206108 #define GEN75_VCS_INSTDONE_SECDone_start  3
   206109 #define GEN7_VCS_INSTDONE_SECDone_start  3
   206110 #define GEN6_VCS_INSTDONE_SECDone_start  3
   206111 
   206112 static inline uint32_t ATTRIBUTE_PURE
   206113 VCS_INSTDONE_SECDone_start(const struct gen_device_info *devinfo)
   206114 {
   206115    switch (devinfo->gen) {
   206116    case 10: return 3;
   206117    case 9: return 3;
   206118    case 8: return 3;
   206119    case 7:
   206120       if (devinfo->is_haswell) {
   206121          return 3;
   206122       } else {
   206123          return 3;
   206124       }
   206125    case 6: return 3;
   206126    case 5: return 0;
   206127    case 4:
   206128       if (devinfo->is_g4x) {
   206129          return 0;
   206130       } else {
   206131          return 0;
   206132       }
   206133    default:
   206134       unreachable("Invalid hardware generation");
   206135    }
   206136 }
   206137 
   206138 
   206139 
   206140 /* VCS_INSTDONE::USB Done */
   206141 
   206142 
   206143 #define GEN10_VCS_INSTDONE_USBDone_bits  1
   206144 #define GEN9_VCS_INSTDONE_USBDone_bits  1
   206145 #define GEN8_VCS_INSTDONE_USBDone_bits  1
   206146 #define GEN75_VCS_INSTDONE_USBDone_bits  1
   206147 #define GEN7_VCS_INSTDONE_USBDone_bits  1
   206148 #define GEN6_VCS_INSTDONE_USBDone_bits  1
   206149 
   206150 static inline uint32_t ATTRIBUTE_PURE
   206151 VCS_INSTDONE_USBDone_bits(const struct gen_device_info *devinfo)
   206152 {
   206153    switch (devinfo->gen) {
   206154    case 10: return 1;
   206155    case 9: return 1;
   206156    case 8: return 1;
   206157    case 7:
   206158       if (devinfo->is_haswell) {
   206159          return 1;
   206160       } else {
   206161          return 1;
   206162       }
   206163    case 6: return 1;
   206164    case 5: return 0;
   206165    case 4:
   206166       if (devinfo->is_g4x) {
   206167          return 0;
   206168       } else {
   206169          return 0;
   206170       }
   206171    default:
   206172       unreachable("Invalid hardware generation");
   206173    }
   206174 }
   206175 
   206176 
   206177 
   206178 #define GEN10_VCS_INSTDONE_USBDone_start  1
   206179 #define GEN9_VCS_INSTDONE_USBDone_start  1
   206180 #define GEN8_VCS_INSTDONE_USBDone_start  1
   206181 #define GEN75_VCS_INSTDONE_USBDone_start  1
   206182 #define GEN7_VCS_INSTDONE_USBDone_start  1
   206183 #define GEN6_VCS_INSTDONE_USBDone_start  1
   206184 
   206185 static inline uint32_t ATTRIBUTE_PURE
   206186 VCS_INSTDONE_USBDone_start(const struct gen_device_info *devinfo)
   206187 {
   206188    switch (devinfo->gen) {
   206189    case 10: return 1;
   206190    case 9: return 1;
   206191    case 8: return 1;
   206192    case 7:
   206193       if (devinfo->is_haswell) {
   206194          return 1;
   206195       } else {
   206196          return 1;
   206197       }
   206198    case 6: return 1;
   206199    case 5: return 0;
   206200    case 4:
   206201       if (devinfo->is_g4x) {
   206202          return 0;
   206203       } else {
   206204          return 0;
   206205       }
   206206    default:
   206207       unreachable("Invalid hardware generation");
   206208    }
   206209 }
   206210 
   206211 
   206212 
   206213 /* VCS_INSTDONE::VAC Done */
   206214 
   206215 
   206216 #define GEN10_VCS_INSTDONE_VACDone_bits  1
   206217 #define GEN9_VCS_INSTDONE_VACDone_bits  1
   206218 #define GEN8_VCS_INSTDONE_VACDone_bits  1
   206219 #define GEN75_VCS_INSTDONE_VACDone_bits  1
   206220 #define GEN7_VCS_INSTDONE_VACDone_bits  1
   206221 #define GEN6_VCS_INSTDONE_VACDone_bits  1
   206222 
   206223 static inline uint32_t ATTRIBUTE_PURE
   206224 VCS_INSTDONE_VACDone_bits(const struct gen_device_info *devinfo)
   206225 {
   206226    switch (devinfo->gen) {
   206227    case 10: return 1;
   206228    case 9: return 1;
   206229    case 8: return 1;
   206230    case 7:
   206231       if (devinfo->is_haswell) {
   206232          return 1;
   206233       } else {
   206234          return 1;
   206235       }
   206236    case 6: return 1;
   206237    case 5: return 0;
   206238    case 4:
   206239       if (devinfo->is_g4x) {
   206240          return 0;
   206241       } else {
   206242          return 0;
   206243       }
   206244    default:
   206245       unreachable("Invalid hardware generation");
   206246    }
   206247 }
   206248 
   206249 
   206250 
   206251 #define GEN10_VCS_INSTDONE_VACDone_start  19
   206252 #define GEN9_VCS_INSTDONE_VACDone_start  19
   206253 #define GEN8_VCS_INSTDONE_VACDone_start  19
   206254 #define GEN75_VCS_INSTDONE_VACDone_start  19
   206255 #define GEN7_VCS_INSTDONE_VACDone_start  19
   206256 #define GEN6_VCS_INSTDONE_VACDone_start  19
   206257 
   206258 static inline uint32_t ATTRIBUTE_PURE
   206259 VCS_INSTDONE_VACDone_start(const struct gen_device_info *devinfo)
   206260 {
   206261    switch (devinfo->gen) {
   206262    case 10: return 19;
   206263    case 9: return 19;
   206264    case 8: return 19;
   206265    case 7:
   206266       if (devinfo->is_haswell) {
   206267          return 19;
   206268       } else {
   206269          return 19;
   206270       }
   206271    case 6: return 19;
   206272    case 5: return 0;
   206273    case 4:
   206274       if (devinfo->is_g4x) {
   206275          return 0;
   206276       } else {
   206277          return 0;
   206278       }
   206279    default:
   206280       unreachable("Invalid hardware generation");
   206281    }
   206282 }
   206283 
   206284 
   206285 
   206286 /* VCS_INSTDONE::VAD Done */
   206287 
   206288 
   206289 #define GEN10_VCS_INSTDONE_VADDone_bits  1
   206290 #define GEN9_VCS_INSTDONE_VADDone_bits  1
   206291 #define GEN8_VCS_INSTDONE_VADDone_bits  1
   206292 #define GEN75_VCS_INSTDONE_VADDone_bits  1
   206293 #define GEN7_VCS_INSTDONE_VADDone_bits  1
   206294 #define GEN6_VCS_INSTDONE_VADDone_bits  1
   206295 
   206296 static inline uint32_t ATTRIBUTE_PURE
   206297 VCS_INSTDONE_VADDone_bits(const struct gen_device_info *devinfo)
   206298 {
   206299    switch (devinfo->gen) {
   206300    case 10: return 1;
   206301    case 9: return 1;
   206302    case 8: return 1;
   206303    case 7:
   206304       if (devinfo->is_haswell) {
   206305          return 1;
   206306       } else {
   206307          return 1;
   206308       }
   206309    case 6: return 1;
   206310    case 5: return 0;
   206311    case 4:
   206312       if (devinfo->is_g4x) {
   206313          return 0;
   206314       } else {
   206315          return 0;
   206316       }
   206317    default:
   206318       unreachable("Invalid hardware generation");
   206319    }
   206320 }
   206321 
   206322 
   206323 
   206324 #define GEN10_VCS_INSTDONE_VADDone_start  16
   206325 #define GEN9_VCS_INSTDONE_VADDone_start  16
   206326 #define GEN8_VCS_INSTDONE_VADDone_start  16
   206327 #define GEN75_VCS_INSTDONE_VADDone_start  16
   206328 #define GEN7_VCS_INSTDONE_VADDone_start  16
   206329 #define GEN6_VCS_INSTDONE_VADDone_start  16
   206330 
   206331 static inline uint32_t ATTRIBUTE_PURE
   206332 VCS_INSTDONE_VADDone_start(const struct gen_device_info *devinfo)
   206333 {
   206334    switch (devinfo->gen) {
   206335    case 10: return 16;
   206336    case 9: return 16;
   206337    case 8: return 16;
   206338    case 7:
   206339       if (devinfo->is_haswell) {
   206340          return 16;
   206341       } else {
   206342          return 16;
   206343       }
   206344    case 6: return 16;
   206345    case 5: return 0;
   206346    case 4:
   206347       if (devinfo->is_g4x) {
   206348          return 0;
   206349       } else {
   206350          return 0;
   206351       }
   206352    default:
   206353       unreachable("Invalid hardware generation");
   206354    }
   206355 }
   206356 
   206357 
   206358 
   206359 /* VCS_INSTDONE::VAM Done */
   206360 
   206361 
   206362 #define GEN10_VCS_INSTDONE_VAMDone_bits  1
   206363 #define GEN9_VCS_INSTDONE_VAMDone_bits  1
   206364 #define GEN8_VCS_INSTDONE_VAMDone_bits  1
   206365 #define GEN75_VCS_INSTDONE_VAMDone_bits  1
   206366 #define GEN7_VCS_INSTDONE_VAMDone_bits  1
   206367 #define GEN6_VCS_INSTDONE_VAMDone_bits  1
   206368 
   206369 static inline uint32_t ATTRIBUTE_PURE
   206370 VCS_INSTDONE_VAMDone_bits(const struct gen_device_info *devinfo)
   206371 {
   206372    switch (devinfo->gen) {
   206373    case 10: return 1;
   206374    case 9: return 1;
   206375    case 8: return 1;
   206376    case 7:
   206377       if (devinfo->is_haswell) {
   206378          return 1;
   206379       } else {
   206380          return 1;
   206381       }
   206382    case 6: return 1;
   206383    case 5: return 0;
   206384    case 4:
   206385       if (devinfo->is_g4x) {
   206386          return 0;
   206387       } else {
   206388          return 0;
   206389       }
   206390    default:
   206391       unreachable("Invalid hardware generation");
   206392    }
   206393 }
   206394 
   206395 
   206396 
   206397 #define GEN10_VCS_INSTDONE_VAMDone_start  20
   206398 #define GEN9_VCS_INSTDONE_VAMDone_start  20
   206399 #define GEN8_VCS_INSTDONE_VAMDone_start  20
   206400 #define GEN75_VCS_INSTDONE_VAMDone_start  20
   206401 #define GEN7_VCS_INSTDONE_VAMDone_start  20
   206402 #define GEN6_VCS_INSTDONE_VAMDone_start  20
   206403 
   206404 static inline uint32_t ATTRIBUTE_PURE
   206405 VCS_INSTDONE_VAMDone_start(const struct gen_device_info *devinfo)
   206406 {
   206407    switch (devinfo->gen) {
   206408    case 10: return 20;
   206409    case 9: return 20;
   206410    case 8: return 20;
   206411    case 7:
   206412       if (devinfo->is_haswell) {
   206413          return 20;
   206414       } else {
   206415          return 20;
   206416       }
   206417    case 6: return 20;
   206418    case 5: return 0;
   206419    case 4:
   206420       if (devinfo->is_g4x) {
   206421          return 0;
   206422       } else {
   206423          return 0;
   206424       }
   206425    default:
   206426       unreachable("Invalid hardware generation");
   206427    }
   206428 }
   206429 
   206430 
   206431 
   206432 /* VCS_INSTDONE::VBP Done */
   206433 
   206434 
   206435 #define GEN10_VCS_INSTDONE_VBPDone_bits  1
   206436 #define GEN9_VCS_INSTDONE_VBPDone_bits  1
   206437 #define GEN8_VCS_INSTDONE_VBPDone_bits  1
   206438 #define GEN75_VCS_INSTDONE_VBPDone_bits  1
   206439 #define GEN7_VCS_INSTDONE_VBPDone_bits  1
   206440 #define GEN6_VCS_INSTDONE_VBPDone_bits  1
   206441 
   206442 static inline uint32_t ATTRIBUTE_PURE
   206443 VCS_INSTDONE_VBPDone_bits(const struct gen_device_info *devinfo)
   206444 {
   206445    switch (devinfo->gen) {
   206446    case 10: return 1;
   206447    case 9: return 1;
   206448    case 8: return 1;
   206449    case 7:
   206450       if (devinfo->is_haswell) {
   206451          return 1;
   206452       } else {
   206453          return 1;
   206454       }
   206455    case 6: return 1;
   206456    case 5: return 0;
   206457    case 4:
   206458       if (devinfo->is_g4x) {
   206459          return 0;
   206460       } else {
   206461          return 0;
   206462       }
   206463    default:
   206464       unreachable("Invalid hardware generation");
   206465    }
   206466 }
   206467 
   206468 
   206469 
   206470 #define GEN10_VCS_INSTDONE_VBPDone_start  22
   206471 #define GEN9_VCS_INSTDONE_VBPDone_start  22
   206472 #define GEN8_VCS_INSTDONE_VBPDone_start  22
   206473 #define GEN75_VCS_INSTDONE_VBPDone_start  22
   206474 #define GEN7_VCS_INSTDONE_VBPDone_start  22
   206475 #define GEN6_VCS_INSTDONE_VBPDone_start  22
   206476 
   206477 static inline uint32_t ATTRIBUTE_PURE
   206478 VCS_INSTDONE_VBPDone_start(const struct gen_device_info *devinfo)
   206479 {
   206480    switch (devinfo->gen) {
   206481    case 10: return 22;
   206482    case 9: return 22;
   206483    case 8: return 22;
   206484    case 7:
   206485       if (devinfo->is_haswell) {
   206486          return 22;
   206487       } else {
   206488          return 22;
   206489       }
   206490    case 6: return 22;
   206491    case 5: return 0;
   206492    case 4:
   206493       if (devinfo->is_g4x) {
   206494          return 0;
   206495       } else {
   206496          return 0;
   206497       }
   206498    default:
   206499       unreachable("Invalid hardware generation");
   206500    }
   206501 }
   206502 
   206503 
   206504 
   206505 /* VCS_INSTDONE::VCD Done */
   206506 
   206507 
   206508 #define GEN10_VCS_INSTDONE_VCDDone_bits  1
   206509 #define GEN9_VCS_INSTDONE_VCDDone_bits  1
   206510 #define GEN8_VCS_INSTDONE_VCDDone_bits  1
   206511 #define GEN75_VCS_INSTDONE_VCDDone_bits  1
   206512 #define GEN7_VCS_INSTDONE_VCDDone_bits  1
   206513 #define GEN6_VCS_INSTDONE_VCDDone_bits  1
   206514 
   206515 static inline uint32_t ATTRIBUTE_PURE
   206516 VCS_INSTDONE_VCDDone_bits(const struct gen_device_info *devinfo)
   206517 {
   206518    switch (devinfo->gen) {
   206519    case 10: return 1;
   206520    case 9: return 1;
   206521    case 8: return 1;
   206522    case 7:
   206523       if (devinfo->is_haswell) {
   206524          return 1;
   206525       } else {
   206526          return 1;
   206527       }
   206528    case 6: return 1;
   206529    case 5: return 0;
   206530    case 4:
   206531       if (devinfo->is_g4x) {
   206532          return 0;
   206533       } else {
   206534          return 0;
   206535       }
   206536    default:
   206537       unreachable("Invalid hardware generation");
   206538    }
   206539 }
   206540 
   206541 
   206542 
   206543 #define GEN10_VCS_INSTDONE_VCDDone_start  15
   206544 #define GEN9_VCS_INSTDONE_VCDDone_start  15
   206545 #define GEN8_VCS_INSTDONE_VCDDone_start  15
   206546 #define GEN75_VCS_INSTDONE_VCDDone_start  15
   206547 #define GEN7_VCS_INSTDONE_VCDDone_start  15
   206548 #define GEN6_VCS_INSTDONE_VCDDone_start  15
   206549 
   206550 static inline uint32_t ATTRIBUTE_PURE
   206551 VCS_INSTDONE_VCDDone_start(const struct gen_device_info *devinfo)
   206552 {
   206553    switch (devinfo->gen) {
   206554    case 10: return 15;
   206555    case 9: return 15;
   206556    case 8: return 15;
   206557    case 7:
   206558       if (devinfo->is_haswell) {
   206559          return 15;
   206560       } else {
   206561          return 15;
   206562       }
   206563    case 6: return 15;
   206564    case 5: return 0;
   206565    case 4:
   206566       if (devinfo->is_g4x) {
   206567          return 0;
   206568       } else {
   206569          return 0;
   206570       }
   206571    default:
   206572       unreachable("Invalid hardware generation");
   206573    }
   206574 }
   206575 
   206576 
   206577 
   206578 /* VCS_INSTDONE::VCI Done */
   206579 
   206580 
   206581 #define GEN10_VCS_INSTDONE_VCIDone_bits  1
   206582 #define GEN9_VCS_INSTDONE_VCIDone_bits  1
   206583 #define GEN8_VCS_INSTDONE_VCIDone_bits  1
   206584 #define GEN75_VCS_INSTDONE_VCIDone_bits  1
   206585 #define GEN7_VCS_INSTDONE_VCIDone_bits  1
   206586 #define GEN6_VCS_INSTDONE_VCIDone_bits  1
   206587 
   206588 static inline uint32_t ATTRIBUTE_PURE
   206589 VCS_INSTDONE_VCIDone_bits(const struct gen_device_info *devinfo)
   206590 {
   206591    switch (devinfo->gen) {
   206592    case 10: return 1;
   206593    case 9: return 1;
   206594    case 8: return 1;
   206595    case 7:
   206596       if (devinfo->is_haswell) {
   206597          return 1;
   206598       } else {
   206599          return 1;
   206600       }
   206601    case 6: return 1;
   206602    case 5: return 0;
   206603    case 4:
   206604       if (devinfo->is_g4x) {
   206605          return 0;
   206606       } else {
   206607          return 0;
   206608       }
   206609    default:
   206610       unreachable("Invalid hardware generation");
   206611    }
   206612 }
   206613 
   206614 
   206615 
   206616 #define GEN10_VCS_INSTDONE_VCIDone_start  24
   206617 #define GEN9_VCS_INSTDONE_VCIDone_start  24
   206618 #define GEN8_VCS_INSTDONE_VCIDone_start  24
   206619 #define GEN75_VCS_INSTDONE_VCIDone_start  24
   206620 #define GEN7_VCS_INSTDONE_VCIDone_start  24
   206621 #define GEN6_VCS_INSTDONE_VCIDone_start  24
   206622 
   206623 static inline uint32_t ATTRIBUTE_PURE
   206624 VCS_INSTDONE_VCIDone_start(const struct gen_device_info *devinfo)
   206625 {
   206626    switch (devinfo->gen) {
   206627    case 10: return 24;
   206628    case 9: return 24;
   206629    case 8: return 24;
   206630    case 7:
   206631       if (devinfo->is_haswell) {
   206632          return 24;
   206633       } else {
   206634          return 24;
   206635       }
   206636    case 6: return 24;
   206637    case 5: return 0;
   206638    case 4:
   206639       if (devinfo->is_g4x) {
   206640          return 0;
   206641       } else {
   206642          return 0;
   206643       }
   206644    default:
   206645       unreachable("Invalid hardware generation");
   206646    }
   206647 }
   206648 
   206649 
   206650 
   206651 /* VCS_INSTDONE::VCP Done */
   206652 
   206653 
   206654 #define GEN10_VCS_INSTDONE_VCPDone_bits  1
   206655 #define GEN9_VCS_INSTDONE_VCPDone_bits  1
   206656 #define GEN8_VCS_INSTDONE_VCPDone_bits  1
   206657 #define GEN75_VCS_INSTDONE_VCPDone_bits  1
   206658 #define GEN7_VCS_INSTDONE_VCPDone_bits  1
   206659 #define GEN6_VCS_INSTDONE_VCPDone_bits  1
   206660 
   206661 static inline uint32_t ATTRIBUTE_PURE
   206662 VCS_INSTDONE_VCPDone_bits(const struct gen_device_info *devinfo)
   206663 {
   206664    switch (devinfo->gen) {
   206665    case 10: return 1;
   206666    case 9: return 1;
   206667    case 8: return 1;
   206668    case 7:
   206669       if (devinfo->is_haswell) {
   206670          return 1;
   206671       } else {
   206672          return 1;
   206673       }
   206674    case 6: return 1;
   206675    case 5: return 0;
   206676    case 4:
   206677       if (devinfo->is_g4x) {
   206678          return 0;
   206679       } else {
   206680          return 0;
   206681       }
   206682    default:
   206683       unreachable("Invalid hardware generation");
   206684    }
   206685 }
   206686 
   206687 
   206688 
   206689 #define GEN10_VCS_INSTDONE_VCPDone_start  14
   206690 #define GEN9_VCS_INSTDONE_VCPDone_start  14
   206691 #define GEN8_VCS_INSTDONE_VCPDone_start  14
   206692 #define GEN75_VCS_INSTDONE_VCPDone_start  14
   206693 #define GEN7_VCS_INSTDONE_VCPDone_start  14
   206694 #define GEN6_VCS_INSTDONE_VCPDone_start  14
   206695 
   206696 static inline uint32_t ATTRIBUTE_PURE
   206697 VCS_INSTDONE_VCPDone_start(const struct gen_device_info *devinfo)
   206698 {
   206699    switch (devinfo->gen) {
   206700    case 10: return 14;
   206701    case 9: return 14;
   206702    case 8: return 14;
   206703    case 7:
   206704       if (devinfo->is_haswell) {
   206705          return 14;
   206706       } else {
   206707          return 14;
   206708       }
   206709    case 6: return 14;
   206710    case 5: return 0;
   206711    case 4:
   206712       if (devinfo->is_g4x) {
   206713          return 0;
   206714       } else {
   206715          return 0;
   206716       }
   206717    default:
   206718       unreachable("Invalid hardware generation");
   206719    }
   206720 }
   206721 
   206722 
   206723 
   206724 /* VCS_INSTDONE::VCR Done */
   206725 
   206726 
   206727 #define GEN10_VCS_INSTDONE_VCRDone_bits  1
   206728 #define GEN9_VCS_INSTDONE_VCRDone_bits  1
   206729 #define GEN8_VCS_INSTDONE_VCRDone_bits  1
   206730 #define GEN75_VCS_INSTDONE_VCRDone_bits  1
   206731 #define GEN7_VCS_INSTDONE_VCRDone_bits  1
   206732 #define GEN6_VCS_INSTDONE_VCRDone_bits  1
   206733 
   206734 static inline uint32_t ATTRIBUTE_PURE
   206735 VCS_INSTDONE_VCRDone_bits(const struct gen_device_info *devinfo)
   206736 {
   206737    switch (devinfo->gen) {
   206738    case 10: return 1;
   206739    case 9: return 1;
   206740    case 8: return 1;
   206741    case 7:
   206742       if (devinfo->is_haswell) {
   206743          return 1;
   206744       } else {
   206745          return 1;
   206746       }
   206747    case 6: return 1;
   206748    case 5: return 0;
   206749    case 4:
   206750       if (devinfo->is_g4x) {
   206751          return 0;
   206752       } else {
   206753          return 0;
   206754       }
   206755    default:
   206756       unreachable("Invalid hardware generation");
   206757    }
   206758 }
   206759 
   206760 
   206761 
   206762 #define GEN10_VCS_INSTDONE_VCRDone_start  25
   206763 #define GEN9_VCS_INSTDONE_VCRDone_start  25
   206764 #define GEN8_VCS_INSTDONE_VCRDone_start  25
   206765 #define GEN75_VCS_INSTDONE_VCRDone_start  25
   206766 #define GEN7_VCS_INSTDONE_VCRDone_start  25
   206767 #define GEN6_VCS_INSTDONE_VCRDone_start  25
   206768 
   206769 static inline uint32_t ATTRIBUTE_PURE
   206770 VCS_INSTDONE_VCRDone_start(const struct gen_device_info *devinfo)
   206771 {
   206772    switch (devinfo->gen) {
   206773    case 10: return 25;
   206774    case 9: return 25;
   206775    case 8: return 25;
   206776    case 7:
   206777       if (devinfo->is_haswell) {
   206778          return 25;
   206779       } else {
   206780          return 25;
   206781       }
   206782    case 6: return 25;
   206783    case 5: return 0;
   206784    case 4:
   206785       if (devinfo->is_g4x) {
   206786          return 0;
   206787       } else {
   206788          return 0;
   206789       }
   206790    default:
   206791       unreachable("Invalid hardware generation");
   206792    }
   206793 }
   206794 
   206795 
   206796 
   206797 /* VCS_INSTDONE::VCS Done */
   206798 
   206799 
   206800 #define GEN10_VCS_INSTDONE_VCSDone_bits  1
   206801 #define GEN9_VCS_INSTDONE_VCSDone_bits  1
   206802 #define GEN8_VCS_INSTDONE_VCSDone_bits  1
   206803 #define GEN75_VCS_INSTDONE_VCSDone_bits  1
   206804 #define GEN7_VCS_INSTDONE_VCSDone_bits  1
   206805 #define GEN6_VCS_INSTDONE_VCSDone_bits  1
   206806 
   206807 static inline uint32_t ATTRIBUTE_PURE
   206808 VCS_INSTDONE_VCSDone_bits(const struct gen_device_info *devinfo)
   206809 {
   206810    switch (devinfo->gen) {
   206811    case 10: return 1;
   206812    case 9: return 1;
   206813    case 8: return 1;
   206814    case 7:
   206815       if (devinfo->is_haswell) {
   206816          return 1;
   206817       } else {
   206818          return 1;
   206819       }
   206820    case 6: return 1;
   206821    case 5: return 0;
   206822    case 4:
   206823       if (devinfo->is_g4x) {
   206824          return 0;
   206825       } else {
   206826          return 0;
   206827       }
   206828    default:
   206829       unreachable("Invalid hardware generation");
   206830    }
   206831 }
   206832 
   206833 
   206834 
   206835 #define GEN10_VCS_INSTDONE_VCSDone_start  30
   206836 #define GEN9_VCS_INSTDONE_VCSDone_start  30
   206837 #define GEN8_VCS_INSTDONE_VCSDone_start  30
   206838 #define GEN75_VCS_INSTDONE_VCSDone_start  30
   206839 #define GEN7_VCS_INSTDONE_VCSDone_start  30
   206840 #define GEN6_VCS_INSTDONE_VCSDone_start  30
   206841 
   206842 static inline uint32_t ATTRIBUTE_PURE
   206843 VCS_INSTDONE_VCSDone_start(const struct gen_device_info *devinfo)
   206844 {
   206845    switch (devinfo->gen) {
   206846    case 10: return 30;
   206847    case 9: return 30;
   206848    case 8: return 30;
   206849    case 7:
   206850       if (devinfo->is_haswell) {
   206851          return 30;
   206852       } else {
   206853          return 30;
   206854       }
   206855    case 6: return 30;
   206856    case 5: return 0;
   206857    case 4:
   206858       if (devinfo->is_g4x) {
   206859          return 0;
   206860       } else {
   206861          return 0;
   206862       }
   206863    default:
   206864       unreachable("Invalid hardware generation");
   206865    }
   206866 }
   206867 
   206868 
   206869 
   206870 /* VCS_INSTDONE::VDS Done */
   206871 
   206872 
   206873 #define GEN10_VCS_INSTDONE_VDSDone_bits  1
   206874 #define GEN9_VCS_INSTDONE_VDSDone_bits  1
   206875 #define GEN8_VCS_INSTDONE_VDSDone_bits  1
   206876 #define GEN75_VCS_INSTDONE_VDSDone_bits  1
   206877 #define GEN7_VCS_INSTDONE_VDSDone_bits  1
   206878 #define GEN6_VCS_INSTDONE_VDSDone_bits  1
   206879 
   206880 static inline uint32_t ATTRIBUTE_PURE
   206881 VCS_INSTDONE_VDSDone_bits(const struct gen_device_info *devinfo)
   206882 {
   206883    switch (devinfo->gen) {
   206884    case 10: return 1;
   206885    case 9: return 1;
   206886    case 8: return 1;
   206887    case 7:
   206888       if (devinfo->is_haswell) {
   206889          return 1;
   206890       } else {
   206891          return 1;
   206892       }
   206893    case 6: return 1;
   206894    case 5: return 0;
   206895    case 4:
   206896       if (devinfo->is_g4x) {
   206897          return 0;
   206898       } else {
   206899          return 0;
   206900       }
   206901    default:
   206902       unreachable("Invalid hardware generation");
   206903    }
   206904 }
   206905 
   206906 
   206907 
   206908 #define GEN10_VCS_INSTDONE_VDSDone_start  12
   206909 #define GEN9_VCS_INSTDONE_VDSDone_start  12
   206910 #define GEN8_VCS_INSTDONE_VDSDone_start  12
   206911 #define GEN75_VCS_INSTDONE_VDSDone_start  12
   206912 #define GEN7_VCS_INSTDONE_VDSDone_start  12
   206913 #define GEN6_VCS_INSTDONE_VDSDone_start  12
   206914 
   206915 static inline uint32_t ATTRIBUTE_PURE
   206916 VCS_INSTDONE_VDSDone_start(const struct gen_device_info *devinfo)
   206917 {
   206918    switch (devinfo->gen) {
   206919    case 10: return 12;
   206920    case 9: return 12;
   206921    case 8: return 12;
   206922    case 7:
   206923       if (devinfo->is_haswell) {
   206924          return 12;
   206925       } else {
   206926          return 12;
   206927       }
   206928    case 6: return 12;
   206929    case 5: return 0;
   206930    case 4:
   206931       if (devinfo->is_g4x) {
   206932          return 0;
   206933       } else {
   206934          return 0;
   206935       }
   206936    default:
   206937       unreachable("Invalid hardware generation");
   206938    }
   206939 }
   206940 
   206941 
   206942 
   206943 /* VCS_INSTDONE::VFT Done */
   206944 
   206945 
   206946 #define GEN10_VCS_INSTDONE_VFTDone_bits  1
   206947 #define GEN9_VCS_INSTDONE_VFTDone_bits  1
   206948 #define GEN8_VCS_INSTDONE_VFTDone_bits  1
   206949 #define GEN75_VCS_INSTDONE_VFTDone_bits  1
   206950 #define GEN7_VCS_INSTDONE_VFTDone_bits  1
   206951 #define GEN6_VCS_INSTDONE_VFTDone_bits  1
   206952 
   206953 static inline uint32_t ATTRIBUTE_PURE
   206954 VCS_INSTDONE_VFTDone_bits(const struct gen_device_info *devinfo)
   206955 {
   206956    switch (devinfo->gen) {
   206957    case 10: return 1;
   206958    case 9: return 1;
   206959    case 8: return 1;
   206960    case 7:
   206961       if (devinfo->is_haswell) {
   206962          return 1;
   206963       } else {
   206964          return 1;
   206965       }
   206966    case 6: return 1;
   206967    case 5: return 0;
   206968    case 4:
   206969       if (devinfo->is_g4x) {
   206970          return 0;
   206971       } else {
   206972          return 0;
   206973       }
   206974    default:
   206975       unreachable("Invalid hardware generation");
   206976    }
   206977 }
   206978 
   206979 
   206980 
   206981 #define GEN10_VCS_INSTDONE_VFTDone_start  5
   206982 #define GEN9_VCS_INSTDONE_VFTDone_start  5
   206983 #define GEN8_VCS_INSTDONE_VFTDone_start  5
   206984 #define GEN75_VCS_INSTDONE_VFTDone_start  5
   206985 #define GEN7_VCS_INSTDONE_VFTDone_start  5
   206986 #define GEN6_VCS_INSTDONE_VFTDone_start  5
   206987 
   206988 static inline uint32_t ATTRIBUTE_PURE
   206989 VCS_INSTDONE_VFTDone_start(const struct gen_device_info *devinfo)
   206990 {
   206991    switch (devinfo->gen) {
   206992    case 10: return 5;
   206993    case 9: return 5;
   206994    case 8: return 5;
   206995    case 7:
   206996       if (devinfo->is_haswell) {
   206997          return 5;
   206998       } else {
   206999          return 5;
   207000       }
   207001    case 6: return 5;
   207002    case 5: return 0;
   207003    case 4:
   207004       if (devinfo->is_g4x) {
   207005          return 0;
   207006       } else {
   207007          return 0;
   207008       }
   207009    default:
   207010       unreachable("Invalid hardware generation");
   207011    }
   207012 }
   207013 
   207014 
   207015 
   207016 /* VCS_INSTDONE::VHR Done */
   207017 
   207018 
   207019 #define GEN10_VCS_INSTDONE_VHRDone_bits  1
   207020 #define GEN9_VCS_INSTDONE_VHRDone_bits  1
   207021 #define GEN8_VCS_INSTDONE_VHRDone_bits  1
   207022 #define GEN75_VCS_INSTDONE_VHRDone_bits  1
   207023 #define GEN7_VCS_INSTDONE_VHRDone_bits  1
   207024 #define GEN6_VCS_INSTDONE_VHRDone_bits  1
   207025 
   207026 static inline uint32_t ATTRIBUTE_PURE
   207027 VCS_INSTDONE_VHRDone_bits(const struct gen_device_info *devinfo)
   207028 {
   207029    switch (devinfo->gen) {
   207030    case 10: return 1;
   207031    case 9: return 1;
   207032    case 8: return 1;
   207033    case 7:
   207034       if (devinfo->is_haswell) {
   207035          return 1;
   207036       } else {
   207037          return 1;
   207038       }
   207039    case 6: return 1;
   207040    case 5: return 0;
   207041    case 4:
   207042       if (devinfo->is_g4x) {
   207043          return 0;
   207044       } else {
   207045          return 0;
   207046       }
   207047    default:
   207048       unreachable("Invalid hardware generation");
   207049    }
   207050 }
   207051 
   207052 
   207053 
   207054 #define GEN10_VCS_INSTDONE_VHRDone_start  23
   207055 #define GEN9_VCS_INSTDONE_VHRDone_start  23
   207056 #define GEN8_VCS_INSTDONE_VHRDone_start  23
   207057 #define GEN75_VCS_INSTDONE_VHRDone_start  23
   207058 #define GEN7_VCS_INSTDONE_VHRDone_start  23
   207059 #define GEN6_VCS_INSTDONE_VHRDone_start  23
   207060 
   207061 static inline uint32_t ATTRIBUTE_PURE
   207062 VCS_INSTDONE_VHRDone_start(const struct gen_device_info *devinfo)
   207063 {
   207064    switch (devinfo->gen) {
   207065    case 10: return 23;
   207066    case 9: return 23;
   207067    case 8: return 23;
   207068    case 7:
   207069       if (devinfo->is_haswell) {
   207070          return 23;
   207071       } else {
   207072          return 23;
   207073       }
   207074    case 6: return 23;
   207075    case 5: return 0;
   207076    case 4:
   207077       if (devinfo->is_g4x) {
   207078          return 0;
   207079       } else {
   207080          return 0;
   207081       }
   207082    default:
   207083       unreachable("Invalid hardware generation");
   207084    }
   207085 }
   207086 
   207087 
   207088 
   207089 /* VCS_INSTDONE::VIN Done */
   207090 
   207091 
   207092 #define GEN10_VCS_INSTDONE_VINDone_bits  1
   207093 #define GEN9_VCS_INSTDONE_VINDone_bits  1
   207094 #define GEN8_VCS_INSTDONE_VINDone_bits  1
   207095 #define GEN75_VCS_INSTDONE_VINDone_bits  1
   207096 #define GEN7_VCS_INSTDONE_VINDone_bits  1
   207097 #define GEN6_VCS_INSTDONE_VINDone_bits  1
   207098 
   207099 static inline uint32_t ATTRIBUTE_PURE
   207100 VCS_INSTDONE_VINDone_bits(const struct gen_device_info *devinfo)
   207101 {
   207102    switch (devinfo->gen) {
   207103    case 10: return 1;
   207104    case 9: return 1;
   207105    case 8: return 1;
   207106    case 7:
   207107       if (devinfo->is_haswell) {
   207108          return 1;
   207109       } else {
   207110          return 1;
   207111       }
   207112    case 6: return 1;
   207113    case 5: return 0;
   207114    case 4:
   207115       if (devinfo->is_g4x) {
   207116          return 0;
   207117       } else {
   207118          return 0;
   207119       }
   207120    default:
   207121       unreachable("Invalid hardware generation");
   207122    }
   207123 }
   207124 
   207125 
   207126 
   207127 #define GEN10_VCS_INSTDONE_VINDone_start  26
   207128 #define GEN9_VCS_INSTDONE_VINDone_start  26
   207129 #define GEN8_VCS_INSTDONE_VINDone_start  26
   207130 #define GEN75_VCS_INSTDONE_VINDone_start  26
   207131 #define GEN7_VCS_INSTDONE_VINDone_start  26
   207132 #define GEN6_VCS_INSTDONE_VINDone_start  26
   207133 
   207134 static inline uint32_t ATTRIBUTE_PURE
   207135 VCS_INSTDONE_VINDone_start(const struct gen_device_info *devinfo)
   207136 {
   207137    switch (devinfo->gen) {
   207138    case 10: return 26;
   207139    case 9: return 26;
   207140    case 8: return 26;
   207141    case 7:
   207142       if (devinfo->is_haswell) {
   207143          return 26;
   207144       } else {
   207145          return 26;
   207146       }
   207147    case 6: return 26;
   207148    case 5: return 0;
   207149    case 4:
   207150       if (devinfo->is_g4x) {
   207151          return 0;
   207152       } else {
   207153          return 0;
   207154       }
   207155    default:
   207156       unreachable("Invalid hardware generation");
   207157    }
   207158 }
   207159 
   207160 
   207161 
   207162 /* VCS_INSTDONE::VIP Done */
   207163 
   207164 
   207165 #define GEN10_VCS_INSTDONE_VIPDone_bits  1
   207166 #define GEN9_VCS_INSTDONE_VIPDone_bits  1
   207167 #define GEN8_VCS_INSTDONE_VIPDone_bits  1
   207168 #define GEN75_VCS_INSTDONE_VIPDone_bits  1
   207169 #define GEN7_VCS_INSTDONE_VIPDone_bits  1
   207170 #define GEN6_VCS_INSTDONE_VIPDone_bits  1
   207171 
   207172 static inline uint32_t ATTRIBUTE_PURE
   207173 VCS_INSTDONE_VIPDone_bits(const struct gen_device_info *devinfo)
   207174 {
   207175    switch (devinfo->gen) {
   207176    case 10: return 1;
   207177    case 9: return 1;
   207178    case 8: return 1;
   207179    case 7:
   207180       if (devinfo->is_haswell) {
   207181          return 1;
   207182       } else {
   207183          return 1;
   207184       }
   207185    case 6: return 1;
   207186    case 5: return 0;
   207187    case 4:
   207188       if (devinfo->is_g4x) {
   207189          return 0;
   207190       } else {
   207191          return 0;
   207192       }
   207193    default:
   207194       unreachable("Invalid hardware generation");
   207195    }
   207196 }
   207197 
   207198 
   207199 
   207200 #define GEN10_VCS_INSTDONE_VIPDone_start  10
   207201 #define GEN9_VCS_INSTDONE_VIPDone_start  10
   207202 #define GEN8_VCS_INSTDONE_VIPDone_start  10
   207203 #define GEN75_VCS_INSTDONE_VIPDone_start  10
   207204 #define GEN7_VCS_INSTDONE_VIPDone_start  10
   207205 #define GEN6_VCS_INSTDONE_VIPDone_start  10
   207206 
   207207 static inline uint32_t ATTRIBUTE_PURE
   207208 VCS_INSTDONE_VIPDone_start(const struct gen_device_info *devinfo)
   207209 {
   207210    switch (devinfo->gen) {
   207211    case 10: return 10;
   207212    case 9: return 10;
   207213    case 8: return 10;
   207214    case 7:
   207215       if (devinfo->is_haswell) {
   207216          return 10;
   207217       } else {
   207218          return 10;
   207219       }
   207220    case 6: return 10;
   207221    case 5: return 0;
   207222    case 4:
   207223       if (devinfo->is_g4x) {
   207224          return 0;
   207225       } else {
   207226          return 0;
   207227       }
   207228    default:
   207229       unreachable("Invalid hardware generation");
   207230    }
   207231 }
   207232 
   207233 
   207234 
   207235 /* VCS_INSTDONE::VIS Done */
   207236 
   207237 
   207238 #define GEN10_VCS_INSTDONE_VISDone_bits  1
   207239 #define GEN9_VCS_INSTDONE_VISDone_bits  1
   207240 #define GEN8_VCS_INSTDONE_VISDone_bits  1
   207241 #define GEN75_VCS_INSTDONE_VISDone_bits  1
   207242 #define GEN7_VCS_INSTDONE_VISDone_bits  1
   207243 #define GEN6_VCS_INSTDONE_VISDone_bits  1
   207244 
   207245 static inline uint32_t ATTRIBUTE_PURE
   207246 VCS_INSTDONE_VISDone_bits(const struct gen_device_info *devinfo)
   207247 {
   207248    switch (devinfo->gen) {
   207249    case 10: return 1;
   207250    case 9: return 1;
   207251    case 8: return 1;
   207252    case 7:
   207253       if (devinfo->is_haswell) {
   207254          return 1;
   207255       } else {
   207256          return 1;
   207257       }
   207258    case 6: return 1;
   207259    case 5: return 0;
   207260    case 4:
   207261       if (devinfo->is_g4x) {
   207262          return 0;
   207263       } else {
   207264          return 0;
   207265       }
   207266    default:
   207267       unreachable("Invalid hardware generation");
   207268    }
   207269 }
   207270 
   207271 
   207272 
   207273 #define GEN10_VCS_INSTDONE_VISDone_start  18
   207274 #define GEN9_VCS_INSTDONE_VISDone_start  18
   207275 #define GEN8_VCS_INSTDONE_VISDone_start  18
   207276 #define GEN75_VCS_INSTDONE_VISDone_start  18
   207277 #define GEN7_VCS_INSTDONE_VISDone_start  18
   207278 #define GEN6_VCS_INSTDONE_VISDone_start  18
   207279 
   207280 static inline uint32_t ATTRIBUTE_PURE
   207281 VCS_INSTDONE_VISDone_start(const struct gen_device_info *devinfo)
   207282 {
   207283    switch (devinfo->gen) {
   207284    case 10: return 18;
   207285    case 9: return 18;
   207286    case 8: return 18;
   207287    case 7:
   207288       if (devinfo->is_haswell) {
   207289          return 18;
   207290       } else {
   207291          return 18;
   207292       }
   207293    case 6: return 18;
   207294    case 5: return 0;
   207295    case 4:
   207296       if (devinfo->is_g4x) {
   207297          return 0;
   207298       } else {
   207299          return 0;
   207300       }
   207301    default:
   207302       unreachable("Invalid hardware generation");
   207303    }
   207304 }
   207305 
   207306 
   207307 
   207308 /* VCS_INSTDONE::VIT Done */
   207309 
   207310 
   207311 #define GEN10_VCS_INSTDONE_VITDone_bits  1
   207312 #define GEN9_VCS_INSTDONE_VITDone_bits  1
   207313 #define GEN8_VCS_INSTDONE_VITDone_bits  1
   207314 #define GEN75_VCS_INSTDONE_VITDone_bits  1
   207315 #define GEN7_VCS_INSTDONE_VITDone_bits  1
   207316 #define GEN6_VCS_INSTDONE_VITDone_bits  1
   207317 
   207318 static inline uint32_t ATTRIBUTE_PURE
   207319 VCS_INSTDONE_VITDone_bits(const struct gen_device_info *devinfo)
   207320 {
   207321    switch (devinfo->gen) {
   207322    case 10: return 1;
   207323    case 9: return 1;
   207324    case 8: return 1;
   207325    case 7:
   207326       if (devinfo->is_haswell) {
   207327          return 1;
   207328       } else {
   207329          return 1;
   207330       }
   207331    case 6: return 1;
   207332    case 5: return 0;
   207333    case 4:
   207334       if (devinfo->is_g4x) {
   207335          return 0;
   207336       } else {
   207337          return 0;
   207338       }
   207339    default:
   207340       unreachable("Invalid hardware generation");
   207341    }
   207342 }
   207343 
   207344 
   207345 
   207346 #define GEN10_VCS_INSTDONE_VITDone_start  11
   207347 #define GEN9_VCS_INSTDONE_VITDone_start  11
   207348 #define GEN8_VCS_INSTDONE_VITDone_start  11
   207349 #define GEN75_VCS_INSTDONE_VITDone_start  11
   207350 #define GEN7_VCS_INSTDONE_VITDone_start  11
   207351 #define GEN6_VCS_INSTDONE_VITDone_start  11
   207352 
   207353 static inline uint32_t ATTRIBUTE_PURE
   207354 VCS_INSTDONE_VITDone_start(const struct gen_device_info *devinfo)
   207355 {
   207356    switch (devinfo->gen) {
   207357    case 10: return 11;
   207358    case 9: return 11;
   207359    case 8: return 11;
   207360    case 7:
   207361       if (devinfo->is_haswell) {
   207362          return 11;
   207363       } else {
   207364          return 11;
   207365       }
   207366    case 6: return 11;
   207367    case 5: return 0;
   207368    case 4:
   207369       if (devinfo->is_g4x) {
   207370          return 0;
   207371       } else {
   207372          return 0;
   207373       }
   207374    default:
   207375       unreachable("Invalid hardware generation");
   207376    }
   207377 }
   207378 
   207379 
   207380 
   207381 /* VCS_INSTDONE::VLF Done */
   207382 
   207383 
   207384 #define GEN10_VCS_INSTDONE_VLFDone_bits  1
   207385 #define GEN9_VCS_INSTDONE_VLFDone_bits  1
   207386 #define GEN8_VCS_INSTDONE_VLFDone_bits  1
   207387 #define GEN75_VCS_INSTDONE_VLFDone_bits  1
   207388 #define GEN7_VCS_INSTDONE_VLFDone_bits  1
   207389 #define GEN6_VCS_INSTDONE_VLFDone_bits  1
   207390 
   207391 static inline uint32_t ATTRIBUTE_PURE
   207392 VCS_INSTDONE_VLFDone_bits(const struct gen_device_info *devinfo)
   207393 {
   207394    switch (devinfo->gen) {
   207395    case 10: return 1;
   207396    case 9: return 1;
   207397    case 8: return 1;
   207398    case 7:
   207399       if (devinfo->is_haswell) {
   207400          return 1;
   207401       } else {
   207402          return 1;
   207403       }
   207404    case 6: return 1;
   207405    case 5: return 0;
   207406    case 4:
   207407       if (devinfo->is_g4x) {
   207408          return 0;
   207409       } else {
   207410          return 0;
   207411       }
   207412    default:
   207413       unreachable("Invalid hardware generation");
   207414    }
   207415 }
   207416 
   207417 
   207418 
   207419 #define GEN10_VCS_INSTDONE_VLFDone_start  7
   207420 #define GEN9_VCS_INSTDONE_VLFDone_start  7
   207421 #define GEN8_VCS_INSTDONE_VLFDone_start  7
   207422 #define GEN75_VCS_INSTDONE_VLFDone_start  7
   207423 #define GEN7_VCS_INSTDONE_VLFDone_start  7
   207424 #define GEN6_VCS_INSTDONE_VLFDone_start  7
   207425 
   207426 static inline uint32_t ATTRIBUTE_PURE
   207427 VCS_INSTDONE_VLFDone_start(const struct gen_device_info *devinfo)
   207428 {
   207429    switch (devinfo->gen) {
   207430    case 10: return 7;
   207431    case 9: return 7;
   207432    case 8: return 7;
   207433    case 7:
   207434       if (devinfo->is_haswell) {
   207435          return 7;
   207436       } else {
   207437          return 7;
   207438       }
   207439    case 6: return 7;
   207440    case 5: return 0;
   207441    case 4:
   207442       if (devinfo->is_g4x) {
   207443          return 0;
   207444       } else {
   207445          return 0;
   207446       }
   207447    default:
   207448       unreachable("Invalid hardware generation");
   207449    }
   207450 }
   207451 
   207452 
   207453 
   207454 /* VCS_INSTDONE::VMC Done */
   207455 
   207456 
   207457 #define GEN10_VCS_INSTDONE_VMCDone_bits  1
   207458 #define GEN9_VCS_INSTDONE_VMCDone_bits  1
   207459 #define GEN8_VCS_INSTDONE_VMCDone_bits  1
   207460 #define GEN75_VCS_INSTDONE_VMCDone_bits  1
   207461 #define GEN7_VCS_INSTDONE_VMCDone_bits  1
   207462 #define GEN6_VCS_INSTDONE_VMCDone_bits  1
   207463 
   207464 static inline uint32_t ATTRIBUTE_PURE
   207465 VCS_INSTDONE_VMCDone_bits(const struct gen_device_info *devinfo)
   207466 {
   207467    switch (devinfo->gen) {
   207468    case 10: return 1;
   207469    case 9: return 1;
   207470    case 8: return 1;
   207471    case 7:
   207472       if (devinfo->is_haswell) {
   207473          return 1;
   207474       } else {
   207475          return 1;
   207476       }
   207477    case 6: return 1;
   207478    case 5: return 0;
   207479    case 4:
   207480       if (devinfo->is_g4x) {
   207481          return 0;
   207482       } else {
   207483          return 0;
   207484       }
   207485    default:
   207486       unreachable("Invalid hardware generation");
   207487    }
   207488 }
   207489 
   207490 
   207491 
   207492 #define GEN10_VCS_INSTDONE_VMCDone_start  9
   207493 #define GEN9_VCS_INSTDONE_VMCDone_start  9
   207494 #define GEN8_VCS_INSTDONE_VMCDone_start  9
   207495 #define GEN75_VCS_INSTDONE_VMCDone_start  9
   207496 #define GEN7_VCS_INSTDONE_VMCDone_start  9
   207497 #define GEN6_VCS_INSTDONE_VMCDone_start  9
   207498 
   207499 static inline uint32_t ATTRIBUTE_PURE
   207500 VCS_INSTDONE_VMCDone_start(const struct gen_device_info *devinfo)
   207501 {
   207502    switch (devinfo->gen) {
   207503    case 10: return 9;
   207504    case 9: return 9;
   207505    case 8: return 9;
   207506    case 7:
   207507       if (devinfo->is_haswell) {
   207508          return 9;
   207509       } else {
   207510          return 9;
   207511       }
   207512    case 6: return 9;
   207513    case 5: return 0;
   207514    case 4:
   207515       if (devinfo->is_g4x) {
   207516          return 0;
   207517       } else {
   207518          return 0;
   207519       }
   207520    default:
   207521       unreachable("Invalid hardware generation");
   207522    }
   207523 }
   207524 
   207525 
   207526 
   207527 /* VCS_INSTDONE::VMD Done */
   207528 
   207529 
   207530 #define GEN10_VCS_INSTDONE_VMDDone_bits  1
   207531 #define GEN9_VCS_INSTDONE_VMDDone_bits  1
   207532 #define GEN8_VCS_INSTDONE_VMDDone_bits  1
   207533 #define GEN75_VCS_INSTDONE_VMDDone_bits  1
   207534 #define GEN7_VCS_INSTDONE_VMDDone_bits  1
   207535 #define GEN6_VCS_INSTDONE_VMDDone_bits  1
   207536 
   207537 static inline uint32_t ATTRIBUTE_PURE
   207538 VCS_INSTDONE_VMDDone_bits(const struct gen_device_info *devinfo)
   207539 {
   207540    switch (devinfo->gen) {
   207541    case 10: return 1;
   207542    case 9: return 1;
   207543    case 8: return 1;
   207544    case 7:
   207545       if (devinfo->is_haswell) {
   207546          return 1;
   207547       } else {
   207548          return 1;
   207549       }
   207550    case 6: return 1;
   207551    case 5: return 0;
   207552    case 4:
   207553       if (devinfo->is_g4x) {
   207554          return 0;
   207555       } else {
   207556          return 0;
   207557       }
   207558    default:
   207559       unreachable("Invalid hardware generation");
   207560    }
   207561 }
   207562 
   207563 
   207564 
   207565 #define GEN10_VCS_INSTDONE_VMDDone_start  17
   207566 #define GEN9_VCS_INSTDONE_VMDDone_start  17
   207567 #define GEN8_VCS_INSTDONE_VMDDone_start  17
   207568 #define GEN75_VCS_INSTDONE_VMDDone_start  17
   207569 #define GEN7_VCS_INSTDONE_VMDDone_start  17
   207570 #define GEN6_VCS_INSTDONE_VMDDone_start  17
   207571 
   207572 static inline uint32_t ATTRIBUTE_PURE
   207573 VCS_INSTDONE_VMDDone_start(const struct gen_device_info *devinfo)
   207574 {
   207575    switch (devinfo->gen) {
   207576    case 10: return 17;
   207577    case 9: return 17;
   207578    case 8: return 17;
   207579    case 7:
   207580       if (devinfo->is_haswell) {
   207581          return 17;
   207582       } else {
   207583          return 17;
   207584       }
   207585    case 6: return 17;
   207586    case 5: return 0;
   207587    case 4:
   207588       if (devinfo->is_g4x) {
   207589          return 0;
   207590       } else {
   207591          return 0;
   207592       }
   207593    default:
   207594       unreachable("Invalid hardware generation");
   207595    }
   207596 }
   207597 
   207598 
   207599 
   207600 /* VCS_INSTDONE::VMX Done */
   207601 
   207602 
   207603 #define GEN10_VCS_INSTDONE_VMXDone_bits  1
   207604 #define GEN9_VCS_INSTDONE_VMXDone_bits  1
   207605 #define GEN8_VCS_INSTDONE_VMXDone_bits  1
   207606 #define GEN75_VCS_INSTDONE_VMXDone_bits  1
   207607 #define GEN7_VCS_INSTDONE_VMXDone_bits  1
   207608 #define GEN6_VCS_INSTDONE_VMXDone_bits  1
   207609 
   207610 static inline uint32_t ATTRIBUTE_PURE
   207611 VCS_INSTDONE_VMXDone_bits(const struct gen_device_info *devinfo)
   207612 {
   207613    switch (devinfo->gen) {
   207614    case 10: return 1;
   207615    case 9: return 1;
   207616    case 8: return 1;
   207617    case 7:
   207618       if (devinfo->is_haswell) {
   207619          return 1;
   207620       } else {
   207621          return 1;
   207622       }
   207623    case 6: return 1;
   207624    case 5: return 0;
   207625    case 4:
   207626       if (devinfo->is_g4x) {
   207627          return 0;
   207628       } else {
   207629          return 0;
   207630       }
   207631    default:
   207632       unreachable("Invalid hardware generation");
   207633    }
   207634 }
   207635 
   207636 
   207637 
   207638 #define GEN10_VCS_INSTDONE_VMXDone_start  13
   207639 #define GEN9_VCS_INSTDONE_VMXDone_start  13
   207640 #define GEN8_VCS_INSTDONE_VMXDone_start  13
   207641 #define GEN75_VCS_INSTDONE_VMXDone_start  13
   207642 #define GEN7_VCS_INSTDONE_VMXDone_start  13
   207643 #define GEN6_VCS_INSTDONE_VMXDone_start  13
   207644 
   207645 static inline uint32_t ATTRIBUTE_PURE
   207646 VCS_INSTDONE_VMXDone_start(const struct gen_device_info *devinfo)
   207647 {
   207648    switch (devinfo->gen) {
   207649    case 10: return 13;
   207650    case 9: return 13;
   207651    case 8: return 13;
   207652    case 7:
   207653       if (devinfo->is_haswell) {
   207654          return 13;
   207655       } else {
   207656          return 13;
   207657       }
   207658    case 6: return 13;
   207659    case 5: return 0;
   207660    case 4:
   207661       if (devinfo->is_g4x) {
   207662          return 0;
   207663       } else {
   207664          return 0;
   207665       }
   207666    default:
   207667       unreachable("Invalid hardware generation");
   207668    }
   207669 }
   207670 
   207671 
   207672 
   207673 /* VCS_INSTDONE::VOP Done */
   207674 
   207675 
   207676 #define GEN10_VCS_INSTDONE_VOPDone_bits  1
   207677 #define GEN9_VCS_INSTDONE_VOPDone_bits  1
   207678 #define GEN8_VCS_INSTDONE_VOPDone_bits  1
   207679 #define GEN75_VCS_INSTDONE_VOPDone_bits  1
   207680 #define GEN7_VCS_INSTDONE_VOPDone_bits  1
   207681 #define GEN6_VCS_INSTDONE_VOPDone_bits  1
   207682 
   207683 static inline uint32_t ATTRIBUTE_PURE
   207684 VCS_INSTDONE_VOPDone_bits(const struct gen_device_info *devinfo)
   207685 {
   207686    switch (devinfo->gen) {
   207687    case 10: return 1;
   207688    case 9: return 1;
   207689    case 8: return 1;
   207690    case 7:
   207691       if (devinfo->is_haswell) {
   207692          return 1;
   207693       } else {
   207694          return 1;
   207695       }
   207696    case 6: return 1;
   207697    case 5: return 0;
   207698    case 4:
   207699       if (devinfo->is_g4x) {
   207700          return 0;
   207701       } else {
   207702          return 0;
   207703       }
   207704    default:
   207705       unreachable("Invalid hardware generation");
   207706    }
   207707 }
   207708 
   207709 
   207710 
   207711 #define GEN10_VCS_INSTDONE_VOPDone_start  8
   207712 #define GEN9_VCS_INSTDONE_VOPDone_start  8
   207713 #define GEN8_VCS_INSTDONE_VOPDone_start  8
   207714 #define GEN75_VCS_INSTDONE_VOPDone_start  8
   207715 #define GEN7_VCS_INSTDONE_VOPDone_start  8
   207716 #define GEN6_VCS_INSTDONE_VOPDone_start  8
   207717 
   207718 static inline uint32_t ATTRIBUTE_PURE
   207719 VCS_INSTDONE_VOPDone_start(const struct gen_device_info *devinfo)
   207720 {
   207721    switch (devinfo->gen) {
   207722    case 10: return 8;
   207723    case 9: return 8;
   207724    case 8: return 8;
   207725    case 7:
   207726       if (devinfo->is_haswell) {
   207727          return 8;
   207728       } else {
   207729          return 8;
   207730       }
   207731    case 6: return 8;
   207732    case 5: return 0;
   207733    case 4:
   207734       if (devinfo->is_g4x) {
   207735          return 0;
   207736       } else {
   207737          return 0;
   207738       }
   207739    default:
   207740       unreachable("Invalid hardware generation");
   207741    }
   207742 }
   207743 
   207744 
   207745 
   207746 /* VCS_INSTDONE::VPR Done */
   207747 
   207748 
   207749 #define GEN10_VCS_INSTDONE_VPRDone_bits  1
   207750 #define GEN9_VCS_INSTDONE_VPRDone_bits  1
   207751 #define GEN8_VCS_INSTDONE_VPRDone_bits  1
   207752 #define GEN75_VCS_INSTDONE_VPRDone_bits  1
   207753 #define GEN7_VCS_INSTDONE_VPRDone_bits  1
   207754 #define GEN6_VCS_INSTDONE_VPRDone_bits  1
   207755 
   207756 static inline uint32_t ATTRIBUTE_PURE
   207757 VCS_INSTDONE_VPRDone_bits(const struct gen_device_info *devinfo)
   207758 {
   207759    switch (devinfo->gen) {
   207760    case 10: return 1;
   207761    case 9: return 1;
   207762    case 8: return 1;
   207763    case 7:
   207764       if (devinfo->is_haswell) {
   207765          return 1;
   207766       } else {
   207767          return 1;
   207768       }
   207769    case 6: return 1;
   207770    case 5: return 0;
   207771    case 4:
   207772       if (devinfo->is_g4x) {
   207773          return 0;
   207774       } else {
   207775          return 0;
   207776       }
   207777    default:
   207778       unreachable("Invalid hardware generation");
   207779    }
   207780 }
   207781 
   207782 
   207783 
   207784 #define GEN10_VCS_INSTDONE_VPRDone_start  27
   207785 #define GEN9_VCS_INSTDONE_VPRDone_start  27
   207786 #define GEN8_VCS_INSTDONE_VPRDone_start  27
   207787 #define GEN75_VCS_INSTDONE_VPRDone_start  27
   207788 #define GEN7_VCS_INSTDONE_VPRDone_start  27
   207789 #define GEN6_VCS_INSTDONE_VPRDone_start  27
   207790 
   207791 static inline uint32_t ATTRIBUTE_PURE
   207792 VCS_INSTDONE_VPRDone_start(const struct gen_device_info *devinfo)
   207793 {
   207794    switch (devinfo->gen) {
   207795    case 10: return 27;
   207796    case 9: return 27;
   207797    case 8: return 27;
   207798    case 7:
   207799       if (devinfo->is_haswell) {
   207800          return 27;
   207801       } else {
   207802          return 27;
   207803       }
   207804    case 6: return 27;
   207805    case 5: return 0;
   207806    case 4:
   207807       if (devinfo->is_g4x) {
   207808          return 0;
   207809       } else {
   207810          return 0;
   207811       }
   207812    default:
   207813       unreachable("Invalid hardware generation");
   207814    }
   207815 }
   207816 
   207817 
   207818 
   207819 /* VCS_INSTDONE::VTQ Done */
   207820 
   207821 
   207822 #define GEN10_VCS_INSTDONE_VTQDone_bits  1
   207823 #define GEN9_VCS_INSTDONE_VTQDone_bits  1
   207824 #define GEN8_VCS_INSTDONE_VTQDone_bits  1
   207825 #define GEN75_VCS_INSTDONE_VTQDone_bits  1
   207826 #define GEN7_VCS_INSTDONE_VTQDone_bits  1
   207827 #define GEN6_VCS_INSTDONE_VTQDone_bits  1
   207828 
   207829 static inline uint32_t ATTRIBUTE_PURE
   207830 VCS_INSTDONE_VTQDone_bits(const struct gen_device_info *devinfo)
   207831 {
   207832    switch (devinfo->gen) {
   207833    case 10: return 1;
   207834    case 9: return 1;
   207835    case 8: return 1;
   207836    case 7:
   207837       if (devinfo->is_haswell) {
   207838          return 1;
   207839       } else {
   207840          return 1;
   207841       }
   207842    case 6: return 1;
   207843    case 5: return 0;
   207844    case 4:
   207845       if (devinfo->is_g4x) {
   207846          return 0;
   207847       } else {
   207848          return 0;
   207849       }
   207850    default:
   207851       unreachable("Invalid hardware generation");
   207852    }
   207853 }
   207854 
   207855 
   207856 
   207857 #define GEN10_VCS_INSTDONE_VTQDone_start  28
   207858 #define GEN9_VCS_INSTDONE_VTQDone_start  28
   207859 #define GEN8_VCS_INSTDONE_VTQDone_start  28
   207860 #define GEN75_VCS_INSTDONE_VTQDone_start  28
   207861 #define GEN7_VCS_INSTDONE_VTQDone_start  28
   207862 #define GEN6_VCS_INSTDONE_VTQDone_start  28
   207863 
   207864 static inline uint32_t ATTRIBUTE_PURE
   207865 VCS_INSTDONE_VTQDone_start(const struct gen_device_info *devinfo)
   207866 {
   207867    switch (devinfo->gen) {
   207868    case 10: return 28;
   207869    case 9: return 28;
   207870    case 8: return 28;
   207871    case 7:
   207872       if (devinfo->is_haswell) {
   207873          return 28;
   207874       } else {
   207875          return 28;
   207876       }
   207877    case 6: return 28;
   207878    case 5: return 0;
   207879    case 4:
   207880       if (devinfo->is_g4x) {
   207881          return 0;
   207882       } else {
   207883          return 0;
   207884       }
   207885    default:
   207886       unreachable("Invalid hardware generation");
   207887    }
   207888 }
   207889 
   207890 
   207891 
   207892 /* VCS_RING_BUFFER_CTL */
   207893 
   207894 
   207895 #define GEN9_VCS_RING_BUFFER_CTL_length  1
   207896 #define GEN8_VCS_RING_BUFFER_CTL_length  1
   207897 #define GEN75_VCS_RING_BUFFER_CTL_length  1
   207898 #define GEN7_VCS_RING_BUFFER_CTL_length  1
   207899 #define GEN6_VCS_RING_BUFFER_CTL_length  1
   207900 
   207901 static inline uint32_t ATTRIBUTE_PURE
   207902 VCS_RING_BUFFER_CTL_length(const struct gen_device_info *devinfo)
   207903 {
   207904    switch (devinfo->gen) {
   207905    case 10: return 0;
   207906    case 9: return 1;
   207907    case 8: return 1;
   207908    case 7:
   207909       if (devinfo->is_haswell) {
   207910          return 1;
   207911       } else {
   207912          return 1;
   207913       }
   207914    case 6: return 1;
   207915    case 5: return 0;
   207916    case 4:
   207917       if (devinfo->is_g4x) {
   207918          return 0;
   207919       } else {
   207920          return 0;
   207921       }
   207922    default:
   207923       unreachable("Invalid hardware generation");
   207924    }
   207925 }
   207926 
   207927 
   207928 
   207929 /* VCS_RING_BUFFER_CTL::Automatic Report Head Pointer */
   207930 
   207931 
   207932 #define GEN9_VCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits  2
   207933 #define GEN8_VCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits  2
   207934 #define GEN75_VCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits  2
   207935 #define GEN7_VCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits  2
   207936 #define GEN6_VCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits  2
   207937 
   207938 static inline uint32_t ATTRIBUTE_PURE
   207939 VCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits(const struct gen_device_info *devinfo)
   207940 {
   207941    switch (devinfo->gen) {
   207942    case 10: return 0;
   207943    case 9: return 2;
   207944    case 8: return 2;
   207945    case 7:
   207946       if (devinfo->is_haswell) {
   207947          return 2;
   207948       } else {
   207949          return 2;
   207950       }
   207951    case 6: return 2;
   207952    case 5: return 0;
   207953    case 4:
   207954       if (devinfo->is_g4x) {
   207955          return 0;
   207956       } else {
   207957          return 0;
   207958       }
   207959    default:
   207960       unreachable("Invalid hardware generation");
   207961    }
   207962 }
   207963 
   207964 
   207965 
   207966 #define GEN9_VCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start  1
   207967 #define GEN8_VCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start  1
   207968 #define GEN75_VCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start  1
   207969 #define GEN7_VCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start  1
   207970 #define GEN6_VCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start  1
   207971 
   207972 static inline uint32_t ATTRIBUTE_PURE
   207973 VCS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start(const struct gen_device_info *devinfo)
   207974 {
   207975    switch (devinfo->gen) {
   207976    case 10: return 0;
   207977    case 9: return 1;
   207978    case 8: return 1;
   207979    case 7:
   207980       if (devinfo->is_haswell) {
   207981          return 1;
   207982       } else {
   207983          return 1;
   207984       }
   207985    case 6: return 1;
   207986    case 5: return 0;
   207987    case 4:
   207988       if (devinfo->is_g4x) {
   207989          return 0;
   207990       } else {
   207991          return 0;
   207992       }
   207993    default:
   207994       unreachable("Invalid hardware generation");
   207995    }
   207996 }
   207997 
   207998 
   207999 
   208000 /* VCS_RING_BUFFER_CTL::Buffer Length (in pages - 1) */
   208001 
   208002 
   208003 #define GEN9_VCS_RING_BUFFER_CTL_BufferLengthinpages1_bits  9
   208004 #define GEN8_VCS_RING_BUFFER_CTL_BufferLengthinpages1_bits  9
   208005 #define GEN75_VCS_RING_BUFFER_CTL_BufferLengthinpages1_bits  9
   208006 #define GEN7_VCS_RING_BUFFER_CTL_BufferLengthinpages1_bits  9
   208007 #define GEN6_VCS_RING_BUFFER_CTL_BufferLengthinpages1_bits  9
   208008 
   208009 static inline uint32_t ATTRIBUTE_PURE
   208010 VCS_RING_BUFFER_CTL_BufferLengthinpages1_bits(const struct gen_device_info *devinfo)
   208011 {
   208012    switch (devinfo->gen) {
   208013    case 10: return 0;
   208014    case 9: return 9;
   208015    case 8: return 9;
   208016    case 7:
   208017       if (devinfo->is_haswell) {
   208018          return 9;
   208019       } else {
   208020          return 9;
   208021       }
   208022    case 6: return 9;
   208023    case 5: return 0;
   208024    case 4:
   208025       if (devinfo->is_g4x) {
   208026          return 0;
   208027       } else {
   208028          return 0;
   208029       }
   208030    default:
   208031       unreachable("Invalid hardware generation");
   208032    }
   208033 }
   208034 
   208035 
   208036 
   208037 #define GEN9_VCS_RING_BUFFER_CTL_BufferLengthinpages1_start  12
   208038 #define GEN8_VCS_RING_BUFFER_CTL_BufferLengthinpages1_start  12
   208039 #define GEN75_VCS_RING_BUFFER_CTL_BufferLengthinpages1_start  12
   208040 #define GEN7_VCS_RING_BUFFER_CTL_BufferLengthinpages1_start  12
   208041 #define GEN6_VCS_RING_BUFFER_CTL_BufferLengthinpages1_start  12
   208042 
   208043 static inline uint32_t ATTRIBUTE_PURE
   208044 VCS_RING_BUFFER_CTL_BufferLengthinpages1_start(const struct gen_device_info *devinfo)
   208045 {
   208046    switch (devinfo->gen) {
   208047    case 10: return 0;
   208048    case 9: return 12;
   208049    case 8: return 12;
   208050    case 7:
   208051       if (devinfo->is_haswell) {
   208052          return 12;
   208053       } else {
   208054          return 12;
   208055       }
   208056    case 6: return 12;
   208057    case 5: return 0;
   208058    case 4:
   208059       if (devinfo->is_g4x) {
   208060          return 0;
   208061       } else {
   208062          return 0;
   208063       }
   208064    default:
   208065       unreachable("Invalid hardware generation");
   208066    }
   208067 }
   208068 
   208069 
   208070 
   208071 /* VCS_RING_BUFFER_CTL::Disable Register Accesses */
   208072 
   208073 
   208074 #define GEN9_VCS_RING_BUFFER_CTL_DisableRegisterAccesses_bits  1
   208075 #define GEN8_VCS_RING_BUFFER_CTL_DisableRegisterAccesses_bits  1
   208076 #define GEN75_VCS_RING_BUFFER_CTL_DisableRegisterAccesses_bits  1
   208077 #define GEN7_VCS_RING_BUFFER_CTL_DisableRegisterAccesses_bits  1
   208078 #define GEN6_VCS_RING_BUFFER_CTL_DisableRegisterAccesses_bits  1
   208079 
   208080 static inline uint32_t ATTRIBUTE_PURE
   208081 VCS_RING_BUFFER_CTL_DisableRegisterAccesses_bits(const struct gen_device_info *devinfo)
   208082 {
   208083    switch (devinfo->gen) {
   208084    case 10: return 0;
   208085    case 9: return 1;
   208086    case 8: return 1;
   208087    case 7:
   208088       if (devinfo->is_haswell) {
   208089          return 1;
   208090       } else {
   208091          return 1;
   208092       }
   208093    case 6: return 1;
   208094    case 5: return 0;
   208095    case 4:
   208096       if (devinfo->is_g4x) {
   208097          return 0;
   208098       } else {
   208099          return 0;
   208100       }
   208101    default:
   208102       unreachable("Invalid hardware generation");
   208103    }
   208104 }
   208105 
   208106 
   208107 
   208108 #define GEN9_VCS_RING_BUFFER_CTL_DisableRegisterAccesses_start  8
   208109 #define GEN8_VCS_RING_BUFFER_CTL_DisableRegisterAccesses_start  8
   208110 #define GEN75_VCS_RING_BUFFER_CTL_DisableRegisterAccesses_start  8
   208111 #define GEN7_VCS_RING_BUFFER_CTL_DisableRegisterAccesses_start  8
   208112 #define GEN6_VCS_RING_BUFFER_CTL_DisableRegisterAccesses_start  8
   208113 
   208114 static inline uint32_t ATTRIBUTE_PURE
   208115 VCS_RING_BUFFER_CTL_DisableRegisterAccesses_start(const struct gen_device_info *devinfo)
   208116 {
   208117    switch (devinfo->gen) {
   208118    case 10: return 0;
   208119    case 9: return 8;
   208120    case 8: return 8;
   208121    case 7:
   208122       if (devinfo->is_haswell) {
   208123          return 8;
   208124       } else {
   208125          return 8;
   208126       }
   208127    case 6: return 8;
   208128    case 5: return 0;
   208129    case 4:
   208130       if (devinfo->is_g4x) {
   208131          return 0;
   208132       } else {
   208133          return 0;
   208134       }
   208135    default:
   208136       unreachable("Invalid hardware generation");
   208137    }
   208138 }
   208139 
   208140 
   208141 
   208142 /* VCS_RING_BUFFER_CTL::RBWait */
   208143 
   208144 
   208145 #define GEN9_VCS_RING_BUFFER_CTL_RBWait_bits  1
   208146 #define GEN8_VCS_RING_BUFFER_CTL_RBWait_bits  1
   208147 #define GEN75_VCS_RING_BUFFER_CTL_RBWait_bits  1
   208148 #define GEN7_VCS_RING_BUFFER_CTL_RBWait_bits  1
   208149 #define GEN6_VCS_RING_BUFFER_CTL_RBWait_bits  1
   208150 
   208151 static inline uint32_t ATTRIBUTE_PURE
   208152 VCS_RING_BUFFER_CTL_RBWait_bits(const struct gen_device_info *devinfo)
   208153 {
   208154    switch (devinfo->gen) {
   208155    case 10: return 0;
   208156    case 9: return 1;
   208157    case 8: return 1;
   208158    case 7:
   208159       if (devinfo->is_haswell) {
   208160          return 1;
   208161       } else {
   208162          return 1;
   208163       }
   208164    case 6: return 1;
   208165    case 5: return 0;
   208166    case 4:
   208167       if (devinfo->is_g4x) {
   208168          return 0;
   208169       } else {
   208170          return 0;
   208171       }
   208172    default:
   208173       unreachable("Invalid hardware generation");
   208174    }
   208175 }
   208176 
   208177 
   208178 
   208179 #define GEN9_VCS_RING_BUFFER_CTL_RBWait_start  11
   208180 #define GEN8_VCS_RING_BUFFER_CTL_RBWait_start  11
   208181 #define GEN75_VCS_RING_BUFFER_CTL_RBWait_start  11
   208182 #define GEN7_VCS_RING_BUFFER_CTL_RBWait_start  11
   208183 #define GEN6_VCS_RING_BUFFER_CTL_RBWait_start  11
   208184 
   208185 static inline uint32_t ATTRIBUTE_PURE
   208186 VCS_RING_BUFFER_CTL_RBWait_start(const struct gen_device_info *devinfo)
   208187 {
   208188    switch (devinfo->gen) {
   208189    case 10: return 0;
   208190    case 9: return 11;
   208191    case 8: return 11;
   208192    case 7:
   208193       if (devinfo->is_haswell) {
   208194          return 11;
   208195       } else {
   208196          return 11;
   208197       }
   208198    case 6: return 11;
   208199    case 5: return 0;
   208200    case 4:
   208201       if (devinfo->is_g4x) {
   208202          return 0;
   208203       } else {
   208204          return 0;
   208205       }
   208206    default:
   208207       unreachable("Invalid hardware generation");
   208208    }
   208209 }
   208210 
   208211 
   208212 
   208213 /* VCS_RING_BUFFER_CTL::Ring Buffer Enable */
   208214 
   208215 
   208216 #define GEN9_VCS_RING_BUFFER_CTL_RingBufferEnable_bits  1
   208217 #define GEN8_VCS_RING_BUFFER_CTL_RingBufferEnable_bits  1
   208218 #define GEN75_VCS_RING_BUFFER_CTL_RingBufferEnable_bits  1
   208219 #define GEN7_VCS_RING_BUFFER_CTL_RingBufferEnable_bits  1
   208220 #define GEN6_VCS_RING_BUFFER_CTL_RingBufferEnable_bits  1
   208221 
   208222 static inline uint32_t ATTRIBUTE_PURE
   208223 VCS_RING_BUFFER_CTL_RingBufferEnable_bits(const struct gen_device_info *devinfo)
   208224 {
   208225    switch (devinfo->gen) {
   208226    case 10: return 0;
   208227    case 9: return 1;
   208228    case 8: return 1;
   208229    case 7:
   208230       if (devinfo->is_haswell) {
   208231          return 1;
   208232       } else {
   208233          return 1;
   208234       }
   208235    case 6: return 1;
   208236    case 5: return 0;
   208237    case 4:
   208238       if (devinfo->is_g4x) {
   208239          return 0;
   208240       } else {
   208241          return 0;
   208242       }
   208243    default:
   208244       unreachable("Invalid hardware generation");
   208245    }
   208246 }
   208247 
   208248 
   208249 
   208250 #define GEN9_VCS_RING_BUFFER_CTL_RingBufferEnable_start  0
   208251 #define GEN8_VCS_RING_BUFFER_CTL_RingBufferEnable_start  0
   208252 #define GEN75_VCS_RING_BUFFER_CTL_RingBufferEnable_start  0
   208253 #define GEN7_VCS_RING_BUFFER_CTL_RingBufferEnable_start  0
   208254 #define GEN6_VCS_RING_BUFFER_CTL_RingBufferEnable_start  0
   208255 
   208256 static inline uint32_t ATTRIBUTE_PURE
   208257 VCS_RING_BUFFER_CTL_RingBufferEnable_start(const struct gen_device_info *devinfo)
   208258 {
   208259    switch (devinfo->gen) {
   208260    case 10: return 0;
   208261    case 9: return 0;
   208262    case 8: return 0;
   208263    case 7:
   208264       if (devinfo->is_haswell) {
   208265          return 0;
   208266       } else {
   208267          return 0;
   208268       }
   208269    case 6: return 0;
   208270    case 5: return 0;
   208271    case 4:
   208272       if (devinfo->is_g4x) {
   208273          return 0;
   208274       } else {
   208275          return 0;
   208276       }
   208277    default:
   208278       unreachable("Invalid hardware generation");
   208279    }
   208280 }
   208281 
   208282 
   208283 
   208284 /* VCS_RING_BUFFER_CTL::Semaphore Wait */
   208285 
   208286 
   208287 #define GEN9_VCS_RING_BUFFER_CTL_SemaphoreWait_bits  1
   208288 #define GEN8_VCS_RING_BUFFER_CTL_SemaphoreWait_bits  1
   208289 #define GEN75_VCS_RING_BUFFER_CTL_SemaphoreWait_bits  1
   208290 #define GEN7_VCS_RING_BUFFER_CTL_SemaphoreWait_bits  1
   208291 #define GEN6_VCS_RING_BUFFER_CTL_SemaphoreWait_bits  1
   208292 
   208293 static inline uint32_t ATTRIBUTE_PURE
   208294 VCS_RING_BUFFER_CTL_SemaphoreWait_bits(const struct gen_device_info *devinfo)
   208295 {
   208296    switch (devinfo->gen) {
   208297    case 10: return 0;
   208298    case 9: return 1;
   208299    case 8: return 1;
   208300    case 7:
   208301       if (devinfo->is_haswell) {
   208302          return 1;
   208303       } else {
   208304          return 1;
   208305       }
   208306    case 6: return 1;
   208307    case 5: return 0;
   208308    case 4:
   208309       if (devinfo->is_g4x) {
   208310          return 0;
   208311       } else {
   208312          return 0;
   208313       }
   208314    default:
   208315       unreachable("Invalid hardware generation");
   208316    }
   208317 }
   208318 
   208319 
   208320 
   208321 #define GEN9_VCS_RING_BUFFER_CTL_SemaphoreWait_start  10
   208322 #define GEN8_VCS_RING_BUFFER_CTL_SemaphoreWait_start  10
   208323 #define GEN75_VCS_RING_BUFFER_CTL_SemaphoreWait_start  10
   208324 #define GEN7_VCS_RING_BUFFER_CTL_SemaphoreWait_start  10
   208325 #define GEN6_VCS_RING_BUFFER_CTL_SemaphoreWait_start  10
   208326 
   208327 static inline uint32_t ATTRIBUTE_PURE
   208328 VCS_RING_BUFFER_CTL_SemaphoreWait_start(const struct gen_device_info *devinfo)
   208329 {
   208330    switch (devinfo->gen) {
   208331    case 10: return 0;
   208332    case 9: return 10;
   208333    case 8: return 10;
   208334    case 7:
   208335       if (devinfo->is_haswell) {
   208336          return 10;
   208337       } else {
   208338          return 10;
   208339       }
   208340    case 6: return 10;
   208341    case 5: return 0;
   208342    case 4:
   208343       if (devinfo->is_g4x) {
   208344          return 0;
   208345       } else {
   208346          return 0;
   208347       }
   208348    default:
   208349       unreachable("Invalid hardware generation");
   208350    }
   208351 }
   208352 
   208353 
   208354 
   208355 /* VECS_ACTHD_UDW */
   208356 
   208357 
   208358 #define GEN9_VECS_ACTHD_UDW_length  1
   208359 #define GEN8_VECS_ACTHD_UDW_length  1
   208360 
   208361 static inline uint32_t ATTRIBUTE_PURE
   208362 VECS_ACTHD_UDW_length(const struct gen_device_info *devinfo)
   208363 {
   208364    switch (devinfo->gen) {
   208365    case 10: return 0;
   208366    case 9: return 1;
   208367    case 8: return 1;
   208368    case 7:
   208369       if (devinfo->is_haswell) {
   208370          return 0;
   208371       } else {
   208372          return 0;
   208373       }
   208374    case 6: return 0;
   208375    case 5: return 0;
   208376    case 4:
   208377       if (devinfo->is_g4x) {
   208378          return 0;
   208379       } else {
   208380          return 0;
   208381       }
   208382    default:
   208383       unreachable("Invalid hardware generation");
   208384    }
   208385 }
   208386 
   208387 
   208388 
   208389 /* VECS_ACTHD_UDW::Head Pointer Upper DWORD */
   208390 
   208391 
   208392 #define GEN9_VECS_ACTHD_UDW_HeadPointerUpperDWORD_bits  16
   208393 #define GEN8_VECS_ACTHD_UDW_HeadPointerUpperDWORD_bits  16
   208394 
   208395 static inline uint32_t ATTRIBUTE_PURE
   208396 VECS_ACTHD_UDW_HeadPointerUpperDWORD_bits(const struct gen_device_info *devinfo)
   208397 {
   208398    switch (devinfo->gen) {
   208399    case 10: return 0;
   208400    case 9: return 16;
   208401    case 8: return 16;
   208402    case 7:
   208403       if (devinfo->is_haswell) {
   208404          return 0;
   208405       } else {
   208406          return 0;
   208407       }
   208408    case 6: return 0;
   208409    case 5: return 0;
   208410    case 4:
   208411       if (devinfo->is_g4x) {
   208412          return 0;
   208413       } else {
   208414          return 0;
   208415       }
   208416    default:
   208417       unreachable("Invalid hardware generation");
   208418    }
   208419 }
   208420 
   208421 
   208422 
   208423 #define GEN9_VECS_ACTHD_UDW_HeadPointerUpperDWORD_start  0
   208424 #define GEN8_VECS_ACTHD_UDW_HeadPointerUpperDWORD_start  0
   208425 
   208426 static inline uint32_t ATTRIBUTE_PURE
   208427 VECS_ACTHD_UDW_HeadPointerUpperDWORD_start(const struct gen_device_info *devinfo)
   208428 {
   208429    switch (devinfo->gen) {
   208430    case 10: return 0;
   208431    case 9: return 0;
   208432    case 8: return 0;
   208433    case 7:
   208434       if (devinfo->is_haswell) {
   208435          return 0;
   208436       } else {
   208437          return 0;
   208438       }
   208439    case 6: return 0;
   208440    case 5: return 0;
   208441    case 4:
   208442       if (devinfo->is_g4x) {
   208443          return 0;
   208444       } else {
   208445          return 0;
   208446       }
   208447    default:
   208448       unreachable("Invalid hardware generation");
   208449    }
   208450 }
   208451 
   208452 
   208453 
   208454 /* VECS_FAULT_REG */
   208455 
   208456 
   208457 #define GEN75_VECS_FAULT_REG_length  1
   208458 
   208459 static inline uint32_t ATTRIBUTE_PURE
   208460 VECS_FAULT_REG_length(const struct gen_device_info *devinfo)
   208461 {
   208462    switch (devinfo->gen) {
   208463    case 10: return 0;
   208464    case 9: return 0;
   208465    case 8: return 0;
   208466    case 7:
   208467       if (devinfo->is_haswell) {
   208468          return 1;
   208469       } else {
   208470          return 0;
   208471       }
   208472    case 6: return 0;
   208473    case 5: return 0;
   208474    case 4:
   208475       if (devinfo->is_g4x) {
   208476          return 0;
   208477       } else {
   208478          return 0;
   208479       }
   208480    default:
   208481       unreachable("Invalid hardware generation");
   208482    }
   208483 }
   208484 
   208485 
   208486 
   208487 /* VECS_FAULT_REG::Fault Type */
   208488 
   208489 
   208490 #define GEN75_VECS_FAULT_REG_FaultType_bits  2
   208491 
   208492 static inline uint32_t ATTRIBUTE_PURE
   208493 VECS_FAULT_REG_FaultType_bits(const struct gen_device_info *devinfo)
   208494 {
   208495    switch (devinfo->gen) {
   208496    case 10: return 0;
   208497    case 9: return 0;
   208498    case 8: return 0;
   208499    case 7:
   208500       if (devinfo->is_haswell) {
   208501          return 2;
   208502       } else {
   208503          return 0;
   208504       }
   208505    case 6: return 0;
   208506    case 5: return 0;
   208507    case 4:
   208508       if (devinfo->is_g4x) {
   208509          return 0;
   208510       } else {
   208511          return 0;
   208512       }
   208513    default:
   208514       unreachable("Invalid hardware generation");
   208515    }
   208516 }
   208517 
   208518 
   208519 
   208520 #define GEN75_VECS_FAULT_REG_FaultType_start  1
   208521 
   208522 static inline uint32_t ATTRIBUTE_PURE
   208523 VECS_FAULT_REG_FaultType_start(const struct gen_device_info *devinfo)
   208524 {
   208525    switch (devinfo->gen) {
   208526    case 10: return 0;
   208527    case 9: return 0;
   208528    case 8: return 0;
   208529    case 7:
   208530       if (devinfo->is_haswell) {
   208531          return 1;
   208532       } else {
   208533          return 0;
   208534       }
   208535    case 6: return 0;
   208536    case 5: return 0;
   208537    case 4:
   208538       if (devinfo->is_g4x) {
   208539          return 0;
   208540       } else {
   208541          return 0;
   208542       }
   208543    default:
   208544       unreachable("Invalid hardware generation");
   208545    }
   208546 }
   208547 
   208548 
   208549 
   208550 /* VECS_FAULT_REG::GTTSEL */
   208551 
   208552 
   208553 #define GEN75_VECS_FAULT_REG_GTTSEL_bits  -9
   208554 
   208555 static inline uint32_t ATTRIBUTE_PURE
   208556 VECS_FAULT_REG_GTTSEL_bits(const struct gen_device_info *devinfo)
   208557 {
   208558    switch (devinfo->gen) {
   208559    case 10: return 0;
   208560    case 9: return 0;
   208561    case 8: return 0;
   208562    case 7:
   208563       if (devinfo->is_haswell) {
   208564          return -9;
   208565       } else {
   208566          return 0;
   208567       }
   208568    case 6: return 0;
   208569    case 5: return 0;
   208570    case 4:
   208571       if (devinfo->is_g4x) {
   208572          return 0;
   208573       } else {
   208574          return 0;
   208575       }
   208576    default:
   208577       unreachable("Invalid hardware generation");
   208578    }
   208579 }
   208580 
   208581 
   208582 
   208583 #define GEN75_VECS_FAULT_REG_GTTSEL_start  11
   208584 
   208585 static inline uint32_t ATTRIBUTE_PURE
   208586 VECS_FAULT_REG_GTTSEL_start(const struct gen_device_info *devinfo)
   208587 {
   208588    switch (devinfo->gen) {
   208589    case 10: return 0;
   208590    case 9: return 0;
   208591    case 8: return 0;
   208592    case 7:
   208593       if (devinfo->is_haswell) {
   208594          return 11;
   208595       } else {
   208596          return 0;
   208597       }
   208598    case 6: return 0;
   208599    case 5: return 0;
   208600    case 4:
   208601       if (devinfo->is_g4x) {
   208602          return 0;
   208603       } else {
   208604          return 0;
   208605       }
   208606    default:
   208607       unreachable("Invalid hardware generation");
   208608    }
   208609 }
   208610 
   208611 
   208612 
   208613 /* VECS_FAULT_REG::SRCID of Fault */
   208614 
   208615 
   208616 #define GEN75_VECS_FAULT_REG_SRCIDofFault_bits  8
   208617 
   208618 static inline uint32_t ATTRIBUTE_PURE
   208619 VECS_FAULT_REG_SRCIDofFault_bits(const struct gen_device_info *devinfo)
   208620 {
   208621    switch (devinfo->gen) {
   208622    case 10: return 0;
   208623    case 9: return 0;
   208624    case 8: return 0;
   208625    case 7:
   208626       if (devinfo->is_haswell) {
   208627          return 8;
   208628       } else {
   208629          return 0;
   208630       }
   208631    case 6: return 0;
   208632    case 5: return 0;
   208633    case 4:
   208634       if (devinfo->is_g4x) {
   208635          return 0;
   208636       } else {
   208637          return 0;
   208638       }
   208639    default:
   208640       unreachable("Invalid hardware generation");
   208641    }
   208642 }
   208643 
   208644 
   208645 
   208646 #define GEN75_VECS_FAULT_REG_SRCIDofFault_start  3
   208647 
   208648 static inline uint32_t ATTRIBUTE_PURE
   208649 VECS_FAULT_REG_SRCIDofFault_start(const struct gen_device_info *devinfo)
   208650 {
   208651    switch (devinfo->gen) {
   208652    case 10: return 0;
   208653    case 9: return 0;
   208654    case 8: return 0;
   208655    case 7:
   208656       if (devinfo->is_haswell) {
   208657          return 3;
   208658       } else {
   208659          return 0;
   208660       }
   208661    case 6: return 0;
   208662    case 5: return 0;
   208663    case 4:
   208664       if (devinfo->is_g4x) {
   208665          return 0;
   208666       } else {
   208667          return 0;
   208668       }
   208669    default:
   208670       unreachable("Invalid hardware generation");
   208671    }
   208672 }
   208673 
   208674 
   208675 
   208676 /* VECS_FAULT_REG::Valid Bit */
   208677 
   208678 
   208679 #define GEN75_VECS_FAULT_REG_ValidBit_bits  1
   208680 
   208681 static inline uint32_t ATTRIBUTE_PURE
   208682 VECS_FAULT_REG_ValidBit_bits(const struct gen_device_info *devinfo)
   208683 {
   208684    switch (devinfo->gen) {
   208685    case 10: return 0;
   208686    case 9: return 0;
   208687    case 8: return 0;
   208688    case 7:
   208689       if (devinfo->is_haswell) {
   208690          return 1;
   208691       } else {
   208692          return 0;
   208693       }
   208694    case 6: return 0;
   208695    case 5: return 0;
   208696    case 4:
   208697       if (devinfo->is_g4x) {
   208698          return 0;
   208699       } else {
   208700          return 0;
   208701       }
   208702    default:
   208703       unreachable("Invalid hardware generation");
   208704    }
   208705 }
   208706 
   208707 
   208708 
   208709 #define GEN75_VECS_FAULT_REG_ValidBit_start  0
   208710 
   208711 static inline uint32_t ATTRIBUTE_PURE
   208712 VECS_FAULT_REG_ValidBit_start(const struct gen_device_info *devinfo)
   208713 {
   208714    switch (devinfo->gen) {
   208715    case 10: return 0;
   208716    case 9: return 0;
   208717    case 8: return 0;
   208718    case 7:
   208719       if (devinfo->is_haswell) {
   208720          return 0;
   208721       } else {
   208722          return 0;
   208723       }
   208724    case 6: return 0;
   208725    case 5: return 0;
   208726    case 4:
   208727       if (devinfo->is_g4x) {
   208728          return 0;
   208729       } else {
   208730          return 0;
   208731       }
   208732    default:
   208733       unreachable("Invalid hardware generation");
   208734    }
   208735 }
   208736 
   208737 
   208738 
   208739 /* VECS_FAULT_REG::Virtual Address of Fault */
   208740 
   208741 
   208742 #define GEN75_VECS_FAULT_REG_VirtualAddressofFault_bits  20
   208743 
   208744 static inline uint32_t ATTRIBUTE_PURE
   208745 VECS_FAULT_REG_VirtualAddressofFault_bits(const struct gen_device_info *devinfo)
   208746 {
   208747    switch (devinfo->gen) {
   208748    case 10: return 0;
   208749    case 9: return 0;
   208750    case 8: return 0;
   208751    case 7:
   208752       if (devinfo->is_haswell) {
   208753          return 20;
   208754       } else {
   208755          return 0;
   208756       }
   208757    case 6: return 0;
   208758    case 5: return 0;
   208759    case 4:
   208760       if (devinfo->is_g4x) {
   208761          return 0;
   208762       } else {
   208763          return 0;
   208764       }
   208765    default:
   208766       unreachable("Invalid hardware generation");
   208767    }
   208768 }
   208769 
   208770 
   208771 
   208772 #define GEN75_VECS_FAULT_REG_VirtualAddressofFault_start  12
   208773 
   208774 static inline uint32_t ATTRIBUTE_PURE
   208775 VECS_FAULT_REG_VirtualAddressofFault_start(const struct gen_device_info *devinfo)
   208776 {
   208777    switch (devinfo->gen) {
   208778    case 10: return 0;
   208779    case 9: return 0;
   208780    case 8: return 0;
   208781    case 7:
   208782       if (devinfo->is_haswell) {
   208783          return 12;
   208784       } else {
   208785          return 0;
   208786       }
   208787    case 6: return 0;
   208788    case 5: return 0;
   208789    case 4:
   208790       if (devinfo->is_g4x) {
   208791          return 0;
   208792       } else {
   208793          return 0;
   208794       }
   208795    default:
   208796       unreachable("Invalid hardware generation");
   208797    }
   208798 }
   208799 
   208800 
   208801 
   208802 /* VECS_INSTDONE */
   208803 
   208804 
   208805 #define GEN10_VECS_INSTDONE_length  1
   208806 #define GEN9_VECS_INSTDONE_length  1
   208807 #define GEN8_VECS_INSTDONE_length  1
   208808 #define GEN75_VECS_INSTDONE_length  1
   208809 
   208810 static inline uint32_t ATTRIBUTE_PURE
   208811 VECS_INSTDONE_length(const struct gen_device_info *devinfo)
   208812 {
   208813    switch (devinfo->gen) {
   208814    case 10: return 1;
   208815    case 9: return 1;
   208816    case 8: return 1;
   208817    case 7:
   208818       if (devinfo->is_haswell) {
   208819          return 1;
   208820       } else {
   208821          return 0;
   208822       }
   208823    case 6: return 0;
   208824    case 5: return 0;
   208825    case 4:
   208826       if (devinfo->is_g4x) {
   208827          return 0;
   208828       } else {
   208829          return 0;
   208830       }
   208831    default:
   208832       unreachable("Invalid hardware generation");
   208833    }
   208834 }
   208835 
   208836 
   208837 
   208838 /* VECS_INSTDONE::GAM Done */
   208839 
   208840 
   208841 #define GEN10_VECS_INSTDONE_GAMDone_bits  1
   208842 #define GEN9_VECS_INSTDONE_GAMDone_bits  1
   208843 #define GEN8_VECS_INSTDONE_GAMDone_bits  1
   208844 #define GEN75_VECS_INSTDONE_GAMDone_bits  1
   208845 
   208846 static inline uint32_t ATTRIBUTE_PURE
   208847 VECS_INSTDONE_GAMDone_bits(const struct gen_device_info *devinfo)
   208848 {
   208849    switch (devinfo->gen) {
   208850    case 10: return 1;
   208851    case 9: return 1;
   208852    case 8: return 1;
   208853    case 7:
   208854       if (devinfo->is_haswell) {
   208855          return 1;
   208856       } else {
   208857          return 0;
   208858       }
   208859    case 6: return 0;
   208860    case 5: return 0;
   208861    case 4:
   208862       if (devinfo->is_g4x) {
   208863          return 0;
   208864       } else {
   208865          return 0;
   208866       }
   208867    default:
   208868       unreachable("Invalid hardware generation");
   208869    }
   208870 }
   208871 
   208872 
   208873 
   208874 #define GEN10_VECS_INSTDONE_GAMDone_start  31
   208875 #define GEN9_VECS_INSTDONE_GAMDone_start  31
   208876 #define GEN8_VECS_INSTDONE_GAMDone_start  31
   208877 #define GEN75_VECS_INSTDONE_GAMDone_start  31
   208878 
   208879 static inline uint32_t ATTRIBUTE_PURE
   208880 VECS_INSTDONE_GAMDone_start(const struct gen_device_info *devinfo)
   208881 {
   208882    switch (devinfo->gen) {
   208883    case 10: return 31;
   208884    case 9: return 31;
   208885    case 8: return 31;
   208886    case 7:
   208887       if (devinfo->is_haswell) {
   208888          return 31;
   208889       } else {
   208890          return 0;
   208891       }
   208892    case 6: return 0;
   208893    case 5: return 0;
   208894    case 4:
   208895       if (devinfo->is_g4x) {
   208896          return 0;
   208897       } else {
   208898          return 0;
   208899       }
   208900    default:
   208901       unreachable("Invalid hardware generation");
   208902    }
   208903 }
   208904 
   208905 
   208906 
   208907 /* VECS_INSTDONE::Ring Enable */
   208908 
   208909 
   208910 #define GEN10_VECS_INSTDONE_RingEnable_bits  1
   208911 #define GEN9_VECS_INSTDONE_RingEnable_bits  1
   208912 #define GEN8_VECS_INSTDONE_RingEnable_bits  1
   208913 #define GEN75_VECS_INSTDONE_RingEnable_bits  1
   208914 
   208915 static inline uint32_t ATTRIBUTE_PURE
   208916 VECS_INSTDONE_RingEnable_bits(const struct gen_device_info *devinfo)
   208917 {
   208918    switch (devinfo->gen) {
   208919    case 10: return 1;
   208920    case 9: return 1;
   208921    case 8: return 1;
   208922    case 7:
   208923       if (devinfo->is_haswell) {
   208924          return 1;
   208925       } else {
   208926          return 0;
   208927       }
   208928    case 6: return 0;
   208929    case 5: return 0;
   208930    case 4:
   208931       if (devinfo->is_g4x) {
   208932          return 0;
   208933       } else {
   208934          return 0;
   208935       }
   208936    default:
   208937       unreachable("Invalid hardware generation");
   208938    }
   208939 }
   208940 
   208941 
   208942 
   208943 #define GEN10_VECS_INSTDONE_RingEnable_start  0
   208944 #define GEN9_VECS_INSTDONE_RingEnable_start  0
   208945 #define GEN8_VECS_INSTDONE_RingEnable_start  0
   208946 #define GEN75_VECS_INSTDONE_RingEnable_start  0
   208947 
   208948 static inline uint32_t ATTRIBUTE_PURE
   208949 VECS_INSTDONE_RingEnable_start(const struct gen_device_info *devinfo)
   208950 {
   208951    switch (devinfo->gen) {
   208952    case 10: return 0;
   208953    case 9: return 0;
   208954    case 8: return 0;
   208955    case 7:
   208956       if (devinfo->is_haswell) {
   208957          return 0;
   208958       } else {
   208959          return 0;
   208960       }
   208961    case 6: return 0;
   208962    case 5: return 0;
   208963    case 4:
   208964       if (devinfo->is_g4x) {
   208965          return 0;
   208966       } else {
   208967          return 0;
   208968       }
   208969    default:
   208970       unreachable("Invalid hardware generation");
   208971    }
   208972 }
   208973 
   208974 
   208975 
   208976 /* VECS_INSTDONE::VECS Done */
   208977 
   208978 
   208979 #define GEN10_VECS_INSTDONE_VECSDone_bits  1
   208980 #define GEN9_VECS_INSTDONE_VECSDone_bits  1
   208981 #define GEN8_VECS_INSTDONE_VECSDone_bits  1
   208982 #define GEN75_VECS_INSTDONE_VECSDone_bits  1
   208983 
   208984 static inline uint32_t ATTRIBUTE_PURE
   208985 VECS_INSTDONE_VECSDone_bits(const struct gen_device_info *devinfo)
   208986 {
   208987    switch (devinfo->gen) {
   208988    case 10: return 1;
   208989    case 9: return 1;
   208990    case 8: return 1;
   208991    case 7:
   208992       if (devinfo->is_haswell) {
   208993          return 1;
   208994       } else {
   208995          return 0;
   208996       }
   208997    case 6: return 0;
   208998    case 5: return 0;
   208999    case 4:
   209000       if (devinfo->is_g4x) {
   209001          return 0;
   209002       } else {
   209003          return 0;
   209004       }
   209005    default:
   209006       unreachable("Invalid hardware generation");
   209007    }
   209008 }
   209009 
   209010 
   209011 
   209012 #define GEN10_VECS_INSTDONE_VECSDone_start  30
   209013 #define GEN9_VECS_INSTDONE_VECSDone_start  30
   209014 #define GEN8_VECS_INSTDONE_VECSDone_start  30
   209015 #define GEN75_VECS_INSTDONE_VECSDone_start  30
   209016 
   209017 static inline uint32_t ATTRIBUTE_PURE
   209018 VECS_INSTDONE_VECSDone_start(const struct gen_device_info *devinfo)
   209019 {
   209020    switch (devinfo->gen) {
   209021    case 10: return 30;
   209022    case 9: return 30;
   209023    case 8: return 30;
   209024    case 7:
   209025       if (devinfo->is_haswell) {
   209026          return 30;
   209027       } else {
   209028          return 0;
   209029       }
   209030    case 6: return 0;
   209031    case 5: return 0;
   209032    case 4:
   209033       if (devinfo->is_g4x) {
   209034          return 0;
   209035       } else {
   209036          return 0;
   209037       }
   209038    default:
   209039       unreachable("Invalid hardware generation");
   209040    }
   209041 }
   209042 
   209043 
   209044 
   209045 /* VECS_RING_BUFFER_CTL */
   209046 
   209047 
   209048 #define GEN9_VECS_RING_BUFFER_CTL_length  1
   209049 #define GEN8_VECS_RING_BUFFER_CTL_length  1
   209050 #define GEN75_VECS_RING_BUFFER_CTL_length  1
   209051 
   209052 static inline uint32_t ATTRIBUTE_PURE
   209053 VECS_RING_BUFFER_CTL_length(const struct gen_device_info *devinfo)
   209054 {
   209055    switch (devinfo->gen) {
   209056    case 10: return 0;
   209057    case 9: return 1;
   209058    case 8: return 1;
   209059    case 7:
   209060       if (devinfo->is_haswell) {
   209061          return 1;
   209062       } else {
   209063          return 0;
   209064       }
   209065    case 6: return 0;
   209066    case 5: return 0;
   209067    case 4:
   209068       if (devinfo->is_g4x) {
   209069          return 0;
   209070       } else {
   209071          return 0;
   209072       }
   209073    default:
   209074       unreachable("Invalid hardware generation");
   209075    }
   209076 }
   209077 
   209078 
   209079 
   209080 /* VECS_RING_BUFFER_CTL::Automatic Report Head Pointer */
   209081 
   209082 
   209083 #define GEN9_VECS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits  2
   209084 #define GEN8_VECS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits  2
   209085 #define GEN75_VECS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits  2
   209086 
   209087 static inline uint32_t ATTRIBUTE_PURE
   209088 VECS_RING_BUFFER_CTL_AutomaticReportHeadPointer_bits(const struct gen_device_info *devinfo)
   209089 {
   209090    switch (devinfo->gen) {
   209091    case 10: return 0;
   209092    case 9: return 2;
   209093    case 8: return 2;
   209094    case 7:
   209095       if (devinfo->is_haswell) {
   209096          return 2;
   209097       } else {
   209098          return 0;
   209099       }
   209100    case 6: return 0;
   209101    case 5: return 0;
   209102    case 4:
   209103       if (devinfo->is_g4x) {
   209104          return 0;
   209105       } else {
   209106          return 0;
   209107       }
   209108    default:
   209109       unreachable("Invalid hardware generation");
   209110    }
   209111 }
   209112 
   209113 
   209114 
   209115 #define GEN9_VECS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start  1
   209116 #define GEN8_VECS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start  1
   209117 #define GEN75_VECS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start  1
   209118 
   209119 static inline uint32_t ATTRIBUTE_PURE
   209120 VECS_RING_BUFFER_CTL_AutomaticReportHeadPointer_start(const struct gen_device_info *devinfo)
   209121 {
   209122    switch (devinfo->gen) {
   209123    case 10: return 0;
   209124    case 9: return 1;
   209125    case 8: return 1;
   209126    case 7:
   209127       if (devinfo->is_haswell) {
   209128          return 1;
   209129       } else {
   209130          return 0;
   209131       }
   209132    case 6: return 0;
   209133    case 5: return 0;
   209134    case 4:
   209135       if (devinfo->is_g4x) {
   209136          return 0;
   209137       } else {
   209138          return 0;
   209139       }
   209140    default:
   209141       unreachable("Invalid hardware generation");
   209142    }
   209143 }
   209144 
   209145 
   209146 
   209147 /* VECS_RING_BUFFER_CTL::Buffer Length (in pages - 1) */
   209148 
   209149 
   209150 #define GEN9_VECS_RING_BUFFER_CTL_BufferLengthinpages1_bits  9
   209151 #define GEN8_VECS_RING_BUFFER_CTL_BufferLengthinpages1_bits  9
   209152 #define GEN75_VECS_RING_BUFFER_CTL_BufferLengthinpages1_bits  9
   209153 
   209154 static inline uint32_t ATTRIBUTE_PURE
   209155 VECS_RING_BUFFER_CTL_BufferLengthinpages1_bits(const struct gen_device_info *devinfo)
   209156 {
   209157    switch (devinfo->gen) {
   209158    case 10: return 0;
   209159    case 9: return 9;
   209160    case 8: return 9;
   209161    case 7:
   209162       if (devinfo->is_haswell) {
   209163          return 9;
   209164       } else {
   209165          return 0;
   209166       }
   209167    case 6: return 0;
   209168    case 5: return 0;
   209169    case 4:
   209170       if (devinfo->is_g4x) {
   209171          return 0;
   209172       } else {
   209173          return 0;
   209174       }
   209175    default:
   209176       unreachable("Invalid hardware generation");
   209177    }
   209178 }
   209179 
   209180 
   209181 
   209182 #define GEN9_VECS_RING_BUFFER_CTL_BufferLengthinpages1_start  12
   209183 #define GEN8_VECS_RING_BUFFER_CTL_BufferLengthinpages1_start  12
   209184 #define GEN75_VECS_RING_BUFFER_CTL_BufferLengthinpages1_start  12
   209185 
   209186 static inline uint32_t ATTRIBUTE_PURE
   209187 VECS_RING_BUFFER_CTL_BufferLengthinpages1_start(const struct gen_device_info *devinfo)
   209188 {
   209189    switch (devinfo->gen) {
   209190    case 10: return 0;
   209191    case 9: return 12;
   209192    case 8: return 12;
   209193    case 7:
   209194       if (devinfo->is_haswell) {
   209195          return 12;
   209196       } else {
   209197          return 0;
   209198       }
   209199    case 6: return 0;
   209200    case 5: return 0;
   209201    case 4:
   209202       if (devinfo->is_g4x) {
   209203          return 0;
   209204       } else {
   209205          return 0;
   209206       }
   209207    default:
   209208       unreachable("Invalid hardware generation");
   209209    }
   209210 }
   209211 
   209212 
   209213 
   209214 /* VECS_RING_BUFFER_CTL::Disable Register Accesses */
   209215 
   209216 
   209217 #define GEN9_VECS_RING_BUFFER_CTL_DisableRegisterAccesses_bits  1
   209218 #define GEN8_VECS_RING_BUFFER_CTL_DisableRegisterAccesses_bits  1
   209219 #define GEN75_VECS_RING_BUFFER_CTL_DisableRegisterAccesses_bits  1
   209220 
   209221 static inline uint32_t ATTRIBUTE_PURE
   209222 VECS_RING_BUFFER_CTL_DisableRegisterAccesses_bits(const struct gen_device_info *devinfo)
   209223 {
   209224    switch (devinfo->gen) {
   209225    case 10: return 0;
   209226    case 9: return 1;
   209227    case 8: return 1;
   209228    case 7:
   209229       if (devinfo->is_haswell) {
   209230          return 1;
   209231       } else {
   209232          return 0;
   209233       }
   209234    case 6: return 0;
   209235    case 5: return 0;
   209236    case 4:
   209237       if (devinfo->is_g4x) {
   209238          return 0;
   209239       } else {
   209240          return 0;
   209241       }
   209242    default:
   209243       unreachable("Invalid hardware generation");
   209244    }
   209245 }
   209246 
   209247 
   209248 
   209249 #define GEN9_VECS_RING_BUFFER_CTL_DisableRegisterAccesses_start  8
   209250 #define GEN8_VECS_RING_BUFFER_CTL_DisableRegisterAccesses_start  8
   209251 #define GEN75_VECS_RING_BUFFER_CTL_DisableRegisterAccesses_start  8
   209252 
   209253 static inline uint32_t ATTRIBUTE_PURE
   209254 VECS_RING_BUFFER_CTL_DisableRegisterAccesses_start(const struct gen_device_info *devinfo)
   209255 {
   209256    switch (devinfo->gen) {
   209257    case 10: return 0;
   209258    case 9: return 8;
   209259    case 8: return 8;
   209260    case 7:
   209261       if (devinfo->is_haswell) {
   209262          return 8;
   209263       } else {
   209264          return 0;
   209265       }
   209266    case 6: return 0;
   209267    case 5: return 0;
   209268    case 4:
   209269       if (devinfo->is_g4x) {
   209270          return 0;
   209271       } else {
   209272          return 0;
   209273       }
   209274    default:
   209275       unreachable("Invalid hardware generation");
   209276    }
   209277 }
   209278 
   209279 
   209280 
   209281 /* VECS_RING_BUFFER_CTL::RBWait */
   209282 
   209283 
   209284 #define GEN9_VECS_RING_BUFFER_CTL_RBWait_bits  1
   209285 #define GEN8_VECS_RING_BUFFER_CTL_RBWait_bits  1
   209286 #define GEN75_VECS_RING_BUFFER_CTL_RBWait_bits  1
   209287 
   209288 static inline uint32_t ATTRIBUTE_PURE
   209289 VECS_RING_BUFFER_CTL_RBWait_bits(const struct gen_device_info *devinfo)
   209290 {
   209291    switch (devinfo->gen) {
   209292    case 10: return 0;
   209293    case 9: return 1;
   209294    case 8: return 1;
   209295    case 7:
   209296       if (devinfo->is_haswell) {
   209297          return 1;
   209298       } else {
   209299          return 0;
   209300       }
   209301    case 6: return 0;
   209302    case 5: return 0;
   209303    case 4:
   209304       if (devinfo->is_g4x) {
   209305          return 0;
   209306       } else {
   209307          return 0;
   209308       }
   209309    default:
   209310       unreachable("Invalid hardware generation");
   209311    }
   209312 }
   209313 
   209314 
   209315 
   209316 #define GEN9_VECS_RING_BUFFER_CTL_RBWait_start  11
   209317 #define GEN8_VECS_RING_BUFFER_CTL_RBWait_start  11
   209318 #define GEN75_VECS_RING_BUFFER_CTL_RBWait_start  11
   209319 
   209320 static inline uint32_t ATTRIBUTE_PURE
   209321 VECS_RING_BUFFER_CTL_RBWait_start(const struct gen_device_info *devinfo)
   209322 {
   209323    switch (devinfo->gen) {
   209324    case 10: return 0;
   209325    case 9: return 11;
   209326    case 8: return 11;
   209327    case 7:
   209328       if (devinfo->is_haswell) {
   209329          return 11;
   209330       } else {
   209331          return 0;
   209332       }
   209333    case 6: return 0;
   209334    case 5: return 0;
   209335    case 4:
   209336       if (devinfo->is_g4x) {
   209337          return 0;
   209338       } else {
   209339          return 0;
   209340       }
   209341    default:
   209342       unreachable("Invalid hardware generation");
   209343    }
   209344 }
   209345 
   209346 
   209347 
   209348 /* VECS_RING_BUFFER_CTL::Ring Buffer Enable */
   209349 
   209350 
   209351 #define GEN9_VECS_RING_BUFFER_CTL_RingBufferEnable_bits  1
   209352 #define GEN8_VECS_RING_BUFFER_CTL_RingBufferEnable_bits  1
   209353 #define GEN75_VECS_RING_BUFFER_CTL_RingBufferEnable_bits  1
   209354 
   209355 static inline uint32_t ATTRIBUTE_PURE
   209356 VECS_RING_BUFFER_CTL_RingBufferEnable_bits(const struct gen_device_info *devinfo)
   209357 {
   209358    switch (devinfo->gen) {
   209359    case 10: return 0;
   209360    case 9: return 1;
   209361    case 8: return 1;
   209362    case 7:
   209363       if (devinfo->is_haswell) {
   209364          return 1;
   209365       } else {
   209366          return 0;
   209367       }
   209368    case 6: return 0;
   209369    case 5: return 0;
   209370    case 4:
   209371       if (devinfo->is_g4x) {
   209372          return 0;
   209373       } else {
   209374          return 0;
   209375       }
   209376    default:
   209377       unreachable("Invalid hardware generation");
   209378    }
   209379 }
   209380 
   209381 
   209382 
   209383 #define GEN9_VECS_RING_BUFFER_CTL_RingBufferEnable_start  0
   209384 #define GEN8_VECS_RING_BUFFER_CTL_RingBufferEnable_start  0
   209385 #define GEN75_VECS_RING_BUFFER_CTL_RingBufferEnable_start  0
   209386 
   209387 static inline uint32_t ATTRIBUTE_PURE
   209388 VECS_RING_BUFFER_CTL_RingBufferEnable_start(const struct gen_device_info *devinfo)
   209389 {
   209390    switch (devinfo->gen) {
   209391    case 10: return 0;
   209392    case 9: return 0;
   209393    case 8: return 0;
   209394    case 7:
   209395       if (devinfo->is_haswell) {
   209396          return 0;
   209397       } else {
   209398          return 0;
   209399       }
   209400    case 6: return 0;
   209401    case 5: return 0;
   209402    case 4:
   209403       if (devinfo->is_g4x) {
   209404          return 0;
   209405       } else {
   209406          return 0;
   209407       }
   209408    default:
   209409       unreachable("Invalid hardware generation");
   209410    }
   209411 }
   209412 
   209413 
   209414 
   209415 /* VECS_RING_BUFFER_CTL::Semaphore Wait */
   209416 
   209417 
   209418 #define GEN9_VECS_RING_BUFFER_CTL_SemaphoreWait_bits  1
   209419 #define GEN8_VECS_RING_BUFFER_CTL_SemaphoreWait_bits  1
   209420 #define GEN75_VECS_RING_BUFFER_CTL_SemaphoreWait_bits  1
   209421 
   209422 static inline uint32_t ATTRIBUTE_PURE
   209423 VECS_RING_BUFFER_CTL_SemaphoreWait_bits(const struct gen_device_info *devinfo)
   209424 {
   209425    switch (devinfo->gen) {
   209426    case 10: return 0;
   209427    case 9: return 1;
   209428    case 8: return 1;
   209429    case 7:
   209430       if (devinfo->is_haswell) {
   209431          return 1;
   209432       } else {
   209433          return 0;
   209434       }
   209435    case 6: return 0;
   209436    case 5: return 0;
   209437    case 4:
   209438       if (devinfo->is_g4x) {
   209439          return 0;
   209440       } else {
   209441          return 0;
   209442       }
   209443    default:
   209444       unreachable("Invalid hardware generation");
   209445    }
   209446 }
   209447 
   209448 
   209449 
   209450 #define GEN9_VECS_RING_BUFFER_CTL_SemaphoreWait_start  10
   209451 #define GEN8_VECS_RING_BUFFER_CTL_SemaphoreWait_start  10
   209452 #define GEN75_VECS_RING_BUFFER_CTL_SemaphoreWait_start  10
   209453 
   209454 static inline uint32_t ATTRIBUTE_PURE
   209455 VECS_RING_BUFFER_CTL_SemaphoreWait_start(const struct gen_device_info *devinfo)
   209456 {
   209457    switch (devinfo->gen) {
   209458    case 10: return 0;
   209459    case 9: return 10;
   209460    case 8: return 10;
   209461    case 7:
   209462       if (devinfo->is_haswell) {
   209463          return 10;
   209464       } else {
   209465          return 0;
   209466       }
   209467    case 6: return 0;
   209468    case 5: return 0;
   209469    case 4:
   209470       if (devinfo->is_g4x) {
   209471          return 0;
   209472       } else {
   209473          return 0;
   209474       }
   209475    default:
   209476       unreachable("Invalid hardware generation");
   209477    }
   209478 }
   209479 
   209480 
   209481 
   209482 /* VERTEX_BUFFER_STATE */
   209483 
   209484 
   209485 #define GEN10_VERTEX_BUFFER_STATE_length  4
   209486 #define GEN9_VERTEX_BUFFER_STATE_length  4
   209487 #define GEN8_VERTEX_BUFFER_STATE_length  4
   209488 #define GEN75_VERTEX_BUFFER_STATE_length  4
   209489 #define GEN7_VERTEX_BUFFER_STATE_length  4
   209490 #define GEN6_VERTEX_BUFFER_STATE_length  4
   209491 #define GEN5_VERTEX_BUFFER_STATE_length  4
   209492 #define GEN45_VERTEX_BUFFER_STATE_length  4
   209493 #define GEN4_VERTEX_BUFFER_STATE_length  4
   209494 
   209495 static inline uint32_t ATTRIBUTE_PURE
   209496 VERTEX_BUFFER_STATE_length(const struct gen_device_info *devinfo)
   209497 {
   209498    switch (devinfo->gen) {
   209499    case 10: return 4;
   209500    case 9: return 4;
   209501    case 8: return 4;
   209502    case 7:
   209503       if (devinfo->is_haswell) {
   209504          return 4;
   209505       } else {
   209506          return 4;
   209507       }
   209508    case 6: return 4;
   209509    case 5: return 4;
   209510    case 4:
   209511       if (devinfo->is_g4x) {
   209512          return 4;
   209513       } else {
   209514          return 4;
   209515       }
   209516    default:
   209517       unreachable("Invalid hardware generation");
   209518    }
   209519 }
   209520 
   209521 
   209522 
   209523 /* VERTEX_BUFFER_STATE::Address Modify Enable */
   209524 
   209525 
   209526 #define GEN10_VERTEX_BUFFER_STATE_AddressModifyEnable_bits  1
   209527 #define GEN9_VERTEX_BUFFER_STATE_AddressModifyEnable_bits  1
   209528 #define GEN8_VERTEX_BUFFER_STATE_AddressModifyEnable_bits  1
   209529 #define GEN75_VERTEX_BUFFER_STATE_AddressModifyEnable_bits  1
   209530 #define GEN7_VERTEX_BUFFER_STATE_AddressModifyEnable_bits  1
   209531 
   209532 static inline uint32_t ATTRIBUTE_PURE
   209533 VERTEX_BUFFER_STATE_AddressModifyEnable_bits(const struct gen_device_info *devinfo)
   209534 {
   209535    switch (devinfo->gen) {
   209536    case 10: return 1;
   209537    case 9: return 1;
   209538    case 8: return 1;
   209539    case 7:
   209540       if (devinfo->is_haswell) {
   209541          return 1;
   209542       } else {
   209543          return 1;
   209544       }
   209545    case 6: return 0;
   209546    case 5: return 0;
   209547    case 4:
   209548       if (devinfo->is_g4x) {
   209549          return 0;
   209550       } else {
   209551          return 0;
   209552       }
   209553    default:
   209554       unreachable("Invalid hardware generation");
   209555    }
   209556 }
   209557 
   209558 
   209559 
   209560 #define GEN10_VERTEX_BUFFER_STATE_AddressModifyEnable_start  14
   209561 #define GEN9_VERTEX_BUFFER_STATE_AddressModifyEnable_start  14
   209562 #define GEN8_VERTEX_BUFFER_STATE_AddressModifyEnable_start  14
   209563 #define GEN75_VERTEX_BUFFER_STATE_AddressModifyEnable_start  14
   209564 #define GEN7_VERTEX_BUFFER_STATE_AddressModifyEnable_start  14
   209565 
   209566 static inline uint32_t ATTRIBUTE_PURE
   209567 VERTEX_BUFFER_STATE_AddressModifyEnable_start(const struct gen_device_info *devinfo)
   209568 {
   209569    switch (devinfo->gen) {
   209570    case 10: return 14;
   209571    case 9: return 14;
   209572    case 8: return 14;
   209573    case 7:
   209574       if (devinfo->is_haswell) {
   209575          return 14;
   209576       } else {
   209577          return 14;
   209578       }
   209579    case 6: return 0;
   209580    case 5: return 0;
   209581    case 4:
   209582       if (devinfo->is_g4x) {
   209583          return 0;
   209584       } else {
   209585          return 0;
   209586       }
   209587    default:
   209588       unreachable("Invalid hardware generation");
   209589    }
   209590 }
   209591 
   209592 
   209593 
   209594 /* VERTEX_BUFFER_STATE::Buffer Access Type */
   209595 
   209596 
   209597 #define GEN75_VERTEX_BUFFER_STATE_BufferAccessType_bits  1
   209598 #define GEN7_VERTEX_BUFFER_STATE_BufferAccessType_bits  1
   209599 #define GEN6_VERTEX_BUFFER_STATE_BufferAccessType_bits  1
   209600 #define GEN5_VERTEX_BUFFER_STATE_BufferAccessType_bits  1
   209601 #define GEN45_VERTEX_BUFFER_STATE_BufferAccessType_bits  1
   209602 #define GEN4_VERTEX_BUFFER_STATE_BufferAccessType_bits  1
   209603 
   209604 static inline uint32_t ATTRIBUTE_PURE
   209605 VERTEX_BUFFER_STATE_BufferAccessType_bits(const struct gen_device_info *devinfo)
   209606 {
   209607    switch (devinfo->gen) {
   209608    case 10: return 0;
   209609    case 9: return 0;
   209610    case 8: return 0;
   209611    case 7:
   209612       if (devinfo->is_haswell) {
   209613          return 1;
   209614       } else {
   209615          return 1;
   209616       }
   209617    case 6: return 1;
   209618    case 5: return 1;
   209619    case 4:
   209620       if (devinfo->is_g4x) {
   209621          return 1;
   209622       } else {
   209623          return 1;
   209624       }
   209625    default:
   209626       unreachable("Invalid hardware generation");
   209627    }
   209628 }
   209629 
   209630 
   209631 
   209632 #define GEN75_VERTEX_BUFFER_STATE_BufferAccessType_start  20
   209633 #define GEN7_VERTEX_BUFFER_STATE_BufferAccessType_start  20
   209634 #define GEN6_VERTEX_BUFFER_STATE_BufferAccessType_start  20
   209635 #define GEN5_VERTEX_BUFFER_STATE_BufferAccessType_start  26
   209636 #define GEN45_VERTEX_BUFFER_STATE_BufferAccessType_start  26
   209637 #define GEN4_VERTEX_BUFFER_STATE_BufferAccessType_start  26
   209638 
   209639 static inline uint32_t ATTRIBUTE_PURE
   209640 VERTEX_BUFFER_STATE_BufferAccessType_start(const struct gen_device_info *devinfo)
   209641 {
   209642    switch (devinfo->gen) {
   209643    case 10: return 0;
   209644    case 9: return 0;
   209645    case 8: return 0;
   209646    case 7:
   209647       if (devinfo->is_haswell) {
   209648          return 20;
   209649       } else {
   209650          return 20;
   209651       }
   209652    case 6: return 20;
   209653    case 5: return 26;
   209654    case 4:
   209655       if (devinfo->is_g4x) {
   209656          return 26;
   209657       } else {
   209658          return 26;
   209659       }
   209660    default:
   209661       unreachable("Invalid hardware generation");
   209662    }
   209663 }
   209664 
   209665 
   209666 
   209667 /* VERTEX_BUFFER_STATE::Buffer Pitch */
   209668 
   209669 
   209670 #define GEN10_VERTEX_BUFFER_STATE_BufferPitch_bits  12
   209671 #define GEN9_VERTEX_BUFFER_STATE_BufferPitch_bits  12
   209672 #define GEN8_VERTEX_BUFFER_STATE_BufferPitch_bits  12
   209673 #define GEN75_VERTEX_BUFFER_STATE_BufferPitch_bits  12
   209674 #define GEN7_VERTEX_BUFFER_STATE_BufferPitch_bits  12
   209675 #define GEN6_VERTEX_BUFFER_STATE_BufferPitch_bits  12
   209676 #define GEN5_VERTEX_BUFFER_STATE_BufferPitch_bits  12
   209677 #define GEN45_VERTEX_BUFFER_STATE_BufferPitch_bits  11
   209678 #define GEN4_VERTEX_BUFFER_STATE_BufferPitch_bits  11
   209679 
   209680 static inline uint32_t ATTRIBUTE_PURE
   209681 VERTEX_BUFFER_STATE_BufferPitch_bits(const struct gen_device_info *devinfo)
   209682 {
   209683    switch (devinfo->gen) {
   209684    case 10: return 12;
   209685    case 9: return 12;
   209686    case 8: return 12;
   209687    case 7:
   209688       if (devinfo->is_haswell) {
   209689          return 12;
   209690       } else {
   209691          return 12;
   209692       }
   209693    case 6: return 12;
   209694    case 5: return 12;
   209695    case 4:
   209696       if (devinfo->is_g4x) {
   209697          return 11;
   209698       } else {
   209699          return 11;
   209700       }
   209701    default:
   209702       unreachable("Invalid hardware generation");
   209703    }
   209704 }
   209705 
   209706 
   209707 
   209708 #define GEN10_VERTEX_BUFFER_STATE_BufferPitch_start  0
   209709 #define GEN9_VERTEX_BUFFER_STATE_BufferPitch_start  0
   209710 #define GEN8_VERTEX_BUFFER_STATE_BufferPitch_start  0
   209711 #define GEN75_VERTEX_BUFFER_STATE_BufferPitch_start  0
   209712 #define GEN7_VERTEX_BUFFER_STATE_BufferPitch_start  0
   209713 #define GEN6_VERTEX_BUFFER_STATE_BufferPitch_start  0
   209714 #define GEN5_VERTEX_BUFFER_STATE_BufferPitch_start  0
   209715 #define GEN45_VERTEX_BUFFER_STATE_BufferPitch_start  0
   209716 #define GEN4_VERTEX_BUFFER_STATE_BufferPitch_start  0
   209717 
   209718 static inline uint32_t ATTRIBUTE_PURE
   209719 VERTEX_BUFFER_STATE_BufferPitch_start(const struct gen_device_info *devinfo)
   209720 {
   209721    switch (devinfo->gen) {
   209722    case 10: return 0;
   209723    case 9: return 0;
   209724    case 8: return 0;
   209725    case 7:
   209726       if (devinfo->is_haswell) {
   209727          return 0;
   209728       } else {
   209729          return 0;
   209730       }
   209731    case 6: return 0;
   209732    case 5: return 0;
   209733    case 4:
   209734       if (devinfo->is_g4x) {
   209735          return 0;
   209736       } else {
   209737          return 0;
   209738       }
   209739    default:
   209740       unreachable("Invalid hardware generation");
   209741    }
   209742 }
   209743 
   209744 
   209745 
   209746 /* VERTEX_BUFFER_STATE::Buffer Size */
   209747 
   209748 
   209749 #define GEN10_VERTEX_BUFFER_STATE_BufferSize_bits  32
   209750 #define GEN9_VERTEX_BUFFER_STATE_BufferSize_bits  32
   209751 #define GEN8_VERTEX_BUFFER_STATE_BufferSize_bits  32
   209752 
   209753 static inline uint32_t ATTRIBUTE_PURE
   209754 VERTEX_BUFFER_STATE_BufferSize_bits(const struct gen_device_info *devinfo)
   209755 {
   209756    switch (devinfo->gen) {
   209757    case 10: return 32;
   209758    case 9: return 32;
   209759    case 8: return 32;
   209760    case 7:
   209761       if (devinfo->is_haswell) {
   209762          return 0;
   209763       } else {
   209764          return 0;
   209765       }
   209766    case 6: return 0;
   209767    case 5: return 0;
   209768    case 4:
   209769       if (devinfo->is_g4x) {
   209770          return 0;
   209771       } else {
   209772          return 0;
   209773       }
   209774    default:
   209775       unreachable("Invalid hardware generation");
   209776    }
   209777 }
   209778 
   209779 
   209780 
   209781 #define GEN10_VERTEX_BUFFER_STATE_BufferSize_start  96
   209782 #define GEN9_VERTEX_BUFFER_STATE_BufferSize_start  96
   209783 #define GEN8_VERTEX_BUFFER_STATE_BufferSize_start  96
   209784 
   209785 static inline uint32_t ATTRIBUTE_PURE
   209786 VERTEX_BUFFER_STATE_BufferSize_start(const struct gen_device_info *devinfo)
   209787 {
   209788    switch (devinfo->gen) {
   209789    case 10: return 96;
   209790    case 9: return 96;
   209791    case 8: return 96;
   209792    case 7:
   209793       if (devinfo->is_haswell) {
   209794          return 0;
   209795       } else {
   209796          return 0;
   209797       }
   209798    case 6: return 0;
   209799    case 5: return 0;
   209800    case 4:
   209801       if (devinfo->is_g4x) {
   209802          return 0;
   209803       } else {
   209804          return 0;
   209805       }
   209806    default:
   209807       unreachable("Invalid hardware generation");
   209808    }
   209809 }
   209810 
   209811 
   209812 
   209813 /* VERTEX_BUFFER_STATE::Buffer Starting Address */
   209814 
   209815 
   209816 #define GEN10_VERTEX_BUFFER_STATE_BufferStartingAddress_bits  64
   209817 #define GEN9_VERTEX_BUFFER_STATE_BufferStartingAddress_bits  64
   209818 #define GEN8_VERTEX_BUFFER_STATE_BufferStartingAddress_bits  64
   209819 #define GEN75_VERTEX_BUFFER_STATE_BufferStartingAddress_bits  32
   209820 #define GEN7_VERTEX_BUFFER_STATE_BufferStartingAddress_bits  32
   209821 #define GEN6_VERTEX_BUFFER_STATE_BufferStartingAddress_bits  32
   209822 #define GEN5_VERTEX_BUFFER_STATE_BufferStartingAddress_bits  32
   209823 #define GEN45_VERTEX_BUFFER_STATE_BufferStartingAddress_bits  32
   209824 #define GEN4_VERTEX_BUFFER_STATE_BufferStartingAddress_bits  32
   209825 
   209826 static inline uint32_t ATTRIBUTE_PURE
   209827 VERTEX_BUFFER_STATE_BufferStartingAddress_bits(const struct gen_device_info *devinfo)
   209828 {
   209829    switch (devinfo->gen) {
   209830    case 10: return 64;
   209831    case 9: return 64;
   209832    case 8: return 64;
   209833    case 7:
   209834       if (devinfo->is_haswell) {
   209835          return 32;
   209836       } else {
   209837          return 32;
   209838       }
   209839    case 6: return 32;
   209840    case 5: return 32;
   209841    case 4:
   209842       if (devinfo->is_g4x) {
   209843          return 32;
   209844       } else {
   209845          return 32;
   209846       }
   209847    default:
   209848       unreachable("Invalid hardware generation");
   209849    }
   209850 }
   209851 
   209852 
   209853 
   209854 #define GEN10_VERTEX_BUFFER_STATE_BufferStartingAddress_start  32
   209855 #define GEN9_VERTEX_BUFFER_STATE_BufferStartingAddress_start  32
   209856 #define GEN8_VERTEX_BUFFER_STATE_BufferStartingAddress_start  32
   209857 #define GEN75_VERTEX_BUFFER_STATE_BufferStartingAddress_start  32
   209858 #define GEN7_VERTEX_BUFFER_STATE_BufferStartingAddress_start  32
   209859 #define GEN6_VERTEX_BUFFER_STATE_BufferStartingAddress_start  32
   209860 #define GEN5_VERTEX_BUFFER_STATE_BufferStartingAddress_start  32
   209861 #define GEN45_VERTEX_BUFFER_STATE_BufferStartingAddress_start  32
   209862 #define GEN4_VERTEX_BUFFER_STATE_BufferStartingAddress_start  32
   209863 
   209864 static inline uint32_t ATTRIBUTE_PURE
   209865 VERTEX_BUFFER_STATE_BufferStartingAddress_start(const struct gen_device_info *devinfo)
   209866 {
   209867    switch (devinfo->gen) {
   209868    case 10: return 32;
   209869    case 9: return 32;
   209870    case 8: return 32;
   209871    case 7:
   209872       if (devinfo->is_haswell) {
   209873          return 32;
   209874       } else {
   209875          return 32;
   209876       }
   209877    case 6: return 32;
   209878    case 5: return 32;
   209879    case 4:
   209880       if (devinfo->is_g4x) {
   209881          return 32;
   209882       } else {
   209883          return 32;
   209884       }
   209885    default:
   209886       unreachable("Invalid hardware generation");
   209887    }
   209888 }
   209889 
   209890 
   209891 
   209892 /* VERTEX_BUFFER_STATE::End Address */
   209893 
   209894 
   209895 #define GEN75_VERTEX_BUFFER_STATE_EndAddress_bits  32
   209896 #define GEN7_VERTEX_BUFFER_STATE_EndAddress_bits  32
   209897 #define GEN6_VERTEX_BUFFER_STATE_EndAddress_bits  32
   209898 #define GEN5_VERTEX_BUFFER_STATE_EndAddress_bits  32
   209899 
   209900 static inline uint32_t ATTRIBUTE_PURE
   209901 VERTEX_BUFFER_STATE_EndAddress_bits(const struct gen_device_info *devinfo)
   209902 {
   209903    switch (devinfo->gen) {
   209904    case 10: return 0;
   209905    case 9: return 0;
   209906    case 8: return 0;
   209907    case 7:
   209908       if (devinfo->is_haswell) {
   209909          return 32;
   209910       } else {
   209911          return 32;
   209912       }
   209913    case 6: return 32;
   209914    case 5: return 32;
   209915    case 4:
   209916       if (devinfo->is_g4x) {
   209917          return 0;
   209918       } else {
   209919          return 0;
   209920       }
   209921    default:
   209922       unreachable("Invalid hardware generation");
   209923    }
   209924 }
   209925 
   209926 
   209927 
   209928 #define GEN75_VERTEX_BUFFER_STATE_EndAddress_start  64
   209929 #define GEN7_VERTEX_BUFFER_STATE_EndAddress_start  64
   209930 #define GEN6_VERTEX_BUFFER_STATE_EndAddress_start  64
   209931 #define GEN5_VERTEX_BUFFER_STATE_EndAddress_start  64
   209932 
   209933 static inline uint32_t ATTRIBUTE_PURE
   209934 VERTEX_BUFFER_STATE_EndAddress_start(const struct gen_device_info *devinfo)
   209935 {
   209936    switch (devinfo->gen) {
   209937    case 10: return 0;
   209938    case 9: return 0;
   209939    case 8: return 0;
   209940    case 7:
   209941       if (devinfo->is_haswell) {
   209942          return 64;
   209943       } else {
   209944          return 64;
   209945       }
   209946    case 6: return 64;
   209947    case 5: return 64;
   209948    case 4:
   209949       if (devinfo->is_g4x) {
   209950          return 0;
   209951       } else {
   209952          return 0;
   209953       }
   209954    default:
   209955       unreachable("Invalid hardware generation");
   209956    }
   209957 }
   209958 
   209959 
   209960 
   209961 /* VERTEX_BUFFER_STATE::Instance Data Step Rate */
   209962 
   209963 
   209964 #define GEN75_VERTEX_BUFFER_STATE_InstanceDataStepRate_bits  32
   209965 #define GEN7_VERTEX_BUFFER_STATE_InstanceDataStepRate_bits  32
   209966 #define GEN6_VERTEX_BUFFER_STATE_InstanceDataStepRate_bits  32
   209967 #define GEN5_VERTEX_BUFFER_STATE_InstanceDataStepRate_bits  32
   209968 #define GEN45_VERTEX_BUFFER_STATE_InstanceDataStepRate_bits  32
   209969 #define GEN4_VERTEX_BUFFER_STATE_InstanceDataStepRate_bits  32
   209970 
   209971 static inline uint32_t ATTRIBUTE_PURE
   209972 VERTEX_BUFFER_STATE_InstanceDataStepRate_bits(const struct gen_device_info *devinfo)
   209973 {
   209974    switch (devinfo->gen) {
   209975    case 10: return 0;
   209976    case 9: return 0;
   209977    case 8: return 0;
   209978    case 7:
   209979       if (devinfo->is_haswell) {
   209980          return 32;
   209981       } else {
   209982          return 32;
   209983       }
   209984    case 6: return 32;
   209985    case 5: return 32;
   209986    case 4:
   209987       if (devinfo->is_g4x) {
   209988          return 32;
   209989       } else {
   209990          return 32;
   209991       }
   209992    default:
   209993       unreachable("Invalid hardware generation");
   209994    }
   209995 }
   209996 
   209997 
   209998 
   209999 #define GEN75_VERTEX_BUFFER_STATE_InstanceDataStepRate_start  96
   210000 #define GEN7_VERTEX_BUFFER_STATE_InstanceDataStepRate_start  96
   210001 #define GEN6_VERTEX_BUFFER_STATE_InstanceDataStepRate_start  96
   210002 #define GEN5_VERTEX_BUFFER_STATE_InstanceDataStepRate_start  96
   210003 #define GEN45_VERTEX_BUFFER_STATE_InstanceDataStepRate_start  96
   210004 #define GEN4_VERTEX_BUFFER_STATE_InstanceDataStepRate_start  96
   210005 
   210006 static inline uint32_t ATTRIBUTE_PURE
   210007 VERTEX_BUFFER_STATE_InstanceDataStepRate_start(const struct gen_device_info *devinfo)
   210008 {
   210009    switch (devinfo->gen) {
   210010    case 10: return 0;
   210011    case 9: return 0;
   210012    case 8: return 0;
   210013    case 7:
   210014       if (devinfo->is_haswell) {
   210015          return 96;
   210016       } else {
   210017          return 96;
   210018       }
   210019    case 6: return 96;
   210020    case 5: return 96;
   210021    case 4:
   210022       if (devinfo->is_g4x) {
   210023          return 96;
   210024       } else {
   210025          return 96;
   210026       }
   210027    default:
   210028       unreachable("Invalid hardware generation");
   210029    }
   210030 }
   210031 
   210032 
   210033 
   210034 /* VERTEX_BUFFER_STATE::Max Index */
   210035 
   210036 
   210037 #define GEN45_VERTEX_BUFFER_STATE_MaxIndex_bits  32
   210038 #define GEN4_VERTEX_BUFFER_STATE_MaxIndex_bits  32
   210039 
   210040 static inline uint32_t ATTRIBUTE_PURE
   210041 VERTEX_BUFFER_STATE_MaxIndex_bits(const struct gen_device_info *devinfo)
   210042 {
   210043    switch (devinfo->gen) {
   210044    case 10: return 0;
   210045    case 9: return 0;
   210046    case 8: return 0;
   210047    case 7:
   210048       if (devinfo->is_haswell) {
   210049          return 0;
   210050       } else {
   210051          return 0;
   210052       }
   210053    case 6: return 0;
   210054    case 5: return 0;
   210055    case 4:
   210056       if (devinfo->is_g4x) {
   210057          return 32;
   210058       } else {
   210059          return 32;
   210060       }
   210061    default:
   210062       unreachable("Invalid hardware generation");
   210063    }
   210064 }
   210065 
   210066 
   210067 
   210068 #define GEN45_VERTEX_BUFFER_STATE_MaxIndex_start  64
   210069 #define GEN4_VERTEX_BUFFER_STATE_MaxIndex_start  64
   210070 
   210071 static inline uint32_t ATTRIBUTE_PURE
   210072 VERTEX_BUFFER_STATE_MaxIndex_start(const struct gen_device_info *devinfo)
   210073 {
   210074    switch (devinfo->gen) {
   210075    case 10: return 0;
   210076    case 9: return 0;
   210077    case 8: return 0;
   210078    case 7:
   210079       if (devinfo->is_haswell) {
   210080          return 0;
   210081       } else {
   210082          return 0;
   210083       }
   210084    case 6: return 0;
   210085    case 5: return 0;
   210086    case 4:
   210087       if (devinfo->is_g4x) {
   210088          return 64;
   210089       } else {
   210090          return 64;
   210091       }
   210092    default:
   210093       unreachable("Invalid hardware generation");
   210094    }
   210095 }
   210096 
   210097 
   210098 
   210099 /* VERTEX_BUFFER_STATE::Memory Object Control State */
   210100 
   210101 
   210102 #define GEN10_VERTEX_BUFFER_STATE_MemoryObjectControlState_bits  7
   210103 #define GEN9_VERTEX_BUFFER_STATE_MemoryObjectControlState_bits  7
   210104 #define GEN8_VERTEX_BUFFER_STATE_MemoryObjectControlState_bits  7
   210105 
   210106 static inline uint32_t ATTRIBUTE_PURE
   210107 VERTEX_BUFFER_STATE_MemoryObjectControlState_bits(const struct gen_device_info *devinfo)
   210108 {
   210109    switch (devinfo->gen) {
   210110    case 10: return 7;
   210111    case 9: return 7;
   210112    case 8: return 7;
   210113    case 7:
   210114       if (devinfo->is_haswell) {
   210115          return 0;
   210116       } else {
   210117          return 0;
   210118       }
   210119    case 6: return 0;
   210120    case 5: return 0;
   210121    case 4:
   210122       if (devinfo->is_g4x) {
   210123          return 0;
   210124       } else {
   210125          return 0;
   210126       }
   210127    default:
   210128       unreachable("Invalid hardware generation");
   210129    }
   210130 }
   210131 
   210132 
   210133 
   210134 #define GEN10_VERTEX_BUFFER_STATE_MemoryObjectControlState_start  16
   210135 #define GEN9_VERTEX_BUFFER_STATE_MemoryObjectControlState_start  16
   210136 #define GEN8_VERTEX_BUFFER_STATE_MemoryObjectControlState_start  16
   210137 
   210138 static inline uint32_t ATTRIBUTE_PURE
   210139 VERTEX_BUFFER_STATE_MemoryObjectControlState_start(const struct gen_device_info *devinfo)
   210140 {
   210141    switch (devinfo->gen) {
   210142    case 10: return 16;
   210143    case 9: return 16;
   210144    case 8: return 16;
   210145    case 7:
   210146       if (devinfo->is_haswell) {
   210147          return 0;
   210148       } else {
   210149          return 0;
   210150       }
   210151    case 6: return 0;
   210152    case 5: return 0;
   210153    case 4:
   210154       if (devinfo->is_g4x) {
   210155          return 0;
   210156       } else {
   210157          return 0;
   210158       }
   210159    default:
   210160       unreachable("Invalid hardware generation");
   210161    }
   210162 }
   210163 
   210164 
   210165 
   210166 /* VERTEX_BUFFER_STATE::Null Vertex Buffer */
   210167 
   210168 
   210169 #define GEN10_VERTEX_BUFFER_STATE_NullVertexBuffer_bits  1
   210170 #define GEN9_VERTEX_BUFFER_STATE_NullVertexBuffer_bits  1
   210171 #define GEN8_VERTEX_BUFFER_STATE_NullVertexBuffer_bits  1
   210172 #define GEN75_VERTEX_BUFFER_STATE_NullVertexBuffer_bits  1
   210173 #define GEN7_VERTEX_BUFFER_STATE_NullVertexBuffer_bits  1
   210174 #define GEN6_VERTEX_BUFFER_STATE_NullVertexBuffer_bits  1
   210175 #define GEN5_VERTEX_BUFFER_STATE_NullVertexBuffer_bits  1
   210176 
   210177 static inline uint32_t ATTRIBUTE_PURE
   210178 VERTEX_BUFFER_STATE_NullVertexBuffer_bits(const struct gen_device_info *devinfo)
   210179 {
   210180    switch (devinfo->gen) {
   210181    case 10: return 1;
   210182    case 9: return 1;
   210183    case 8: return 1;
   210184    case 7:
   210185       if (devinfo->is_haswell) {
   210186          return 1;
   210187       } else {
   210188          return 1;
   210189       }
   210190    case 6: return 1;
   210191    case 5: return 1;
   210192    case 4:
   210193       if (devinfo->is_g4x) {
   210194          return 0;
   210195       } else {
   210196          return 0;
   210197       }
   210198    default:
   210199       unreachable("Invalid hardware generation");
   210200    }
   210201 }
   210202 
   210203 
   210204 
   210205 #define GEN10_VERTEX_BUFFER_STATE_NullVertexBuffer_start  13
   210206 #define GEN9_VERTEX_BUFFER_STATE_NullVertexBuffer_start  13
   210207 #define GEN8_VERTEX_BUFFER_STATE_NullVertexBuffer_start  13
   210208 #define GEN75_VERTEX_BUFFER_STATE_NullVertexBuffer_start  13
   210209 #define GEN7_VERTEX_BUFFER_STATE_NullVertexBuffer_start  13
   210210 #define GEN6_VERTEX_BUFFER_STATE_NullVertexBuffer_start  13
   210211 #define GEN5_VERTEX_BUFFER_STATE_NullVertexBuffer_start  13
   210212 
   210213 static inline uint32_t ATTRIBUTE_PURE
   210214 VERTEX_BUFFER_STATE_NullVertexBuffer_start(const struct gen_device_info *devinfo)
   210215 {
   210216    switch (devinfo->gen) {
   210217    case 10: return 13;
   210218    case 9: return 13;
   210219    case 8: return 13;
   210220    case 7:
   210221       if (devinfo->is_haswell) {
   210222          return 13;
   210223       } else {
   210224          return 13;
   210225       }
   210226    case 6: return 13;
   210227    case 5: return 13;
   210228    case 4:
   210229       if (devinfo->is_g4x) {
   210230          return 0;
   210231       } else {
   210232          return 0;
   210233       }
   210234    default:
   210235       unreachable("Invalid hardware generation");
   210236    }
   210237 }
   210238 
   210239 
   210240 
   210241 /* VERTEX_BUFFER_STATE::Vertex Buffer Index */
   210242 
   210243 
   210244 #define GEN10_VERTEX_BUFFER_STATE_VertexBufferIndex_bits  6
   210245 #define GEN9_VERTEX_BUFFER_STATE_VertexBufferIndex_bits  6
   210246 #define GEN8_VERTEX_BUFFER_STATE_VertexBufferIndex_bits  6
   210247 #define GEN75_VERTEX_BUFFER_STATE_VertexBufferIndex_bits  6
   210248 #define GEN7_VERTEX_BUFFER_STATE_VertexBufferIndex_bits  6
   210249 #define GEN6_VERTEX_BUFFER_STATE_VertexBufferIndex_bits  6
   210250 #define GEN5_VERTEX_BUFFER_STATE_VertexBufferIndex_bits  5
   210251 #define GEN45_VERTEX_BUFFER_STATE_VertexBufferIndex_bits  5
   210252 #define GEN4_VERTEX_BUFFER_STATE_VertexBufferIndex_bits  5
   210253 
   210254 static inline uint32_t ATTRIBUTE_PURE
   210255 VERTEX_BUFFER_STATE_VertexBufferIndex_bits(const struct gen_device_info *devinfo)
   210256 {
   210257    switch (devinfo->gen) {
   210258    case 10: return 6;
   210259    case 9: return 6;
   210260    case 8: return 6;
   210261    case 7:
   210262       if (devinfo->is_haswell) {
   210263          return 6;
   210264       } else {
   210265          return 6;
   210266       }
   210267    case 6: return 6;
   210268    case 5: return 5;
   210269    case 4:
   210270       if (devinfo->is_g4x) {
   210271          return 5;
   210272       } else {
   210273          return 5;
   210274       }
   210275    default:
   210276       unreachable("Invalid hardware generation");
   210277    }
   210278 }
   210279 
   210280 
   210281 
   210282 #define GEN10_VERTEX_BUFFER_STATE_VertexBufferIndex_start  26
   210283 #define GEN9_VERTEX_BUFFER_STATE_VertexBufferIndex_start  26
   210284 #define GEN8_VERTEX_BUFFER_STATE_VertexBufferIndex_start  26
   210285 #define GEN75_VERTEX_BUFFER_STATE_VertexBufferIndex_start  26
   210286 #define GEN7_VERTEX_BUFFER_STATE_VertexBufferIndex_start  26
   210287 #define GEN6_VERTEX_BUFFER_STATE_VertexBufferIndex_start  26
   210288 #define GEN5_VERTEX_BUFFER_STATE_VertexBufferIndex_start  27
   210289 #define GEN45_VERTEX_BUFFER_STATE_VertexBufferIndex_start  27
   210290 #define GEN4_VERTEX_BUFFER_STATE_VertexBufferIndex_start  27
   210291 
   210292 static inline uint32_t ATTRIBUTE_PURE
   210293 VERTEX_BUFFER_STATE_VertexBufferIndex_start(const struct gen_device_info *devinfo)
   210294 {
   210295    switch (devinfo->gen) {
   210296    case 10: return 26;
   210297    case 9: return 26;
   210298    case 8: return 26;
   210299    case 7:
   210300       if (devinfo->is_haswell) {
   210301          return 26;
   210302       } else {
   210303          return 26;
   210304       }
   210305    case 6: return 26;
   210306    case 5: return 27;
   210307    case 4:
   210308       if (devinfo->is_g4x) {
   210309          return 27;
   210310       } else {
   210311          return 27;
   210312       }
   210313    default:
   210314       unreachable("Invalid hardware generation");
   210315    }
   210316 }
   210317 
   210318 
   210319 
   210320 /* VERTEX_BUFFER_STATE::Vertex Buffer MOCS */
   210321 
   210322 
   210323 #define GEN10_VERTEX_BUFFER_STATE_VertexBufferMOCS_bits  7
   210324 #define GEN9_VERTEX_BUFFER_STATE_VertexBufferMOCS_bits  7
   210325 #define GEN8_VERTEX_BUFFER_STATE_VertexBufferMOCS_bits  7
   210326 #define GEN75_VERTEX_BUFFER_STATE_VertexBufferMOCS_bits  4
   210327 #define GEN7_VERTEX_BUFFER_STATE_VertexBufferMOCS_bits  4
   210328 #define GEN6_VERTEX_BUFFER_STATE_VertexBufferMOCS_bits  4
   210329 
   210330 static inline uint32_t ATTRIBUTE_PURE
   210331 VERTEX_BUFFER_STATE_VertexBufferMOCS_bits(const struct gen_device_info *devinfo)
   210332 {
   210333    switch (devinfo->gen) {
   210334    case 10: return 7;
   210335    case 9: return 7;
   210336    case 8: return 7;
   210337    case 7:
   210338       if (devinfo->is_haswell) {
   210339          return 4;
   210340       } else {
   210341          return 4;
   210342       }
   210343    case 6: return 4;
   210344    case 5: return 0;
   210345    case 4:
   210346       if (devinfo->is_g4x) {
   210347          return 0;
   210348       } else {
   210349          return 0;
   210350       }
   210351    default:
   210352       unreachable("Invalid hardware generation");
   210353    }
   210354 }
   210355 
   210356 
   210357 
   210358 #define GEN10_VERTEX_BUFFER_STATE_VertexBufferMOCS_start  16
   210359 #define GEN9_VERTEX_BUFFER_STATE_VertexBufferMOCS_start  16
   210360 #define GEN8_VERTEX_BUFFER_STATE_VertexBufferMOCS_start  16
   210361 #define GEN75_VERTEX_BUFFER_STATE_VertexBufferMOCS_start  16
   210362 #define GEN7_VERTEX_BUFFER_STATE_VertexBufferMOCS_start  16
   210363 #define GEN6_VERTEX_BUFFER_STATE_VertexBufferMOCS_start  16
   210364 
   210365 static inline uint32_t ATTRIBUTE_PURE
   210366 VERTEX_BUFFER_STATE_VertexBufferMOCS_start(const struct gen_device_info *devinfo)
   210367 {
   210368    switch (devinfo->gen) {
   210369    case 10: return 16;
   210370    case 9: return 16;
   210371    case 8: return 16;
   210372    case 7:
   210373       if (devinfo->is_haswell) {
   210374          return 16;
   210375       } else {
   210376          return 16;
   210377       }
   210378    case 6: return 16;
   210379    case 5: return 0;
   210380    case 4:
   210381       if (devinfo->is_g4x) {
   210382          return 0;
   210383       } else {
   210384          return 0;
   210385       }
   210386    default:
   210387       unreachable("Invalid hardware generation");
   210388    }
   210389 }
   210390 
   210391 
   210392 
   210393 /* VERTEX_BUFFER_STATE::Vertex Buffer Memory Object Control State */
   210394 
   210395 
   210396 #define GEN75_VERTEX_BUFFER_STATE_VertexBufferMemoryObjectControlState_bits  4
   210397 #define GEN7_VERTEX_BUFFER_STATE_VertexBufferMemoryObjectControlState_bits  4
   210398 #define GEN6_VERTEX_BUFFER_STATE_VertexBufferMemoryObjectControlState_bits  4
   210399 
   210400 static inline uint32_t ATTRIBUTE_PURE
   210401 VERTEX_BUFFER_STATE_VertexBufferMemoryObjectControlState_bits(const struct gen_device_info *devinfo)
   210402 {
   210403    switch (devinfo->gen) {
   210404    case 10: return 0;
   210405    case 9: return 0;
   210406    case 8: return 0;
   210407    case 7:
   210408       if (devinfo->is_haswell) {
   210409          return 4;
   210410       } else {
   210411          return 4;
   210412       }
   210413    case 6: return 4;
   210414    case 5: return 0;
   210415    case 4:
   210416       if (devinfo->is_g4x) {
   210417          return 0;
   210418       } else {
   210419          return 0;
   210420       }
   210421    default:
   210422       unreachable("Invalid hardware generation");
   210423    }
   210424 }
   210425 
   210426 
   210427 
   210428 #define GEN75_VERTEX_BUFFER_STATE_VertexBufferMemoryObjectControlState_start  16
   210429 #define GEN7_VERTEX_BUFFER_STATE_VertexBufferMemoryObjectControlState_start  16
   210430 #define GEN6_VERTEX_BUFFER_STATE_VertexBufferMemoryObjectControlState_start  16
   210431 
   210432 static inline uint32_t ATTRIBUTE_PURE
   210433 VERTEX_BUFFER_STATE_VertexBufferMemoryObjectControlState_start(const struct gen_device_info *devinfo)
   210434 {
   210435    switch (devinfo->gen) {
   210436    case 10: return 0;
   210437    case 9: return 0;
   210438    case 8: return 0;
   210439    case 7:
   210440       if (devinfo->is_haswell) {
   210441          return 16;
   210442       } else {
   210443          return 16;
   210444       }
   210445    case 6: return 16;
   210446    case 5: return 0;
   210447    case 4:
   210448       if (devinfo->is_g4x) {
   210449          return 0;
   210450       } else {
   210451          return 0;
   210452       }
   210453    default:
   210454       unreachable("Invalid hardware generation");
   210455    }
   210456 }
   210457 
   210458 
   210459 
   210460 /* VERTEX_BUFFER_STATE::Vertex Fetch Invalidate */
   210461 
   210462 
   210463 #define GEN75_VERTEX_BUFFER_STATE_VertexFetchInvalidate_bits  1
   210464 #define GEN7_VERTEX_BUFFER_STATE_VertexFetchInvalidate_bits  1
   210465 #define GEN6_VERTEX_BUFFER_STATE_VertexFetchInvalidate_bits  1
   210466 
   210467 static inline uint32_t ATTRIBUTE_PURE
   210468 VERTEX_BUFFER_STATE_VertexFetchInvalidate_bits(const struct gen_device_info *devinfo)
   210469 {
   210470    switch (devinfo->gen) {
   210471    case 10: return 0;
   210472    case 9: return 0;
   210473    case 8: return 0;
   210474    case 7:
   210475       if (devinfo->is_haswell) {
   210476          return 1;
   210477       } else {
   210478          return 1;
   210479       }
   210480    case 6: return 1;
   210481    case 5: return 0;
   210482    case 4:
   210483       if (devinfo->is_g4x) {
   210484          return 0;
   210485       } else {
   210486          return 0;
   210487       }
   210488    default:
   210489       unreachable("Invalid hardware generation");
   210490    }
   210491 }
   210492 
   210493 
   210494 
   210495 #define GEN75_VERTEX_BUFFER_STATE_VertexFetchInvalidate_start  12
   210496 #define GEN7_VERTEX_BUFFER_STATE_VertexFetchInvalidate_start  12
   210497 #define GEN6_VERTEX_BUFFER_STATE_VertexFetchInvalidate_start  12
   210498 
   210499 static inline uint32_t ATTRIBUTE_PURE
   210500 VERTEX_BUFFER_STATE_VertexFetchInvalidate_start(const struct gen_device_info *devinfo)
   210501 {
   210502    switch (devinfo->gen) {
   210503    case 10: return 0;
   210504    case 9: return 0;
   210505    case 8: return 0;
   210506    case 7:
   210507       if (devinfo->is_haswell) {
   210508          return 12;
   210509       } else {
   210510          return 12;
   210511       }
   210512    case 6: return 12;
   210513    case 5: return 0;
   210514    case 4:
   210515       if (devinfo->is_g4x) {
   210516          return 0;
   210517       } else {
   210518          return 0;
   210519       }
   210520    default:
   210521       unreachable("Invalid hardware generation");
   210522    }
   210523 }
   210524 
   210525 
   210526 
   210527 /* VERTEX_ELEMENT_STATE */
   210528 
   210529 
   210530 #define GEN10_VERTEX_ELEMENT_STATE_length  2
   210531 #define GEN9_VERTEX_ELEMENT_STATE_length  2
   210532 #define GEN8_VERTEX_ELEMENT_STATE_length  2
   210533 #define GEN75_VERTEX_ELEMENT_STATE_length  2
   210534 #define GEN7_VERTEX_ELEMENT_STATE_length  2
   210535 #define GEN6_VERTEX_ELEMENT_STATE_length  2
   210536 #define GEN5_VERTEX_ELEMENT_STATE_length  2
   210537 #define GEN45_VERTEX_ELEMENT_STATE_length  2
   210538 #define GEN4_VERTEX_ELEMENT_STATE_length  2
   210539 
   210540 static inline uint32_t ATTRIBUTE_PURE
   210541 VERTEX_ELEMENT_STATE_length(const struct gen_device_info *devinfo)
   210542 {
   210543    switch (devinfo->gen) {
   210544    case 10: return 2;
   210545    case 9: return 2;
   210546    case 8: return 2;
   210547    case 7:
   210548       if (devinfo->is_haswell) {
   210549          return 2;
   210550       } else {
   210551          return 2;
   210552       }
   210553    case 6: return 2;
   210554    case 5: return 2;
   210555    case 4:
   210556       if (devinfo->is_g4x) {
   210557          return 2;
   210558       } else {
   210559          return 2;
   210560       }
   210561    default:
   210562       unreachable("Invalid hardware generation");
   210563    }
   210564 }
   210565 
   210566 
   210567 
   210568 /* VERTEX_ELEMENT_STATE::Component 0 Control */
   210569 
   210570 
   210571 #define GEN10_VERTEX_ELEMENT_STATE_Component0Control_bits  3
   210572 #define GEN9_VERTEX_ELEMENT_STATE_Component0Control_bits  3
   210573 #define GEN8_VERTEX_ELEMENT_STATE_Component0Control_bits  3
   210574 #define GEN75_VERTEX_ELEMENT_STATE_Component0Control_bits  3
   210575 #define GEN7_VERTEX_ELEMENT_STATE_Component0Control_bits  3
   210576 #define GEN6_VERTEX_ELEMENT_STATE_Component0Control_bits  3
   210577 #define GEN5_VERTEX_ELEMENT_STATE_Component0Control_bits  3
   210578 #define GEN45_VERTEX_ELEMENT_STATE_Component0Control_bits  3
   210579 #define GEN4_VERTEX_ELEMENT_STATE_Component0Control_bits  3
   210580 
   210581 static inline uint32_t ATTRIBUTE_PURE
   210582 VERTEX_ELEMENT_STATE_Component0Control_bits(const struct gen_device_info *devinfo)
   210583 {
   210584    switch (devinfo->gen) {
   210585    case 10: return 3;
   210586    case 9: return 3;
   210587    case 8: return 3;
   210588    case 7:
   210589       if (devinfo->is_haswell) {
   210590          return 3;
   210591       } else {
   210592          return 3;
   210593       }
   210594    case 6: return 3;
   210595    case 5: return 3;
   210596    case 4:
   210597       if (devinfo->is_g4x) {
   210598          return 3;
   210599       } else {
   210600          return 3;
   210601       }
   210602    default:
   210603       unreachable("Invalid hardware generation");
   210604    }
   210605 }
   210606 
   210607 
   210608 
   210609 #define GEN10_VERTEX_ELEMENT_STATE_Component0Control_start  60
   210610 #define GEN9_VERTEX_ELEMENT_STATE_Component0Control_start  60
   210611 #define GEN8_VERTEX_ELEMENT_STATE_Component0Control_start  60
   210612 #define GEN75_VERTEX_ELEMENT_STATE_Component0Control_start  60
   210613 #define GEN7_VERTEX_ELEMENT_STATE_Component0Control_start  60
   210614 #define GEN6_VERTEX_ELEMENT_STATE_Component0Control_start  60
   210615 #define GEN5_VERTEX_ELEMENT_STATE_Component0Control_start  60
   210616 #define GEN45_VERTEX_ELEMENT_STATE_Component0Control_start  60
   210617 #define GEN4_VERTEX_ELEMENT_STATE_Component0Control_start  60
   210618 
   210619 static inline uint32_t ATTRIBUTE_PURE
   210620 VERTEX_ELEMENT_STATE_Component0Control_start(const struct gen_device_info *devinfo)
   210621 {
   210622    switch (devinfo->gen) {
   210623    case 10: return 60;
   210624    case 9: return 60;
   210625    case 8: return 60;
   210626    case 7:
   210627       if (devinfo->is_haswell) {
   210628          return 60;
   210629       } else {
   210630          return 60;
   210631       }
   210632    case 6: return 60;
   210633    case 5: return 60;
   210634    case 4:
   210635       if (devinfo->is_g4x) {
   210636          return 60;
   210637       } else {
   210638          return 60;
   210639       }
   210640    default:
   210641       unreachable("Invalid hardware generation");
   210642    }
   210643 }
   210644 
   210645 
   210646 
   210647 /* VERTEX_ELEMENT_STATE::Component 1 Control */
   210648 
   210649 
   210650 #define GEN10_VERTEX_ELEMENT_STATE_Component1Control_bits  3
   210651 #define GEN9_VERTEX_ELEMENT_STATE_Component1Control_bits  3
   210652 #define GEN8_VERTEX_ELEMENT_STATE_Component1Control_bits  3
   210653 #define GEN75_VERTEX_ELEMENT_STATE_Component1Control_bits  3
   210654 #define GEN7_VERTEX_ELEMENT_STATE_Component1Control_bits  3
   210655 #define GEN6_VERTEX_ELEMENT_STATE_Component1Control_bits  3
   210656 #define GEN5_VERTEX_ELEMENT_STATE_Component1Control_bits  3
   210657 #define GEN45_VERTEX_ELEMENT_STATE_Component1Control_bits  3
   210658 #define GEN4_VERTEX_ELEMENT_STATE_Component1Control_bits  3
   210659 
   210660 static inline uint32_t ATTRIBUTE_PURE
   210661 VERTEX_ELEMENT_STATE_Component1Control_bits(const struct gen_device_info *devinfo)
   210662 {
   210663    switch (devinfo->gen) {
   210664    case 10: return 3;
   210665    case 9: return 3;
   210666    case 8: return 3;
   210667    case 7:
   210668       if (devinfo->is_haswell) {
   210669          return 3;
   210670       } else {
   210671          return 3;
   210672       }
   210673    case 6: return 3;
   210674    case 5: return 3;
   210675    case 4:
   210676       if (devinfo->is_g4x) {
   210677          return 3;
   210678       } else {
   210679          return 3;
   210680       }
   210681    default:
   210682       unreachable("Invalid hardware generation");
   210683    }
   210684 }
   210685 
   210686 
   210687 
   210688 #define GEN10_VERTEX_ELEMENT_STATE_Component1Control_start  56
   210689 #define GEN9_VERTEX_ELEMENT_STATE_Component1Control_start  56
   210690 #define GEN8_VERTEX_ELEMENT_STATE_Component1Control_start  56
   210691 #define GEN75_VERTEX_ELEMENT_STATE_Component1Control_start  56
   210692 #define GEN7_VERTEX_ELEMENT_STATE_Component1Control_start  56
   210693 #define GEN6_VERTEX_ELEMENT_STATE_Component1Control_start  56
   210694 #define GEN5_VERTEX_ELEMENT_STATE_Component1Control_start  56
   210695 #define GEN45_VERTEX_ELEMENT_STATE_Component1Control_start  56
   210696 #define GEN4_VERTEX_ELEMENT_STATE_Component1Control_start  56
   210697 
   210698 static inline uint32_t ATTRIBUTE_PURE
   210699 VERTEX_ELEMENT_STATE_Component1Control_start(const struct gen_device_info *devinfo)
   210700 {
   210701    switch (devinfo->gen) {
   210702    case 10: return 56;
   210703    case 9: return 56;
   210704    case 8: return 56;
   210705    case 7:
   210706       if (devinfo->is_haswell) {
   210707          return 56;
   210708       } else {
   210709          return 56;
   210710       }
   210711    case 6: return 56;
   210712    case 5: return 56;
   210713    case 4:
   210714       if (devinfo->is_g4x) {
   210715          return 56;
   210716       } else {
   210717          return 56;
   210718       }
   210719    default:
   210720       unreachable("Invalid hardware generation");
   210721    }
   210722 }
   210723 
   210724 
   210725 
   210726 /* VERTEX_ELEMENT_STATE::Component 2 Control */
   210727 
   210728 
   210729 #define GEN10_VERTEX_ELEMENT_STATE_Component2Control_bits  3
   210730 #define GEN9_VERTEX_ELEMENT_STATE_Component2Control_bits  3
   210731 #define GEN8_VERTEX_ELEMENT_STATE_Component2Control_bits  3
   210732 #define GEN75_VERTEX_ELEMENT_STATE_Component2Control_bits  3
   210733 #define GEN7_VERTEX_ELEMENT_STATE_Component2Control_bits  3
   210734 #define GEN6_VERTEX_ELEMENT_STATE_Component2Control_bits  3
   210735 #define GEN5_VERTEX_ELEMENT_STATE_Component2Control_bits  3
   210736 #define GEN45_VERTEX_ELEMENT_STATE_Component2Control_bits  3
   210737 #define GEN4_VERTEX_ELEMENT_STATE_Component2Control_bits  3
   210738 
   210739 static inline uint32_t ATTRIBUTE_PURE
   210740 VERTEX_ELEMENT_STATE_Component2Control_bits(const struct gen_device_info *devinfo)
   210741 {
   210742    switch (devinfo->gen) {
   210743    case 10: return 3;
   210744    case 9: return 3;
   210745    case 8: return 3;
   210746    case 7:
   210747       if (devinfo->is_haswell) {
   210748          return 3;
   210749       } else {
   210750          return 3;
   210751       }
   210752    case 6: return 3;
   210753    case 5: return 3;
   210754    case 4:
   210755       if (devinfo->is_g4x) {
   210756          return 3;
   210757       } else {
   210758          return 3;
   210759       }
   210760    default:
   210761       unreachable("Invalid hardware generation");
   210762    }
   210763 }
   210764 
   210765 
   210766 
   210767 #define GEN10_VERTEX_ELEMENT_STATE_Component2Control_start  52
   210768 #define GEN9_VERTEX_ELEMENT_STATE_Component2Control_start  52
   210769 #define GEN8_VERTEX_ELEMENT_STATE_Component2Control_start  52
   210770 #define GEN75_VERTEX_ELEMENT_STATE_Component2Control_start  52
   210771 #define GEN7_VERTEX_ELEMENT_STATE_Component2Control_start  52
   210772 #define GEN6_VERTEX_ELEMENT_STATE_Component2Control_start  52
   210773 #define GEN5_VERTEX_ELEMENT_STATE_Component2Control_start  52
   210774 #define GEN45_VERTEX_ELEMENT_STATE_Component2Control_start  52
   210775 #define GEN4_VERTEX_ELEMENT_STATE_Component2Control_start  52
   210776 
   210777 static inline uint32_t ATTRIBUTE_PURE
   210778 VERTEX_ELEMENT_STATE_Component2Control_start(const struct gen_device_info *devinfo)
   210779 {
   210780    switch (devinfo->gen) {
   210781    case 10: return 52;
   210782    case 9: return 52;
   210783    case 8: return 52;
   210784    case 7:
   210785       if (devinfo->is_haswell) {
   210786          return 52;
   210787       } else {
   210788          return 52;
   210789       }
   210790    case 6: return 52;
   210791    case 5: return 52;
   210792    case 4:
   210793       if (devinfo->is_g4x) {
   210794          return 52;
   210795       } else {
   210796          return 52;
   210797       }
   210798    default:
   210799       unreachable("Invalid hardware generation");
   210800    }
   210801 }
   210802 
   210803 
   210804 
   210805 /* VERTEX_ELEMENT_STATE::Component 3 Control */
   210806 
   210807 
   210808 #define GEN10_VERTEX_ELEMENT_STATE_Component3Control_bits  3
   210809 #define GEN9_VERTEX_ELEMENT_STATE_Component3Control_bits  3
   210810 #define GEN8_VERTEX_ELEMENT_STATE_Component3Control_bits  3
   210811 #define GEN75_VERTEX_ELEMENT_STATE_Component3Control_bits  3
   210812 #define GEN7_VERTEX_ELEMENT_STATE_Component3Control_bits  3
   210813 #define GEN6_VERTEX_ELEMENT_STATE_Component3Control_bits  3
   210814 #define GEN5_VERTEX_ELEMENT_STATE_Component3Control_bits  3
   210815 #define GEN45_VERTEX_ELEMENT_STATE_Component3Control_bits  3
   210816 #define GEN4_VERTEX_ELEMENT_STATE_Component3Control_bits  3
   210817 
   210818 static inline uint32_t ATTRIBUTE_PURE
   210819 VERTEX_ELEMENT_STATE_Component3Control_bits(const struct gen_device_info *devinfo)
   210820 {
   210821    switch (devinfo->gen) {
   210822    case 10: return 3;
   210823    case 9: return 3;
   210824    case 8: return 3;
   210825    case 7:
   210826       if (devinfo->is_haswell) {
   210827          return 3;
   210828       } else {
   210829          return 3;
   210830       }
   210831    case 6: return 3;
   210832    case 5: return 3;
   210833    case 4:
   210834       if (devinfo->is_g4x) {
   210835          return 3;
   210836       } else {
   210837          return 3;
   210838       }
   210839    default:
   210840       unreachable("Invalid hardware generation");
   210841    }
   210842 }
   210843 
   210844 
   210845 
   210846 #define GEN10_VERTEX_ELEMENT_STATE_Component3Control_start  48
   210847 #define GEN9_VERTEX_ELEMENT_STATE_Component3Control_start  48
   210848 #define GEN8_VERTEX_ELEMENT_STATE_Component3Control_start  48
   210849 #define GEN75_VERTEX_ELEMENT_STATE_Component3Control_start  48
   210850 #define GEN7_VERTEX_ELEMENT_STATE_Component3Control_start  48
   210851 #define GEN6_VERTEX_ELEMENT_STATE_Component3Control_start  48
   210852 #define GEN5_VERTEX_ELEMENT_STATE_Component3Control_start  48
   210853 #define GEN45_VERTEX_ELEMENT_STATE_Component3Control_start  48
   210854 #define GEN4_VERTEX_ELEMENT_STATE_Component3Control_start  48
   210855 
   210856 static inline uint32_t ATTRIBUTE_PURE
   210857 VERTEX_ELEMENT_STATE_Component3Control_start(const struct gen_device_info *devinfo)
   210858 {
   210859    switch (devinfo->gen) {
   210860    case 10: return 48;
   210861    case 9: return 48;
   210862    case 8: return 48;
   210863    case 7:
   210864       if (devinfo->is_haswell) {
   210865          return 48;
   210866       } else {
   210867          return 48;
   210868       }
   210869    case 6: return 48;
   210870    case 5: return 48;
   210871    case 4:
   210872       if (devinfo->is_g4x) {
   210873          return 48;
   210874       } else {
   210875          return 48;
   210876       }
   210877    default:
   210878       unreachable("Invalid hardware generation");
   210879    }
   210880 }
   210881 
   210882 
   210883 
   210884 /* VERTEX_ELEMENT_STATE::Destination Element Offset */
   210885 
   210886 
   210887 #define GEN5_VERTEX_ELEMENT_STATE_DestinationElementOffset_bits  8
   210888 #define GEN45_VERTEX_ELEMENT_STATE_DestinationElementOffset_bits  8
   210889 #define GEN4_VERTEX_ELEMENT_STATE_DestinationElementOffset_bits  8
   210890 
   210891 static inline uint32_t ATTRIBUTE_PURE
   210892 VERTEX_ELEMENT_STATE_DestinationElementOffset_bits(const struct gen_device_info *devinfo)
   210893 {
   210894    switch (devinfo->gen) {
   210895    case 10: return 0;
   210896    case 9: return 0;
   210897    case 8: return 0;
   210898    case 7:
   210899       if (devinfo->is_haswell) {
   210900          return 0;
   210901       } else {
   210902          return 0;
   210903       }
   210904    case 6: return 0;
   210905    case 5: return 8;
   210906    case 4:
   210907       if (devinfo->is_g4x) {
   210908          return 8;
   210909       } else {
   210910          return 8;
   210911       }
   210912    default:
   210913       unreachable("Invalid hardware generation");
   210914    }
   210915 }
   210916 
   210917 
   210918 
   210919 #define GEN5_VERTEX_ELEMENT_STATE_DestinationElementOffset_start  32
   210920 #define GEN45_VERTEX_ELEMENT_STATE_DestinationElementOffset_start  32
   210921 #define GEN4_VERTEX_ELEMENT_STATE_DestinationElementOffset_start  32
   210922 
   210923 static inline uint32_t ATTRIBUTE_PURE
   210924 VERTEX_ELEMENT_STATE_DestinationElementOffset_start(const struct gen_device_info *devinfo)
   210925 {
   210926    switch (devinfo->gen) {
   210927    case 10: return 0;
   210928    case 9: return 0;
   210929    case 8: return 0;
   210930    case 7:
   210931       if (devinfo->is_haswell) {
   210932          return 0;
   210933       } else {
   210934          return 0;
   210935       }
   210936    case 6: return 0;
   210937    case 5: return 32;
   210938    case 4:
   210939       if (devinfo->is_g4x) {
   210940          return 32;
   210941       } else {
   210942          return 32;
   210943       }
   210944    default:
   210945       unreachable("Invalid hardware generation");
   210946    }
   210947 }
   210948 
   210949 
   210950 
   210951 /* VERTEX_ELEMENT_STATE::Edge Flag Enable */
   210952 
   210953 
   210954 #define GEN10_VERTEX_ELEMENT_STATE_EdgeFlagEnable_bits  1
   210955 #define GEN9_VERTEX_ELEMENT_STATE_EdgeFlagEnable_bits  1
   210956 #define GEN8_VERTEX_ELEMENT_STATE_EdgeFlagEnable_bits  1
   210957 #define GEN75_VERTEX_ELEMENT_STATE_EdgeFlagEnable_bits  1
   210958 #define GEN7_VERTEX_ELEMENT_STATE_EdgeFlagEnable_bits  1
   210959 #define GEN6_VERTEX_ELEMENT_STATE_EdgeFlagEnable_bits  1
   210960 
   210961 static inline uint32_t ATTRIBUTE_PURE
   210962 VERTEX_ELEMENT_STATE_EdgeFlagEnable_bits(const struct gen_device_info *devinfo)
   210963 {
   210964    switch (devinfo->gen) {
   210965    case 10: return 1;
   210966    case 9: return 1;
   210967    case 8: return 1;
   210968    case 7:
   210969       if (devinfo->is_haswell) {
   210970          return 1;
   210971       } else {
   210972          return 1;
   210973       }
   210974    case 6: return 1;
   210975    case 5: return 0;
   210976    case 4:
   210977       if (devinfo->is_g4x) {
   210978          return 0;
   210979       } else {
   210980          return 0;
   210981       }
   210982    default:
   210983       unreachable("Invalid hardware generation");
   210984    }
   210985 }
   210986 
   210987 
   210988 
   210989 #define GEN10_VERTEX_ELEMENT_STATE_EdgeFlagEnable_start  15
   210990 #define GEN9_VERTEX_ELEMENT_STATE_EdgeFlagEnable_start  15
   210991 #define GEN8_VERTEX_ELEMENT_STATE_EdgeFlagEnable_start  15
   210992 #define GEN75_VERTEX_ELEMENT_STATE_EdgeFlagEnable_start  15
   210993 #define GEN7_VERTEX_ELEMENT_STATE_EdgeFlagEnable_start  15
   210994 #define GEN6_VERTEX_ELEMENT_STATE_EdgeFlagEnable_start  15
   210995 
   210996 static inline uint32_t ATTRIBUTE_PURE
   210997 VERTEX_ELEMENT_STATE_EdgeFlagEnable_start(const struct gen_device_info *devinfo)
   210998 {
   210999    switch (devinfo->gen) {
   211000    case 10: return 15;
   211001    case 9: return 15;
   211002    case 8: return 15;
   211003    case 7:
   211004       if (devinfo->is_haswell) {
   211005          return 15;
   211006       } else {
   211007          return 15;
   211008       }
   211009    case 6: return 15;
   211010    case 5: return 0;
   211011    case 4:
   211012       if (devinfo->is_g4x) {
   211013          return 0;
   211014       } else {
   211015          return 0;
   211016       }
   211017    default:
   211018       unreachable("Invalid hardware generation");
   211019    }
   211020 }
   211021 
   211022 
   211023 
   211024 /* VERTEX_ELEMENT_STATE::Source Element Format */
   211025 
   211026 
   211027 #define GEN10_VERTEX_ELEMENT_STATE_SourceElementFormat_bits  9
   211028 #define GEN9_VERTEX_ELEMENT_STATE_SourceElementFormat_bits  9
   211029 #define GEN8_VERTEX_ELEMENT_STATE_SourceElementFormat_bits  9
   211030 #define GEN75_VERTEX_ELEMENT_STATE_SourceElementFormat_bits  9
   211031 #define GEN7_VERTEX_ELEMENT_STATE_SourceElementFormat_bits  9
   211032 #define GEN6_VERTEX_ELEMENT_STATE_SourceElementFormat_bits  9
   211033 #define GEN5_VERTEX_ELEMENT_STATE_SourceElementFormat_bits  9
   211034 #define GEN45_VERTEX_ELEMENT_STATE_SourceElementFormat_bits  9
   211035 #define GEN4_VERTEX_ELEMENT_STATE_SourceElementFormat_bits  9
   211036 
   211037 static inline uint32_t ATTRIBUTE_PURE
   211038 VERTEX_ELEMENT_STATE_SourceElementFormat_bits(const struct gen_device_info *devinfo)
   211039 {
   211040    switch (devinfo->gen) {
   211041    case 10: return 9;
   211042    case 9: return 9;
   211043    case 8: return 9;
   211044    case 7:
   211045       if (devinfo->is_haswell) {
   211046          return 9;
   211047       } else {
   211048          return 9;
   211049       }
   211050    case 6: return 9;
   211051    case 5: return 9;
   211052    case 4:
   211053       if (devinfo->is_g4x) {
   211054          return 9;
   211055       } else {
   211056          return 9;
   211057       }
   211058    default:
   211059       unreachable("Invalid hardware generation");
   211060    }
   211061 }
   211062 
   211063 
   211064 
   211065 #define GEN10_VERTEX_ELEMENT_STATE_SourceElementFormat_start  16
   211066 #define GEN9_VERTEX_ELEMENT_STATE_SourceElementFormat_start  16
   211067 #define GEN8_VERTEX_ELEMENT_STATE_SourceElementFormat_start  16
   211068 #define GEN75_VERTEX_ELEMENT_STATE_SourceElementFormat_start  16
   211069 #define GEN7_VERTEX_ELEMENT_STATE_SourceElementFormat_start  16
   211070 #define GEN6_VERTEX_ELEMENT_STATE_SourceElementFormat_start  16
   211071 #define GEN5_VERTEX_ELEMENT_STATE_SourceElementFormat_start  16
   211072 #define GEN45_VERTEX_ELEMENT_STATE_SourceElementFormat_start  16
   211073 #define GEN4_VERTEX_ELEMENT_STATE_SourceElementFormat_start  16
   211074 
   211075 static inline uint32_t ATTRIBUTE_PURE
   211076 VERTEX_ELEMENT_STATE_SourceElementFormat_start(const struct gen_device_info *devinfo)
   211077 {
   211078    switch (devinfo->gen) {
   211079    case 10: return 16;
   211080    case 9: return 16;
   211081    case 8: return 16;
   211082    case 7:
   211083       if (devinfo->is_haswell) {
   211084          return 16;
   211085       } else {
   211086          return 16;
   211087       }
   211088    case 6: return 16;
   211089    case 5: return 16;
   211090    case 4:
   211091       if (devinfo->is_g4x) {
   211092          return 16;
   211093       } else {
   211094          return 16;
   211095       }
   211096    default:
   211097       unreachable("Invalid hardware generation");
   211098    }
   211099 }
   211100 
   211101 
   211102 
   211103 /* VERTEX_ELEMENT_STATE::Source Element Offset */
   211104 
   211105 
   211106 #define GEN10_VERTEX_ELEMENT_STATE_SourceElementOffset_bits  12
   211107 #define GEN9_VERTEX_ELEMENT_STATE_SourceElementOffset_bits  12
   211108 #define GEN8_VERTEX_ELEMENT_STATE_SourceElementOffset_bits  12
   211109 #define GEN75_VERTEX_ELEMENT_STATE_SourceElementOffset_bits  12
   211110 #define GEN7_VERTEX_ELEMENT_STATE_SourceElementOffset_bits  12
   211111 #define GEN6_VERTEX_ELEMENT_STATE_SourceElementOffset_bits  12
   211112 #define GEN5_VERTEX_ELEMENT_STATE_SourceElementOffset_bits  11
   211113 #define GEN45_VERTEX_ELEMENT_STATE_SourceElementOffset_bits  11
   211114 #define GEN4_VERTEX_ELEMENT_STATE_SourceElementOffset_bits  11
   211115 
   211116 static inline uint32_t ATTRIBUTE_PURE
   211117 VERTEX_ELEMENT_STATE_SourceElementOffset_bits(const struct gen_device_info *devinfo)
   211118 {
   211119    switch (devinfo->gen) {
   211120    case 10: return 12;
   211121    case 9: return 12;
   211122    case 8: return 12;
   211123    case 7:
   211124       if (devinfo->is_haswell) {
   211125          return 12;
   211126       } else {
   211127          return 12;
   211128       }
   211129    case 6: return 12;
   211130    case 5: return 11;
   211131    case 4:
   211132       if (devinfo->is_g4x) {
   211133          return 11;
   211134       } else {
   211135          return 11;
   211136       }
   211137    default:
   211138       unreachable("Invalid hardware generation");
   211139    }
   211140 }
   211141 
   211142 
   211143 
   211144 #define GEN10_VERTEX_ELEMENT_STATE_SourceElementOffset_start  0
   211145 #define GEN9_VERTEX_ELEMENT_STATE_SourceElementOffset_start  0
   211146 #define GEN8_VERTEX_ELEMENT_STATE_SourceElementOffset_start  0
   211147 #define GEN75_VERTEX_ELEMENT_STATE_SourceElementOffset_start  0
   211148 #define GEN7_VERTEX_ELEMENT_STATE_SourceElementOffset_start  0
   211149 #define GEN6_VERTEX_ELEMENT_STATE_SourceElementOffset_start  0
   211150 #define GEN5_VERTEX_ELEMENT_STATE_SourceElementOffset_start  0
   211151 #define GEN45_VERTEX_ELEMENT_STATE_SourceElementOffset_start  0
   211152 #define GEN4_VERTEX_ELEMENT_STATE_SourceElementOffset_start  0
   211153 
   211154 static inline uint32_t ATTRIBUTE_PURE
   211155 VERTEX_ELEMENT_STATE_SourceElementOffset_start(const struct gen_device_info *devinfo)
   211156 {
   211157    switch (devinfo->gen) {
   211158    case 10: return 0;
   211159    case 9: return 0;
   211160    case 8: return 0;
   211161    case 7:
   211162       if (devinfo->is_haswell) {
   211163          return 0;
   211164       } else {
   211165          return 0;
   211166       }
   211167    case 6: return 0;
   211168    case 5: return 0;
   211169    case 4:
   211170       if (devinfo->is_g4x) {
   211171          return 0;
   211172       } else {
   211173          return 0;
   211174       }
   211175    default:
   211176       unreachable("Invalid hardware generation");
   211177    }
   211178 }
   211179 
   211180 
   211181 
   211182 /* VERTEX_ELEMENT_STATE::Valid */
   211183 
   211184 
   211185 #define GEN10_VERTEX_ELEMENT_STATE_Valid_bits  1
   211186 #define GEN9_VERTEX_ELEMENT_STATE_Valid_bits  1
   211187 #define GEN8_VERTEX_ELEMENT_STATE_Valid_bits  1
   211188 #define GEN75_VERTEX_ELEMENT_STATE_Valid_bits  1
   211189 #define GEN7_VERTEX_ELEMENT_STATE_Valid_bits  1
   211190 #define GEN6_VERTEX_ELEMENT_STATE_Valid_bits  1
   211191 #define GEN5_VERTEX_ELEMENT_STATE_Valid_bits  1
   211192 #define GEN45_VERTEX_ELEMENT_STATE_Valid_bits  1
   211193 #define GEN4_VERTEX_ELEMENT_STATE_Valid_bits  1
   211194 
   211195 static inline uint32_t ATTRIBUTE_PURE
   211196 VERTEX_ELEMENT_STATE_Valid_bits(const struct gen_device_info *devinfo)
   211197 {
   211198    switch (devinfo->gen) {
   211199    case 10: return 1;
   211200    case 9: return 1;
   211201    case 8: return 1;
   211202    case 7:
   211203       if (devinfo->is_haswell) {
   211204          return 1;
   211205       } else {
   211206          return 1;
   211207       }
   211208    case 6: return 1;
   211209    case 5: return 1;
   211210    case 4:
   211211       if (devinfo->is_g4x) {
   211212          return 1;
   211213       } else {
   211214          return 1;
   211215       }
   211216    default:
   211217       unreachable("Invalid hardware generation");
   211218    }
   211219 }
   211220 
   211221 
   211222 
   211223 #define GEN10_VERTEX_ELEMENT_STATE_Valid_start  25
   211224 #define GEN9_VERTEX_ELEMENT_STATE_Valid_start  25
   211225 #define GEN8_VERTEX_ELEMENT_STATE_Valid_start  25
   211226 #define GEN75_VERTEX_ELEMENT_STATE_Valid_start  25
   211227 #define GEN7_VERTEX_ELEMENT_STATE_Valid_start  25
   211228 #define GEN6_VERTEX_ELEMENT_STATE_Valid_start  25
   211229 #define GEN5_VERTEX_ELEMENT_STATE_Valid_start  26
   211230 #define GEN45_VERTEX_ELEMENT_STATE_Valid_start  26
   211231 #define GEN4_VERTEX_ELEMENT_STATE_Valid_start  26
   211232 
   211233 static inline uint32_t ATTRIBUTE_PURE
   211234 VERTEX_ELEMENT_STATE_Valid_start(const struct gen_device_info *devinfo)
   211235 {
   211236    switch (devinfo->gen) {
   211237    case 10: return 25;
   211238    case 9: return 25;
   211239    case 8: return 25;
   211240    case 7:
   211241       if (devinfo->is_haswell) {
   211242          return 25;
   211243       } else {
   211244          return 25;
   211245       }
   211246    case 6: return 25;
   211247    case 5: return 26;
   211248    case 4:
   211249       if (devinfo->is_g4x) {
   211250          return 26;
   211251       } else {
   211252          return 26;
   211253       }
   211254    default:
   211255       unreachable("Invalid hardware generation");
   211256    }
   211257 }
   211258 
   211259 
   211260 
   211261 /* VERTEX_ELEMENT_STATE::Vertex Buffer Index */
   211262 
   211263 
   211264 #define GEN10_VERTEX_ELEMENT_STATE_VertexBufferIndex_bits  6
   211265 #define GEN9_VERTEX_ELEMENT_STATE_VertexBufferIndex_bits  6
   211266 #define GEN8_VERTEX_ELEMENT_STATE_VertexBufferIndex_bits  6
   211267 #define GEN75_VERTEX_ELEMENT_STATE_VertexBufferIndex_bits  6
   211268 #define GEN7_VERTEX_ELEMENT_STATE_VertexBufferIndex_bits  6
   211269 #define GEN6_VERTEX_ELEMENT_STATE_VertexBufferIndex_bits  6
   211270 #define GEN5_VERTEX_ELEMENT_STATE_VertexBufferIndex_bits  5
   211271 #define GEN45_VERTEX_ELEMENT_STATE_VertexBufferIndex_bits  5
   211272 #define GEN4_VERTEX_ELEMENT_STATE_VertexBufferIndex_bits  5
   211273 
   211274 static inline uint32_t ATTRIBUTE_PURE
   211275 VERTEX_ELEMENT_STATE_VertexBufferIndex_bits(const struct gen_device_info *devinfo)
   211276 {
   211277    switch (devinfo->gen) {
   211278    case 10: return 6;
   211279    case 9: return 6;
   211280    case 8: return 6;
   211281    case 7:
   211282       if (devinfo->is_haswell) {
   211283          return 6;
   211284       } else {
   211285          return 6;
   211286       }
   211287    case 6: return 6;
   211288    case 5: return 5;
   211289    case 4:
   211290       if (devinfo->is_g4x) {
   211291          return 5;
   211292       } else {
   211293          return 5;
   211294       }
   211295    default:
   211296       unreachable("Invalid hardware generation");
   211297    }
   211298 }
   211299 
   211300 
   211301 
   211302 #define GEN10_VERTEX_ELEMENT_STATE_VertexBufferIndex_start  26
   211303 #define GEN9_VERTEX_ELEMENT_STATE_VertexBufferIndex_start  26
   211304 #define GEN8_VERTEX_ELEMENT_STATE_VertexBufferIndex_start  26
   211305 #define GEN75_VERTEX_ELEMENT_STATE_VertexBufferIndex_start  26
   211306 #define GEN7_VERTEX_ELEMENT_STATE_VertexBufferIndex_start  26
   211307 #define GEN6_VERTEX_ELEMENT_STATE_VertexBufferIndex_start  26
   211308 #define GEN5_VERTEX_ELEMENT_STATE_VertexBufferIndex_start  27
   211309 #define GEN45_VERTEX_ELEMENT_STATE_VertexBufferIndex_start  27
   211310 #define GEN4_VERTEX_ELEMENT_STATE_VertexBufferIndex_start  27
   211311 
   211312 static inline uint32_t ATTRIBUTE_PURE
   211313 VERTEX_ELEMENT_STATE_VertexBufferIndex_start(const struct gen_device_info *devinfo)
   211314 {
   211315    switch (devinfo->gen) {
   211316    case 10: return 26;
   211317    case 9: return 26;
   211318    case 8: return 26;
   211319    case 7:
   211320       if (devinfo->is_haswell) {
   211321          return 26;
   211322       } else {
   211323          return 26;
   211324       }
   211325    case 6: return 26;
   211326    case 5: return 27;
   211327    case 4:
   211328       if (devinfo->is_g4x) {
   211329          return 27;
   211330       } else {
   211331          return 27;
   211332       }
   211333    default:
   211334       unreachable("Invalid hardware generation");
   211335    }
   211336 }
   211337 
   211338 
   211339 
   211340 /* VS_INVOCATION_COUNT */
   211341 
   211342 
   211343 #define GEN10_VS_INVOCATION_COUNT_length  2
   211344 #define GEN9_VS_INVOCATION_COUNT_length  2
   211345 #define GEN8_VS_INVOCATION_COUNT_length  2
   211346 #define GEN75_VS_INVOCATION_COUNT_length  2
   211347 #define GEN7_VS_INVOCATION_COUNT_length  2
   211348 
   211349 static inline uint32_t ATTRIBUTE_PURE
   211350 VS_INVOCATION_COUNT_length(const struct gen_device_info *devinfo)
   211351 {
   211352    switch (devinfo->gen) {
   211353    case 10: return 2;
   211354    case 9: return 2;
   211355    case 8: return 2;
   211356    case 7:
   211357       if (devinfo->is_haswell) {
   211358          return 2;
   211359       } else {
   211360          return 2;
   211361       }
   211362    case 6: return 0;
   211363    case 5: return 0;
   211364    case 4:
   211365       if (devinfo->is_g4x) {
   211366          return 0;
   211367       } else {
   211368          return 0;
   211369       }
   211370    default:
   211371       unreachable("Invalid hardware generation");
   211372    }
   211373 }
   211374 
   211375 
   211376 
   211377 /* VS_INVOCATION_COUNT::VS Invocation Count Report */
   211378 
   211379 
   211380 #define GEN10_VS_INVOCATION_COUNT_VSInvocationCountReport_bits  64
   211381 #define GEN9_VS_INVOCATION_COUNT_VSInvocationCountReport_bits  64
   211382 #define GEN8_VS_INVOCATION_COUNT_VSInvocationCountReport_bits  64
   211383 #define GEN75_VS_INVOCATION_COUNT_VSInvocationCountReport_bits  64
   211384 #define GEN7_VS_INVOCATION_COUNT_VSInvocationCountReport_bits  64
   211385 
   211386 static inline uint32_t ATTRIBUTE_PURE
   211387 VS_INVOCATION_COUNT_VSInvocationCountReport_bits(const struct gen_device_info *devinfo)
   211388 {
   211389    switch (devinfo->gen) {
   211390    case 10: return 64;
   211391    case 9: return 64;
   211392    case 8: return 64;
   211393    case 7:
   211394       if (devinfo->is_haswell) {
   211395          return 64;
   211396       } else {
   211397          return 64;
   211398       }
   211399    case 6: return 0;
   211400    case 5: return 0;
   211401    case 4:
   211402       if (devinfo->is_g4x) {
   211403          return 0;
   211404       } else {
   211405          return 0;
   211406       }
   211407    default:
   211408       unreachable("Invalid hardware generation");
   211409    }
   211410 }
   211411 
   211412 
   211413 
   211414 #define GEN10_VS_INVOCATION_COUNT_VSInvocationCountReport_start  0
   211415 #define GEN9_VS_INVOCATION_COUNT_VSInvocationCountReport_start  0
   211416 #define GEN8_VS_INVOCATION_COUNT_VSInvocationCountReport_start  0
   211417 #define GEN75_VS_INVOCATION_COUNT_VSInvocationCountReport_start  0
   211418 #define GEN7_VS_INVOCATION_COUNT_VSInvocationCountReport_start  0
   211419 
   211420 static inline uint32_t ATTRIBUTE_PURE
   211421 VS_INVOCATION_COUNT_VSInvocationCountReport_start(const struct gen_device_info *devinfo)
   211422 {
   211423    switch (devinfo->gen) {
   211424    case 10: return 0;
   211425    case 9: return 0;
   211426    case 8: return 0;
   211427    case 7:
   211428       if (devinfo->is_haswell) {
   211429          return 0;
   211430       } else {
   211431          return 0;
   211432       }
   211433    case 6: return 0;
   211434    case 5: return 0;
   211435    case 4:
   211436       if (devinfo->is_g4x) {
   211437          return 0;
   211438       } else {
   211439          return 0;
   211440       }
   211441    default:
   211442       unreachable("Invalid hardware generation");
   211443    }
   211444 }
   211445 
   211446 
   211447 
   211448 /* VS_STATE */
   211449 
   211450 
   211451 #define GEN5_VS_STATE_length  7
   211452 #define GEN45_VS_STATE_length  7
   211453 #define GEN4_VS_STATE_length  7
   211454 
   211455 static inline uint32_t ATTRIBUTE_PURE
   211456 VS_STATE_length(const struct gen_device_info *devinfo)
   211457 {
   211458    switch (devinfo->gen) {
   211459    case 10: return 0;
   211460    case 9: return 0;
   211461    case 8: return 0;
   211462    case 7:
   211463       if (devinfo->is_haswell) {
   211464          return 0;
   211465       } else {
   211466          return 0;
   211467       }
   211468    case 6: return 0;
   211469    case 5: return 7;
   211470    case 4:
   211471       if (devinfo->is_g4x) {
   211472          return 7;
   211473       } else {
   211474          return 7;
   211475       }
   211476    default:
   211477       unreachable("Invalid hardware generation");
   211478    }
   211479 }
   211480 
   211481 
   211482 
   211483 /* VS_STATE::Binding Table Entry Count */
   211484 
   211485 
   211486 #define GEN5_VS_STATE_BindingTableEntryCount_bits  8
   211487 #define GEN45_VS_STATE_BindingTableEntryCount_bits  8
   211488 #define GEN4_VS_STATE_BindingTableEntryCount_bits  8
   211489 
   211490 static inline uint32_t ATTRIBUTE_PURE
   211491 VS_STATE_BindingTableEntryCount_bits(const struct gen_device_info *devinfo)
   211492 {
   211493    switch (devinfo->gen) {
   211494    case 10: return 0;
   211495    case 9: return 0;
   211496    case 8: return 0;
   211497    case 7:
   211498       if (devinfo->is_haswell) {
   211499          return 0;
   211500       } else {
   211501          return 0;
   211502       }
   211503    case 6: return 0;
   211504    case 5: return 8;
   211505    case 4:
   211506       if (devinfo->is_g4x) {
   211507          return 8;
   211508       } else {
   211509          return 8;
   211510       }
   211511    default:
   211512       unreachable("Invalid hardware generation");
   211513    }
   211514 }
   211515 
   211516 
   211517 
   211518 #define GEN5_VS_STATE_BindingTableEntryCount_start  50
   211519 #define GEN45_VS_STATE_BindingTableEntryCount_start  50
   211520 #define GEN4_VS_STATE_BindingTableEntryCount_start  50
   211521 
   211522 static inline uint32_t ATTRIBUTE_PURE
   211523 VS_STATE_BindingTableEntryCount_start(const struct gen_device_info *devinfo)
   211524 {
   211525    switch (devinfo->gen) {
   211526    case 10: return 0;
   211527    case 9: return 0;
   211528    case 8: return 0;
   211529    case 7:
   211530       if (devinfo->is_haswell) {
   211531          return 0;
   211532       } else {
   211533          return 0;
   211534       }
   211535    case 6: return 0;
   211536    case 5: return 50;
   211537    case 4:
   211538       if (devinfo->is_g4x) {
   211539          return 50;
   211540       } else {
   211541          return 50;
   211542       }
   211543    default:
   211544       unreachable("Invalid hardware generation");
   211545    }
   211546 }
   211547 
   211548 
   211549 
   211550 /* VS_STATE::Constant URB Entry Read Length */
   211551 
   211552 
   211553 #define GEN5_VS_STATE_ConstantURBEntryReadLength_bits  6
   211554 #define GEN45_VS_STATE_ConstantURBEntryReadLength_bits  6
   211555 #define GEN4_VS_STATE_ConstantURBEntryReadLength_bits  6
   211556 
   211557 static inline uint32_t ATTRIBUTE_PURE
   211558 VS_STATE_ConstantURBEntryReadLength_bits(const struct gen_device_info *devinfo)
   211559 {
   211560    switch (devinfo->gen) {
   211561    case 10: return 0;
   211562    case 9: return 0;
   211563    case 8: return 0;
   211564    case 7:
   211565       if (devinfo->is_haswell) {
   211566          return 0;
   211567       } else {
   211568          return 0;
   211569       }
   211570    case 6: return 0;
   211571    case 5: return 6;
   211572    case 4:
   211573       if (devinfo->is_g4x) {
   211574          return 6;
   211575       } else {
   211576          return 6;
   211577       }
   211578    default:
   211579       unreachable("Invalid hardware generation");
   211580    }
   211581 }
   211582 
   211583 
   211584 
   211585 #define GEN5_VS_STATE_ConstantURBEntryReadLength_start  121
   211586 #define GEN45_VS_STATE_ConstantURBEntryReadLength_start  121
   211587 #define GEN4_VS_STATE_ConstantURBEntryReadLength_start  121
   211588 
   211589 static inline uint32_t ATTRIBUTE_PURE
   211590 VS_STATE_ConstantURBEntryReadLength_start(const struct gen_device_info *devinfo)
   211591 {
   211592    switch (devinfo->gen) {
   211593    case 10: return 0;
   211594    case 9: return 0;
   211595    case 8: return 0;
   211596    case 7:
   211597       if (devinfo->is_haswell) {
   211598          return 0;
   211599       } else {
   211600          return 0;
   211601       }
   211602    case 6: return 0;
   211603    case 5: return 121;
   211604    case 4:
   211605       if (devinfo->is_g4x) {
   211606          return 121;
   211607       } else {
   211608          return 121;
   211609       }
   211610    default:
   211611       unreachable("Invalid hardware generation");
   211612    }
   211613 }
   211614 
   211615 
   211616 
   211617 /* VS_STATE::Constant URB Entry Read Offset */
   211618 
   211619 
   211620 #define GEN5_VS_STATE_ConstantURBEntryReadOffset_bits  6
   211621 #define GEN45_VS_STATE_ConstantURBEntryReadOffset_bits  6
   211622 #define GEN4_VS_STATE_ConstantURBEntryReadOffset_bits  6
   211623 
   211624 static inline uint32_t ATTRIBUTE_PURE
   211625 VS_STATE_ConstantURBEntryReadOffset_bits(const struct gen_device_info *devinfo)
   211626 {
   211627    switch (devinfo->gen) {
   211628    case 10: return 0;
   211629    case 9: return 0;
   211630    case 8: return 0;
   211631    case 7:
   211632       if (devinfo->is_haswell) {
   211633          return 0;
   211634       } else {
   211635          return 0;
   211636       }
   211637    case 6: return 0;
   211638    case 5: return 6;
   211639    case 4:
   211640       if (devinfo->is_g4x) {
   211641          return 6;
   211642       } else {
   211643          return 6;
   211644       }
   211645    default:
   211646       unreachable("Invalid hardware generation");
   211647    }
   211648 }
   211649 
   211650 
   211651 
   211652 #define GEN5_VS_STATE_ConstantURBEntryReadOffset_start  114
   211653 #define GEN45_VS_STATE_ConstantURBEntryReadOffset_start  114
   211654 #define GEN4_VS_STATE_ConstantURBEntryReadOffset_start  114
   211655 
   211656 static inline uint32_t ATTRIBUTE_PURE
   211657 VS_STATE_ConstantURBEntryReadOffset_start(const struct gen_device_info *devinfo)
   211658 {
   211659    switch (devinfo->gen) {
   211660    case 10: return 0;
   211661    case 9: return 0;
   211662    case 8: return 0;
   211663    case 7:
   211664       if (devinfo->is_haswell) {
   211665          return 0;
   211666       } else {
   211667          return 0;
   211668       }
   211669    case 6: return 0;
   211670    case 5: return 114;
   211671    case 4:
   211672       if (devinfo->is_g4x) {
   211673          return 114;
   211674       } else {
   211675          return 114;
   211676       }
   211677    default:
   211678       unreachable("Invalid hardware generation");
   211679    }
   211680 }
   211681 
   211682 
   211683 
   211684 /* VS_STATE::Dispatch GRF Start Register For URB Data */
   211685 
   211686 
   211687 #define GEN5_VS_STATE_DispatchGRFStartRegisterForURBData_bits  4
   211688 #define GEN45_VS_STATE_DispatchGRFStartRegisterForURBData_bits  4
   211689 #define GEN4_VS_STATE_DispatchGRFStartRegisterForURBData_bits  4
   211690 
   211691 static inline uint32_t ATTRIBUTE_PURE
   211692 VS_STATE_DispatchGRFStartRegisterForURBData_bits(const struct gen_device_info *devinfo)
   211693 {
   211694    switch (devinfo->gen) {
   211695    case 10: return 0;
   211696    case 9: return 0;
   211697    case 8: return 0;
   211698    case 7:
   211699       if (devinfo->is_haswell) {
   211700          return 0;
   211701       } else {
   211702          return 0;
   211703       }
   211704    case 6: return 0;
   211705    case 5: return 4;
   211706    case 4:
   211707       if (devinfo->is_g4x) {
   211708          return 4;
   211709       } else {
   211710          return 4;
   211711       }
   211712    default:
   211713       unreachable("Invalid hardware generation");
   211714    }
   211715 }
   211716 
   211717 
   211718 
   211719 #define GEN5_VS_STATE_DispatchGRFStartRegisterForURBData_start  96
   211720 #define GEN45_VS_STATE_DispatchGRFStartRegisterForURBData_start  96
   211721 #define GEN4_VS_STATE_DispatchGRFStartRegisterForURBData_start  96
   211722 
   211723 static inline uint32_t ATTRIBUTE_PURE
   211724 VS_STATE_DispatchGRFStartRegisterForURBData_start(const struct gen_device_info *devinfo)
   211725 {
   211726    switch (devinfo->gen) {
   211727    case 10: return 0;
   211728    case 9: return 0;
   211729    case 8: return 0;
   211730    case 7:
   211731       if (devinfo->is_haswell) {
   211732          return 0;
   211733       } else {
   211734          return 0;
   211735       }
   211736    case 6: return 0;
   211737    case 5: return 96;
   211738    case 4:
   211739       if (devinfo->is_g4x) {
   211740          return 96;
   211741       } else {
   211742          return 96;
   211743       }
   211744    default:
   211745       unreachable("Invalid hardware generation");
   211746    }
   211747 }
   211748 
   211749 
   211750 
   211751 /* VS_STATE::Enable */
   211752 
   211753 
   211754 #define GEN5_VS_STATE_Enable_bits  1
   211755 #define GEN45_VS_STATE_Enable_bits  1
   211756 #define GEN4_VS_STATE_Enable_bits  1
   211757 
   211758 static inline uint32_t ATTRIBUTE_PURE
   211759 VS_STATE_Enable_bits(const struct gen_device_info *devinfo)
   211760 {
   211761    switch (devinfo->gen) {
   211762    case 10: return 0;
   211763    case 9: return 0;
   211764    case 8: return 0;
   211765    case 7:
   211766       if (devinfo->is_haswell) {
   211767          return 0;
   211768       } else {
   211769          return 0;
   211770       }
   211771    case 6: return 0;
   211772    case 5: return 1;
   211773    case 4:
   211774       if (devinfo->is_g4x) {
   211775          return 1;
   211776       } else {
   211777          return 1;
   211778       }
   211779    default:
   211780       unreachable("Invalid hardware generation");
   211781    }
   211782 }
   211783 
   211784 
   211785 
   211786 #define GEN5_VS_STATE_Enable_start  192
   211787 #define GEN45_VS_STATE_Enable_start  192
   211788 #define GEN4_VS_STATE_Enable_start  192
   211789 
   211790 static inline uint32_t ATTRIBUTE_PURE
   211791 VS_STATE_Enable_start(const struct gen_device_info *devinfo)
   211792 {
   211793    switch (devinfo->gen) {
   211794    case 10: return 0;
   211795    case 9: return 0;
   211796    case 8: return 0;
   211797    case 7:
   211798       if (devinfo->is_haswell) {
   211799          return 0;
   211800       } else {
   211801          return 0;
   211802       }
   211803    case 6: return 0;
   211804    case 5: return 192;
   211805    case 4:
   211806       if (devinfo->is_g4x) {
   211807          return 192;
   211808       } else {
   211809          return 192;
   211810       }
   211811    default:
   211812       unreachable("Invalid hardware generation");
   211813    }
   211814 }
   211815 
   211816 
   211817 
   211818 /* VS_STATE::Floating Point Mode */
   211819 
   211820 
   211821 #define GEN5_VS_STATE_FloatingPointMode_bits  1
   211822 #define GEN45_VS_STATE_FloatingPointMode_bits  1
   211823 #define GEN4_VS_STATE_FloatingPointMode_bits  1
   211824 
   211825 static inline uint32_t ATTRIBUTE_PURE
   211826 VS_STATE_FloatingPointMode_bits(const struct gen_device_info *devinfo)
   211827 {
   211828    switch (devinfo->gen) {
   211829    case 10: return 0;
   211830    case 9: return 0;
   211831    case 8: return 0;
   211832    case 7:
   211833       if (devinfo->is_haswell) {
   211834          return 0;
   211835       } else {
   211836          return 0;
   211837       }
   211838    case 6: return 0;
   211839    case 5: return 1;
   211840    case 4:
   211841       if (devinfo->is_g4x) {
   211842          return 1;
   211843       } else {
   211844          return 1;
   211845       }
   211846    default:
   211847       unreachable("Invalid hardware generation");
   211848    }
   211849 }
   211850 
   211851 
   211852 
   211853 #define GEN5_VS_STATE_FloatingPointMode_start  48
   211854 #define GEN45_VS_STATE_FloatingPointMode_start  48
   211855 #define GEN4_VS_STATE_FloatingPointMode_start  48
   211856 
   211857 static inline uint32_t ATTRIBUTE_PURE
   211858 VS_STATE_FloatingPointMode_start(const struct gen_device_info *devinfo)
   211859 {
   211860    switch (devinfo->gen) {
   211861    case 10: return 0;
   211862    case 9: return 0;
   211863    case 8: return 0;
   211864    case 7:
   211865       if (devinfo->is_haswell) {
   211866          return 0;
   211867       } else {
   211868          return 0;
   211869       }
   211870    case 6: return 0;
   211871    case 5: return 48;
   211872    case 4:
   211873       if (devinfo->is_g4x) {
   211874          return 48;
   211875       } else {
   211876          return 48;
   211877       }
   211878    default:
   211879       unreachable("Invalid hardware generation");
   211880    }
   211881 }
   211882 
   211883 
   211884 
   211885 /* VS_STATE::GRF Register Count */
   211886 
   211887 
   211888 #define GEN5_VS_STATE_GRFRegisterCount_bits  3
   211889 #define GEN45_VS_STATE_GRFRegisterCount_bits  3
   211890 #define GEN4_VS_STATE_GRFRegisterCount_bits  3
   211891 
   211892 static inline uint32_t ATTRIBUTE_PURE
   211893 VS_STATE_GRFRegisterCount_bits(const struct gen_device_info *devinfo)
   211894 {
   211895    switch (devinfo->gen) {
   211896    case 10: return 0;
   211897    case 9: return 0;
   211898    case 8: return 0;
   211899    case 7:
   211900       if (devinfo->is_haswell) {
   211901          return 0;
   211902       } else {
   211903          return 0;
   211904       }
   211905    case 6: return 0;
   211906    case 5: return 3;
   211907    case 4:
   211908       if (devinfo->is_g4x) {
   211909          return 3;
   211910       } else {
   211911          return 3;
   211912       }
   211913    default:
   211914       unreachable("Invalid hardware generation");
   211915    }
   211916 }
   211917 
   211918 
   211919 
   211920 #define GEN5_VS_STATE_GRFRegisterCount_start  1
   211921 #define GEN45_VS_STATE_GRFRegisterCount_start  1
   211922 #define GEN4_VS_STATE_GRFRegisterCount_start  1
   211923 
   211924 static inline uint32_t ATTRIBUTE_PURE
   211925 VS_STATE_GRFRegisterCount_start(const struct gen_device_info *devinfo)
   211926 {
   211927    switch (devinfo->gen) {
   211928    case 10: return 0;
   211929    case 9: return 0;
   211930    case 8: return 0;
   211931    case 7:
   211932       if (devinfo->is_haswell) {
   211933          return 0;
   211934       } else {
   211935          return 0;
   211936       }
   211937    case 6: return 0;
   211938    case 5: return 1;
   211939    case 4:
   211940       if (devinfo->is_g4x) {
   211941          return 1;
   211942       } else {
   211943          return 1;
   211944       }
   211945    default:
   211946       unreachable("Invalid hardware generation");
   211947    }
   211948 }
   211949 
   211950 
   211951 
   211952 /* VS_STATE::Illegal Opcode Exception Enable */
   211953 
   211954 
   211955 #define GEN5_VS_STATE_IllegalOpcodeExceptionEnable_bits  1
   211956 #define GEN45_VS_STATE_IllegalOpcodeExceptionEnable_bits  1
   211957 #define GEN4_VS_STATE_IllegalOpcodeExceptionEnable_bits  1
   211958 
   211959 static inline uint32_t ATTRIBUTE_PURE
   211960 VS_STATE_IllegalOpcodeExceptionEnable_bits(const struct gen_device_info *devinfo)
   211961 {
   211962    switch (devinfo->gen) {
   211963    case 10: return 0;
   211964    case 9: return 0;
   211965    case 8: return 0;
   211966    case 7:
   211967       if (devinfo->is_haswell) {
   211968          return 0;
   211969       } else {
   211970          return 0;
   211971       }
   211972    case 6: return 0;
   211973    case 5: return 1;
   211974    case 4:
   211975       if (devinfo->is_g4x) {
   211976          return 1;
   211977       } else {
   211978          return 1;
   211979       }
   211980    default:
   211981       unreachable("Invalid hardware generation");
   211982    }
   211983 }
   211984 
   211985 
   211986 
   211987 #define GEN5_VS_STATE_IllegalOpcodeExceptionEnable_start  45
   211988 #define GEN45_VS_STATE_IllegalOpcodeExceptionEnable_start  45
   211989 #define GEN4_VS_STATE_IllegalOpcodeExceptionEnable_start  45
   211990 
   211991 static inline uint32_t ATTRIBUTE_PURE
   211992 VS_STATE_IllegalOpcodeExceptionEnable_start(const struct gen_device_info *devinfo)
   211993 {
   211994    switch (devinfo->gen) {
   211995    case 10: return 0;
   211996    case 9: return 0;
   211997    case 8: return 0;
   211998    case 7:
   211999       if (devinfo->is_haswell) {
   212000          return 0;
   212001       } else {
   212002          return 0;
   212003       }
   212004    case 6: return 0;
   212005    case 5: return 45;
   212006    case 4:
   212007       if (devinfo->is_g4x) {
   212008          return 45;
   212009       } else {
   212010          return 45;
   212011       }
   212012    default:
   212013       unreachable("Invalid hardware generation");
   212014    }
   212015 }
   212016 
   212017 
   212018 
   212019 /* VS_STATE::Kernel Start Pointer */
   212020 
   212021 
   212022 #define GEN5_VS_STATE_KernelStartPointer_bits  26
   212023 #define GEN45_VS_STATE_KernelStartPointer_bits  26
   212024 #define GEN4_VS_STATE_KernelStartPointer_bits  26
   212025 
   212026 static inline uint32_t ATTRIBUTE_PURE
   212027 VS_STATE_KernelStartPointer_bits(const struct gen_device_info *devinfo)
   212028 {
   212029    switch (devinfo->gen) {
   212030    case 10: return 0;
   212031    case 9: return 0;
   212032    case 8: return 0;
   212033    case 7:
   212034       if (devinfo->is_haswell) {
   212035          return 0;
   212036       } else {
   212037          return 0;
   212038       }
   212039    case 6: return 0;
   212040    case 5: return 26;
   212041    case 4:
   212042       if (devinfo->is_g4x) {
   212043          return 26;
   212044       } else {
   212045          return 26;
   212046       }
   212047    default:
   212048       unreachable("Invalid hardware generation");
   212049    }
   212050 }
   212051 
   212052 
   212053 
   212054 #define GEN5_VS_STATE_KernelStartPointer_start  6
   212055 #define GEN45_VS_STATE_KernelStartPointer_start  6
   212056 #define GEN4_VS_STATE_KernelStartPointer_start  6
   212057 
   212058 static inline uint32_t ATTRIBUTE_PURE
   212059 VS_STATE_KernelStartPointer_start(const struct gen_device_info *devinfo)
   212060 {
   212061    switch (devinfo->gen) {
   212062    case 10: return 0;
   212063    case 9: return 0;
   212064    case 8: return 0;
   212065    case 7:
   212066       if (devinfo->is_haswell) {
   212067          return 0;
   212068       } else {
   212069          return 0;
   212070       }
   212071    case 6: return 0;
   212072    case 5: return 6;
   212073    case 4:
   212074       if (devinfo->is_g4x) {
   212075          return 6;
   212076       } else {
   212077          return 6;
   212078       }
   212079    default:
   212080       unreachable("Invalid hardware generation");
   212081    }
   212082 }
   212083 
   212084 
   212085 
   212086 /* VS_STATE::Mask Stack Exception Enable */
   212087 
   212088 
   212089 #define GEN5_VS_STATE_MaskStackExceptionEnable_bits  1
   212090 #define GEN45_VS_STATE_MaskStackExceptionEnable_bits  1
   212091 #define GEN4_VS_STATE_MaskStackExceptionEnable_bits  1
   212092 
   212093 static inline uint32_t ATTRIBUTE_PURE
   212094 VS_STATE_MaskStackExceptionEnable_bits(const struct gen_device_info *devinfo)
   212095 {
   212096    switch (devinfo->gen) {
   212097    case 10: return 0;
   212098    case 9: return 0;
   212099    case 8: return 0;
   212100    case 7:
   212101       if (devinfo->is_haswell) {
   212102          return 0;
   212103       } else {
   212104          return 0;
   212105       }
   212106    case 6: return 0;
   212107    case 5: return 1;
   212108    case 4:
   212109       if (devinfo->is_g4x) {
   212110          return 1;
   212111       } else {
   212112          return 1;
   212113       }
   212114    default:
   212115       unreachable("Invalid hardware generation");
   212116    }
   212117 }
   212118 
   212119 
   212120 
   212121 #define GEN5_VS_STATE_MaskStackExceptionEnable_start  43
   212122 #define GEN45_VS_STATE_MaskStackExceptionEnable_start  43
   212123 #define GEN4_VS_STATE_MaskStackExceptionEnable_start  43
   212124 
   212125 static inline uint32_t ATTRIBUTE_PURE
   212126 VS_STATE_MaskStackExceptionEnable_start(const struct gen_device_info *devinfo)
   212127 {
   212128    switch (devinfo->gen) {
   212129    case 10: return 0;
   212130    case 9: return 0;
   212131    case 8: return 0;
   212132    case 7:
   212133       if (devinfo->is_haswell) {
   212134          return 0;
   212135       } else {
   212136          return 0;
   212137       }
   212138    case 6: return 0;
   212139    case 5: return 43;
   212140    case 4:
   212141       if (devinfo->is_g4x) {
   212142          return 43;
   212143       } else {
   212144          return 43;
   212145       }
   212146    default:
   212147       unreachable("Invalid hardware generation");
   212148    }
   212149 }
   212150 
   212151 
   212152 
   212153 /* VS_STATE::Maximum Number of Threads */
   212154 
   212155 
   212156 #define GEN5_VS_STATE_MaximumNumberofThreads_bits  6
   212157 #define GEN45_VS_STATE_MaximumNumberofThreads_bits  6
   212158 #define GEN4_VS_STATE_MaximumNumberofThreads_bits  6
   212159 
   212160 static inline uint32_t ATTRIBUTE_PURE
   212161 VS_STATE_MaximumNumberofThreads_bits(const struct gen_device_info *devinfo)
   212162 {
   212163    switch (devinfo->gen) {
   212164    case 10: return 0;
   212165    case 9: return 0;
   212166    case 8: return 0;
   212167    case 7:
   212168       if (devinfo->is_haswell) {
   212169          return 0;
   212170       } else {
   212171          return 0;
   212172       }
   212173    case 6: return 0;
   212174    case 5: return 6;
   212175    case 4:
   212176       if (devinfo->is_g4x) {
   212177          return 6;
   212178       } else {
   212179          return 6;
   212180       }
   212181    default:
   212182       unreachable("Invalid hardware generation");
   212183    }
   212184 }
   212185 
   212186 
   212187 
   212188 #define GEN5_VS_STATE_MaximumNumberofThreads_start  153
   212189 #define GEN45_VS_STATE_MaximumNumberofThreads_start  153
   212190 #define GEN4_VS_STATE_MaximumNumberofThreads_start  153
   212191 
   212192 static inline uint32_t ATTRIBUTE_PURE
   212193 VS_STATE_MaximumNumberofThreads_start(const struct gen_device_info *devinfo)
   212194 {
   212195    switch (devinfo->gen) {
   212196    case 10: return 0;
   212197    case 9: return 0;
   212198    case 8: return 0;
   212199    case 7:
   212200       if (devinfo->is_haswell) {
   212201          return 0;
   212202       } else {
   212203          return 0;
   212204       }
   212205    case 6: return 0;
   212206    case 5: return 153;
   212207    case 4:
   212208       if (devinfo->is_g4x) {
   212209          return 153;
   212210       } else {
   212211          return 153;
   212212       }
   212213    default:
   212214       unreachable("Invalid hardware generation");
   212215    }
   212216 }
   212217 
   212218 
   212219 
   212220 /* VS_STATE::Number of URB Entries */
   212221 
   212222 
   212223 #define GEN5_VS_STATE_NumberofURBEntries_bits  8
   212224 #define GEN45_VS_STATE_NumberofURBEntries_bits  8
   212225 #define GEN4_VS_STATE_NumberofURBEntries_bits  8
   212226 
   212227 static inline uint32_t ATTRIBUTE_PURE
   212228 VS_STATE_NumberofURBEntries_bits(const struct gen_device_info *devinfo)
   212229 {
   212230    switch (devinfo->gen) {
   212231    case 10: return 0;
   212232    case 9: return 0;
   212233    case 8: return 0;
   212234    case 7:
   212235       if (devinfo->is_haswell) {
   212236          return 0;
   212237       } else {
   212238          return 0;
   212239       }
   212240    case 6: return 0;
   212241    case 5: return 8;
   212242    case 4:
   212243       if (devinfo->is_g4x) {
   212244          return 8;
   212245       } else {
   212246          return 8;
   212247       }
   212248    default:
   212249       unreachable("Invalid hardware generation");
   212250    }
   212251 }
   212252 
   212253 
   212254 
   212255 #define GEN5_VS_STATE_NumberofURBEntries_start  139
   212256 #define GEN45_VS_STATE_NumberofURBEntries_start  139
   212257 #define GEN4_VS_STATE_NumberofURBEntries_start  139
   212258 
   212259 static inline uint32_t ATTRIBUTE_PURE
   212260 VS_STATE_NumberofURBEntries_start(const struct gen_device_info *devinfo)
   212261 {
   212262    switch (devinfo->gen) {
   212263    case 10: return 0;
   212264    case 9: return 0;
   212265    case 8: return 0;
   212266    case 7:
   212267       if (devinfo->is_haswell) {
   212268          return 0;
   212269       } else {
   212270          return 0;
   212271       }
   212272    case 6: return 0;
   212273    case 5: return 139;
   212274    case 4:
   212275       if (devinfo->is_g4x) {
   212276          return 139;
   212277       } else {
   212278          return 139;
   212279       }
   212280    default:
   212281       unreachable("Invalid hardware generation");
   212282    }
   212283 }
   212284 
   212285 
   212286 
   212287 /* VS_STATE::Per-Thread Scratch Space */
   212288 
   212289 
   212290 #define GEN5_VS_STATE_PerThreadScratchSpace_bits  4
   212291 #define GEN45_VS_STATE_PerThreadScratchSpace_bits  4
   212292 #define GEN4_VS_STATE_PerThreadScratchSpace_bits  4
   212293 
   212294 static inline uint32_t ATTRIBUTE_PURE
   212295 VS_STATE_PerThreadScratchSpace_bits(const struct gen_device_info *devinfo)
   212296 {
   212297    switch (devinfo->gen) {
   212298    case 10: return 0;
   212299    case 9: return 0;
   212300    case 8: return 0;
   212301    case 7:
   212302       if (devinfo->is_haswell) {
   212303          return 0;
   212304       } else {
   212305          return 0;
   212306       }
   212307    case 6: return 0;
   212308    case 5: return 4;
   212309    case 4:
   212310       if (devinfo->is_g4x) {
   212311          return 4;
   212312       } else {
   212313          return 4;
   212314       }
   212315    default:
   212316       unreachable("Invalid hardware generation");
   212317    }
   212318 }
   212319 
   212320 
   212321 
   212322 #define GEN5_VS_STATE_PerThreadScratchSpace_start  64
   212323 #define GEN45_VS_STATE_PerThreadScratchSpace_start  64
   212324 #define GEN4_VS_STATE_PerThreadScratchSpace_start  64
   212325 
   212326 static inline uint32_t ATTRIBUTE_PURE
   212327 VS_STATE_PerThreadScratchSpace_start(const struct gen_device_info *devinfo)
   212328 {
   212329    switch (devinfo->gen) {
   212330    case 10: return 0;
   212331    case 9: return 0;
   212332    case 8: return 0;
   212333    case 7:
   212334       if (devinfo->is_haswell) {
   212335          return 0;
   212336       } else {
   212337          return 0;
   212338       }
   212339    case 6: return 0;
   212340    case 5: return 64;
   212341    case 4:
   212342       if (devinfo->is_g4x) {
   212343          return 64;
   212344       } else {
   212345          return 64;
   212346       }
   212347    default:
   212348       unreachable("Invalid hardware generation");
   212349    }
   212350 }
   212351 
   212352 
   212353 
   212354 /* VS_STATE::Sampler Count */
   212355 
   212356 
   212357 #define GEN5_VS_STATE_SamplerCount_bits  3
   212358 #define GEN45_VS_STATE_SamplerCount_bits  3
   212359 #define GEN4_VS_STATE_SamplerCount_bits  3
   212360 
   212361 static inline uint32_t ATTRIBUTE_PURE
   212362 VS_STATE_SamplerCount_bits(const struct gen_device_info *devinfo)
   212363 {
   212364    switch (devinfo->gen) {
   212365    case 10: return 0;
   212366    case 9: return 0;
   212367    case 8: return 0;
   212368    case 7:
   212369       if (devinfo->is_haswell) {
   212370          return 0;
   212371       } else {
   212372          return 0;
   212373       }
   212374    case 6: return 0;
   212375    case 5: return 3;
   212376    case 4:
   212377       if (devinfo->is_g4x) {
   212378          return 3;
   212379       } else {
   212380          return 3;
   212381       }
   212382    default:
   212383       unreachable("Invalid hardware generation");
   212384    }
   212385 }
   212386 
   212387 
   212388 
   212389 #define GEN5_VS_STATE_SamplerCount_start  160
   212390 #define GEN45_VS_STATE_SamplerCount_start  160
   212391 #define GEN4_VS_STATE_SamplerCount_start  160
   212392 
   212393 static inline uint32_t ATTRIBUTE_PURE
   212394 VS_STATE_SamplerCount_start(const struct gen_device_info *devinfo)
   212395 {
   212396    switch (devinfo->gen) {
   212397    case 10: return 0;
   212398    case 9: return 0;
   212399    case 8: return 0;
   212400    case 7:
   212401       if (devinfo->is_haswell) {
   212402          return 0;
   212403       } else {
   212404          return 0;
   212405       }
   212406    case 6: return 0;
   212407    case 5: return 160;
   212408    case 4:
   212409       if (devinfo->is_g4x) {
   212410          return 160;
   212411       } else {
   212412          return 160;
   212413       }
   212414    default:
   212415       unreachable("Invalid hardware generation");
   212416    }
   212417 }
   212418 
   212419 
   212420 
   212421 /* VS_STATE::Sampler State Pointer */
   212422 
   212423 
   212424 #define GEN5_VS_STATE_SamplerStatePointer_bits  27
   212425 #define GEN45_VS_STATE_SamplerStatePointer_bits  27
   212426 #define GEN4_VS_STATE_SamplerStatePointer_bits  27
   212427 
   212428 static inline uint32_t ATTRIBUTE_PURE
   212429 VS_STATE_SamplerStatePointer_bits(const struct gen_device_info *devinfo)
   212430 {
   212431    switch (devinfo->gen) {
   212432    case 10: return 0;
   212433    case 9: return 0;
   212434    case 8: return 0;
   212435    case 7:
   212436       if (devinfo->is_haswell) {
   212437          return 0;
   212438       } else {
   212439          return 0;
   212440       }
   212441    case 6: return 0;
   212442    case 5: return 27;
   212443    case 4:
   212444       if (devinfo->is_g4x) {
   212445          return 27;
   212446       } else {
   212447          return 27;
   212448       }
   212449    default:
   212450       unreachable("Invalid hardware generation");
   212451    }
   212452 }
   212453 
   212454 
   212455 
   212456 #define GEN5_VS_STATE_SamplerStatePointer_start  165
   212457 #define GEN45_VS_STATE_SamplerStatePointer_start  165
   212458 #define GEN4_VS_STATE_SamplerStatePointer_start  165
   212459 
   212460 static inline uint32_t ATTRIBUTE_PURE
   212461 VS_STATE_SamplerStatePointer_start(const struct gen_device_info *devinfo)
   212462 {
   212463    switch (devinfo->gen) {
   212464    case 10: return 0;
   212465    case 9: return 0;
   212466    case 8: return 0;
   212467    case 7:
   212468       if (devinfo->is_haswell) {
   212469          return 0;
   212470       } else {
   212471          return 0;
   212472       }
   212473    case 6: return 0;
   212474    case 5: return 165;
   212475    case 4:
   212476       if (devinfo->is_g4x) {
   212477          return 165;
   212478       } else {
   212479          return 165;
   212480       }
   212481    default:
   212482       unreachable("Invalid hardware generation");
   212483    }
   212484 }
   212485 
   212486 
   212487 
   212488 /* VS_STATE::Scratch Space Base Pointer */
   212489 
   212490 
   212491 #define GEN5_VS_STATE_ScratchSpaceBasePointer_bits  22
   212492 #define GEN45_VS_STATE_ScratchSpaceBasePointer_bits  22
   212493 #define GEN4_VS_STATE_ScratchSpaceBasePointer_bits  22
   212494 
   212495 static inline uint32_t ATTRIBUTE_PURE
   212496 VS_STATE_ScratchSpaceBasePointer_bits(const struct gen_device_info *devinfo)
   212497 {
   212498    switch (devinfo->gen) {
   212499    case 10: return 0;
   212500    case 9: return 0;
   212501    case 8: return 0;
   212502    case 7:
   212503       if (devinfo->is_haswell) {
   212504          return 0;
   212505       } else {
   212506          return 0;
   212507       }
   212508    case 6: return 0;
   212509    case 5: return 22;
   212510    case 4:
   212511       if (devinfo->is_g4x) {
   212512          return 22;
   212513       } else {
   212514          return 22;
   212515       }
   212516    default:
   212517       unreachable("Invalid hardware generation");
   212518    }
   212519 }
   212520 
   212521 
   212522 
   212523 #define GEN5_VS_STATE_ScratchSpaceBasePointer_start  74
   212524 #define GEN45_VS_STATE_ScratchSpaceBasePointer_start  74
   212525 #define GEN4_VS_STATE_ScratchSpaceBasePointer_start  74
   212526 
   212527 static inline uint32_t ATTRIBUTE_PURE
   212528 VS_STATE_ScratchSpaceBasePointer_start(const struct gen_device_info *devinfo)
   212529 {
   212530    switch (devinfo->gen) {
   212531    case 10: return 0;
   212532    case 9: return 0;
   212533    case 8: return 0;
   212534    case 7:
   212535       if (devinfo->is_haswell) {
   212536          return 0;
   212537       } else {
   212538          return 0;
   212539       }
   212540    case 6: return 0;
   212541    case 5: return 74;
   212542    case 4:
   212543       if (devinfo->is_g4x) {
   212544          return 74;
   212545       } else {
   212546          return 74;
   212547       }
   212548    default:
   212549       unreachable("Invalid hardware generation");
   212550    }
   212551 }
   212552 
   212553 
   212554 
   212555 /* VS_STATE::Single Program Flow */
   212556 
   212557 
   212558 #define GEN5_VS_STATE_SingleProgramFlow_bits  1
   212559 #define GEN45_VS_STATE_SingleProgramFlow_bits  1
   212560 #define GEN4_VS_STATE_SingleProgramFlow_bits  1
   212561 
   212562 static inline uint32_t ATTRIBUTE_PURE
   212563 VS_STATE_SingleProgramFlow_bits(const struct gen_device_info *devinfo)
   212564 {
   212565    switch (devinfo->gen) {
   212566    case 10: return 0;
   212567    case 9: return 0;
   212568    case 8: return 0;
   212569    case 7:
   212570       if (devinfo->is_haswell) {
   212571          return 0;
   212572       } else {
   212573          return 0;
   212574       }
   212575    case 6: return 0;
   212576    case 5: return 1;
   212577    case 4:
   212578       if (devinfo->is_g4x) {
   212579          return 1;
   212580       } else {
   212581          return 1;
   212582       }
   212583    default:
   212584       unreachable("Invalid hardware generation");
   212585    }
   212586 }
   212587 
   212588 
   212589 
   212590 #define GEN5_VS_STATE_SingleProgramFlow_start  63
   212591 #define GEN45_VS_STATE_SingleProgramFlow_start  63
   212592 #define GEN4_VS_STATE_SingleProgramFlow_start  63
   212593 
   212594 static inline uint32_t ATTRIBUTE_PURE
   212595 VS_STATE_SingleProgramFlow_start(const struct gen_device_info *devinfo)
   212596 {
   212597    switch (devinfo->gen) {
   212598    case 10: return 0;
   212599    case 9: return 0;
   212600    case 8: return 0;
   212601    case 7:
   212602       if (devinfo->is_haswell) {
   212603          return 0;
   212604       } else {
   212605          return 0;
   212606       }
   212607    case 6: return 0;
   212608    case 5: return 63;
   212609    case 4:
   212610       if (devinfo->is_g4x) {
   212611          return 63;
   212612       } else {
   212613          return 63;
   212614       }
   212615    default:
   212616       unreachable("Invalid hardware generation");
   212617    }
   212618 }
   212619 
   212620 
   212621 
   212622 /* VS_STATE::Software  Exception Enable */
   212623 
   212624 
   212625 #define GEN5_VS_STATE_SoftwareExceptionEnable_bits  1
   212626 #define GEN45_VS_STATE_SoftwareExceptionEnable_bits  1
   212627 #define GEN4_VS_STATE_SoftwareExceptionEnable_bits  1
   212628 
   212629 static inline uint32_t ATTRIBUTE_PURE
   212630 VS_STATE_SoftwareExceptionEnable_bits(const struct gen_device_info *devinfo)
   212631 {
   212632    switch (devinfo->gen) {
   212633    case 10: return 0;
   212634    case 9: return 0;
   212635    case 8: return 0;
   212636    case 7:
   212637       if (devinfo->is_haswell) {
   212638          return 0;
   212639       } else {
   212640          return 0;
   212641       }
   212642    case 6: return 0;
   212643    case 5: return 1;
   212644    case 4:
   212645       if (devinfo->is_g4x) {
   212646          return 1;
   212647       } else {
   212648          return 1;
   212649       }
   212650    default:
   212651       unreachable("Invalid hardware generation");
   212652    }
   212653 }
   212654 
   212655 
   212656 
   212657 #define GEN5_VS_STATE_SoftwareExceptionEnable_start  39
   212658 #define GEN45_VS_STATE_SoftwareExceptionEnable_start  39
   212659 #define GEN4_VS_STATE_SoftwareExceptionEnable_start  39
   212660 
   212661 static inline uint32_t ATTRIBUTE_PURE
   212662 VS_STATE_SoftwareExceptionEnable_start(const struct gen_device_info *devinfo)
   212663 {
   212664    switch (devinfo->gen) {
   212665    case 10: return 0;
   212666    case 9: return 0;
   212667    case 8: return 0;
   212668    case 7:
   212669       if (devinfo->is_haswell) {
   212670          return 0;
   212671       } else {
   212672          return 0;
   212673       }
   212674    case 6: return 0;
   212675    case 5: return 39;
   212676    case 4:
   212677       if (devinfo->is_g4x) {
   212678          return 39;
   212679       } else {
   212680          return 39;
   212681       }
   212682    default:
   212683       unreachable("Invalid hardware generation");
   212684    }
   212685 }
   212686 
   212687 
   212688 
   212689 /* VS_STATE::Statistics Enable */
   212690 
   212691 
   212692 #define GEN5_VS_STATE_StatisticsEnable_bits  1
   212693 #define GEN45_VS_STATE_StatisticsEnable_bits  1
   212694 #define GEN4_VS_STATE_StatisticsEnable_bits  1
   212695 
   212696 static inline uint32_t ATTRIBUTE_PURE
   212697 VS_STATE_StatisticsEnable_bits(const struct gen_device_info *devinfo)
   212698 {
   212699    switch (devinfo->gen) {
   212700    case 10: return 0;
   212701    case 9: return 0;
   212702    case 8: return 0;
   212703    case 7:
   212704       if (devinfo->is_haswell) {
   212705          return 0;
   212706       } else {
   212707          return 0;
   212708       }
   212709    case 6: return 0;
   212710    case 5: return 1;
   212711    case 4:
   212712       if (devinfo->is_g4x) {
   212713          return 1;
   212714       } else {
   212715          return 1;
   212716       }
   212717    default:
   212718       unreachable("Invalid hardware generation");
   212719    }
   212720 }
   212721 
   212722 
   212723 
   212724 #define GEN5_VS_STATE_StatisticsEnable_start  138
   212725 #define GEN45_VS_STATE_StatisticsEnable_start  138
   212726 #define GEN4_VS_STATE_StatisticsEnable_start  138
   212727 
   212728 static inline uint32_t ATTRIBUTE_PURE
   212729 VS_STATE_StatisticsEnable_start(const struct gen_device_info *devinfo)
   212730 {
   212731    switch (devinfo->gen) {
   212732    case 10: return 0;
   212733    case 9: return 0;
   212734    case 8: return 0;
   212735    case 7:
   212736       if (devinfo->is_haswell) {
   212737          return 0;
   212738       } else {
   212739          return 0;
   212740       }
   212741    case 6: return 0;
   212742    case 5: return 138;
   212743    case 4:
   212744       if (devinfo->is_g4x) {
   212745          return 138;
   212746       } else {
   212747          return 138;
   212748       }
   212749    default:
   212750       unreachable("Invalid hardware generation");
   212751    }
   212752 }
   212753 
   212754 
   212755 
   212756 /* VS_STATE::Thread Priority */
   212757 
   212758 
   212759 #define GEN5_VS_STATE_ThreadPriority_bits  1
   212760 #define GEN45_VS_STATE_ThreadPriority_bits  1
   212761 #define GEN4_VS_STATE_ThreadPriority_bits  1
   212762 
   212763 static inline uint32_t ATTRIBUTE_PURE
   212764 VS_STATE_ThreadPriority_bits(const struct gen_device_info *devinfo)
   212765 {
   212766    switch (devinfo->gen) {
   212767    case 10: return 0;
   212768    case 9: return 0;
   212769    case 8: return 0;
   212770    case 7:
   212771       if (devinfo->is_haswell) {
   212772          return 0;
   212773       } else {
   212774          return 0;
   212775       }
   212776    case 6: return 0;
   212777    case 5: return 1;
   212778    case 4:
   212779       if (devinfo->is_g4x) {
   212780          return 1;
   212781       } else {
   212782          return 1;
   212783       }
   212784    default:
   212785       unreachable("Invalid hardware generation");
   212786    }
   212787 }
   212788 
   212789 
   212790 
   212791 #define GEN5_VS_STATE_ThreadPriority_start  49
   212792 #define GEN45_VS_STATE_ThreadPriority_start  49
   212793 #define GEN4_VS_STATE_ThreadPriority_start  49
   212794 
   212795 static inline uint32_t ATTRIBUTE_PURE
   212796 VS_STATE_ThreadPriority_start(const struct gen_device_info *devinfo)
   212797 {
   212798    switch (devinfo->gen) {
   212799    case 10: return 0;
   212800    case 9: return 0;
   212801    case 8: return 0;
   212802    case 7:
   212803       if (devinfo->is_haswell) {
   212804          return 0;
   212805       } else {
   212806          return 0;
   212807       }
   212808    case 6: return 0;
   212809    case 5: return 49;
   212810    case 4:
   212811       if (devinfo->is_g4x) {
   212812          return 49;
   212813       } else {
   212814          return 49;
   212815       }
   212816    default:
   212817       unreachable("Invalid hardware generation");
   212818    }
   212819 }
   212820 
   212821 
   212822 
   212823 /* VS_STATE::URB Entry Allocation Size */
   212824 
   212825 
   212826 #define GEN5_VS_STATE_URBEntryAllocationSize_bits  5
   212827 #define GEN45_VS_STATE_URBEntryAllocationSize_bits  5
   212828 #define GEN4_VS_STATE_URBEntryAllocationSize_bits  5
   212829 
   212830 static inline uint32_t ATTRIBUTE_PURE
   212831 VS_STATE_URBEntryAllocationSize_bits(const struct gen_device_info *devinfo)
   212832 {
   212833    switch (devinfo->gen) {
   212834    case 10: return 0;
   212835    case 9: return 0;
   212836    case 8: return 0;
   212837    case 7:
   212838       if (devinfo->is_haswell) {
   212839          return 0;
   212840       } else {
   212841          return 0;
   212842       }
   212843    case 6: return 0;
   212844    case 5: return 5;
   212845    case 4:
   212846       if (devinfo->is_g4x) {
   212847          return 5;
   212848       } else {
   212849          return 5;
   212850       }
   212851    default:
   212852       unreachable("Invalid hardware generation");
   212853    }
   212854 }
   212855 
   212856 
   212857 
   212858 #define GEN5_VS_STATE_URBEntryAllocationSize_start  147
   212859 #define GEN45_VS_STATE_URBEntryAllocationSize_start  147
   212860 #define GEN4_VS_STATE_URBEntryAllocationSize_start  147
   212861 
   212862 static inline uint32_t ATTRIBUTE_PURE
   212863 VS_STATE_URBEntryAllocationSize_start(const struct gen_device_info *devinfo)
   212864 {
   212865    switch (devinfo->gen) {
   212866    case 10: return 0;
   212867    case 9: return 0;
   212868    case 8: return 0;
   212869    case 7:
   212870       if (devinfo->is_haswell) {
   212871          return 0;
   212872       } else {
   212873          return 0;
   212874       }
   212875    case 6: return 0;
   212876    case 5: return 147;
   212877    case 4:
   212878       if (devinfo->is_g4x) {
   212879          return 147;
   212880       } else {
   212881          return 147;
   212882       }
   212883    default:
   212884       unreachable("Invalid hardware generation");
   212885    }
   212886 }
   212887 
   212888 
   212889 
   212890 /* VS_STATE::Vertex Cache Disable */
   212891 
   212892 
   212893 #define GEN5_VS_STATE_VertexCacheDisable_bits  1
   212894 #define GEN45_VS_STATE_VertexCacheDisable_bits  1
   212895 #define GEN4_VS_STATE_VertexCacheDisable_bits  1
   212896 
   212897 static inline uint32_t ATTRIBUTE_PURE
   212898 VS_STATE_VertexCacheDisable_bits(const struct gen_device_info *devinfo)
   212899 {
   212900    switch (devinfo->gen) {
   212901    case 10: return 0;
   212902    case 9: return 0;
   212903    case 8: return 0;
   212904    case 7:
   212905       if (devinfo->is_haswell) {
   212906          return 0;
   212907       } else {
   212908          return 0;
   212909       }
   212910    case 6: return 0;
   212911    case 5: return 1;
   212912    case 4:
   212913       if (devinfo->is_g4x) {
   212914          return 1;
   212915       } else {
   212916          return 1;
   212917       }
   212918    default:
   212919       unreachable("Invalid hardware generation");
   212920    }
   212921 }
   212922 
   212923 
   212924 
   212925 #define GEN5_VS_STATE_VertexCacheDisable_start  193
   212926 #define GEN45_VS_STATE_VertexCacheDisable_start  193
   212927 #define GEN4_VS_STATE_VertexCacheDisable_start  193
   212928 
   212929 static inline uint32_t ATTRIBUTE_PURE
   212930 VS_STATE_VertexCacheDisable_start(const struct gen_device_info *devinfo)
   212931 {
   212932    switch (devinfo->gen) {
   212933    case 10: return 0;
   212934    case 9: return 0;
   212935    case 8: return 0;
   212936    case 7:
   212937       if (devinfo->is_haswell) {
   212938          return 0;
   212939       } else {
   212940          return 0;
   212941       }
   212942    case 6: return 0;
   212943    case 5: return 193;
   212944    case 4:
   212945       if (devinfo->is_g4x) {
   212946          return 193;
   212947       } else {
   212948          return 193;
   212949       }
   212950    default:
   212951       unreachable("Invalid hardware generation");
   212952    }
   212953 }
   212954 
   212955 
   212956 
   212957 /* VS_STATE::Vertex URB Entry Read Length */
   212958 
   212959 
   212960 #define GEN5_VS_STATE_VertexURBEntryReadLength_bits  6
   212961 #define GEN45_VS_STATE_VertexURBEntryReadLength_bits  6
   212962 #define GEN4_VS_STATE_VertexURBEntryReadLength_bits  6
   212963 
   212964 static inline uint32_t ATTRIBUTE_PURE
   212965 VS_STATE_VertexURBEntryReadLength_bits(const struct gen_device_info *devinfo)
   212966 {
   212967    switch (devinfo->gen) {
   212968    case 10: return 0;
   212969    case 9: return 0;
   212970    case 8: return 0;
   212971    case 7:
   212972       if (devinfo->is_haswell) {
   212973          return 0;
   212974       } else {
   212975          return 0;
   212976       }
   212977    case 6: return 0;
   212978    case 5: return 6;
   212979    case 4:
   212980       if (devinfo->is_g4x) {
   212981          return 6;
   212982       } else {
   212983          return 6;
   212984       }
   212985    default:
   212986       unreachable("Invalid hardware generation");
   212987    }
   212988 }
   212989 
   212990 
   212991 
   212992 #define GEN5_VS_STATE_VertexURBEntryReadLength_start  107
   212993 #define GEN45_VS_STATE_VertexURBEntryReadLength_start  107
   212994 #define GEN4_VS_STATE_VertexURBEntryReadLength_start  107
   212995 
   212996 static inline uint32_t ATTRIBUTE_PURE
   212997 VS_STATE_VertexURBEntryReadLength_start(const struct gen_device_info *devinfo)
   212998 {
   212999    switch (devinfo->gen) {
   213000    case 10: return 0;
   213001    case 9: return 0;
   213002    case 8: return 0;
   213003    case 7:
   213004       if (devinfo->is_haswell) {
   213005          return 0;
   213006       } else {
   213007          return 0;
   213008       }
   213009    case 6: return 0;
   213010    case 5: return 107;
   213011    case 4:
   213012       if (devinfo->is_g4x) {
   213013          return 107;
   213014       } else {
   213015          return 107;
   213016       }
   213017    default:
   213018       unreachable("Invalid hardware generation");
   213019    }
   213020 }
   213021 
   213022 
   213023 
   213024 /* VS_STATE::Vertex URB Entry Read Offset */
   213025 
   213026 
   213027 #define GEN5_VS_STATE_VertexURBEntryReadOffset_bits  6
   213028 #define GEN45_VS_STATE_VertexURBEntryReadOffset_bits  6
   213029 #define GEN4_VS_STATE_VertexURBEntryReadOffset_bits  6
   213030 
   213031 static inline uint32_t ATTRIBUTE_PURE
   213032 VS_STATE_VertexURBEntryReadOffset_bits(const struct gen_device_info *devinfo)
   213033 {
   213034    switch (devinfo->gen) {
   213035    case 10: return 0;
   213036    case 9: return 0;
   213037    case 8: return 0;
   213038    case 7:
   213039       if (devinfo->is_haswell) {
   213040          return 0;
   213041       } else {
   213042          return 0;
   213043       }
   213044    case 6: return 0;
   213045    case 5: return 6;
   213046    case 4:
   213047       if (devinfo->is_g4x) {
   213048          return 6;
   213049       } else {
   213050          return 6;
   213051       }
   213052    default:
   213053       unreachable("Invalid hardware generation");
   213054    }
   213055 }
   213056 
   213057 
   213058 
   213059 #define GEN5_VS_STATE_VertexURBEntryReadOffset_start  100
   213060 #define GEN45_VS_STATE_VertexURBEntryReadOffset_start  100
   213061 #define GEN4_VS_STATE_VertexURBEntryReadOffset_start  100
   213062 
   213063 static inline uint32_t ATTRIBUTE_PURE
   213064 VS_STATE_VertexURBEntryReadOffset_start(const struct gen_device_info *devinfo)
   213065 {
   213066    switch (devinfo->gen) {
   213067    case 10: return 0;
   213068    case 9: return 0;
   213069    case 8: return 0;
   213070    case 7:
   213071       if (devinfo->is_haswell) {
   213072          return 0;
   213073       } else {
   213074          return 0;
   213075       }
   213076    case 6: return 0;
   213077    case 5: return 100;
   213078    case 4:
   213079       if (devinfo->is_g4x) {
   213080          return 100;
   213081       } else {
   213082          return 100;
   213083       }
   213084    default:
   213085       unreachable("Invalid hardware generation");
   213086    }
   213087 }
   213088 
   213089 
   213090 
   213091 /* WM_STATE */
   213092 
   213093 
   213094 #define GEN5_WM_STATE_length  11
   213095 #define GEN45_WM_STATE_length  8
   213096 #define GEN4_WM_STATE_length  8
   213097 
   213098 static inline uint32_t ATTRIBUTE_PURE
   213099 WM_STATE_length(const struct gen_device_info *devinfo)
   213100 {
   213101    switch (devinfo->gen) {
   213102    case 10: return 0;
   213103    case 9: return 0;
   213104    case 8: return 0;
   213105    case 7:
   213106       if (devinfo->is_haswell) {
   213107          return 0;
   213108       } else {
   213109          return 0;
   213110       }
   213111    case 6: return 0;
   213112    case 5: return 11;
   213113    case 4:
   213114       if (devinfo->is_g4x) {
   213115          return 8;
   213116       } else {
   213117          return 8;
   213118       }
   213119    default:
   213120       unreachable("Invalid hardware generation");
   213121    }
   213122 }
   213123 
   213124 
   213125 
   213126 /* WM_STATE::16 Pixel Dispatch Enable */
   213127 
   213128 
   213129 #define GEN5_WM_STATE_16PixelDispatchEnable_bits  1
   213130 #define GEN45_WM_STATE_16PixelDispatchEnable_bits  1
   213131 #define GEN4_WM_STATE_16PixelDispatchEnable_bits  1
   213132 
   213133 static inline uint32_t ATTRIBUTE_PURE
   213134 WM_STATE_16PixelDispatchEnable_bits(const struct gen_device_info *devinfo)
   213135 {
   213136    switch (devinfo->gen) {
   213137    case 10: return 0;
   213138    case 9: return 0;
   213139    case 8: return 0;
   213140    case 7:
   213141       if (devinfo->is_haswell) {
   213142          return 0;
   213143       } else {
   213144          return 0;
   213145       }
   213146    case 6: return 0;
   213147    case 5: return 1;
   213148    case 4:
   213149       if (devinfo->is_g4x) {
   213150          return 1;
   213151       } else {
   213152          return 1;
   213153       }
   213154    default:
   213155       unreachable("Invalid hardware generation");
   213156    }
   213157 }
   213158 
   213159 
   213160 
   213161 #define GEN5_WM_STATE_16PixelDispatchEnable_start  161
   213162 #define GEN45_WM_STATE_16PixelDispatchEnable_start  161
   213163 #define GEN4_WM_STATE_16PixelDispatchEnable_start  161
   213164 
   213165 static inline uint32_t ATTRIBUTE_PURE
   213166 WM_STATE_16PixelDispatchEnable_start(const struct gen_device_info *devinfo)
   213167 {
   213168    switch (devinfo->gen) {
   213169    case 10: return 0;
   213170    case 9: return 0;
   213171    case 8: return 0;
   213172    case 7:
   213173       if (devinfo->is_haswell) {
   213174          return 0;
   213175       } else {
   213176          return 0;
   213177       }
   213178    case 6: return 0;
   213179    case 5: return 161;
   213180    case 4:
   213181       if (devinfo->is_g4x) {
   213182          return 161;
   213183       } else {
   213184          return 161;
   213185       }
   213186    default:
   213187       unreachable("Invalid hardware generation");
   213188    }
   213189 }
   213190 
   213191 
   213192 
   213193 /* WM_STATE::32 Pixel Dispatch Enable */
   213194 
   213195 
   213196 #define GEN5_WM_STATE_32PixelDispatchEnable_bits  1
   213197 #define GEN45_WM_STATE_32PixelDispatchEnable_bits  1
   213198 #define GEN4_WM_STATE_32PixelDispatchEnable_bits  1
   213199 
   213200 static inline uint32_t ATTRIBUTE_PURE
   213201 WM_STATE_32PixelDispatchEnable_bits(const struct gen_device_info *devinfo)
   213202 {
   213203    switch (devinfo->gen) {
   213204    case 10: return 0;
   213205    case 9: return 0;
   213206    case 8: return 0;
   213207    case 7:
   213208       if (devinfo->is_haswell) {
   213209          return 0;
   213210       } else {
   213211          return 0;
   213212       }
   213213    case 6: return 0;
   213214    case 5: return 1;
   213215    case 4:
   213216       if (devinfo->is_g4x) {
   213217          return 1;
   213218       } else {
   213219          return 1;
   213220       }
   213221    default:
   213222       unreachable("Invalid hardware generation");
   213223    }
   213224 }
   213225 
   213226 
   213227 
   213228 #define GEN5_WM_STATE_32PixelDispatchEnable_start  162
   213229 #define GEN45_WM_STATE_32PixelDispatchEnable_start  162
   213230 #define GEN4_WM_STATE_32PixelDispatchEnable_start  162
   213231 
   213232 static inline uint32_t ATTRIBUTE_PURE
   213233 WM_STATE_32PixelDispatchEnable_start(const struct gen_device_info *devinfo)
   213234 {
   213235    switch (devinfo->gen) {
   213236    case 10: return 0;
   213237    case 9: return 0;
   213238    case 8: return 0;
   213239    case 7:
   213240       if (devinfo->is_haswell) {
   213241          return 0;
   213242       } else {
   213243          return 0;
   213244       }
   213245    case 6: return 0;
   213246    case 5: return 162;
   213247    case 4:
   213248       if (devinfo->is_g4x) {
   213249          return 162;
   213250       } else {
   213251          return 162;
   213252       }
   213253    default:
   213254       unreachable("Invalid hardware generation");
   213255    }
   213256 }
   213257 
   213258 
   213259 
   213260 /* WM_STATE::8 Pixel Dispatch Enable */
   213261 
   213262 
   213263 #define GEN5_WM_STATE_8PixelDispatchEnable_bits  1
   213264 #define GEN45_WM_STATE_8PixelDispatchEnable_bits  1
   213265 #define GEN4_WM_STATE_8PixelDispatchEnable_bits  1
   213266 
   213267 static inline uint32_t ATTRIBUTE_PURE
   213268 WM_STATE_8PixelDispatchEnable_bits(const struct gen_device_info *devinfo)
   213269 {
   213270    switch (devinfo->gen) {
   213271    case 10: return 0;
   213272    case 9: return 0;
   213273    case 8: return 0;
   213274    case 7:
   213275       if (devinfo->is_haswell) {
   213276          return 0;
   213277       } else {
   213278          return 0;
   213279       }
   213280    case 6: return 0;
   213281    case 5: return 1;
   213282    case 4:
   213283       if (devinfo->is_g4x) {
   213284          return 1;
   213285       } else {
   213286          return 1;
   213287       }
   213288    default:
   213289       unreachable("Invalid hardware generation");
   213290    }
   213291 }
   213292 
   213293 
   213294 
   213295 #define GEN5_WM_STATE_8PixelDispatchEnable_start  160
   213296 #define GEN45_WM_STATE_8PixelDispatchEnable_start  160
   213297 #define GEN4_WM_STATE_8PixelDispatchEnable_start  160
   213298 
   213299 static inline uint32_t ATTRIBUTE_PURE
   213300 WM_STATE_8PixelDispatchEnable_start(const struct gen_device_info *devinfo)
   213301 {
   213302    switch (devinfo->gen) {
   213303    case 10: return 0;
   213304    case 9: return 0;
   213305    case 8: return 0;
   213306    case 7:
   213307       if (devinfo->is_haswell) {
   213308          return 0;
   213309       } else {
   213310          return 0;
   213311       }
   213312    case 6: return 0;
   213313    case 5: return 160;
   213314    case 4:
   213315       if (devinfo->is_g4x) {
   213316          return 160;
   213317       } else {
   213318          return 160;
   213319       }
   213320    default:
   213321       unreachable("Invalid hardware generation");
   213322    }
   213323 }
   213324 
   213325 
   213326 
   213327 /* WM_STATE::Binding Table Entry Count */
   213328 
   213329 
   213330 #define GEN5_WM_STATE_BindingTableEntryCount_bits  8
   213331 #define GEN45_WM_STATE_BindingTableEntryCount_bits  8
   213332 #define GEN4_WM_STATE_BindingTableEntryCount_bits  8
   213333 
   213334 static inline uint32_t ATTRIBUTE_PURE
   213335 WM_STATE_BindingTableEntryCount_bits(const struct gen_device_info *devinfo)
   213336 {
   213337    switch (devinfo->gen) {
   213338    case 10: return 0;
   213339    case 9: return 0;
   213340    case 8: return 0;
   213341    case 7:
   213342       if (devinfo->is_haswell) {
   213343          return 0;
   213344       } else {
   213345          return 0;
   213346       }
   213347    case 6: return 0;
   213348    case 5: return 8;
   213349    case 4:
   213350       if (devinfo->is_g4x) {
   213351          return 8;
   213352       } else {
   213353          return 8;
   213354       }
   213355    default:
   213356       unreachable("Invalid hardware generation");
   213357    }
   213358 }
   213359 
   213360 
   213361 
   213362 #define GEN5_WM_STATE_BindingTableEntryCount_start  50
   213363 #define GEN45_WM_STATE_BindingTableEntryCount_start  50
   213364 #define GEN4_WM_STATE_BindingTableEntryCount_start  50
   213365 
   213366 static inline uint32_t ATTRIBUTE_PURE
   213367 WM_STATE_BindingTableEntryCount_start(const struct gen_device_info *devinfo)
   213368 {
   213369    switch (devinfo->gen) {
   213370    case 10: return 0;
   213371    case 9: return 0;
   213372    case 8: return 0;
   213373    case 7:
   213374       if (devinfo->is_haswell) {
   213375          return 0;
   213376       } else {
   213377          return 0;
   213378       }
   213379    case 6: return 0;
   213380    case 5: return 50;
   213381    case 4:
   213382       if (devinfo->is_g4x) {
   213383          return 50;
   213384       } else {
   213385          return 50;
   213386       }
   213387    default:
   213388       unreachable("Invalid hardware generation");
   213389    }
   213390 }
   213391 
   213392 
   213393 
   213394 /* WM_STATE::Constant URB Entry Read Length */
   213395 
   213396 
   213397 #define GEN5_WM_STATE_ConstantURBEntryReadLength_bits  6
   213398 #define GEN45_WM_STATE_ConstantURBEntryReadLength_bits  6
   213399 #define GEN4_WM_STATE_ConstantURBEntryReadLength_bits  6
   213400 
   213401 static inline uint32_t ATTRIBUTE_PURE
   213402 WM_STATE_ConstantURBEntryReadLength_bits(const struct gen_device_info *devinfo)
   213403 {
   213404    switch (devinfo->gen) {
   213405    case 10: return 0;
   213406    case 9: return 0;
   213407    case 8: return 0;
   213408    case 7:
   213409       if (devinfo->is_haswell) {
   213410          return 0;
   213411       } else {
   213412          return 0;
   213413       }
   213414    case 6: return 0;
   213415    case 5: return 6;
   213416    case 4:
   213417       if (devinfo->is_g4x) {
   213418          return 6;
   213419       } else {
   213420          return 6;
   213421       }
   213422    default:
   213423       unreachable("Invalid hardware generation");
   213424    }
   213425 }
   213426 
   213427 
   213428 
   213429 #define GEN5_WM_STATE_ConstantURBEntryReadLength_start  121
   213430 #define GEN45_WM_STATE_ConstantURBEntryReadLength_start  121
   213431 #define GEN4_WM_STATE_ConstantURBEntryReadLength_start  121
   213432 
   213433 static inline uint32_t ATTRIBUTE_PURE
   213434 WM_STATE_ConstantURBEntryReadLength_start(const struct gen_device_info *devinfo)
   213435 {
   213436    switch (devinfo->gen) {
   213437    case 10: return 0;
   213438    case 9: return 0;
   213439    case 8: return 0;
   213440    case 7:
   213441       if (devinfo->is_haswell) {
   213442          return 0;
   213443       } else {
   213444          return 0;
   213445       }
   213446    case 6: return 0;
   213447    case 5: return 121;
   213448    case 4:
   213449       if (devinfo->is_g4x) {
   213450          return 121;
   213451       } else {
   213452          return 121;
   213453       }
   213454    default:
   213455       unreachable("Invalid hardware generation");
   213456    }
   213457 }
   213458 
   213459 
   213460 
   213461 /* WM_STATE::Constant URB Entry Read Offset */
   213462 
   213463 
   213464 #define GEN5_WM_STATE_ConstantURBEntryReadOffset_bits  6
   213465 #define GEN45_WM_STATE_ConstantURBEntryReadOffset_bits  6
   213466 #define GEN4_WM_STATE_ConstantURBEntryReadOffset_bits  6
   213467 
   213468 static inline uint32_t ATTRIBUTE_PURE
   213469 WM_STATE_ConstantURBEntryReadOffset_bits(const struct gen_device_info *devinfo)
   213470 {
   213471    switch (devinfo->gen) {
   213472    case 10: return 0;
   213473    case 9: return 0;
   213474    case 8: return 0;
   213475    case 7:
   213476       if (devinfo->is_haswell) {
   213477          return 0;
   213478       } else {
   213479          return 0;
   213480       }
   213481    case 6: return 0;
   213482    case 5: return 6;
   213483    case 4:
   213484       if (devinfo->is_g4x) {
   213485          return 6;
   213486       } else {
   213487          return 6;
   213488       }
   213489    default:
   213490       unreachable("Invalid hardware generation");
   213491    }
   213492 }
   213493 
   213494 
   213495 
   213496 #define GEN5_WM_STATE_ConstantURBEntryReadOffset_start  114
   213497 #define GEN45_WM_STATE_ConstantURBEntryReadOffset_start  114
   213498 #define GEN4_WM_STATE_ConstantURBEntryReadOffset_start  114
   213499 
   213500 static inline uint32_t ATTRIBUTE_PURE
   213501 WM_STATE_ConstantURBEntryReadOffset_start(const struct gen_device_info *devinfo)
   213502 {
   213503    switch (devinfo->gen) {
   213504    case 10: return 0;
   213505    case 9: return 0;
   213506    case 8: return 0;
   213507    case 7:
   213508       if (devinfo->is_haswell) {
   213509          return 0;
   213510       } else {
   213511          return 0;
   213512       }
   213513    case 6: return 0;
   213514    case 5: return 114;
   213515    case 4:
   213516       if (devinfo->is_g4x) {
   213517          return 114;
   213518       } else {
   213519          return 114;
   213520       }
   213521    default:
   213522       unreachable("Invalid hardware generation");
   213523    }
   213524 }
   213525 
   213526 
   213527 
   213528 /* WM_STATE::Contiguous 32 Pixel Dispatch Enable */
   213529 
   213530 
   213531 #define GEN5_WM_STATE_Contiguous32PixelDispatchEnable_bits  1
   213532 #define GEN45_WM_STATE_Contiguous32PixelDispatchEnable_bits  1
   213533 
   213534 static inline uint32_t ATTRIBUTE_PURE
   213535 WM_STATE_Contiguous32PixelDispatchEnable_bits(const struct gen_device_info *devinfo)
   213536 {
   213537    switch (devinfo->gen) {
   213538    case 10: return 0;
   213539    case 9: return 0;
   213540    case 8: return 0;
   213541    case 7:
   213542       if (devinfo->is_haswell) {
   213543          return 0;
   213544       } else {
   213545          return 0;
   213546       }
   213547    case 6: return 0;
   213548    case 5: return 1;
   213549    case 4:
   213550       if (devinfo->is_g4x) {
   213551          return 1;
   213552       } else {
   213553          return 0;
   213554       }
   213555    default:
   213556       unreachable("Invalid hardware generation");
   213557    }
   213558 }
   213559 
   213560 
   213561 
   213562 #define GEN5_WM_STATE_Contiguous32PixelDispatchEnable_start  163
   213563 #define GEN45_WM_STATE_Contiguous32PixelDispatchEnable_start  163
   213564 
   213565 static inline uint32_t ATTRIBUTE_PURE
   213566 WM_STATE_Contiguous32PixelDispatchEnable_start(const struct gen_device_info *devinfo)
   213567 {
   213568    switch (devinfo->gen) {
   213569    case 10: return 0;
   213570    case 9: return 0;
   213571    case 8: return 0;
   213572    case 7:
   213573       if (devinfo->is_haswell) {
   213574          return 0;
   213575       } else {
   213576          return 0;
   213577       }
   213578    case 6: return 0;
   213579    case 5: return 163;
   213580    case 4:
   213581       if (devinfo->is_g4x) {
   213582          return 163;
   213583       } else {
   213584          return 0;
   213585       }
   213586    default:
   213587       unreachable("Invalid hardware generation");
   213588    }
   213589 }
   213590 
   213591 
   213592 
   213593 /* WM_STATE::Contiguous 64 Pixel Dispatch Enable */
   213594 
   213595 
   213596 #define GEN5_WM_STATE_Contiguous64PixelDispatchEnable_bits  1
   213597 #define GEN45_WM_STATE_Contiguous64PixelDispatchEnable_bits  1
   213598 
   213599 static inline uint32_t ATTRIBUTE_PURE
   213600 WM_STATE_Contiguous64PixelDispatchEnable_bits(const struct gen_device_info *devinfo)
   213601 {
   213602    switch (devinfo->gen) {
   213603    case 10: return 0;
   213604    case 9: return 0;
   213605    case 8: return 0;
   213606    case 7:
   213607       if (devinfo->is_haswell) {
   213608          return 0;
   213609       } else {
   213610          return 0;
   213611       }
   213612    case 6: return 0;
   213613    case 5: return 1;
   213614    case 4:
   213615       if (devinfo->is_g4x) {
   213616          return 1;
   213617       } else {
   213618          return 0;
   213619       }
   213620    default:
   213621       unreachable("Invalid hardware generation");
   213622    }
   213623 }
   213624 
   213625 
   213626 
   213627 #define GEN5_WM_STATE_Contiguous64PixelDispatchEnable_start  164
   213628 #define GEN45_WM_STATE_Contiguous64PixelDispatchEnable_start  164
   213629 
   213630 static inline uint32_t ATTRIBUTE_PURE
   213631 WM_STATE_Contiguous64PixelDispatchEnable_start(const struct gen_device_info *devinfo)
   213632 {
   213633    switch (devinfo->gen) {
   213634    case 10: return 0;
   213635    case 9: return 0;
   213636    case 8: return 0;
   213637    case 7:
   213638       if (devinfo->is_haswell) {
   213639          return 0;
   213640       } else {
   213641          return 0;
   213642       }
   213643    case 6: return 0;
   213644    case 5: return 164;
   213645    case 4:
   213646       if (devinfo->is_g4x) {
   213647          return 164;
   213648       } else {
   213649          return 0;
   213650       }
   213651    default:
   213652       unreachable("Invalid hardware generation");
   213653    }
   213654 }
   213655 
   213656 
   213657 
   213658 /* WM_STATE::Depth Buffer Clear */
   213659 
   213660 
   213661 #define GEN5_WM_STATE_DepthBufferClear_bits  1
   213662 
   213663 static inline uint32_t ATTRIBUTE_PURE
   213664 WM_STATE_DepthBufferClear_bits(const struct gen_device_info *devinfo)
   213665 {
   213666    switch (devinfo->gen) {
   213667    case 10: return 0;
   213668    case 9: return 0;
   213669    case 8: return 0;
   213670    case 7:
   213671       if (devinfo->is_haswell) {
   213672          return 0;
   213673       } else {
   213674          return 0;
   213675       }
   213676    case 6: return 0;
   213677    case 5: return 1;
   213678    case 4:
   213679       if (devinfo->is_g4x) {
   213680          return 0;
   213681       } else {
   213682          return 0;
   213683       }
   213684    default:
   213685       unreachable("Invalid hardware generation");
   213686    }
   213687 }
   213688 
   213689 
   213690 
   213691 #define GEN5_WM_STATE_DepthBufferClear_start  167
   213692 
   213693 static inline uint32_t ATTRIBUTE_PURE
   213694 WM_STATE_DepthBufferClear_start(const struct gen_device_info *devinfo)
   213695 {
   213696    switch (devinfo->gen) {
   213697    case 10: return 0;
   213698    case 9: return 0;
   213699    case 8: return 0;
   213700    case 7:
   213701       if (devinfo->is_haswell) {
   213702          return 0;
   213703       } else {
   213704          return 0;
   213705       }
   213706    case 6: return 0;
   213707    case 5: return 167;
   213708    case 4:
   213709       if (devinfo->is_g4x) {
   213710          return 0;
   213711       } else {
   213712          return 0;
   213713       }
   213714    default:
   213715       unreachable("Invalid hardware generation");
   213716    }
   213717 }
   213718 
   213719 
   213720 
   213721 /* WM_STATE::Depth Buffer Resolve Enable */
   213722 
   213723 
   213724 #define GEN5_WM_STATE_DepthBufferResolveEnable_bits  1
   213725 
   213726 static inline uint32_t ATTRIBUTE_PURE
   213727 WM_STATE_DepthBufferResolveEnable_bits(const struct gen_device_info *devinfo)
   213728 {
   213729    switch (devinfo->gen) {
   213730    case 10: return 0;
   213731    case 9: return 0;
   213732    case 8: return 0;
   213733    case 7:
   213734       if (devinfo->is_haswell) {
   213735          return 0;
   213736       } else {
   213737          return 0;
   213738       }
   213739    case 6: return 0;
   213740    case 5: return 1;
   213741    case 4:
   213742       if (devinfo->is_g4x) {
   213743          return 0;
   213744       } else {
   213745          return 0;
   213746       }
   213747    default:
   213748       unreachable("Invalid hardware generation");
   213749    }
   213750 }
   213751 
   213752 
   213753 
   213754 #define GEN5_WM_STATE_DepthBufferResolveEnable_start  168
   213755 
   213756 static inline uint32_t ATTRIBUTE_PURE
   213757 WM_STATE_DepthBufferResolveEnable_start(const struct gen_device_info *devinfo)
   213758 {
   213759    switch (devinfo->gen) {
   213760    case 10: return 0;
   213761    case 9: return 0;
   213762    case 8: return 0;
   213763    case 7:
   213764       if (devinfo->is_haswell) {
   213765          return 0;
   213766       } else {
   213767          return 0;
   213768       }
   213769    case 6: return 0;
   213770    case 5: return 168;
   213771    case 4:
   213772       if (devinfo->is_g4x) {
   213773          return 0;
   213774       } else {
   213775          return 0;
   213776       }
   213777    default:
   213778       unreachable("Invalid hardware generation");
   213779    }
   213780 }
   213781 
   213782 
   213783 
   213784 /* WM_STATE::Depth Coefficient URB Read Offset */
   213785 
   213786 
   213787 #define GEN5_WM_STATE_DepthCoefficientURBReadOffset_bits  6
   213788 #define GEN45_WM_STATE_DepthCoefficientURBReadOffset_bits  6
   213789 #define GEN4_WM_STATE_DepthCoefficientURBReadOffset_bits  6
   213790 
   213791 static inline uint32_t ATTRIBUTE_PURE
   213792 WM_STATE_DepthCoefficientURBReadOffset_bits(const struct gen_device_info *devinfo)
   213793 {
   213794    switch (devinfo->gen) {
   213795    case 10: return 0;
   213796    case 9: return 0;
   213797    case 8: return 0;
   213798    case 7:
   213799       if (devinfo->is_haswell) {
   213800          return 0;
   213801       } else {
   213802          return 0;
   213803       }
   213804    case 6: return 0;
   213805    case 5: return 6;
   213806    case 4:
   213807       if (devinfo->is_g4x) {
   213808          return 6;
   213809       } else {
   213810          return 6;
   213811       }
   213812    default:
   213813       unreachable("Invalid hardware generation");
   213814    }
   213815 }
   213816 
   213817 
   213818 
   213819 #define GEN5_WM_STATE_DepthCoefficientURBReadOffset_start  40
   213820 #define GEN45_WM_STATE_DepthCoefficientURBReadOffset_start  40
   213821 #define GEN4_WM_STATE_DepthCoefficientURBReadOffset_start  40
   213822 
   213823 static inline uint32_t ATTRIBUTE_PURE
   213824 WM_STATE_DepthCoefficientURBReadOffset_start(const struct gen_device_info *devinfo)
   213825 {
   213826    switch (devinfo->gen) {
   213827    case 10: return 0;
   213828    case 9: return 0;
   213829    case 8: return 0;
   213830    case 7:
   213831       if (devinfo->is_haswell) {
   213832          return 0;
   213833       } else {
   213834          return 0;
   213835       }
   213836    case 6: return 0;
   213837    case 5: return 40;
   213838    case 4:
   213839       if (devinfo->is_g4x) {
   213840          return 40;
   213841       } else {
   213842          return 40;
   213843       }
   213844    default:
   213845       unreachable("Invalid hardware generation");
   213846    }
   213847 }
   213848 
   213849 
   213850 
   213851 /* WM_STATE::Dispatch GRF Start Register For Constant/Setup Data 0 */
   213852 
   213853 
   213854 #define GEN5_WM_STATE_DispatchGRFStartRegisterForConstantSetupData0_bits  4
   213855 #define GEN45_WM_STATE_DispatchGRFStartRegisterForConstantSetupData0_bits  4
   213856 #define GEN4_WM_STATE_DispatchGRFStartRegisterForConstantSetupData0_bits  4
   213857 
   213858 static inline uint32_t ATTRIBUTE_PURE
   213859 WM_STATE_DispatchGRFStartRegisterForConstantSetupData0_bits(const struct gen_device_info *devinfo)
   213860 {
   213861    switch (devinfo->gen) {
   213862    case 10: return 0;
   213863    case 9: return 0;
   213864    case 8: return 0;
   213865    case 7:
   213866       if (devinfo->is_haswell) {
   213867          return 0;
   213868       } else {
   213869          return 0;
   213870       }
   213871    case 6: return 0;
   213872    case 5: return 4;
   213873    case 4:
   213874       if (devinfo->is_g4x) {
   213875          return 4;
   213876       } else {
   213877          return 4;
   213878       }
   213879    default:
   213880       unreachable("Invalid hardware generation");
   213881    }
   213882 }
   213883 
   213884 
   213885 
   213886 #define GEN5_WM_STATE_DispatchGRFStartRegisterForConstantSetupData0_start  96
   213887 #define GEN45_WM_STATE_DispatchGRFStartRegisterForConstantSetupData0_start  96
   213888 #define GEN4_WM_STATE_DispatchGRFStartRegisterForConstantSetupData0_start  96
   213889 
   213890 static inline uint32_t ATTRIBUTE_PURE
   213891 WM_STATE_DispatchGRFStartRegisterForConstantSetupData0_start(const struct gen_device_info *devinfo)
   213892 {
   213893    switch (devinfo->gen) {
   213894    case 10: return 0;
   213895    case 9: return 0;
   213896    case 8: return 0;
   213897    case 7:
   213898       if (devinfo->is_haswell) {
   213899          return 0;
   213900       } else {
   213901          return 0;
   213902       }
   213903    case 6: return 0;
   213904    case 5: return 96;
   213905    case 4:
   213906       if (devinfo->is_g4x) {
   213907          return 96;
   213908       } else {
   213909          return 96;
   213910       }
   213911    default:
   213912       unreachable("Invalid hardware generation");
   213913    }
   213914 }
   213915 
   213916 
   213917 
   213918 /* WM_STATE::Early Depth Test Enable */
   213919 
   213920 
   213921 #define GEN5_WM_STATE_EarlyDepthTestEnable_bits  1
   213922 #define GEN45_WM_STATE_EarlyDepthTestEnable_bits  1
   213923 #define GEN4_WM_STATE_EarlyDepthTestEnable_bits  1
   213924 
   213925 static inline uint32_t ATTRIBUTE_PURE
   213926 WM_STATE_EarlyDepthTestEnable_bits(const struct gen_device_info *devinfo)
   213927 {
   213928    switch (devinfo->gen) {
   213929    case 10: return 0;
   213930    case 9: return 0;
   213931    case 8: return 0;
   213932    case 7:
   213933       if (devinfo->is_haswell) {
   213934          return 0;
   213935       } else {
   213936          return 0;
   213937       }
   213938    case 6: return 0;
   213939    case 5: return 1;
   213940    case 4:
   213941       if (devinfo->is_g4x) {
   213942          return 1;
   213943       } else {
   213944          return 1;
   213945       }
   213946    default:
   213947       unreachable("Invalid hardware generation");
   213948    }
   213949 }
   213950 
   213951 
   213952 
   213953 #define GEN5_WM_STATE_EarlyDepthTestEnable_start  178
   213954 #define GEN45_WM_STATE_EarlyDepthTestEnable_start  178
   213955 #define GEN4_WM_STATE_EarlyDepthTestEnable_start  178
   213956 
   213957 static inline uint32_t ATTRIBUTE_PURE
   213958 WM_STATE_EarlyDepthTestEnable_start(const struct gen_device_info *devinfo)
   213959 {
   213960    switch (devinfo->gen) {
   213961    case 10: return 0;
   213962    case 9: return 0;
   213963    case 8: return 0;
   213964    case 7:
   213965       if (devinfo->is_haswell) {
   213966          return 0;
   213967       } else {
   213968          return 0;
   213969       }
   213970    case 6: return 0;
   213971    case 5: return 178;
   213972    case 4:
   213973       if (devinfo->is_g4x) {
   213974          return 178;
   213975       } else {
   213976          return 178;
   213977       }
   213978    default:
   213979       unreachable("Invalid hardware generation");
   213980    }
   213981 }
   213982 
   213983 
   213984 
   213985 /* WM_STATE::Fast Span Coverage Enable */
   213986 
   213987 
   213988 #define GEN5_WM_STATE_FastSpanCoverageEnable_bits  1
   213989 
   213990 static inline uint32_t ATTRIBUTE_PURE
   213991 WM_STATE_FastSpanCoverageEnable_bits(const struct gen_device_info *devinfo)
   213992 {
   213993    switch (devinfo->gen) {
   213994    case 10: return 0;
   213995    case 9: return 0;
   213996    case 8: return 0;
   213997    case 7:
   213998       if (devinfo->is_haswell) {
   213999          return 0;
   214000       } else {
   214001          return 0;
   214002       }
   214003    case 6: return 0;
   214004    case 5: return 1;
   214005    case 4:
   214006       if (devinfo->is_g4x) {
   214007          return 0;
   214008       } else {
   214009          return 0;
   214010       }
   214011    default:
   214012       unreachable("Invalid hardware generation");
   214013    }
   214014 }
   214015 
   214016 
   214017 
   214018 #define GEN5_WM_STATE_FastSpanCoverageEnable_start  166
   214019 
   214020 static inline uint32_t ATTRIBUTE_PURE
   214021 WM_STATE_FastSpanCoverageEnable_start(const struct gen_device_info *devinfo)
   214022 {
   214023    switch (devinfo->gen) {
   214024    case 10: return 0;
   214025    case 9: return 0;
   214026    case 8: return 0;
   214027    case 7:
   214028       if (devinfo->is_haswell) {
   214029          return 0;
   214030       } else {
   214031          return 0;
   214032       }
   214033    case 6: return 0;
   214034    case 5: return 166;
   214035    case 4:
   214036       if (devinfo->is_g4x) {
   214037          return 0;
   214038       } else {
   214039          return 0;
   214040       }
   214041    default:
   214042       unreachable("Invalid hardware generation");
   214043    }
   214044 }
   214045 
   214046 
   214047 
   214048 /* WM_STATE::Floating Point Mode */
   214049 
   214050 
   214051 #define GEN5_WM_STATE_FloatingPointMode_bits  1
   214052 #define GEN45_WM_STATE_FloatingPointMode_bits  1
   214053 #define GEN4_WM_STATE_FloatingPointMode_bits  1
   214054 
   214055 static inline uint32_t ATTRIBUTE_PURE
   214056 WM_STATE_FloatingPointMode_bits(const struct gen_device_info *devinfo)
   214057 {
   214058    switch (devinfo->gen) {
   214059    case 10: return 0;
   214060    case 9: return 0;
   214061    case 8: return 0;
   214062    case 7:
   214063       if (devinfo->is_haswell) {
   214064          return 0;
   214065       } else {
   214066          return 0;
   214067       }
   214068    case 6: return 0;
   214069    case 5: return 1;
   214070    case 4:
   214071       if (devinfo->is_g4x) {
   214072          return 1;
   214073       } else {
   214074          return 1;
   214075       }
   214076    default:
   214077       unreachable("Invalid hardware generation");
   214078    }
   214079 }
   214080 
   214081 
   214082 
   214083 #define GEN5_WM_STATE_FloatingPointMode_start  48
   214084 #define GEN45_WM_STATE_FloatingPointMode_start  48
   214085 #define GEN4_WM_STATE_FloatingPointMode_start  48
   214086 
   214087 static inline uint32_t ATTRIBUTE_PURE
   214088 WM_STATE_FloatingPointMode_start(const struct gen_device_info *devinfo)
   214089 {
   214090    switch (devinfo->gen) {
   214091    case 10: return 0;
   214092    case 9: return 0;
   214093    case 8: return 0;
   214094    case 7:
   214095       if (devinfo->is_haswell) {
   214096          return 0;
   214097       } else {
   214098          return 0;
   214099       }
   214100    case 6: return 0;
   214101    case 5: return 48;
   214102    case 4:
   214103       if (devinfo->is_g4x) {
   214104          return 48;
   214105       } else {
   214106          return 48;
   214107       }
   214108    default:
   214109       unreachable("Invalid hardware generation");
   214110    }
   214111 }
   214112 
   214113 
   214114 
   214115 /* WM_STATE::GRF Register Count 0 */
   214116 
   214117 
   214118 #define GEN5_WM_STATE_GRFRegisterCount0_bits  3
   214119 #define GEN45_WM_STATE_GRFRegisterCount0_bits  3
   214120 #define GEN4_WM_STATE_GRFRegisterCount0_bits  3
   214121 
   214122 static inline uint32_t ATTRIBUTE_PURE
   214123 WM_STATE_GRFRegisterCount0_bits(const struct gen_device_info *devinfo)
   214124 {
   214125    switch (devinfo->gen) {
   214126    case 10: return 0;
   214127    case 9: return 0;
   214128    case 8: return 0;
   214129    case 7:
   214130       if (devinfo->is_haswell) {
   214131          return 0;
   214132       } else {
   214133          return 0;
   214134       }
   214135    case 6: return 0;
   214136    case 5: return 3;
   214137    case 4:
   214138       if (devinfo->is_g4x) {
   214139          return 3;
   214140       } else {
   214141          return 3;
   214142       }
   214143    default:
   214144       unreachable("Invalid hardware generation");
   214145    }
   214146 }
   214147 
   214148 
   214149 
   214150 #define GEN5_WM_STATE_GRFRegisterCount0_start  1
   214151 #define GEN45_WM_STATE_GRFRegisterCount0_start  1
   214152 #define GEN4_WM_STATE_GRFRegisterCount0_start  1
   214153 
   214154 static inline uint32_t ATTRIBUTE_PURE
   214155 WM_STATE_GRFRegisterCount0_start(const struct gen_device_info *devinfo)
   214156 {
   214157    switch (devinfo->gen) {
   214158    case 10: return 0;
   214159    case 9: return 0;
   214160    case 8: return 0;
   214161    case 7:
   214162       if (devinfo->is_haswell) {
   214163          return 0;
   214164       } else {
   214165          return 0;
   214166       }
   214167    case 6: return 0;
   214168    case 5: return 1;
   214169    case 4:
   214170       if (devinfo->is_g4x) {
   214171          return 1;
   214172       } else {
   214173          return 1;
   214174       }
   214175    default:
   214176       unreachable("Invalid hardware generation");
   214177    }
   214178 }
   214179 
   214180 
   214181 
   214182 /* WM_STATE::GRF Register Count 1 */
   214183 
   214184 
   214185 #define GEN5_WM_STATE_GRFRegisterCount1_bits  3
   214186 
   214187 static inline uint32_t ATTRIBUTE_PURE
   214188 WM_STATE_GRFRegisterCount1_bits(const struct gen_device_info *devinfo)
   214189 {
   214190    switch (devinfo->gen) {
   214191    case 10: return 0;
   214192    case 9: return 0;
   214193    case 8: return 0;
   214194    case 7:
   214195       if (devinfo->is_haswell) {
   214196          return 0;
   214197       } else {
   214198          return 0;
   214199       }
   214200    case 6: return 0;
   214201    case 5: return 3;
   214202    case 4:
   214203       if (devinfo->is_g4x) {
   214204          return 0;
   214205       } else {
   214206          return 0;
   214207       }
   214208    default:
   214209       unreachable("Invalid hardware generation");
   214210    }
   214211 }
   214212 
   214213 
   214214 
   214215 #define GEN5_WM_STATE_GRFRegisterCount1_start  257
   214216 
   214217 static inline uint32_t ATTRIBUTE_PURE
   214218 WM_STATE_GRFRegisterCount1_start(const struct gen_device_info *devinfo)
   214219 {
   214220    switch (devinfo->gen) {
   214221    case 10: return 0;
   214222    case 9: return 0;
   214223    case 8: return 0;
   214224    case 7:
   214225       if (devinfo->is_haswell) {
   214226          return 0;
   214227       } else {
   214228          return 0;
   214229       }
   214230    case 6: return 0;
   214231    case 5: return 257;
   214232    case 4:
   214233       if (devinfo->is_g4x) {
   214234          return 0;
   214235       } else {
   214236          return 0;
   214237       }
   214238    default:
   214239       unreachable("Invalid hardware generation");
   214240    }
   214241 }
   214242 
   214243 
   214244 
   214245 /* WM_STATE::GRF Register Count 2 */
   214246 
   214247 
   214248 #define GEN5_WM_STATE_GRFRegisterCount2_bits  3
   214249 
   214250 static inline uint32_t ATTRIBUTE_PURE
   214251 WM_STATE_GRFRegisterCount2_bits(const struct gen_device_info *devinfo)
   214252 {
   214253    switch (devinfo->gen) {
   214254    case 10: return 0;
   214255    case 9: return 0;
   214256    case 8: return 0;
   214257    case 7:
   214258       if (devinfo->is_haswell) {
   214259          return 0;
   214260       } else {
   214261          return 0;
   214262       }
   214263    case 6: return 0;
   214264    case 5: return 3;
   214265    case 4:
   214266       if (devinfo->is_g4x) {
   214267          return 0;
   214268       } else {
   214269          return 0;
   214270       }
   214271    default:
   214272       unreachable("Invalid hardware generation");
   214273    }
   214274 }
   214275 
   214276 
   214277 
   214278 #define GEN5_WM_STATE_GRFRegisterCount2_start  289
   214279 
   214280 static inline uint32_t ATTRIBUTE_PURE
   214281 WM_STATE_GRFRegisterCount2_start(const struct gen_device_info *devinfo)
   214282 {
   214283    switch (devinfo->gen) {
   214284    case 10: return 0;
   214285    case 9: return 0;
   214286    case 8: return 0;
   214287    case 7:
   214288       if (devinfo->is_haswell) {
   214289          return 0;
   214290       } else {
   214291          return 0;
   214292       }
   214293    case 6: return 0;
   214294    case 5: return 289;
   214295    case 4:
   214296       if (devinfo->is_g4x) {
   214297          return 0;
   214298       } else {
   214299          return 0;
   214300       }
   214301    default:
   214302       unreachable("Invalid hardware generation");
   214303    }
   214304 }
   214305 
   214306 
   214307 
   214308 /* WM_STATE::GRF Register Count 3 */
   214309 
   214310 
   214311 #define GEN5_WM_STATE_GRFRegisterCount3_bits  3
   214312 
   214313 static inline uint32_t ATTRIBUTE_PURE
   214314 WM_STATE_GRFRegisterCount3_bits(const struct gen_device_info *devinfo)
   214315 {
   214316    switch (devinfo->gen) {
   214317    case 10: return 0;
   214318    case 9: return 0;
   214319    case 8: return 0;
   214320    case 7:
   214321       if (devinfo->is_haswell) {
   214322          return 0;
   214323       } else {
   214324          return 0;
   214325       }
   214326    case 6: return 0;
   214327    case 5: return 3;
   214328    case 4:
   214329       if (devinfo->is_g4x) {
   214330          return 0;
   214331       } else {
   214332          return 0;
   214333       }
   214334    default:
   214335       unreachable("Invalid hardware generation");
   214336    }
   214337 }
   214338 
   214339 
   214340 
   214341 #define GEN5_WM_STATE_GRFRegisterCount3_start  321
   214342 
   214343 static inline uint32_t ATTRIBUTE_PURE
   214344 WM_STATE_GRFRegisterCount3_start(const struct gen_device_info *devinfo)
   214345 {
   214346    switch (devinfo->gen) {
   214347    case 10: return 0;
   214348    case 9: return 0;
   214349    case 8: return 0;
   214350    case 7:
   214351       if (devinfo->is_haswell) {
   214352          return 0;
   214353       } else {
   214354          return 0;
   214355       }
   214356    case 6: return 0;
   214357    case 5: return 321;
   214358    case 4:
   214359       if (devinfo->is_g4x) {
   214360          return 0;
   214361       } else {
   214362          return 0;
   214363       }
   214364    default:
   214365       unreachable("Invalid hardware generation");
   214366    }
   214367 }
   214368 
   214369 
   214370 
   214371 /* WM_STATE::Global Depth Offset Constant */
   214372 
   214373 
   214374 #define GEN5_WM_STATE_GlobalDepthOffsetConstant_bits  32
   214375 #define GEN45_WM_STATE_GlobalDepthOffsetConstant_bits  32
   214376 #define GEN4_WM_STATE_GlobalDepthOffsetConstant_bits  32
   214377 
   214378 static inline uint32_t ATTRIBUTE_PURE
   214379 WM_STATE_GlobalDepthOffsetConstant_bits(const struct gen_device_info *devinfo)
   214380 {
   214381    switch (devinfo->gen) {
   214382    case 10: return 0;
   214383    case 9: return 0;
   214384    case 8: return 0;
   214385    case 7:
   214386       if (devinfo->is_haswell) {
   214387          return 0;
   214388       } else {
   214389          return 0;
   214390       }
   214391    case 6: return 0;
   214392    case 5: return 32;
   214393    case 4:
   214394       if (devinfo->is_g4x) {
   214395          return 32;
   214396       } else {
   214397          return 32;
   214398       }
   214399    default:
   214400       unreachable("Invalid hardware generation");
   214401    }
   214402 }
   214403 
   214404 
   214405 
   214406 #define GEN5_WM_STATE_GlobalDepthOffsetConstant_start  192
   214407 #define GEN45_WM_STATE_GlobalDepthOffsetConstant_start  192
   214408 #define GEN4_WM_STATE_GlobalDepthOffsetConstant_start  192
   214409 
   214410 static inline uint32_t ATTRIBUTE_PURE
   214411 WM_STATE_GlobalDepthOffsetConstant_start(const struct gen_device_info *devinfo)
   214412 {
   214413    switch (devinfo->gen) {
   214414    case 10: return 0;
   214415    case 9: return 0;
   214416    case 8: return 0;
   214417    case 7:
   214418       if (devinfo->is_haswell) {
   214419          return 0;
   214420       } else {
   214421          return 0;
   214422       }
   214423    case 6: return 0;
   214424    case 5: return 192;
   214425    case 4:
   214426       if (devinfo->is_g4x) {
   214427          return 192;
   214428       } else {
   214429          return 192;
   214430       }
   214431    default:
   214432       unreachable("Invalid hardware generation");
   214433    }
   214434 }
   214435 
   214436 
   214437 
   214438 /* WM_STATE::Global Depth Offset Enable */
   214439 
   214440 
   214441 #define GEN5_WM_STATE_GlobalDepthOffsetEnable_bits  1
   214442 #define GEN45_WM_STATE_GlobalDepthOffsetEnable_bits  1
   214443 #define GEN4_WM_STATE_GlobalDepthOffsetEnable_bits  1
   214444 
   214445 static inline uint32_t ATTRIBUTE_PURE
   214446 WM_STATE_GlobalDepthOffsetEnable_bits(const struct gen_device_info *devinfo)
   214447 {
   214448    switch (devinfo->gen) {
   214449    case 10: return 0;
   214450    case 9: return 0;
   214451    case 8: return 0;
   214452    case 7:
   214453       if (devinfo->is_haswell) {
   214454          return 0;
   214455       } else {
   214456          return 0;
   214457       }
   214458    case 6: return 0;
   214459    case 5: return 1;
   214460    case 4:
   214461       if (devinfo->is_g4x) {
   214462          return 1;
   214463       } else {
   214464          return 1;
   214465       }
   214466    default:
   214467       unreachable("Invalid hardware generation");
   214468    }
   214469 }
   214470 
   214471 
   214472 
   214473 #define GEN5_WM_STATE_GlobalDepthOffsetEnable_start  172
   214474 #define GEN45_WM_STATE_GlobalDepthOffsetEnable_start  172
   214475 #define GEN4_WM_STATE_GlobalDepthOffsetEnable_start  172
   214476 
   214477 static inline uint32_t ATTRIBUTE_PURE
   214478 WM_STATE_GlobalDepthOffsetEnable_start(const struct gen_device_info *devinfo)
   214479 {
   214480    switch (devinfo->gen) {
   214481    case 10: return 0;
   214482    case 9: return 0;
   214483    case 8: return 0;
   214484    case 7:
   214485       if (devinfo->is_haswell) {
   214486          return 0;
   214487       } else {
   214488          return 0;
   214489       }
   214490    case 6: return 0;
   214491    case 5: return 172;
   214492    case 4:
   214493       if (devinfo->is_g4x) {
   214494          return 172;
   214495       } else {
   214496          return 172;
   214497       }
   214498    default:
   214499       unreachable("Invalid hardware generation");
   214500    }
   214501 }
   214502 
   214503 
   214504 
   214505 /* WM_STATE::Global Depth Offset Scale */
   214506 
   214507 
   214508 #define GEN5_WM_STATE_GlobalDepthOffsetScale_bits  32
   214509 #define GEN45_WM_STATE_GlobalDepthOffsetScale_bits  32
   214510 #define GEN4_WM_STATE_GlobalDepthOffsetScale_bits  32
   214511 
   214512 static inline uint32_t ATTRIBUTE_PURE
   214513 WM_STATE_GlobalDepthOffsetScale_bits(const struct gen_device_info *devinfo)
   214514 {
   214515    switch (devinfo->gen) {
   214516    case 10: return 0;
   214517    case 9: return 0;
   214518    case 8: return 0;
   214519    case 7:
   214520       if (devinfo->is_haswell) {
   214521          return 0;
   214522       } else {
   214523          return 0;
   214524       }
   214525    case 6: return 0;
   214526    case 5: return 32;
   214527    case 4:
   214528       if (devinfo->is_g4x) {
   214529          return 32;
   214530       } else {
   214531          return 32;
   214532       }
   214533    default:
   214534       unreachable("Invalid hardware generation");
   214535    }
   214536 }
   214537 
   214538 
   214539 
   214540 #define GEN5_WM_STATE_GlobalDepthOffsetScale_start  224
   214541 #define GEN45_WM_STATE_GlobalDepthOffsetScale_start  224
   214542 #define GEN4_WM_STATE_GlobalDepthOffsetScale_start  224
   214543 
   214544 static inline uint32_t ATTRIBUTE_PURE
   214545 WM_STATE_GlobalDepthOffsetScale_start(const struct gen_device_info *devinfo)
   214546 {
   214547    switch (devinfo->gen) {
   214548    case 10: return 0;
   214549    case 9: return 0;
   214550    case 8: return 0;
   214551    case 7:
   214552       if (devinfo->is_haswell) {
   214553          return 0;
   214554       } else {
   214555          return 0;
   214556       }
   214557    case 6: return 0;
   214558    case 5: return 224;
   214559    case 4:
   214560       if (devinfo->is_g4x) {
   214561          return 224;
   214562       } else {
   214563          return 224;
   214564       }
   214565    default:
   214566       unreachable("Invalid hardware generation");
   214567    }
   214568 }
   214569 
   214570 
   214571 
   214572 /* WM_STATE::Hierarchical Depth Buffer Resolve Enable */
   214573 
   214574 
   214575 #define GEN5_WM_STATE_HierarchicalDepthBufferResolveEnable_bits  1
   214576 
   214577 static inline uint32_t ATTRIBUTE_PURE
   214578 WM_STATE_HierarchicalDepthBufferResolveEnable_bits(const struct gen_device_info *devinfo)
   214579 {
   214580    switch (devinfo->gen) {
   214581    case 10: return 0;
   214582    case 9: return 0;
   214583    case 8: return 0;
   214584    case 7:
   214585       if (devinfo->is_haswell) {
   214586          return 0;
   214587       } else {
   214588          return 0;
   214589       }
   214590    case 6: return 0;
   214591    case 5: return 1;
   214592    case 4:
   214593       if (devinfo->is_g4x) {
   214594          return 0;
   214595       } else {
   214596          return 0;
   214597       }
   214598    default:
   214599       unreachable("Invalid hardware generation");
   214600    }
   214601 }
   214602 
   214603 
   214604 
   214605 #define GEN5_WM_STATE_HierarchicalDepthBufferResolveEnable_start  169
   214606 
   214607 static inline uint32_t ATTRIBUTE_PURE
   214608 WM_STATE_HierarchicalDepthBufferResolveEnable_start(const struct gen_device_info *devinfo)
   214609 {
   214610    switch (devinfo->gen) {
   214611    case 10: return 0;
   214612    case 9: return 0;
   214613    case 8: return 0;
   214614    case 7:
   214615       if (devinfo->is_haswell) {
   214616          return 0;
   214617       } else {
   214618          return 0;
   214619       }
   214620    case 6: return 0;
   214621    case 5: return 169;
   214622    case 4:
   214623       if (devinfo->is_g4x) {
   214624          return 0;
   214625       } else {
   214626          return 0;
   214627       }
   214628    default:
   214629       unreachable("Invalid hardware generation");
   214630    }
   214631 }
   214632 
   214633 
   214634 
   214635 /* WM_STATE::Illegal Opcode Exception Enable */
   214636 
   214637 
   214638 #define GEN5_WM_STATE_IllegalOpcodeExceptionEnable_bits  1
   214639 #define GEN45_WM_STATE_IllegalOpcodeExceptionEnable_bits  1
   214640 #define GEN4_WM_STATE_IllegalOpcodeExceptionEnable_bits  1
   214641 
   214642 static inline uint32_t ATTRIBUTE_PURE
   214643 WM_STATE_IllegalOpcodeExceptionEnable_bits(const struct gen_device_info *devinfo)
   214644 {
   214645    switch (devinfo->gen) {
   214646    case 10: return 0;
   214647    case 9: return 0;
   214648    case 8: return 0;
   214649    case 7:
   214650       if (devinfo->is_haswell) {
   214651          return 0;
   214652       } else {
   214653          return 0;
   214654       }
   214655    case 6: return 0;
   214656    case 5: return 1;
   214657    case 4:
   214658       if (devinfo->is_g4x) {
   214659          return 1;
   214660       } else {
   214661          return 1;
   214662       }
   214663    default:
   214664       unreachable("Invalid hardware generation");
   214665    }
   214666 }
   214667 
   214668 
   214669 
   214670 #define GEN5_WM_STATE_IllegalOpcodeExceptionEnable_start  36
   214671 #define GEN45_WM_STATE_IllegalOpcodeExceptionEnable_start  36
   214672 #define GEN4_WM_STATE_IllegalOpcodeExceptionEnable_start  36
   214673 
   214674 static inline uint32_t ATTRIBUTE_PURE
   214675 WM_STATE_IllegalOpcodeExceptionEnable_start(const struct gen_device_info *devinfo)
   214676 {
   214677    switch (devinfo->gen) {
   214678    case 10: return 0;
   214679    case 9: return 0;
   214680    case 8: return 0;
   214681    case 7:
   214682       if (devinfo->is_haswell) {
   214683          return 0;
   214684       } else {
   214685          return 0;
   214686       }
   214687    case 6: return 0;
   214688    case 5: return 36;
   214689    case 4:
   214690       if (devinfo->is_g4x) {
   214691          return 36;
   214692       } else {
   214693          return 36;
   214694       }
   214695    default:
   214696       unreachable("Invalid hardware generation");
   214697    }
   214698 }
   214699 
   214700 
   214701 
   214702 /* WM_STATE::Kernel Start Pointer 0 */
   214703 
   214704 
   214705 #define GEN5_WM_STATE_KernelStartPointer0_bits  26
   214706 #define GEN45_WM_STATE_KernelStartPointer0_bits  26
   214707 #define GEN4_WM_STATE_KernelStartPointer0_bits  26
   214708 
   214709 static inline uint32_t ATTRIBUTE_PURE
   214710 WM_STATE_KernelStartPointer0_bits(const struct gen_device_info *devinfo)
   214711 {
   214712    switch (devinfo->gen) {
   214713    case 10: return 0;
   214714    case 9: return 0;
   214715    case 8: return 0;
   214716    case 7:
   214717       if (devinfo->is_haswell) {
   214718          return 0;
   214719       } else {
   214720          return 0;
   214721       }
   214722    case 6: return 0;
   214723    case 5: return 26;
   214724    case 4:
   214725       if (devinfo->is_g4x) {
   214726          return 26;
   214727       } else {
   214728          return 26;
   214729       }
   214730    default:
   214731       unreachable("Invalid hardware generation");
   214732    }
   214733 }
   214734 
   214735 
   214736 
   214737 #define GEN5_WM_STATE_KernelStartPointer0_start  6
   214738 #define GEN45_WM_STATE_KernelStartPointer0_start  6
   214739 #define GEN4_WM_STATE_KernelStartPointer0_start  6
   214740 
   214741 static inline uint32_t ATTRIBUTE_PURE
   214742 WM_STATE_KernelStartPointer0_start(const struct gen_device_info *devinfo)
   214743 {
   214744    switch (devinfo->gen) {
   214745    case 10: return 0;
   214746    case 9: return 0;
   214747    case 8: return 0;
   214748    case 7:
   214749       if (devinfo->is_haswell) {
   214750          return 0;
   214751       } else {
   214752          return 0;
   214753       }
   214754    case 6: return 0;
   214755    case 5: return 6;
   214756    case 4:
   214757       if (devinfo->is_g4x) {
   214758          return 6;
   214759       } else {
   214760          return 6;
   214761       }
   214762    default:
   214763       unreachable("Invalid hardware generation");
   214764    }
   214765 }
   214766 
   214767 
   214768 
   214769 /* WM_STATE::Kernel Start Pointer 1 */
   214770 
   214771 
   214772 #define GEN5_WM_STATE_KernelStartPointer1_bits  26
   214773 
   214774 static inline uint32_t ATTRIBUTE_PURE
   214775 WM_STATE_KernelStartPointer1_bits(const struct gen_device_info *devinfo)
   214776 {
   214777    switch (devinfo->gen) {
   214778    case 10: return 0;
   214779    case 9: return 0;
   214780    case 8: return 0;
   214781    case 7:
   214782       if (devinfo->is_haswell) {
   214783          return 0;
   214784       } else {
   214785          return 0;
   214786       }
   214787    case 6: return 0;
   214788    case 5: return 26;
   214789    case 4:
   214790       if (devinfo->is_g4x) {
   214791          return 0;
   214792       } else {
   214793          return 0;
   214794       }
   214795    default:
   214796       unreachable("Invalid hardware generation");
   214797    }
   214798 }
   214799 
   214800 
   214801 
   214802 #define GEN5_WM_STATE_KernelStartPointer1_start  262
   214803 
   214804 static inline uint32_t ATTRIBUTE_PURE
   214805 WM_STATE_KernelStartPointer1_start(const struct gen_device_info *devinfo)
   214806 {
   214807    switch (devinfo->gen) {
   214808    case 10: return 0;
   214809    case 9: return 0;
   214810    case 8: return 0;
   214811    case 7:
   214812       if (devinfo->is_haswell) {
   214813          return 0;
   214814       } else {
   214815          return 0;
   214816       }
   214817    case 6: return 0;
   214818    case 5: return 262;
   214819    case 4:
   214820       if (devinfo->is_g4x) {
   214821          return 0;
   214822       } else {
   214823          return 0;
   214824       }
   214825    default:
   214826       unreachable("Invalid hardware generation");
   214827    }
   214828 }
   214829 
   214830 
   214831 
   214832 /* WM_STATE::Kernel Start Pointer 2 */
   214833 
   214834 
   214835 #define GEN5_WM_STATE_KernelStartPointer2_bits  26
   214836 
   214837 static inline uint32_t ATTRIBUTE_PURE
   214838 WM_STATE_KernelStartPointer2_bits(const struct gen_device_info *devinfo)
   214839 {
   214840    switch (devinfo->gen) {
   214841    case 10: return 0;
   214842    case 9: return 0;
   214843    case 8: return 0;
   214844    case 7:
   214845       if (devinfo->is_haswell) {
   214846          return 0;
   214847       } else {
   214848          return 0;
   214849       }
   214850    case 6: return 0;
   214851    case 5: return 26;
   214852    case 4:
   214853       if (devinfo->is_g4x) {
   214854          return 0;
   214855       } else {
   214856          return 0;
   214857       }
   214858    default:
   214859       unreachable("Invalid hardware generation");
   214860    }
   214861 }
   214862 
   214863 
   214864 
   214865 #define GEN5_WM_STATE_KernelStartPointer2_start  294
   214866 
   214867 static inline uint32_t ATTRIBUTE_PURE
   214868 WM_STATE_KernelStartPointer2_start(const struct gen_device_info *devinfo)
   214869 {
   214870    switch (devinfo->gen) {
   214871    case 10: return 0;
   214872    case 9: return 0;
   214873    case 8: return 0;
   214874    case 7:
   214875       if (devinfo->is_haswell) {
   214876          return 0;
   214877       } else {
   214878          return 0;
   214879       }
   214880    case 6: return 0;
   214881    case 5: return 294;
   214882    case 4:
   214883       if (devinfo->is_g4x) {
   214884          return 0;
   214885       } else {
   214886          return 0;
   214887       }
   214888    default:
   214889       unreachable("Invalid hardware generation");
   214890    }
   214891 }
   214892 
   214893 
   214894 
   214895 /* WM_STATE::Kernel Start Pointer 3 */
   214896 
   214897 
   214898 #define GEN5_WM_STATE_KernelStartPointer3_bits  26
   214899 
   214900 static inline uint32_t ATTRIBUTE_PURE
   214901 WM_STATE_KernelStartPointer3_bits(const struct gen_device_info *devinfo)
   214902 {
   214903    switch (devinfo->gen) {
   214904    case 10: return 0;
   214905    case 9: return 0;
   214906    case 8: return 0;
   214907    case 7:
   214908       if (devinfo->is_haswell) {
   214909          return 0;
   214910       } else {
   214911          return 0;
   214912       }
   214913    case 6: return 0;
   214914    case 5: return 26;
   214915    case 4:
   214916       if (devinfo->is_g4x) {
   214917          return 0;
   214918       } else {
   214919          return 0;
   214920       }
   214921    default:
   214922       unreachable("Invalid hardware generation");
   214923    }
   214924 }
   214925 
   214926 
   214927 
   214928 #define GEN5_WM_STATE_KernelStartPointer3_start  326
   214929 
   214930 static inline uint32_t ATTRIBUTE_PURE
   214931 WM_STATE_KernelStartPointer3_start(const struct gen_device_info *devinfo)
   214932 {
   214933    switch (devinfo->gen) {
   214934    case 10: return 0;
   214935    case 9: return 0;
   214936    case 8: return 0;
   214937    case 7:
   214938       if (devinfo->is_haswell) {
   214939          return 0;
   214940       } else {
   214941          return 0;
   214942       }
   214943    case 6: return 0;
   214944    case 5: return 326;
   214945    case 4:
   214946       if (devinfo->is_g4x) {
   214947          return 0;
   214948       } else {
   214949          return 0;
   214950       }
   214951    default:
   214952       unreachable("Invalid hardware generation");
   214953    }
   214954 }
   214955 
   214956 
   214957 
   214958 /* WM_STATE::Legacy Diamond Line Rasterization */
   214959 
   214960 
   214961 #define GEN5_WM_STATE_LegacyDiamondLineRasterization_bits  1
   214962 #define GEN45_WM_STATE_LegacyDiamondLineRasterization_bits  1
   214963 #define GEN4_WM_STATE_LegacyDiamondLineRasterization_bits  1
   214964 
   214965 static inline uint32_t ATTRIBUTE_PURE
   214966 WM_STATE_LegacyDiamondLineRasterization_bits(const struct gen_device_info *devinfo)
   214967 {
   214968    switch (devinfo->gen) {
   214969    case 10: return 0;
   214970    case 9: return 0;
   214971    case 8: return 0;
   214972    case 7:
   214973       if (devinfo->is_haswell) {
   214974          return 0;
   214975       } else {
   214976          return 0;
   214977       }
   214978    case 6: return 0;
   214979    case 5: return 1;
   214980    case 4:
   214981       if (devinfo->is_g4x) {
   214982          return 1;
   214983       } else {
   214984          return 1;
   214985       }
   214986    default:
   214987       unreachable("Invalid hardware generation");
   214988    }
   214989 }
   214990 
   214991 
   214992 
   214993 #define GEN5_WM_STATE_LegacyDiamondLineRasterization_start  183
   214994 #define GEN45_WM_STATE_LegacyDiamondLineRasterization_start  183
   214995 #define GEN4_WM_STATE_LegacyDiamondLineRasterization_start  183
   214996 
   214997 static inline uint32_t ATTRIBUTE_PURE
   214998 WM_STATE_LegacyDiamondLineRasterization_start(const struct gen_device_info *devinfo)
   214999 {
   215000    switch (devinfo->gen) {
   215001    case 10: return 0;
   215002    case 9: return 0;
   215003    case 8: return 0;
   215004    case 7:
   215005       if (devinfo->is_haswell) {
   215006          return 0;
   215007       } else {
   215008          return 0;
   215009       }
   215010    case 6: return 0;
   215011    case 5: return 183;
   215012    case 4:
   215013       if (devinfo->is_g4x) {
   215014          return 183;
   215015       } else {
   215016          return 183;
   215017       }
   215018    default:
   215019       unreachable("Invalid hardware generation");
   215020    }
   215021 }
   215022 
   215023 
   215024 
   215025 /* WM_STATE::Legacy Global Depth Bias Enable */
   215026 
   215027 
   215028 #define GEN5_WM_STATE_LegacyGlobalDepthBiasEnable_bits  1
   215029 #define GEN45_WM_STATE_LegacyGlobalDepthBiasEnable_bits  1
   215030 #define GEN4_WM_STATE_LegacyGlobalDepthBiasEnable_bits  1
   215031 
   215032 static inline uint32_t ATTRIBUTE_PURE
   215033 WM_STATE_LegacyGlobalDepthBiasEnable_bits(const struct gen_device_info *devinfo)
   215034 {
   215035    switch (devinfo->gen) {
   215036    case 10: return 0;
   215037    case 9: return 0;
   215038    case 8: return 0;
   215039    case 7:
   215040       if (devinfo->is_haswell) {
   215041          return 0;
   215042       } else {
   215043          return 0;
   215044       }
   215045    case 6: return 0;
   215046    case 5: return 1;
   215047    case 4:
   215048       if (devinfo->is_g4x) {
   215049          return 1;
   215050       } else {
   215051          return 1;
   215052       }
   215053    default:
   215054       unreachable("Invalid hardware generation");
   215055    }
   215056 }
   215057 
   215058 
   215059 
   215060 #define GEN5_WM_STATE_LegacyGlobalDepthBiasEnable_start  170
   215061 #define GEN45_WM_STATE_LegacyGlobalDepthBiasEnable_start  170
   215062 #define GEN4_WM_STATE_LegacyGlobalDepthBiasEnable_start  170
   215063 
   215064 static inline uint32_t ATTRIBUTE_PURE
   215065 WM_STATE_LegacyGlobalDepthBiasEnable_start(const struct gen_device_info *devinfo)
   215066 {
   215067    switch (devinfo->gen) {
   215068    case 10: return 0;
   215069    case 9: return 0;
   215070    case 8: return 0;
   215071    case 7:
   215072       if (devinfo->is_haswell) {
   215073          return 0;
   215074       } else {
   215075          return 0;
   215076       }
   215077    case 6: return 0;
   215078    case 5: return 170;
   215079    case 4:
   215080       if (devinfo->is_g4x) {
   215081          return 170;
   215082       } else {
   215083          return 170;
   215084       }
   215085    default:
   215086       unreachable("Invalid hardware generation");
   215087    }
   215088 }
   215089 
   215090 
   215091 
   215092 /* WM_STATE::Line Antialiasing Region Width */
   215093 
   215094 
   215095 #define GEN5_WM_STATE_LineAntialiasingRegionWidth_bits  2
   215096 #define GEN45_WM_STATE_LineAntialiasingRegionWidth_bits  2
   215097 #define GEN4_WM_STATE_LineAntialiasingRegionWidth_bits  2
   215098 
   215099 static inline uint32_t ATTRIBUTE_PURE
   215100 WM_STATE_LineAntialiasingRegionWidth_bits(const struct gen_device_info *devinfo)
   215101 {
   215102    switch (devinfo->gen) {
   215103    case 10: return 0;
   215104    case 9: return 0;
   215105    case 8: return 0;
   215106    case 7:
   215107       if (devinfo->is_haswell) {
   215108          return 0;
   215109       } else {
   215110          return 0;
   215111       }
   215112    case 6: return 0;
   215113    case 5: return 2;
   215114    case 4:
   215115       if (devinfo->is_g4x) {
   215116          return 2;
   215117       } else {
   215118          return 2;
   215119       }
   215120    default:
   215121       unreachable("Invalid hardware generation");
   215122    }
   215123 }
   215124 
   215125 
   215126 
   215127 #define GEN5_WM_STATE_LineAntialiasingRegionWidth_start  174
   215128 #define GEN45_WM_STATE_LineAntialiasingRegionWidth_start  174
   215129 #define GEN4_WM_STATE_LineAntialiasingRegionWidth_start  174
   215130 
   215131 static inline uint32_t ATTRIBUTE_PURE
   215132 WM_STATE_LineAntialiasingRegionWidth_start(const struct gen_device_info *devinfo)
   215133 {
   215134    switch (devinfo->gen) {
   215135    case 10: return 0;
   215136    case 9: return 0;
   215137    case 8: return 0;
   215138    case 7:
   215139       if (devinfo->is_haswell) {
   215140          return 0;
   215141       } else {
   215142          return 0;
   215143       }
   215144    case 6: return 0;
   215145    case 5: return 174;
   215146    case 4:
   215147       if (devinfo->is_g4x) {
   215148          return 174;
   215149       } else {
   215150          return 174;
   215151       }
   215152    default:
   215153       unreachable("Invalid hardware generation");
   215154    }
   215155 }
   215156 
   215157 
   215158 
   215159 /* WM_STATE::Line End Cap Antialiasing Region Width */
   215160 
   215161 
   215162 #define GEN5_WM_STATE_LineEndCapAntialiasingRegionWidth_bits  2
   215163 #define GEN45_WM_STATE_LineEndCapAntialiasingRegionWidth_bits  2
   215164 #define GEN4_WM_STATE_LineEndCapAntialiasingRegionWidth_bits  2
   215165 
   215166 static inline uint32_t ATTRIBUTE_PURE
   215167 WM_STATE_LineEndCapAntialiasingRegionWidth_bits(const struct gen_device_info *devinfo)
   215168 {
   215169    switch (devinfo->gen) {
   215170    case 10: return 0;
   215171    case 9: return 0;
   215172    case 8: return 0;
   215173    case 7:
   215174       if (devinfo->is_haswell) {
   215175          return 0;
   215176       } else {
   215177          return 0;
   215178       }
   215179    case 6: return 0;
   215180    case 5: return 2;
   215181    case 4:
   215182       if (devinfo->is_g4x) {
   215183          return 2;
   215184       } else {
   215185          return 2;
   215186       }
   215187    default:
   215188       unreachable("Invalid hardware generation");
   215189    }
   215190 }
   215191 
   215192 
   215193 
   215194 #define GEN5_WM_STATE_LineEndCapAntialiasingRegionWidth_start  176
   215195 #define GEN45_WM_STATE_LineEndCapAntialiasingRegionWidth_start  176
   215196 #define GEN4_WM_STATE_LineEndCapAntialiasingRegionWidth_start  176
   215197 
   215198 static inline uint32_t ATTRIBUTE_PURE
   215199 WM_STATE_LineEndCapAntialiasingRegionWidth_start(const struct gen_device_info *devinfo)
   215200 {
   215201    switch (devinfo->gen) {
   215202    case 10: return 0;
   215203    case 9: return 0;
   215204    case 8: return 0;
   215205    case 7:
   215206       if (devinfo->is_haswell) {
   215207          return 0;
   215208       } else {
   215209          return 0;
   215210       }
   215211    case 6: return 0;
   215212    case 5: return 176;
   215213    case 4:
   215214       if (devinfo->is_g4x) {
   215215          return 176;
   215216       } else {
   215217          return 176;
   215218       }
   215219    default:
   215220       unreachable("Invalid hardware generation");
   215221    }
   215222 }
   215223 
   215224 
   215225 
   215226 /* WM_STATE::Line Stipple Enable */
   215227 
   215228 
   215229 #define GEN5_WM_STATE_LineStippleEnable_bits  1
   215230 #define GEN45_WM_STATE_LineStippleEnable_bits  1
   215231 #define GEN4_WM_STATE_LineStippleEnable_bits  1
   215232 
   215233 static inline uint32_t ATTRIBUTE_PURE
   215234 WM_STATE_LineStippleEnable_bits(const struct gen_device_info *devinfo)
   215235 {
   215236    switch (devinfo->gen) {
   215237    case 10: return 0;
   215238    case 9: return 0;
   215239    case 8: return 0;
   215240    case 7:
   215241       if (devinfo->is_haswell) {
   215242          return 0;
   215243       } else {
   215244          return 0;
   215245       }
   215246    case 6: return 0;
   215247    case 5: return 1;
   215248    case 4:
   215249       if (devinfo->is_g4x) {
   215250          return 1;
   215251       } else {
   215252          return 1;
   215253       }
   215254    default:
   215255       unreachable("Invalid hardware generation");
   215256    }
   215257 }
   215258 
   215259 
   215260 
   215261 #define GEN5_WM_STATE_LineStippleEnable_start  171
   215262 #define GEN45_WM_STATE_LineStippleEnable_start  171
   215263 #define GEN4_WM_STATE_LineStippleEnable_start  171
   215264 
   215265 static inline uint32_t ATTRIBUTE_PURE
   215266 WM_STATE_LineStippleEnable_start(const struct gen_device_info *devinfo)
   215267 {
   215268    switch (devinfo->gen) {
   215269    case 10: return 0;
   215270    case 9: return 0;
   215271    case 8: return 0;
   215272    case 7:
   215273       if (devinfo->is_haswell) {
   215274          return 0;
   215275       } else {
   215276          return 0;
   215277       }
   215278    case 6: return 0;
   215279    case 5: return 171;
   215280    case 4:
   215281       if (devinfo->is_g4x) {
   215282          return 171;
   215283       } else {
   215284          return 171;
   215285       }
   215286    default:
   215287       unreachable("Invalid hardware generation");
   215288    }
   215289 }
   215290 
   215291 
   215292 
   215293 /* WM_STATE::Mask Stack Exception Enable */
   215294 
   215295 
   215296 #define GEN5_WM_STATE_MaskStackExceptionEnable_bits  1
   215297 #define GEN45_WM_STATE_MaskStackExceptionEnable_bits  1
   215298 #define GEN4_WM_STATE_MaskStackExceptionEnable_bits  1
   215299 
   215300 static inline uint32_t ATTRIBUTE_PURE
   215301 WM_STATE_MaskStackExceptionEnable_bits(const struct gen_device_info *devinfo)
   215302 {
   215303    switch (devinfo->gen) {
   215304    case 10: return 0;
   215305    case 9: return 0;
   215306    case 8: return 0;
   215307    case 7:
   215308       if (devinfo->is_haswell) {
   215309          return 0;
   215310       } else {
   215311          return 0;
   215312       }
   215313    case 6: return 0;
   215314    case 5: return 1;
   215315    case 4:
   215316       if (devinfo->is_g4x) {
   215317          return 1;
   215318       } else {
   215319          return 1;
   215320       }
   215321    default:
   215322       unreachable("Invalid hardware generation");
   215323    }
   215324 }
   215325 
   215326 
   215327 
   215328 #define GEN5_WM_STATE_MaskStackExceptionEnable_start  34
   215329 #define GEN45_WM_STATE_MaskStackExceptionEnable_start  34
   215330 #define GEN4_WM_STATE_MaskStackExceptionEnable_start  34
   215331 
   215332 static inline uint32_t ATTRIBUTE_PURE
   215333 WM_STATE_MaskStackExceptionEnable_start(const struct gen_device_info *devinfo)
   215334 {
   215335    switch (devinfo->gen) {
   215336    case 10: return 0;
   215337    case 9: return 0;
   215338    case 8: return 0;
   215339    case 7:
   215340       if (devinfo->is_haswell) {
   215341          return 0;
   215342       } else {
   215343          return 0;
   215344       }
   215345    case 6: return 0;
   215346    case 5: return 34;
   215347    case 4:
   215348       if (devinfo->is_g4x) {
   215349          return 34;
   215350       } else {
   215351          return 34;
   215352       }
   215353    default:
   215354       unreachable("Invalid hardware generation");
   215355    }
   215356 }
   215357 
   215358 
   215359 
   215360 /* WM_STATE::Maximum Number of Threads */
   215361 
   215362 
   215363 #define GEN5_WM_STATE_MaximumNumberofThreads_bits  7
   215364 #define GEN45_WM_STATE_MaximumNumberofThreads_bits  7
   215365 #define GEN4_WM_STATE_MaximumNumberofThreads_bits  7
   215366 
   215367 static inline uint32_t ATTRIBUTE_PURE
   215368 WM_STATE_MaximumNumberofThreads_bits(const struct gen_device_info *devinfo)
   215369 {
   215370    switch (devinfo->gen) {
   215371    case 10: return 0;
   215372    case 9: return 0;
   215373    case 8: return 0;
   215374    case 7:
   215375       if (devinfo->is_haswell) {
   215376          return 0;
   215377       } else {
   215378          return 0;
   215379       }
   215380    case 6: return 0;
   215381    case 5: return 7;
   215382    case 4:
   215383       if (devinfo->is_g4x) {
   215384          return 7;
   215385       } else {
   215386          return 7;
   215387       }
   215388    default:
   215389       unreachable("Invalid hardware generation");
   215390    }
   215391 }
   215392 
   215393 
   215394 
   215395 #define GEN5_WM_STATE_MaximumNumberofThreads_start  185
   215396 #define GEN45_WM_STATE_MaximumNumberofThreads_start  185
   215397 #define GEN4_WM_STATE_MaximumNumberofThreads_start  185
   215398 
   215399 static inline uint32_t ATTRIBUTE_PURE
   215400 WM_STATE_MaximumNumberofThreads_start(const struct gen_device_info *devinfo)
   215401 {
   215402    switch (devinfo->gen) {
   215403    case 10: return 0;
   215404    case 9: return 0;
   215405    case 8: return 0;
   215406    case 7:
   215407       if (devinfo->is_haswell) {
   215408          return 0;
   215409       } else {
   215410          return 0;
   215411       }
   215412    case 6: return 0;
   215413    case 5: return 185;
   215414    case 4:
   215415       if (devinfo->is_g4x) {
   215416          return 185;
   215417       } else {
   215418          return 185;
   215419       }
   215420    default:
   215421       unreachable("Invalid hardware generation");
   215422    }
   215423 }
   215424 
   215425 
   215426 
   215427 /* WM_STATE::Per-Thread Scratch Space */
   215428 
   215429 
   215430 #define GEN5_WM_STATE_PerThreadScratchSpace_bits  4
   215431 #define GEN45_WM_STATE_PerThreadScratchSpace_bits  4
   215432 #define GEN4_WM_STATE_PerThreadScratchSpace_bits  4
   215433 
   215434 static inline uint32_t ATTRIBUTE_PURE
   215435 WM_STATE_PerThreadScratchSpace_bits(const struct gen_device_info *devinfo)
   215436 {
   215437    switch (devinfo->gen) {
   215438    case 10: return 0;
   215439    case 9: return 0;
   215440    case 8: return 0;
   215441    case 7:
   215442       if (devinfo->is_haswell) {
   215443          return 0;
   215444       } else {
   215445          return 0;
   215446       }
   215447    case 6: return 0;
   215448    case 5: return 4;
   215449    case 4:
   215450       if (devinfo->is_g4x) {
   215451          return 4;
   215452       } else {
   215453          return 4;
   215454       }
   215455    default:
   215456       unreachable("Invalid hardware generation");
   215457    }
   215458 }
   215459 
   215460 
   215461 
   215462 #define GEN5_WM_STATE_PerThreadScratchSpace_start  64
   215463 #define GEN45_WM_STATE_PerThreadScratchSpace_start  64
   215464 #define GEN4_WM_STATE_PerThreadScratchSpace_start  64
   215465 
   215466 static inline uint32_t ATTRIBUTE_PURE
   215467 WM_STATE_PerThreadScratchSpace_start(const struct gen_device_info *devinfo)
   215468 {
   215469    switch (devinfo->gen) {
   215470    case 10: return 0;
   215471    case 9: return 0;
   215472    case 8: return 0;
   215473    case 7:
   215474       if (devinfo->is_haswell) {
   215475          return 0;
   215476       } else {
   215477          return 0;
   215478       }
   215479    case 6: return 0;
   215480    case 5: return 64;
   215481    case 4:
   215482       if (devinfo->is_g4x) {
   215483          return 64;
   215484       } else {
   215485          return 64;
   215486       }
   215487    default:
   215488       unreachable("Invalid hardware generation");
   215489    }
   215490 }
   215491 
   215492 
   215493 
   215494 /* WM_STATE::Pixel Shader Computed Depth */
   215495 
   215496 
   215497 #define GEN5_WM_STATE_PixelShaderComputedDepth_bits  1
   215498 #define GEN45_WM_STATE_PixelShaderComputedDepth_bits  1
   215499 #define GEN4_WM_STATE_PixelShaderComputedDepth_bits  1
   215500 
   215501 static inline uint32_t ATTRIBUTE_PURE
   215502 WM_STATE_PixelShaderComputedDepth_bits(const struct gen_device_info *devinfo)
   215503 {
   215504    switch (devinfo->gen) {
   215505    case 10: return 0;
   215506    case 9: return 0;
   215507    case 8: return 0;
   215508    case 7:
   215509       if (devinfo->is_haswell) {
   215510          return 0;
   215511       } else {
   215512          return 0;
   215513       }
   215514    case 6: return 0;
   215515    case 5: return 1;
   215516    case 4:
   215517       if (devinfo->is_g4x) {
   215518          return 1;
   215519       } else {
   215520          return 1;
   215521       }
   215522    default:
   215523       unreachable("Invalid hardware generation");
   215524    }
   215525 }
   215526 
   215527 
   215528 
   215529 #define GEN5_WM_STATE_PixelShaderComputedDepth_start  181
   215530 #define GEN45_WM_STATE_PixelShaderComputedDepth_start  181
   215531 #define GEN4_WM_STATE_PixelShaderComputedDepth_start  181
   215532 
   215533 static inline uint32_t ATTRIBUTE_PURE
   215534 WM_STATE_PixelShaderComputedDepth_start(const struct gen_device_info *devinfo)
   215535 {
   215536    switch (devinfo->gen) {
   215537    case 10: return 0;
   215538    case 9: return 0;
   215539    case 8: return 0;
   215540    case 7:
   215541       if (devinfo->is_haswell) {
   215542          return 0;
   215543       } else {
   215544          return 0;
   215545       }
   215546    case 6: return 0;
   215547    case 5: return 181;
   215548    case 4:
   215549       if (devinfo->is_g4x) {
   215550          return 181;
   215551       } else {
   215552          return 181;
   215553       }
   215554    default:
   215555       unreachable("Invalid hardware generation");
   215556    }
   215557 }
   215558 
   215559 
   215560 
   215561 /* WM_STATE::Pixel Shader Kills Pixel */
   215562 
   215563 
   215564 #define GEN5_WM_STATE_PixelShaderKillsPixel_bits  1
   215565 #define GEN45_WM_STATE_PixelShaderKillsPixel_bits  1
   215566 #define GEN4_WM_STATE_PixelShaderKillsPixel_bits  1
   215567 
   215568 static inline uint32_t ATTRIBUTE_PURE
   215569 WM_STATE_PixelShaderKillsPixel_bits(const struct gen_device_info *devinfo)
   215570 {
   215571    switch (devinfo->gen) {
   215572    case 10: return 0;
   215573    case 9: return 0;
   215574    case 8: return 0;
   215575    case 7:
   215576       if (devinfo->is_haswell) {
   215577          return 0;
   215578       } else {
   215579          return 0;
   215580       }
   215581    case 6: return 0;
   215582    case 5: return 1;
   215583    case 4:
   215584       if (devinfo->is_g4x) {
   215585          return 1;
   215586       } else {
   215587          return 1;
   215588       }
   215589    default:
   215590       unreachable("Invalid hardware generation");
   215591    }
   215592 }
   215593 
   215594 
   215595 
   215596 #define GEN5_WM_STATE_PixelShaderKillsPixel_start  182
   215597 #define GEN45_WM_STATE_PixelShaderKillsPixel_start  182
   215598 #define GEN4_WM_STATE_PixelShaderKillsPixel_start  182
   215599 
   215600 static inline uint32_t ATTRIBUTE_PURE
   215601 WM_STATE_PixelShaderKillsPixel_start(const struct gen_device_info *devinfo)
   215602 {
   215603    switch (devinfo->gen) {
   215604    case 10: return 0;
   215605    case 9: return 0;
   215606    case 8: return 0;
   215607    case 7:
   215608       if (devinfo->is_haswell) {
   215609          return 0;
   215610       } else {
   215611          return 0;
   215612       }
   215613    case 6: return 0;
   215614    case 5: return 182;
   215615    case 4:
   215616       if (devinfo->is_g4x) {
   215617          return 182;
   215618       } else {
   215619          return 182;
   215620       }
   215621    default:
   215622       unreachable("Invalid hardware generation");
   215623    }
   215624 }
   215625 
   215626 
   215627 
   215628 /* WM_STATE::Pixel Shader Uses Source Depth */
   215629 
   215630 
   215631 #define GEN5_WM_STATE_PixelShaderUsesSourceDepth_bits  1
   215632 #define GEN45_WM_STATE_PixelShaderUsesSourceDepth_bits  1
   215633 #define GEN4_WM_STATE_PixelShaderUsesSourceDepth_bits  1
   215634 
   215635 static inline uint32_t ATTRIBUTE_PURE
   215636 WM_STATE_PixelShaderUsesSourceDepth_bits(const struct gen_device_info *devinfo)
   215637 {
   215638    switch (devinfo->gen) {
   215639    case 10: return 0;
   215640    case 9: return 0;
   215641    case 8: return 0;
   215642    case 7:
   215643       if (devinfo->is_haswell) {
   215644          return 0;
   215645       } else {
   215646          return 0;
   215647       }
   215648    case 6: return 0;
   215649    case 5: return 1;
   215650    case 4:
   215651       if (devinfo->is_g4x) {
   215652          return 1;
   215653       } else {
   215654          return 1;
   215655       }
   215656    default:
   215657       unreachable("Invalid hardware generation");
   215658    }
   215659 }
   215660 
   215661 
   215662 
   215663 #define GEN5_WM_STATE_PixelShaderUsesSourceDepth_start  180
   215664 #define GEN45_WM_STATE_PixelShaderUsesSourceDepth_start  180
   215665 #define GEN4_WM_STATE_PixelShaderUsesSourceDepth_start  180
   215666 
   215667 static inline uint32_t ATTRIBUTE_PURE
   215668 WM_STATE_PixelShaderUsesSourceDepth_start(const struct gen_device_info *devinfo)
   215669 {
   215670    switch (devinfo->gen) {
   215671    case 10: return 0;
   215672    case 9: return 0;
   215673    case 8: return 0;
   215674    case 7:
   215675       if (devinfo->is_haswell) {
   215676          return 0;
   215677       } else {
   215678          return 0;
   215679       }
   215680    case 6: return 0;
   215681    case 5: return 180;
   215682    case 4:
   215683       if (devinfo->is_g4x) {
   215684          return 180;
   215685       } else {
   215686          return 180;
   215687       }
   215688    default:
   215689       unreachable("Invalid hardware generation");
   215690    }
   215691 }
   215692 
   215693 
   215694 
   215695 /* WM_STATE::Polygon Stipple Enable */
   215696 
   215697 
   215698 #define GEN5_WM_STATE_PolygonStippleEnable_bits  1
   215699 #define GEN45_WM_STATE_PolygonStippleEnable_bits  1
   215700 #define GEN4_WM_STATE_PolygonStippleEnable_bits  1
   215701 
   215702 static inline uint32_t ATTRIBUTE_PURE
   215703 WM_STATE_PolygonStippleEnable_bits(const struct gen_device_info *devinfo)
   215704 {
   215705    switch (devinfo->gen) {
   215706    case 10: return 0;
   215707    case 9: return 0;
   215708    case 8: return 0;
   215709    case 7:
   215710       if (devinfo->is_haswell) {
   215711          return 0;
   215712       } else {
   215713          return 0;
   215714       }
   215715    case 6: return 0;
   215716    case 5: return 1;
   215717    case 4:
   215718       if (devinfo->is_g4x) {
   215719          return 1;
   215720       } else {
   215721          return 1;
   215722       }
   215723    default:
   215724       unreachable("Invalid hardware generation");
   215725    }
   215726 }
   215727 
   215728 
   215729 
   215730 #define GEN5_WM_STATE_PolygonStippleEnable_start  173
   215731 #define GEN45_WM_STATE_PolygonStippleEnable_start  173
   215732 #define GEN4_WM_STATE_PolygonStippleEnable_start  173
   215733 
   215734 static inline uint32_t ATTRIBUTE_PURE
   215735 WM_STATE_PolygonStippleEnable_start(const struct gen_device_info *devinfo)
   215736 {
   215737    switch (devinfo->gen) {
   215738    case 10: return 0;
   215739    case 9: return 0;
   215740    case 8: return 0;
   215741    case 7:
   215742       if (devinfo->is_haswell) {
   215743          return 0;
   215744       } else {
   215745          return 0;
   215746       }
   215747    case 6: return 0;
   215748    case 5: return 173;
   215749    case 4:
   215750       if (devinfo->is_g4x) {
   215751          return 173;
   215752       } else {
   215753          return 173;
   215754       }
   215755    default:
   215756       unreachable("Invalid hardware generation");
   215757    }
   215758 }
   215759 
   215760 
   215761 
   215762 /* WM_STATE::Sampler Count */
   215763 
   215764 
   215765 #define GEN5_WM_STATE_SamplerCount_bits  3
   215766 #define GEN45_WM_STATE_SamplerCount_bits  3
   215767 #define GEN4_WM_STATE_SamplerCount_bits  3
   215768 
   215769 static inline uint32_t ATTRIBUTE_PURE
   215770 WM_STATE_SamplerCount_bits(const struct gen_device_info *devinfo)
   215771 {
   215772    switch (devinfo->gen) {
   215773    case 10: return 0;
   215774    case 9: return 0;
   215775    case 8: return 0;
   215776    case 7:
   215777       if (devinfo->is_haswell) {
   215778          return 0;
   215779       } else {
   215780          return 0;
   215781       }
   215782    case 6: return 0;
   215783    case 5: return 3;
   215784    case 4:
   215785       if (devinfo->is_g4x) {
   215786          return 3;
   215787       } else {
   215788          return 3;
   215789       }
   215790    default:
   215791       unreachable("Invalid hardware generation");
   215792    }
   215793 }
   215794 
   215795 
   215796 
   215797 #define GEN5_WM_STATE_SamplerCount_start  130
   215798 #define GEN45_WM_STATE_SamplerCount_start  130
   215799 #define GEN4_WM_STATE_SamplerCount_start  130
   215800 
   215801 static inline uint32_t ATTRIBUTE_PURE
   215802 WM_STATE_SamplerCount_start(const struct gen_device_info *devinfo)
   215803 {
   215804    switch (devinfo->gen) {
   215805    case 10: return 0;
   215806    case 9: return 0;
   215807    case 8: return 0;
   215808    case 7:
   215809       if (devinfo->is_haswell) {
   215810          return 0;
   215811       } else {
   215812          return 0;
   215813       }
   215814    case 6: return 0;
   215815    case 5: return 130;
   215816    case 4:
   215817       if (devinfo->is_g4x) {
   215818          return 130;
   215819       } else {
   215820          return 130;
   215821       }
   215822    default:
   215823       unreachable("Invalid hardware generation");
   215824    }
   215825 }
   215826 
   215827 
   215828 
   215829 /* WM_STATE::Sampler State Pointer */
   215830 
   215831 
   215832 #define GEN5_WM_STATE_SamplerStatePointer_bits  27
   215833 #define GEN45_WM_STATE_SamplerStatePointer_bits  27
   215834 #define GEN4_WM_STATE_SamplerStatePointer_bits  27
   215835 
   215836 static inline uint32_t ATTRIBUTE_PURE
   215837 WM_STATE_SamplerStatePointer_bits(const struct gen_device_info *devinfo)
   215838 {
   215839    switch (devinfo->gen) {
   215840    case 10: return 0;
   215841    case 9: return 0;
   215842    case 8: return 0;
   215843    case 7:
   215844       if (devinfo->is_haswell) {
   215845          return 0;
   215846       } else {
   215847          return 0;
   215848       }
   215849    case 6: return 0;
   215850    case 5: return 27;
   215851    case 4:
   215852       if (devinfo->is_g4x) {
   215853          return 27;
   215854       } else {
   215855          return 27;
   215856       }
   215857    default:
   215858       unreachable("Invalid hardware generation");
   215859    }
   215860 }
   215861 
   215862 
   215863 
   215864 #define GEN5_WM_STATE_SamplerStatePointer_start  133
   215865 #define GEN45_WM_STATE_SamplerStatePointer_start  133
   215866 #define GEN4_WM_STATE_SamplerStatePointer_start  133
   215867 
   215868 static inline uint32_t ATTRIBUTE_PURE
   215869 WM_STATE_SamplerStatePointer_start(const struct gen_device_info *devinfo)
   215870 {
   215871    switch (devinfo->gen) {
   215872    case 10: return 0;
   215873    case 9: return 0;
   215874    case 8: return 0;
   215875    case 7:
   215876       if (devinfo->is_haswell) {
   215877          return 0;
   215878       } else {
   215879          return 0;
   215880       }
   215881    case 6: return 0;
   215882    case 5: return 133;
   215883    case 4:
   215884       if (devinfo->is_g4x) {
   215885          return 133;
   215886       } else {
   215887          return 133;
   215888       }
   215889    default:
   215890       unreachable("Invalid hardware generation");
   215891    }
   215892 }
   215893 
   215894 
   215895 
   215896 /* WM_STATE::Scratch Space Base Pointer */
   215897 
   215898 
   215899 #define GEN5_WM_STATE_ScratchSpaceBasePointer_bits  22
   215900 #define GEN45_WM_STATE_ScratchSpaceBasePointer_bits  22
   215901 #define GEN4_WM_STATE_ScratchSpaceBasePointer_bits  22
   215902 
   215903 static inline uint32_t ATTRIBUTE_PURE
   215904 WM_STATE_ScratchSpaceBasePointer_bits(const struct gen_device_info *devinfo)
   215905 {
   215906    switch (devinfo->gen) {
   215907    case 10: return 0;
   215908    case 9: return 0;
   215909    case 8: return 0;
   215910    case 7:
   215911       if (devinfo->is_haswell) {
   215912          return 0;
   215913       } else {
   215914          return 0;
   215915       }
   215916    case 6: return 0;
   215917    case 5: return 22;
   215918    case 4:
   215919       if (devinfo->is_g4x) {
   215920          return 22;
   215921       } else {
   215922          return 22;
   215923       }
   215924    default:
   215925       unreachable("Invalid hardware generation");
   215926    }
   215927 }
   215928 
   215929 
   215930 
   215931 #define GEN5_WM_STATE_ScratchSpaceBasePointer_start  74
   215932 #define GEN45_WM_STATE_ScratchSpaceBasePointer_start  74
   215933 #define GEN4_WM_STATE_ScratchSpaceBasePointer_start  74
   215934 
   215935 static inline uint32_t ATTRIBUTE_PURE
   215936 WM_STATE_ScratchSpaceBasePointer_start(const struct gen_device_info *devinfo)
   215937 {
   215938    switch (devinfo->gen) {
   215939    case 10: return 0;
   215940    case 9: return 0;
   215941    case 8: return 0;
   215942    case 7:
   215943       if (devinfo->is_haswell) {
   215944          return 0;
   215945       } else {
   215946          return 0;
   215947       }
   215948    case 6: return 0;
   215949    case 5: return 74;
   215950    case 4:
   215951       if (devinfo->is_g4x) {
   215952          return 74;
   215953       } else {
   215954          return 74;
   215955       }
   215956    default:
   215957       unreachable("Invalid hardware generation");
   215958    }
   215959 }
   215960 
   215961 
   215962 
   215963 /* WM_STATE::Setup URB Entry Read Length */
   215964 
   215965 
   215966 #define GEN5_WM_STATE_SetupURBEntryReadLength_bits  6
   215967 #define GEN45_WM_STATE_SetupURBEntryReadLength_bits  6
   215968 #define GEN4_WM_STATE_SetupURBEntryReadLength_bits  6
   215969 
   215970 static inline uint32_t ATTRIBUTE_PURE
   215971 WM_STATE_SetupURBEntryReadLength_bits(const struct gen_device_info *devinfo)
   215972 {
   215973    switch (devinfo->gen) {
   215974    case 10: return 0;
   215975    case 9: return 0;
   215976    case 8: return 0;
   215977    case 7:
   215978       if (devinfo->is_haswell) {
   215979          return 0;
   215980       } else {
   215981          return 0;
   215982       }
   215983    case 6: return 0;
   215984    case 5: return 6;
   215985    case 4:
   215986       if (devinfo->is_g4x) {
   215987          return 6;
   215988       } else {
   215989          return 6;
   215990       }
   215991    default:
   215992       unreachable("Invalid hardware generation");
   215993    }
   215994 }
   215995 
   215996 
   215997 
   215998 #define GEN5_WM_STATE_SetupURBEntryReadLength_start  107
   215999 #define GEN45_WM_STATE_SetupURBEntryReadLength_start  107
   216000 #define GEN4_WM_STATE_SetupURBEntryReadLength_start  107
   216001 
   216002 static inline uint32_t ATTRIBUTE_PURE
   216003 WM_STATE_SetupURBEntryReadLength_start(const struct gen_device_info *devinfo)
   216004 {
   216005    switch (devinfo->gen) {
   216006    case 10: return 0;
   216007    case 9: return 0;
   216008    case 8: return 0;
   216009    case 7:
   216010       if (devinfo->is_haswell) {
   216011          return 0;
   216012       } else {
   216013          return 0;
   216014       }
   216015    case 6: return 0;
   216016    case 5: return 107;
   216017    case 4:
   216018       if (devinfo->is_g4x) {
   216019          return 107;
   216020       } else {
   216021          return 107;
   216022       }
   216023    default:
   216024       unreachable("Invalid hardware generation");
   216025    }
   216026 }
   216027 
   216028 
   216029 
   216030 /* WM_STATE::Setup URB Entry Read Offset */
   216031 
   216032 
   216033 #define GEN5_WM_STATE_SetupURBEntryReadOffset_bits  6
   216034 #define GEN45_WM_STATE_SetupURBEntryReadOffset_bits  6
   216035 #define GEN4_WM_STATE_SetupURBEntryReadOffset_bits  6
   216036 
   216037 static inline uint32_t ATTRIBUTE_PURE
   216038 WM_STATE_SetupURBEntryReadOffset_bits(const struct gen_device_info *devinfo)
   216039 {
   216040    switch (devinfo->gen) {
   216041    case 10: return 0;
   216042    case 9: return 0;
   216043    case 8: return 0;
   216044    case 7:
   216045       if (devinfo->is_haswell) {
   216046          return 0;
   216047       } else {
   216048          return 0;
   216049       }
   216050    case 6: return 0;
   216051    case 5: return 6;
   216052    case 4:
   216053       if (devinfo->is_g4x) {
   216054          return 6;
   216055       } else {
   216056          return 6;
   216057       }
   216058    default:
   216059       unreachable("Invalid hardware generation");
   216060    }
   216061 }
   216062 
   216063 
   216064 
   216065 #define GEN5_WM_STATE_SetupURBEntryReadOffset_start  100
   216066 #define GEN45_WM_STATE_SetupURBEntryReadOffset_start  100
   216067 #define GEN4_WM_STATE_SetupURBEntryReadOffset_start  100
   216068 
   216069 static inline uint32_t ATTRIBUTE_PURE
   216070 WM_STATE_SetupURBEntryReadOffset_start(const struct gen_device_info *devinfo)
   216071 {
   216072    switch (devinfo->gen) {
   216073    case 10: return 0;
   216074    case 9: return 0;
   216075    case 8: return 0;
   216076    case 7:
   216077       if (devinfo->is_haswell) {
   216078          return 0;
   216079       } else {
   216080          return 0;
   216081       }
   216082    case 6: return 0;
   216083    case 5: return 100;
   216084    case 4:
   216085       if (devinfo->is_g4x) {
   216086          return 100;
   216087       } else {
   216088          return 100;
   216089       }
   216090    default:
   216091       unreachable("Invalid hardware generation");
   216092    }
   216093 }
   216094 
   216095 
   216096 
   216097 /* WM_STATE::Single Program Flow */
   216098 
   216099 
   216100 #define GEN5_WM_STATE_SingleProgramFlow_bits  1
   216101 #define GEN45_WM_STATE_SingleProgramFlow_bits  1
   216102 #define GEN4_WM_STATE_SingleProgramFlow_bits  1
   216103 
   216104 static inline uint32_t ATTRIBUTE_PURE
   216105 WM_STATE_SingleProgramFlow_bits(const struct gen_device_info *devinfo)
   216106 {
   216107    switch (devinfo->gen) {
   216108    case 10: return 0;
   216109    case 9: return 0;
   216110    case 8: return 0;
   216111    case 7:
   216112       if (devinfo->is_haswell) {
   216113          return 0;
   216114       } else {
   216115          return 0;
   216116       }
   216117    case 6: return 0;
   216118    case 5: return 1;
   216119    case 4:
   216120       if (devinfo->is_g4x) {
   216121          return 1;
   216122       } else {
   216123          return 1;
   216124       }
   216125    default:
   216126       unreachable("Invalid hardware generation");
   216127    }
   216128 }
   216129 
   216130 
   216131 
   216132 #define GEN5_WM_STATE_SingleProgramFlow_start  63
   216133 #define GEN45_WM_STATE_SingleProgramFlow_start  63
   216134 #define GEN4_WM_STATE_SingleProgramFlow_start  63
   216135 
   216136 static inline uint32_t ATTRIBUTE_PURE
   216137 WM_STATE_SingleProgramFlow_start(const struct gen_device_info *devinfo)
   216138 {
   216139    switch (devinfo->gen) {
   216140    case 10: return 0;
   216141    case 9: return 0;
   216142    case 8: return 0;
   216143    case 7:
   216144       if (devinfo->is_haswell) {
   216145          return 0;
   216146       } else {
   216147          return 0;
   216148       }
   216149    case 6: return 0;
   216150    case 5: return 63;
   216151    case 4:
   216152       if (devinfo->is_g4x) {
   216153          return 63;
   216154       } else {
   216155          return 63;
   216156       }
   216157    default:
   216158       unreachable("Invalid hardware generation");
   216159    }
   216160 }
   216161 
   216162 
   216163 
   216164 /* WM_STATE::Software  Exception Enable */
   216165 
   216166 
   216167 #define GEN5_WM_STATE_SoftwareExceptionEnable_bits  1
   216168 #define GEN45_WM_STATE_SoftwareExceptionEnable_bits  1
   216169 #define GEN4_WM_STATE_SoftwareExceptionEnable_bits  1
   216170 
   216171 static inline uint32_t ATTRIBUTE_PURE
   216172 WM_STATE_SoftwareExceptionEnable_bits(const struct gen_device_info *devinfo)
   216173 {
   216174    switch (devinfo->gen) {
   216175    case 10: return 0;
   216176    case 9: return 0;
   216177    case 8: return 0;
   216178    case 7:
   216179       if (devinfo->is_haswell) {
   216180          return 0;
   216181       } else {
   216182          return 0;
   216183       }
   216184    case 6: return 0;
   216185    case 5: return 1;
   216186    case 4:
   216187       if (devinfo->is_g4x) {
   216188          return 1;
   216189       } else {
   216190          return 1;
   216191       }
   216192    default:
   216193       unreachable("Invalid hardware generation");
   216194    }
   216195 }
   216196 
   216197 
   216198 
   216199 #define GEN5_WM_STATE_SoftwareExceptionEnable_start  33
   216200 #define GEN45_WM_STATE_SoftwareExceptionEnable_start  33
   216201 #define GEN4_WM_STATE_SoftwareExceptionEnable_start  33
   216202 
   216203 static inline uint32_t ATTRIBUTE_PURE
   216204 WM_STATE_SoftwareExceptionEnable_start(const struct gen_device_info *devinfo)
   216205 {
   216206    switch (devinfo->gen) {
   216207    case 10: return 0;
   216208    case 9: return 0;
   216209    case 8: return 0;
   216210    case 7:
   216211       if (devinfo->is_haswell) {
   216212          return 0;
   216213       } else {
   216214          return 0;
   216215       }
   216216    case 6: return 0;
   216217    case 5: return 33;
   216218    case 4:
   216219       if (devinfo->is_g4x) {
   216220          return 33;
   216221       } else {
   216222          return 33;
   216223       }
   216224    default:
   216225       unreachable("Invalid hardware generation");
   216226    }
   216227 }
   216228 
   216229 
   216230 
   216231 /* WM_STATE::Statistics Enable */
   216232 
   216233 
   216234 #define GEN5_WM_STATE_StatisticsEnable_bits  1
   216235 #define GEN45_WM_STATE_StatisticsEnable_bits  1
   216236 #define GEN4_WM_STATE_StatisticsEnable_bits  1
   216237 
   216238 static inline uint32_t ATTRIBUTE_PURE
   216239 WM_STATE_StatisticsEnable_bits(const struct gen_device_info *devinfo)
   216240 {
   216241    switch (devinfo->gen) {
   216242    case 10: return 0;
   216243    case 9: return 0;
   216244    case 8: return 0;
   216245    case 7:
   216246       if (devinfo->is_haswell) {
   216247          return 0;
   216248       } else {
   216249          return 0;
   216250       }
   216251    case 6: return 0;
   216252    case 5: return 1;
   216253    case 4:
   216254       if (devinfo->is_g4x) {
   216255          return 1;
   216256       } else {
   216257          return 1;
   216258       }
   216259    default:
   216260       unreachable("Invalid hardware generation");
   216261    }
   216262 }
   216263 
   216264 
   216265 
   216266 #define GEN5_WM_STATE_StatisticsEnable_start  128
   216267 #define GEN45_WM_STATE_StatisticsEnable_start  128
   216268 #define GEN4_WM_STATE_StatisticsEnable_start  128
   216269 
   216270 static inline uint32_t ATTRIBUTE_PURE
   216271 WM_STATE_StatisticsEnable_start(const struct gen_device_info *devinfo)
   216272 {
   216273    switch (devinfo->gen) {
   216274    case 10: return 0;
   216275    case 9: return 0;
   216276    case 8: return 0;
   216277    case 7:
   216278       if (devinfo->is_haswell) {
   216279          return 0;
   216280       } else {
   216281          return 0;
   216282       }
   216283    case 6: return 0;
   216284    case 5: return 128;
   216285    case 4:
   216286       if (devinfo->is_g4x) {
   216287          return 128;
   216288       } else {
   216289          return 128;
   216290       }
   216291    default:
   216292       unreachable("Invalid hardware generation");
   216293    }
   216294 }
   216295 
   216296 
   216297 
   216298 /* WM_STATE::Thread Dispatch Enable */
   216299 
   216300 
   216301 #define GEN5_WM_STATE_ThreadDispatchEnable_bits  1
   216302 #define GEN45_WM_STATE_ThreadDispatchEnable_bits  1
   216303 #define GEN4_WM_STATE_ThreadDispatchEnable_bits  1
   216304 
   216305 static inline uint32_t ATTRIBUTE_PURE
   216306 WM_STATE_ThreadDispatchEnable_bits(const struct gen_device_info *devinfo)
   216307 {
   216308    switch (devinfo->gen) {
   216309    case 10: return 0;
   216310    case 9: return 0;
   216311    case 8: return 0;
   216312    case 7:
   216313       if (devinfo->is_haswell) {
   216314          return 0;
   216315       } else {
   216316          return 0;
   216317       }
   216318    case 6: return 0;
   216319    case 5: return 1;
   216320    case 4:
   216321       if (devinfo->is_g4x) {
   216322          return 1;
   216323       } else {
   216324          return 1;
   216325       }
   216326    default:
   216327       unreachable("Invalid hardware generation");
   216328    }
   216329 }
   216330 
   216331 
   216332 
   216333 #define GEN5_WM_STATE_ThreadDispatchEnable_start  179
   216334 #define GEN45_WM_STATE_ThreadDispatchEnable_start  179
   216335 #define GEN4_WM_STATE_ThreadDispatchEnable_start  179
   216336 
   216337 static inline uint32_t ATTRIBUTE_PURE
   216338 WM_STATE_ThreadDispatchEnable_start(const struct gen_device_info *devinfo)
   216339 {
   216340    switch (devinfo->gen) {
   216341    case 10: return 0;
   216342    case 9: return 0;
   216343    case 8: return 0;
   216344    case 7:
   216345       if (devinfo->is_haswell) {
   216346          return 0;
   216347       } else {
   216348          return 0;
   216349       }
   216350    case 6: return 0;
   216351    case 5: return 179;
   216352    case 4:
   216353       if (devinfo->is_g4x) {
   216354          return 179;
   216355       } else {
   216356          return 179;
   216357       }
   216358    default:
   216359       unreachable("Invalid hardware generation");
   216360    }
   216361 }
   216362 
   216363 
   216364 
   216365 /* WM_STATE::Thread Priority */
   216366 
   216367 
   216368 #define GEN5_WM_STATE_ThreadPriority_bits  1
   216369 #define GEN45_WM_STATE_ThreadPriority_bits  1
   216370 #define GEN4_WM_STATE_ThreadPriority_bits  1
   216371 
   216372 static inline uint32_t ATTRIBUTE_PURE
   216373 WM_STATE_ThreadPriority_bits(const struct gen_device_info *devinfo)
   216374 {
   216375    switch (devinfo->gen) {
   216376    case 10: return 0;
   216377    case 9: return 0;
   216378    case 8: return 0;
   216379    case 7:
   216380       if (devinfo->is_haswell) {
   216381          return 0;
   216382       } else {
   216383          return 0;
   216384       }
   216385    case 6: return 0;
   216386    case 5: return 1;
   216387    case 4:
   216388       if (devinfo->is_g4x) {
   216389          return 1;
   216390       } else {
   216391          return 1;
   216392       }
   216393    default:
   216394       unreachable("Invalid hardware generation");
   216395    }
   216396 }
   216397 
   216398 
   216399 
   216400 #define GEN5_WM_STATE_ThreadPriority_start  49
   216401 #define GEN45_WM_STATE_ThreadPriority_start  49
   216402 #define GEN4_WM_STATE_ThreadPriority_start  49
   216403 
   216404 static inline uint32_t ATTRIBUTE_PURE
   216405 WM_STATE_ThreadPriority_start(const struct gen_device_info *devinfo)
   216406 {
   216407    switch (devinfo->gen) {
   216408    case 10: return 0;
   216409    case 9: return 0;
   216410    case 8: return 0;
   216411    case 7:
   216412       if (devinfo->is_haswell) {
   216413          return 0;
   216414       } else {
   216415          return 0;
   216416       }
   216417    case 6: return 0;
   216418    case 5: return 49;
   216419    case 4:
   216420       if (devinfo->is_g4x) {
   216421          return 49;
   216422       } else {
   216423          return 49;
   216424       }
   216425    default:
   216426       unreachable("Invalid hardware generation");
   216427    }
   216428 }
   216429 
   216430 
   216431 
   216432 /* XY_COLOR_BLT */
   216433 
   216434 
   216435 #define GEN5_XY_COLOR_BLT_length  6
   216436 #define GEN45_XY_COLOR_BLT_length  6
   216437 #define GEN4_XY_COLOR_BLT_length  6
   216438 
   216439 static inline uint32_t ATTRIBUTE_PURE
   216440 XY_COLOR_BLT_length(const struct gen_device_info *devinfo)
   216441 {
   216442    switch (devinfo->gen) {
   216443    case 10: return 0;
   216444    case 9: return 0;
   216445    case 8: return 0;
   216446    case 7:
   216447       if (devinfo->is_haswell) {
   216448          return 0;
   216449       } else {
   216450          return 0;
   216451       }
   216452    case 6: return 0;
   216453    case 5: return 6;
   216454    case 4:
   216455       if (devinfo->is_g4x) {
   216456          return 6;
   216457       } else {
   216458          return 6;
   216459       }
   216460    default:
   216461       unreachable("Invalid hardware generation");
   216462    }
   216463 }
   216464 
   216465 
   216466 
   216467 /* XY_COLOR_BLT::2D Command Opcode */
   216468 
   216469 
   216470 #define GEN5_XY_COLOR_BLT_2DCommandOpcode_bits  7
   216471 #define GEN45_XY_COLOR_BLT_2DCommandOpcode_bits  7
   216472 #define GEN4_XY_COLOR_BLT_2DCommandOpcode_bits  7
   216473 
   216474 static inline uint32_t ATTRIBUTE_PURE
   216475 XY_COLOR_BLT_2DCommandOpcode_bits(const struct gen_device_info *devinfo)
   216476 {
   216477    switch (devinfo->gen) {
   216478    case 10: return 0;
   216479    case 9: return 0;
   216480    case 8: return 0;
   216481    case 7:
   216482       if (devinfo->is_haswell) {
   216483          return 0;
   216484       } else {
   216485          return 0;
   216486       }
   216487    case 6: return 0;
   216488    case 5: return 7;
   216489    case 4:
   216490       if (devinfo->is_g4x) {
   216491          return 7;
   216492       } else {
   216493          return 7;
   216494       }
   216495    default:
   216496       unreachable("Invalid hardware generation");
   216497    }
   216498 }
   216499 
   216500 
   216501 
   216502 #define GEN5_XY_COLOR_BLT_2DCommandOpcode_start  22
   216503 #define GEN45_XY_COLOR_BLT_2DCommandOpcode_start  22
   216504 #define GEN4_XY_COLOR_BLT_2DCommandOpcode_start  22
   216505 
   216506 static inline uint32_t ATTRIBUTE_PURE
   216507 XY_COLOR_BLT_2DCommandOpcode_start(const struct gen_device_info *devinfo)
   216508 {
   216509    switch (devinfo->gen) {
   216510    case 10: return 0;
   216511    case 9: return 0;
   216512    case 8: return 0;
   216513    case 7:
   216514       if (devinfo->is_haswell) {
   216515          return 0;
   216516       } else {
   216517          return 0;
   216518       }
   216519    case 6: return 0;
   216520    case 5: return 22;
   216521    case 4:
   216522       if (devinfo->is_g4x) {
   216523          return 22;
   216524       } else {
   216525          return 22;
   216526       }
   216527    default:
   216528       unreachable("Invalid hardware generation");
   216529    }
   216530 }
   216531 
   216532 
   216533 
   216534 /* XY_COLOR_BLT::32bpp Byte Mask */
   216535 
   216536 
   216537 #define GEN5_XY_COLOR_BLT_32bppByteMask_bits  2
   216538 #define GEN45_XY_COLOR_BLT_32bppByteMask_bits  2
   216539 #define GEN4_XY_COLOR_BLT_32bppByteMask_bits  2
   216540 
   216541 static inline uint32_t ATTRIBUTE_PURE
   216542 XY_COLOR_BLT_32bppByteMask_bits(const struct gen_device_info *devinfo)
   216543 {
   216544    switch (devinfo->gen) {
   216545    case 10: return 0;
   216546    case 9: return 0;
   216547    case 8: return 0;
   216548    case 7:
   216549       if (devinfo->is_haswell) {
   216550          return 0;
   216551       } else {
   216552          return 0;
   216553       }
   216554    case 6: return 0;
   216555    case 5: return 2;
   216556    case 4:
   216557       if (devinfo->is_g4x) {
   216558          return 2;
   216559       } else {
   216560          return 2;
   216561       }
   216562    default:
   216563       unreachable("Invalid hardware generation");
   216564    }
   216565 }
   216566 
   216567 
   216568 
   216569 #define GEN5_XY_COLOR_BLT_32bppByteMask_start  20
   216570 #define GEN45_XY_COLOR_BLT_32bppByteMask_start  20
   216571 #define GEN4_XY_COLOR_BLT_32bppByteMask_start  20
   216572 
   216573 static inline uint32_t ATTRIBUTE_PURE
   216574 XY_COLOR_BLT_32bppByteMask_start(const struct gen_device_info *devinfo)
   216575 {
   216576    switch (devinfo->gen) {
   216577    case 10: return 0;
   216578    case 9: return 0;
   216579    case 8: return 0;
   216580    case 7:
   216581       if (devinfo->is_haswell) {
   216582          return 0;
   216583       } else {
   216584          return 0;
   216585       }
   216586    case 6: return 0;
   216587    case 5: return 20;
   216588    case 4:
   216589       if (devinfo->is_g4x) {
   216590          return 20;
   216591       } else {
   216592          return 20;
   216593       }
   216594    default:
   216595       unreachable("Invalid hardware generation");
   216596    }
   216597 }
   216598 
   216599 
   216600 
   216601 /* XY_COLOR_BLT::Clipping Enabled */
   216602 
   216603 
   216604 #define GEN5_XY_COLOR_BLT_ClippingEnabled_bits  1
   216605 #define GEN45_XY_COLOR_BLT_ClippingEnabled_bits  1
   216606 #define GEN4_XY_COLOR_BLT_ClippingEnabled_bits  1
   216607 
   216608 static inline uint32_t ATTRIBUTE_PURE
   216609 XY_COLOR_BLT_ClippingEnabled_bits(const struct gen_device_info *devinfo)
   216610 {
   216611    switch (devinfo->gen) {
   216612    case 10: return 0;
   216613    case 9: return 0;
   216614    case 8: return 0;
   216615    case 7:
   216616       if (devinfo->is_haswell) {
   216617          return 0;
   216618       } else {
   216619          return 0;
   216620       }
   216621    case 6: return 0;
   216622    case 5: return 1;
   216623    case 4:
   216624       if (devinfo->is_g4x) {
   216625          return 1;
   216626       } else {
   216627          return 1;
   216628       }
   216629    default:
   216630       unreachable("Invalid hardware generation");
   216631    }
   216632 }
   216633 
   216634 
   216635 
   216636 #define GEN5_XY_COLOR_BLT_ClippingEnabled_start  62
   216637 #define GEN45_XY_COLOR_BLT_ClippingEnabled_start  62
   216638 #define GEN4_XY_COLOR_BLT_ClippingEnabled_start  62
   216639 
   216640 static inline uint32_t ATTRIBUTE_PURE
   216641 XY_COLOR_BLT_ClippingEnabled_start(const struct gen_device_info *devinfo)
   216642 {
   216643    switch (devinfo->gen) {
   216644    case 10: return 0;
   216645    case 9: return 0;
   216646    case 8: return 0;
   216647    case 7:
   216648       if (devinfo->is_haswell) {
   216649          return 0;
   216650       } else {
   216651          return 0;
   216652       }
   216653    case 6: return 0;
   216654    case 5: return 62;
   216655    case 4:
   216656       if (devinfo->is_g4x) {
   216657          return 62;
   216658       } else {
   216659          return 62;
   216660       }
   216661    default:
   216662       unreachable("Invalid hardware generation");
   216663    }
   216664 }
   216665 
   216666 
   216667 
   216668 /* XY_COLOR_BLT::Color Depth */
   216669 
   216670 
   216671 #define GEN5_XY_COLOR_BLT_ColorDepth_bits  3
   216672 #define GEN45_XY_COLOR_BLT_ColorDepth_bits  2
   216673 #define GEN4_XY_COLOR_BLT_ColorDepth_bits  2
   216674 
   216675 static inline uint32_t ATTRIBUTE_PURE
   216676 XY_COLOR_BLT_ColorDepth_bits(const struct gen_device_info *devinfo)
   216677 {
   216678    switch (devinfo->gen) {
   216679    case 10: return 0;
   216680    case 9: return 0;
   216681    case 8: return 0;
   216682    case 7:
   216683       if (devinfo->is_haswell) {
   216684          return 0;
   216685       } else {
   216686          return 0;
   216687       }
   216688    case 6: return 0;
   216689    case 5: return 3;
   216690    case 4:
   216691       if (devinfo->is_g4x) {
   216692          return 2;
   216693       } else {
   216694          return 2;
   216695       }
   216696    default:
   216697       unreachable("Invalid hardware generation");
   216698    }
   216699 }
   216700 
   216701 
   216702 
   216703 #define GEN5_XY_COLOR_BLT_ColorDepth_start  56
   216704 #define GEN45_XY_COLOR_BLT_ColorDepth_start  56
   216705 #define GEN4_XY_COLOR_BLT_ColorDepth_start  56
   216706 
   216707 static inline uint32_t ATTRIBUTE_PURE
   216708 XY_COLOR_BLT_ColorDepth_start(const struct gen_device_info *devinfo)
   216709 {
   216710    switch (devinfo->gen) {
   216711    case 10: return 0;
   216712    case 9: return 0;
   216713    case 8: return 0;
   216714    case 7:
   216715       if (devinfo->is_haswell) {
   216716          return 0;
   216717       } else {
   216718          return 0;
   216719       }
   216720    case 6: return 0;
   216721    case 5: return 56;
   216722    case 4:
   216723       if (devinfo->is_g4x) {
   216724          return 56;
   216725       } else {
   216726          return 56;
   216727       }
   216728    default:
   216729       unreachable("Invalid hardware generation");
   216730    }
   216731 }
   216732 
   216733 
   216734 
   216735 /* XY_COLOR_BLT::Command Type */
   216736 
   216737 
   216738 #define GEN5_XY_COLOR_BLT_CommandType_bits  3
   216739 #define GEN45_XY_COLOR_BLT_CommandType_bits  3
   216740 #define GEN4_XY_COLOR_BLT_CommandType_bits  3
   216741 
   216742 static inline uint32_t ATTRIBUTE_PURE
   216743 XY_COLOR_BLT_CommandType_bits(const struct gen_device_info *devinfo)
   216744 {
   216745    switch (devinfo->gen) {
   216746    case 10: return 0;
   216747    case 9: return 0;
   216748    case 8: return 0;
   216749    case 7:
   216750       if (devinfo->is_haswell) {
   216751          return 0;
   216752       } else {
   216753          return 0;
   216754       }
   216755    case 6: return 0;
   216756    case 5: return 3;
   216757    case 4:
   216758       if (devinfo->is_g4x) {
   216759          return 3;
   216760       } else {
   216761          return 3;
   216762       }
   216763    default:
   216764       unreachable("Invalid hardware generation");
   216765    }
   216766 }
   216767 
   216768 
   216769 
   216770 #define GEN5_XY_COLOR_BLT_CommandType_start  29
   216771 #define GEN45_XY_COLOR_BLT_CommandType_start  29
   216772 #define GEN4_XY_COLOR_BLT_CommandType_start  29
   216773 
   216774 static inline uint32_t ATTRIBUTE_PURE
   216775 XY_COLOR_BLT_CommandType_start(const struct gen_device_info *devinfo)
   216776 {
   216777    switch (devinfo->gen) {
   216778    case 10: return 0;
   216779    case 9: return 0;
   216780    case 8: return 0;
   216781    case 7:
   216782       if (devinfo->is_haswell) {
   216783          return 0;
   216784       } else {
   216785          return 0;
   216786       }
   216787    case 6: return 0;
   216788    case 5: return 29;
   216789    case 4:
   216790       if (devinfo->is_g4x) {
   216791          return 29;
   216792       } else {
   216793          return 29;
   216794       }
   216795    default:
   216796       unreachable("Invalid hardware generation");
   216797    }
   216798 }
   216799 
   216800 
   216801 
   216802 /* XY_COLOR_BLT::DWord Length */
   216803 
   216804 
   216805 #define GEN5_XY_COLOR_BLT_DWordLength_bits  8
   216806 #define GEN45_XY_COLOR_BLT_DWordLength_bits  8
   216807 #define GEN4_XY_COLOR_BLT_DWordLength_bits  8
   216808 
   216809 static inline uint32_t ATTRIBUTE_PURE
   216810 XY_COLOR_BLT_DWordLength_bits(const struct gen_device_info *devinfo)
   216811 {
   216812    switch (devinfo->gen) {
   216813    case 10: return 0;
   216814    case 9: return 0;
   216815    case 8: return 0;
   216816    case 7:
   216817       if (devinfo->is_haswell) {
   216818          return 0;
   216819       } else {
   216820          return 0;
   216821       }
   216822    case 6: return 0;
   216823    case 5: return 8;
   216824    case 4:
   216825       if (devinfo->is_g4x) {
   216826          return 8;
   216827       } else {
   216828          return 8;
   216829       }
   216830    default:
   216831       unreachable("Invalid hardware generation");
   216832    }
   216833 }
   216834 
   216835 
   216836 
   216837 #define GEN5_XY_COLOR_BLT_DWordLength_start  0
   216838 #define GEN45_XY_COLOR_BLT_DWordLength_start  0
   216839 #define GEN4_XY_COLOR_BLT_DWordLength_start  0
   216840 
   216841 static inline uint32_t ATTRIBUTE_PURE
   216842 XY_COLOR_BLT_DWordLength_start(const struct gen_device_info *devinfo)
   216843 {
   216844    switch (devinfo->gen) {
   216845    case 10: return 0;
   216846    case 9: return 0;
   216847    case 8: return 0;
   216848    case 7:
   216849       if (devinfo->is_haswell) {
   216850          return 0;
   216851       } else {
   216852          return 0;
   216853       }
   216854    case 6: return 0;
   216855    case 5: return 0;
   216856    case 4:
   216857       if (devinfo->is_g4x) {
   216858          return 0;
   216859       } else {
   216860          return 0;
   216861       }
   216862    default:
   216863       unreachable("Invalid hardware generation");
   216864    }
   216865 }
   216866 
   216867 
   216868 
   216869 /* XY_COLOR_BLT::Destination Base Address */
   216870 
   216871 
   216872 #define GEN5_XY_COLOR_BLT_DestinationBaseAddress_bits  32
   216873 #define GEN45_XY_COLOR_BLT_DestinationBaseAddress_bits  32
   216874 #define GEN4_XY_COLOR_BLT_DestinationBaseAddress_bits  32
   216875 
   216876 static inline uint32_t ATTRIBUTE_PURE
   216877 XY_COLOR_BLT_DestinationBaseAddress_bits(const struct gen_device_info *devinfo)
   216878 {
   216879    switch (devinfo->gen) {
   216880    case 10: return 0;
   216881    case 9: return 0;
   216882    case 8: return 0;
   216883    case 7:
   216884       if (devinfo->is_haswell) {
   216885          return 0;
   216886       } else {
   216887          return 0;
   216888       }
   216889    case 6: return 0;
   216890    case 5: return 32;
   216891    case 4:
   216892       if (devinfo->is_g4x) {
   216893          return 32;
   216894       } else {
   216895          return 32;
   216896       }
   216897    default:
   216898       unreachable("Invalid hardware generation");
   216899    }
   216900 }
   216901 
   216902 
   216903 
   216904 #define GEN5_XY_COLOR_BLT_DestinationBaseAddress_start  128
   216905 #define GEN45_XY_COLOR_BLT_DestinationBaseAddress_start  128
   216906 #define GEN4_XY_COLOR_BLT_DestinationBaseAddress_start  128
   216907 
   216908 static inline uint32_t ATTRIBUTE_PURE
   216909 XY_COLOR_BLT_DestinationBaseAddress_start(const struct gen_device_info *devinfo)
   216910 {
   216911    switch (devinfo->gen) {
   216912    case 10: return 0;
   216913    case 9: return 0;
   216914    case 8: return 0;
   216915    case 7:
   216916       if (devinfo->is_haswell) {
   216917          return 0;
   216918       } else {
   216919          return 0;
   216920       }
   216921    case 6: return 0;
   216922    case 5: return 128;
   216923    case 4:
   216924       if (devinfo->is_g4x) {
   216925          return 128;
   216926       } else {
   216927          return 128;
   216928       }
   216929    default:
   216930       unreachable("Invalid hardware generation");
   216931    }
   216932 }
   216933 
   216934 
   216935 
   216936 /* XY_COLOR_BLT::Destination Pitch */
   216937 
   216938 
   216939 #define GEN5_XY_COLOR_BLT_DestinationPitch_bits  16
   216940 #define GEN45_XY_COLOR_BLT_DestinationPitch_bits  16
   216941 #define GEN4_XY_COLOR_BLT_DestinationPitch_bits  16
   216942 
   216943 static inline uint32_t ATTRIBUTE_PURE
   216944 XY_COLOR_BLT_DestinationPitch_bits(const struct gen_device_info *devinfo)
   216945 {
   216946    switch (devinfo->gen) {
   216947    case 10: return 0;
   216948    case 9: return 0;
   216949    case 8: return 0;
   216950    case 7:
   216951       if (devinfo->is_haswell) {
   216952          return 0;
   216953       } else {
   216954          return 0;
   216955       }
   216956    case 6: return 0;
   216957    case 5: return 16;
   216958    case 4:
   216959       if (devinfo->is_g4x) {
   216960          return 16;
   216961       } else {
   216962          return 16;
   216963       }
   216964    default:
   216965       unreachable("Invalid hardware generation");
   216966    }
   216967 }
   216968 
   216969 
   216970 
   216971 #define GEN5_XY_COLOR_BLT_DestinationPitch_start  32
   216972 #define GEN45_XY_COLOR_BLT_DestinationPitch_start  32
   216973 #define GEN4_XY_COLOR_BLT_DestinationPitch_start  32
   216974 
   216975 static inline uint32_t ATTRIBUTE_PURE
   216976 XY_COLOR_BLT_DestinationPitch_start(const struct gen_device_info *devinfo)
   216977 {
   216978    switch (devinfo->gen) {
   216979    case 10: return 0;
   216980    case 9: return 0;
   216981    case 8: return 0;
   216982    case 7:
   216983       if (devinfo->is_haswell) {
   216984          return 0;
   216985       } else {
   216986          return 0;
   216987       }
   216988    case 6: return 0;
   216989    case 5: return 32;
   216990    case 4:
   216991       if (devinfo->is_g4x) {
   216992          return 32;
   216993       } else {
   216994          return 32;
   216995       }
   216996    default:
   216997       unreachable("Invalid hardware generation");
   216998    }
   216999 }
   217000 
   217001 
   217002 
   217003 /* XY_COLOR_BLT::Destination X1 Coordinate */
   217004 
   217005 
   217006 #define GEN5_XY_COLOR_BLT_DestinationX1Coordinate_bits  16
   217007 #define GEN45_XY_COLOR_BLT_DestinationX1Coordinate_bits  16
   217008 #define GEN4_XY_COLOR_BLT_DestinationX1Coordinate_bits  16
   217009 
   217010 static inline uint32_t ATTRIBUTE_PURE
   217011 XY_COLOR_BLT_DestinationX1Coordinate_bits(const struct gen_device_info *devinfo)
   217012 {
   217013    switch (devinfo->gen) {
   217014    case 10: return 0;
   217015    case 9: return 0;
   217016    case 8: return 0;
   217017    case 7:
   217018       if (devinfo->is_haswell) {
   217019          return 0;
   217020       } else {
   217021          return 0;
   217022       }
   217023    case 6: return 0;
   217024    case 5: return 16;
   217025    case 4:
   217026       if (devinfo->is_g4x) {
   217027          return 16;
   217028       } else {
   217029          return 16;
   217030       }
   217031    default:
   217032       unreachable("Invalid hardware generation");
   217033    }
   217034 }
   217035 
   217036 
   217037 
   217038 #define GEN5_XY_COLOR_BLT_DestinationX1Coordinate_start  64
   217039 #define GEN45_XY_COLOR_BLT_DestinationX1Coordinate_start  64
   217040 #define GEN4_XY_COLOR_BLT_DestinationX1Coordinate_start  64
   217041 
   217042 static inline uint32_t ATTRIBUTE_PURE
   217043 XY_COLOR_BLT_DestinationX1Coordinate_start(const struct gen_device_info *devinfo)
   217044 {
   217045    switch (devinfo->gen) {
   217046    case 10: return 0;
   217047    case 9: return 0;
   217048    case 8: return 0;
   217049    case 7:
   217050       if (devinfo->is_haswell) {
   217051          return 0;
   217052       } else {
   217053          return 0;
   217054       }
   217055    case 6: return 0;
   217056    case 5: return 64;
   217057    case 4:
   217058       if (devinfo->is_g4x) {
   217059          return 64;
   217060       } else {
   217061          return 64;
   217062       }
   217063    default:
   217064       unreachable("Invalid hardware generation");
   217065    }
   217066 }
   217067 
   217068 
   217069 
   217070 /* XY_COLOR_BLT::Destination X2 Coordinate */
   217071 
   217072 
   217073 #define GEN5_XY_COLOR_BLT_DestinationX2Coordinate_bits  16
   217074 #define GEN45_XY_COLOR_BLT_DestinationX2Coordinate_bits  16
   217075 #define GEN4_XY_COLOR_BLT_DestinationX2Coordinate_bits  16
   217076 
   217077 static inline uint32_t ATTRIBUTE_PURE
   217078 XY_COLOR_BLT_DestinationX2Coordinate_bits(const struct gen_device_info *devinfo)
   217079 {
   217080    switch (devinfo->gen) {
   217081    case 10: return 0;
   217082    case 9: return 0;
   217083    case 8: return 0;
   217084    case 7:
   217085       if (devinfo->is_haswell) {
   217086          return 0;
   217087       } else {
   217088          return 0;
   217089       }
   217090    case 6: return 0;
   217091    case 5: return 16;
   217092    case 4:
   217093       if (devinfo->is_g4x) {
   217094          return 16;
   217095       } else {
   217096          return 16;
   217097       }
   217098    default:
   217099       unreachable("Invalid hardware generation");
   217100    }
   217101 }
   217102 
   217103 
   217104 
   217105 #define GEN5_XY_COLOR_BLT_DestinationX2Coordinate_start  96
   217106 #define GEN45_XY_COLOR_BLT_DestinationX2Coordinate_start  96
   217107 #define GEN4_XY_COLOR_BLT_DestinationX2Coordinate_start  96
   217108 
   217109 static inline uint32_t ATTRIBUTE_PURE
   217110 XY_COLOR_BLT_DestinationX2Coordinate_start(const struct gen_device_info *devinfo)
   217111 {
   217112    switch (devinfo->gen) {
   217113    case 10: return 0;
   217114    case 9: return 0;
   217115    case 8: return 0;
   217116    case 7:
   217117       if (devinfo->is_haswell) {
   217118          return 0;
   217119       } else {
   217120          return 0;
   217121       }
   217122    case 6: return 0;
   217123    case 5: return 96;
   217124    case 4:
   217125       if (devinfo->is_g4x) {
   217126          return 96;
   217127       } else {
   217128          return 96;
   217129       }
   217130    default:
   217131       unreachable("Invalid hardware generation");
   217132    }
   217133 }
   217134 
   217135 
   217136 
   217137 /* XY_COLOR_BLT::Destination Y1 Coordinate */
   217138 
   217139 
   217140 #define GEN5_XY_COLOR_BLT_DestinationY1Coordinate_bits  16
   217141 #define GEN45_XY_COLOR_BLT_DestinationY1Coordinate_bits  16
   217142 #define GEN4_XY_COLOR_BLT_DestinationY1Coordinate_bits  16
   217143 
   217144 static inline uint32_t ATTRIBUTE_PURE
   217145 XY_COLOR_BLT_DestinationY1Coordinate_bits(const struct gen_device_info *devinfo)
   217146 {
   217147    switch (devinfo->gen) {
   217148    case 10: return 0;
   217149    case 9: return 0;
   217150    case 8: return 0;
   217151    case 7:
   217152       if (devinfo->is_haswell) {
   217153          return 0;
   217154       } else {
   217155          return 0;
   217156       }
   217157    case 6: return 0;
   217158    case 5: return 16;
   217159    case 4:
   217160       if (devinfo->is_g4x) {
   217161          return 16;
   217162       } else {
   217163          return 16;
   217164       }
   217165    default:
   217166       unreachable("Invalid hardware generation");
   217167    }
   217168 }
   217169 
   217170 
   217171 
   217172 #define GEN5_XY_COLOR_BLT_DestinationY1Coordinate_start  80
   217173 #define GEN45_XY_COLOR_BLT_DestinationY1Coordinate_start  80
   217174 #define GEN4_XY_COLOR_BLT_DestinationY1Coordinate_start  80
   217175 
   217176 static inline uint32_t ATTRIBUTE_PURE
   217177 XY_COLOR_BLT_DestinationY1Coordinate_start(const struct gen_device_info *devinfo)
   217178 {
   217179    switch (devinfo->gen) {
   217180    case 10: return 0;
   217181    case 9: return 0;
   217182    case 8: return 0;
   217183    case 7:
   217184       if (devinfo->is_haswell) {
   217185          return 0;
   217186       } else {
   217187          return 0;
   217188       }
   217189    case 6: return 0;
   217190    case 5: return 80;
   217191    case 4:
   217192       if (devinfo->is_g4x) {
   217193          return 80;
   217194       } else {
   217195          return 80;
   217196       }
   217197    default:
   217198       unreachable("Invalid hardware generation");
   217199    }
   217200 }
   217201 
   217202 
   217203 
   217204 /* XY_COLOR_BLT::Destination Y2 Coordinate */
   217205 
   217206 
   217207 #define GEN5_XY_COLOR_BLT_DestinationY2Coordinate_bits  16
   217208 #define GEN45_XY_COLOR_BLT_DestinationY2Coordinate_bits  16
   217209 #define GEN4_XY_COLOR_BLT_DestinationY2Coordinate_bits  16
   217210 
   217211 static inline uint32_t ATTRIBUTE_PURE
   217212 XY_COLOR_BLT_DestinationY2Coordinate_bits(const struct gen_device_info *devinfo)
   217213 {
   217214    switch (devinfo->gen) {
   217215    case 10: return 0;
   217216    case 9: return 0;
   217217    case 8: return 0;
   217218    case 7:
   217219       if (devinfo->is_haswell) {
   217220          return 0;
   217221       } else {
   217222          return 0;
   217223       }
   217224    case 6: return 0;
   217225    case 5: return 16;
   217226    case 4:
   217227       if (devinfo->is_g4x) {
   217228          return 16;
   217229       } else {
   217230          return 16;
   217231       }
   217232    default:
   217233       unreachable("Invalid hardware generation");
   217234    }
   217235 }
   217236 
   217237 
   217238 
   217239 #define GEN5_XY_COLOR_BLT_DestinationY2Coordinate_start  112
   217240 #define GEN45_XY_COLOR_BLT_DestinationY2Coordinate_start  112
   217241 #define GEN4_XY_COLOR_BLT_DestinationY2Coordinate_start  112
   217242 
   217243 static inline uint32_t ATTRIBUTE_PURE
   217244 XY_COLOR_BLT_DestinationY2Coordinate_start(const struct gen_device_info *devinfo)
   217245 {
   217246    switch (devinfo->gen) {
   217247    case 10: return 0;
   217248    case 9: return 0;
   217249    case 8: return 0;
   217250    case 7:
   217251       if (devinfo->is_haswell) {
   217252          return 0;
   217253       } else {
   217254          return 0;
   217255       }
   217256    case 6: return 0;
   217257    case 5: return 112;
   217258    case 4:
   217259       if (devinfo->is_g4x) {
   217260          return 112;
   217261       } else {
   217262          return 112;
   217263       }
   217264    default:
   217265       unreachable("Invalid hardware generation");
   217266    }
   217267 }
   217268 
   217269 
   217270 
   217271 /* XY_COLOR_BLT::Raster Operation */
   217272 
   217273 
   217274 #define GEN5_XY_COLOR_BLT_RasterOperation_bits  8
   217275 #define GEN45_XY_COLOR_BLT_RasterOperation_bits  8
   217276 #define GEN4_XY_COLOR_BLT_RasterOperation_bits  8
   217277 
   217278 static inline uint32_t ATTRIBUTE_PURE
   217279 XY_COLOR_BLT_RasterOperation_bits(const struct gen_device_info *devinfo)
   217280 {
   217281    switch (devinfo->gen) {
   217282    case 10: return 0;
   217283    case 9: return 0;
   217284    case 8: return 0;
   217285    case 7:
   217286       if (devinfo->is_haswell) {
   217287          return 0;
   217288       } else {
   217289          return 0;
   217290       }
   217291    case 6: return 0;
   217292    case 5: return 8;
   217293    case 4:
   217294       if (devinfo->is_g4x) {
   217295          return 8;
   217296       } else {
   217297          return 8;
   217298       }
   217299    default:
   217300       unreachable("Invalid hardware generation");
   217301    }
   217302 }
   217303 
   217304 
   217305 
   217306 #define GEN5_XY_COLOR_BLT_RasterOperation_start  48
   217307 #define GEN45_XY_COLOR_BLT_RasterOperation_start  48
   217308 #define GEN4_XY_COLOR_BLT_RasterOperation_start  48
   217309 
   217310 static inline uint32_t ATTRIBUTE_PURE
   217311 XY_COLOR_BLT_RasterOperation_start(const struct gen_device_info *devinfo)
   217312 {
   217313    switch (devinfo->gen) {
   217314    case 10: return 0;
   217315    case 9: return 0;
   217316    case 8: return 0;
   217317    case 7:
   217318       if (devinfo->is_haswell) {
   217319          return 0;
   217320       } else {
   217321          return 0;
   217322       }
   217323    case 6: return 0;
   217324    case 5: return 48;
   217325    case 4:
   217326       if (devinfo->is_g4x) {
   217327          return 48;
   217328       } else {
   217329          return 48;
   217330       }
   217331    default:
   217332       unreachable("Invalid hardware generation");
   217333    }
   217334 }
   217335 
   217336 
   217337 
   217338 /* XY_COLOR_BLT::Solid Pattern Color */
   217339 
   217340 
   217341 #define GEN5_XY_COLOR_BLT_SolidPatternColor_bits  32
   217342 #define GEN45_XY_COLOR_BLT_SolidPatternColor_bits  32
   217343 #define GEN4_XY_COLOR_BLT_SolidPatternColor_bits  32
   217344 
   217345 static inline uint32_t ATTRIBUTE_PURE
   217346 XY_COLOR_BLT_SolidPatternColor_bits(const struct gen_device_info *devinfo)
   217347 {
   217348    switch (devinfo->gen) {
   217349    case 10: return 0;
   217350    case 9: return 0;
   217351    case 8: return 0;
   217352    case 7:
   217353       if (devinfo->is_haswell) {
   217354          return 0;
   217355       } else {
   217356          return 0;
   217357       }
   217358    case 6: return 0;
   217359    case 5: return 32;
   217360    case 4:
   217361       if (devinfo->is_g4x) {
   217362          return 32;
   217363       } else {
   217364          return 32;
   217365       }
   217366    default:
   217367       unreachable("Invalid hardware generation");
   217368    }
   217369 }
   217370 
   217371 
   217372 
   217373 #define GEN5_XY_COLOR_BLT_SolidPatternColor_start  160
   217374 #define GEN45_XY_COLOR_BLT_SolidPatternColor_start  160
   217375 #define GEN4_XY_COLOR_BLT_SolidPatternColor_start  160
   217376 
   217377 static inline uint32_t ATTRIBUTE_PURE
   217378 XY_COLOR_BLT_SolidPatternColor_start(const struct gen_device_info *devinfo)
   217379 {
   217380    switch (devinfo->gen) {
   217381    case 10: return 0;
   217382    case 9: return 0;
   217383    case 8: return 0;
   217384    case 7:
   217385       if (devinfo->is_haswell) {
   217386          return 0;
   217387       } else {
   217388          return 0;
   217389       }
   217390    case 6: return 0;
   217391    case 5: return 160;
   217392    case 4:
   217393       if (devinfo->is_g4x) {
   217394          return 160;
   217395       } else {
   217396          return 160;
   217397       }
   217398    default:
   217399       unreachable("Invalid hardware generation");
   217400    }
   217401 }
   217402 
   217403 
   217404 
   217405 /* XY_COLOR_BLT::Tiling Enable */
   217406 
   217407 
   217408 #define GEN5_XY_COLOR_BLT_TilingEnable_bits  1
   217409 #define GEN45_XY_COLOR_BLT_TilingEnable_bits  1
   217410 #define GEN4_XY_COLOR_BLT_TilingEnable_bits  1
   217411 
   217412 static inline uint32_t ATTRIBUTE_PURE
   217413 XY_COLOR_BLT_TilingEnable_bits(const struct gen_device_info *devinfo)
   217414 {
   217415    switch (devinfo->gen) {
   217416    case 10: return 0;
   217417    case 9: return 0;
   217418    case 8: return 0;
   217419    case 7:
   217420       if (devinfo->is_haswell) {
   217421          return 0;
   217422       } else {
   217423          return 0;
   217424       }
   217425    case 6: return 0;
   217426    case 5: return 1;
   217427    case 4:
   217428       if (devinfo->is_g4x) {
   217429          return 1;
   217430       } else {
   217431          return 1;
   217432       }
   217433    default:
   217434       unreachable("Invalid hardware generation");
   217435    }
   217436 }
   217437 
   217438 
   217439 
   217440 #define GEN5_XY_COLOR_BLT_TilingEnable_start  11
   217441 #define GEN45_XY_COLOR_BLT_TilingEnable_start  11
   217442 #define GEN4_XY_COLOR_BLT_TilingEnable_start  11
   217443 
   217444 static inline uint32_t ATTRIBUTE_PURE
   217445 XY_COLOR_BLT_TilingEnable_start(const struct gen_device_info *devinfo)
   217446 {
   217447    switch (devinfo->gen) {
   217448    case 10: return 0;
   217449    case 9: return 0;
   217450    case 8: return 0;
   217451    case 7:
   217452       if (devinfo->is_haswell) {
   217453          return 0;
   217454       } else {
   217455          return 0;
   217456       }
   217457    case 6: return 0;
   217458    case 5: return 11;
   217459    case 4:
   217460       if (devinfo->is_g4x) {
   217461          return 11;
   217462       } else {
   217463          return 11;
   217464       }
   217465    default:
   217466       unreachable("Invalid hardware generation");
   217467    }
   217468 }
   217469 
   217470 
   217471 
   217472 /* XY_SETUP_BLT */
   217473 
   217474 
   217475 #define GEN5_XY_SETUP_BLT_length  8
   217476 #define GEN45_XY_SETUP_BLT_length  8
   217477 #define GEN4_XY_SETUP_BLT_length  8
   217478 
   217479 static inline uint32_t ATTRIBUTE_PURE
   217480 XY_SETUP_BLT_length(const struct gen_device_info *devinfo)
   217481 {
   217482    switch (devinfo->gen) {
   217483    case 10: return 0;
   217484    case 9: return 0;
   217485    case 8: return 0;
   217486    case 7:
   217487       if (devinfo->is_haswell) {
   217488          return 0;
   217489       } else {
   217490          return 0;
   217491       }
   217492    case 6: return 0;
   217493    case 5: return 8;
   217494    case 4:
   217495       if (devinfo->is_g4x) {
   217496          return 8;
   217497       } else {
   217498          return 8;
   217499       }
   217500    default:
   217501       unreachable("Invalid hardware generation");
   217502    }
   217503 }
   217504 
   217505 
   217506 
   217507 /* XY_SETUP_BLT::2D Command Opcode */
   217508 
   217509 
   217510 #define GEN5_XY_SETUP_BLT_2DCommandOpcode_bits  7
   217511 #define GEN45_XY_SETUP_BLT_2DCommandOpcode_bits  7
   217512 #define GEN4_XY_SETUP_BLT_2DCommandOpcode_bits  7
   217513 
   217514 static inline uint32_t ATTRIBUTE_PURE
   217515 XY_SETUP_BLT_2DCommandOpcode_bits(const struct gen_device_info *devinfo)
   217516 {
   217517    switch (devinfo->gen) {
   217518    case 10: return 0;
   217519    case 9: return 0;
   217520    case 8: return 0;
   217521    case 7:
   217522       if (devinfo->is_haswell) {
   217523          return 0;
   217524       } else {
   217525          return 0;
   217526       }
   217527    case 6: return 0;
   217528    case 5: return 7;
   217529    case 4:
   217530       if (devinfo->is_g4x) {
   217531          return 7;
   217532       } else {
   217533          return 7;
   217534       }
   217535    default:
   217536       unreachable("Invalid hardware generation");
   217537    }
   217538 }
   217539 
   217540 
   217541 
   217542 #define GEN5_XY_SETUP_BLT_2DCommandOpcode_start  22
   217543 #define GEN45_XY_SETUP_BLT_2DCommandOpcode_start  22
   217544 #define GEN4_XY_SETUP_BLT_2DCommandOpcode_start  22
   217545 
   217546 static inline uint32_t ATTRIBUTE_PURE
   217547 XY_SETUP_BLT_2DCommandOpcode_start(const struct gen_device_info *devinfo)
   217548 {
   217549    switch (devinfo->gen) {
   217550    case 10: return 0;
   217551    case 9: return 0;
   217552    case 8: return 0;
   217553    case 7:
   217554       if (devinfo->is_haswell) {
   217555          return 0;
   217556       } else {
   217557          return 0;
   217558       }
   217559    case 6: return 0;
   217560    case 5: return 22;
   217561    case 4:
   217562       if (devinfo->is_g4x) {
   217563          return 22;
   217564       } else {
   217565          return 22;
   217566       }
   217567    default:
   217568       unreachable("Invalid hardware generation");
   217569    }
   217570 }
   217571 
   217572 
   217573 
   217574 /* XY_SETUP_BLT::32bpp Byte Mask */
   217575 
   217576 
   217577 #define GEN5_XY_SETUP_BLT_32bppByteMask_bits  2
   217578 #define GEN45_XY_SETUP_BLT_32bppByteMask_bits  2
   217579 #define GEN4_XY_SETUP_BLT_32bppByteMask_bits  2
   217580 
   217581 static inline uint32_t ATTRIBUTE_PURE
   217582 XY_SETUP_BLT_32bppByteMask_bits(const struct gen_device_info *devinfo)
   217583 {
   217584    switch (devinfo->gen) {
   217585    case 10: return 0;
   217586    case 9: return 0;
   217587    case 8: return 0;
   217588    case 7:
   217589       if (devinfo->is_haswell) {
   217590          return 0;
   217591       } else {
   217592          return 0;
   217593       }
   217594    case 6: return 0;
   217595    case 5: return 2;
   217596    case 4:
   217597       if (devinfo->is_g4x) {
   217598          return 2;
   217599       } else {
   217600          return 2;
   217601       }
   217602    default:
   217603       unreachable("Invalid hardware generation");
   217604    }
   217605 }
   217606 
   217607 
   217608 
   217609 #define GEN5_XY_SETUP_BLT_32bppByteMask_start  20
   217610 #define GEN45_XY_SETUP_BLT_32bppByteMask_start  20
   217611 #define GEN4_XY_SETUP_BLT_32bppByteMask_start  20
   217612 
   217613 static inline uint32_t ATTRIBUTE_PURE
   217614 XY_SETUP_BLT_32bppByteMask_start(const struct gen_device_info *devinfo)
   217615 {
   217616    switch (devinfo->gen) {
   217617    case 10: return 0;
   217618    case 9: return 0;
   217619    case 8: return 0;
   217620    case 7:
   217621       if (devinfo->is_haswell) {
   217622          return 0;
   217623       } else {
   217624          return 0;
   217625       }
   217626    case 6: return 0;
   217627    case 5: return 20;
   217628    case 4:
   217629       if (devinfo->is_g4x) {
   217630          return 20;
   217631       } else {
   217632          return 20;
   217633       }
   217634    default:
   217635       unreachable("Invalid hardware generation");
   217636    }
   217637 }
   217638 
   217639 
   217640 
   217641 /* XY_SETUP_BLT::Background Color */
   217642 
   217643 
   217644 #define GEN5_XY_SETUP_BLT_BackgroundColor_bits  32
   217645 #define GEN45_XY_SETUP_BLT_BackgroundColor_bits  32
   217646 #define GEN4_XY_SETUP_BLT_BackgroundColor_bits  32
   217647 
   217648 static inline uint32_t ATTRIBUTE_PURE
   217649 XY_SETUP_BLT_BackgroundColor_bits(const struct gen_device_info *devinfo)
   217650 {
   217651    switch (devinfo->gen) {
   217652    case 10: return 0;
   217653    case 9: return 0;
   217654    case 8: return 0;
   217655    case 7:
   217656       if (devinfo->is_haswell) {
   217657          return 0;
   217658       } else {
   217659          return 0;
   217660       }
   217661    case 6: return 0;
   217662    case 5: return 32;
   217663    case 4:
   217664       if (devinfo->is_g4x) {
   217665          return 32;
   217666       } else {
   217667          return 32;
   217668       }
   217669    default:
   217670       unreachable("Invalid hardware generation");
   217671    }
   217672 }
   217673 
   217674 
   217675 
   217676 #define GEN5_XY_SETUP_BLT_BackgroundColor_start  160
   217677 #define GEN45_XY_SETUP_BLT_BackgroundColor_start  160
   217678 #define GEN4_XY_SETUP_BLT_BackgroundColor_start  160
   217679 
   217680 static inline uint32_t ATTRIBUTE_PURE
   217681 XY_SETUP_BLT_BackgroundColor_start(const struct gen_device_info *devinfo)
   217682 {
   217683    switch (devinfo->gen) {
   217684    case 10: return 0;
   217685    case 9: return 0;
   217686    case 8: return 0;
   217687    case 7:
   217688       if (devinfo->is_haswell) {
   217689          return 0;
   217690       } else {
   217691          return 0;
   217692       }
   217693    case 6: return 0;
   217694    case 5: return 160;
   217695    case 4:
   217696       if (devinfo->is_g4x) {
   217697          return 160;
   217698       } else {
   217699          return 160;
   217700       }
   217701    default:
   217702       unreachable("Invalid hardware generation");
   217703    }
   217704 }
   217705 
   217706 
   217707 
   217708 /* XY_SETUP_BLT::ClipRect X1 Coordinate */
   217709 
   217710 
   217711 #define GEN5_XY_SETUP_BLT_ClipRectX1Coordinate_bits  16
   217712 #define GEN45_XY_SETUP_BLT_ClipRectX1Coordinate_bits  16
   217713 #define GEN4_XY_SETUP_BLT_ClipRectX1Coordinate_bits  16
   217714 
   217715 static inline uint32_t ATTRIBUTE_PURE
   217716 XY_SETUP_BLT_ClipRectX1Coordinate_bits(const struct gen_device_info *devinfo)
   217717 {
   217718    switch (devinfo->gen) {
   217719    case 10: return 0;
   217720    case 9: return 0;
   217721    case 8: return 0;
   217722    case 7:
   217723       if (devinfo->is_haswell) {
   217724          return 0;
   217725       } else {
   217726          return 0;
   217727       }
   217728    case 6: return 0;
   217729    case 5: return 16;
   217730    case 4:
   217731       if (devinfo->is_g4x) {
   217732          return 16;
   217733       } else {
   217734          return 16;
   217735       }
   217736    default:
   217737       unreachable("Invalid hardware generation");
   217738    }
   217739 }
   217740 
   217741 
   217742 
   217743 #define GEN5_XY_SETUP_BLT_ClipRectX1Coordinate_start  64
   217744 #define GEN45_XY_SETUP_BLT_ClipRectX1Coordinate_start  64
   217745 #define GEN4_XY_SETUP_BLT_ClipRectX1Coordinate_start  64
   217746 
   217747 static inline uint32_t ATTRIBUTE_PURE
   217748 XY_SETUP_BLT_ClipRectX1Coordinate_start(const struct gen_device_info *devinfo)
   217749 {
   217750    switch (devinfo->gen) {
   217751    case 10: return 0;
   217752    case 9: return 0;
   217753    case 8: return 0;
   217754    case 7:
   217755       if (devinfo->is_haswell) {
   217756          return 0;
   217757       } else {
   217758          return 0;
   217759       }
   217760    case 6: return 0;
   217761    case 5: return 64;
   217762    case 4:
   217763       if (devinfo->is_g4x) {
   217764          return 64;
   217765       } else {
   217766          return 64;
   217767       }
   217768    default:
   217769       unreachable("Invalid hardware generation");
   217770    }
   217771 }
   217772 
   217773 
   217774 
   217775 /* XY_SETUP_BLT::ClipRect X2 Coordinate */
   217776 
   217777 
   217778 #define GEN5_XY_SETUP_BLT_ClipRectX2Coordinate_bits  16
   217779 #define GEN45_XY_SETUP_BLT_ClipRectX2Coordinate_bits  16
   217780 #define GEN4_XY_SETUP_BLT_ClipRectX2Coordinate_bits  16
   217781 
   217782 static inline uint32_t ATTRIBUTE_PURE
   217783 XY_SETUP_BLT_ClipRectX2Coordinate_bits(const struct gen_device_info *devinfo)
   217784 {
   217785    switch (devinfo->gen) {
   217786    case 10: return 0;
   217787    case 9: return 0;
   217788    case 8: return 0;
   217789    case 7:
   217790       if (devinfo->is_haswell) {
   217791          return 0;
   217792       } else {
   217793          return 0;
   217794       }
   217795    case 6: return 0;
   217796    case 5: return 16;
   217797    case 4:
   217798       if (devinfo->is_g4x) {
   217799          return 16;
   217800       } else {
   217801          return 16;
   217802       }
   217803    default:
   217804       unreachable("Invalid hardware generation");
   217805    }
   217806 }
   217807 
   217808 
   217809 
   217810 #define GEN5_XY_SETUP_BLT_ClipRectX2Coordinate_start  96
   217811 #define GEN45_XY_SETUP_BLT_ClipRectX2Coordinate_start  96
   217812 #define GEN4_XY_SETUP_BLT_ClipRectX2Coordinate_start  96
   217813 
   217814 static inline uint32_t ATTRIBUTE_PURE
   217815 XY_SETUP_BLT_ClipRectX2Coordinate_start(const struct gen_device_info *devinfo)
   217816 {
   217817    switch (devinfo->gen) {
   217818    case 10: return 0;
   217819    case 9: return 0;
   217820    case 8: return 0;
   217821    case 7:
   217822       if (devinfo->is_haswell) {
   217823          return 0;
   217824       } else {
   217825          return 0;
   217826       }
   217827    case 6: return 0;
   217828    case 5: return 96;
   217829    case 4:
   217830       if (devinfo->is_g4x) {
   217831          return 96;
   217832       } else {
   217833          return 96;
   217834       }
   217835    default:
   217836       unreachable("Invalid hardware generation");
   217837    }
   217838 }
   217839 
   217840 
   217841 
   217842 /* XY_SETUP_BLT::ClipRect Y1 Coordinate */
   217843 
   217844 
   217845 #define GEN5_XY_SETUP_BLT_ClipRectY1Coordinate_bits  16
   217846 #define GEN45_XY_SETUP_BLT_ClipRectY1Coordinate_bits  16
   217847 #define GEN4_XY_SETUP_BLT_ClipRectY1Coordinate_bits  16
   217848 
   217849 static inline uint32_t ATTRIBUTE_PURE
   217850 XY_SETUP_BLT_ClipRectY1Coordinate_bits(const struct gen_device_info *devinfo)
   217851 {
   217852    switch (devinfo->gen) {
   217853    case 10: return 0;
   217854    case 9: return 0;
   217855    case 8: return 0;
   217856    case 7:
   217857       if (devinfo->is_haswell) {
   217858          return 0;
   217859       } else {
   217860          return 0;
   217861       }
   217862    case 6: return 0;
   217863    case 5: return 16;
   217864    case 4:
   217865       if (devinfo->is_g4x) {
   217866          return 16;
   217867       } else {
   217868          return 16;
   217869       }
   217870    default:
   217871       unreachable("Invalid hardware generation");
   217872    }
   217873 }
   217874 
   217875 
   217876 
   217877 #define GEN5_XY_SETUP_BLT_ClipRectY1Coordinate_start  80
   217878 #define GEN45_XY_SETUP_BLT_ClipRectY1Coordinate_start  80
   217879 #define GEN4_XY_SETUP_BLT_ClipRectY1Coordinate_start  80
   217880 
   217881 static inline uint32_t ATTRIBUTE_PURE
   217882 XY_SETUP_BLT_ClipRectY1Coordinate_start(const struct gen_device_info *devinfo)
   217883 {
   217884    switch (devinfo->gen) {
   217885    case 10: return 0;
   217886    case 9: return 0;
   217887    case 8: return 0;
   217888    case 7:
   217889       if (devinfo->is_haswell) {
   217890          return 0;
   217891       } else {
   217892          return 0;
   217893       }
   217894    case 6: return 0;
   217895    case 5: return 80;
   217896    case 4:
   217897       if (devinfo->is_g4x) {
   217898          return 80;
   217899       } else {
   217900          return 80;
   217901       }
   217902    default:
   217903       unreachable("Invalid hardware generation");
   217904    }
   217905 }
   217906 
   217907 
   217908 
   217909 /* XY_SETUP_BLT::ClipRect Y2 Coordinate */
   217910 
   217911 
   217912 #define GEN5_XY_SETUP_BLT_ClipRectY2Coordinate_bits  16
   217913 #define GEN45_XY_SETUP_BLT_ClipRectY2Coordinate_bits  16
   217914 #define GEN4_XY_SETUP_BLT_ClipRectY2Coordinate_bits  16
   217915 
   217916 static inline uint32_t ATTRIBUTE_PURE
   217917 XY_SETUP_BLT_ClipRectY2Coordinate_bits(const struct gen_device_info *devinfo)
   217918 {
   217919    switch (devinfo->gen) {
   217920    case 10: return 0;
   217921    case 9: return 0;
   217922    case 8: return 0;
   217923    case 7:
   217924       if (devinfo->is_haswell) {
   217925          return 0;
   217926       } else {
   217927          return 0;
   217928       }
   217929    case 6: return 0;
   217930    case 5: return 16;
   217931    case 4:
   217932       if (devinfo->is_g4x) {
   217933          return 16;
   217934       } else {
   217935          return 16;
   217936       }
   217937    default:
   217938       unreachable("Invalid hardware generation");
   217939    }
   217940 }
   217941 
   217942 
   217943 
   217944 #define GEN5_XY_SETUP_BLT_ClipRectY2Coordinate_start  112
   217945 #define GEN45_XY_SETUP_BLT_ClipRectY2Coordinate_start  112
   217946 #define GEN4_XY_SETUP_BLT_ClipRectY2Coordinate_start  112
   217947 
   217948 static inline uint32_t ATTRIBUTE_PURE
   217949 XY_SETUP_BLT_ClipRectY2Coordinate_start(const struct gen_device_info *devinfo)
   217950 {
   217951    switch (devinfo->gen) {
   217952    case 10: return 0;
   217953    case 9: return 0;
   217954    case 8: return 0;
   217955    case 7:
   217956       if (devinfo->is_haswell) {
   217957          return 0;
   217958       } else {
   217959          return 0;
   217960       }
   217961    case 6: return 0;
   217962    case 5: return 112;
   217963    case 4:
   217964       if (devinfo->is_g4x) {
   217965          return 112;
   217966       } else {
   217967          return 112;
   217968       }
   217969    default:
   217970       unreachable("Invalid hardware generation");
   217971    }
   217972 }
   217973 
   217974 
   217975 
   217976 /* XY_SETUP_BLT::Clipping Enabled */
   217977 
   217978 
   217979 #define GEN5_XY_SETUP_BLT_ClippingEnabled_bits  1
   217980 #define GEN45_XY_SETUP_BLT_ClippingEnabled_bits  1
   217981 #define GEN4_XY_SETUP_BLT_ClippingEnabled_bits  1
   217982 
   217983 static inline uint32_t ATTRIBUTE_PURE
   217984 XY_SETUP_BLT_ClippingEnabled_bits(const struct gen_device_info *devinfo)
   217985 {
   217986    switch (devinfo->gen) {
   217987    case 10: return 0;
   217988    case 9: return 0;
   217989    case 8: return 0;
   217990    case 7:
   217991       if (devinfo->is_haswell) {
   217992          return 0;
   217993       } else {
   217994          return 0;
   217995       }
   217996    case 6: return 0;
   217997    case 5: return 1;
   217998    case 4:
   217999       if (devinfo->is_g4x) {
   218000          return 1;
   218001       } else {
   218002          return 1;
   218003       }
   218004    default:
   218005       unreachable("Invalid hardware generation");
   218006    }
   218007 }
   218008 
   218009 
   218010 
   218011 #define GEN5_XY_SETUP_BLT_ClippingEnabled_start  62
   218012 #define GEN45_XY_SETUP_BLT_ClippingEnabled_start  62
   218013 #define GEN4_XY_SETUP_BLT_ClippingEnabled_start  62
   218014 
   218015 static inline uint32_t ATTRIBUTE_PURE
   218016 XY_SETUP_BLT_ClippingEnabled_start(const struct gen_device_info *devinfo)
   218017 {
   218018    switch (devinfo->gen) {
   218019    case 10: return 0;
   218020    case 9: return 0;
   218021    case 8: return 0;
   218022    case 7:
   218023       if (devinfo->is_haswell) {
   218024          return 0;
   218025       } else {
   218026          return 0;
   218027       }
   218028    case 6: return 0;
   218029    case 5: return 62;
   218030    case 4:
   218031       if (devinfo->is_g4x) {
   218032          return 62;
   218033       } else {
   218034          return 62;
   218035       }
   218036    default:
   218037       unreachable("Invalid hardware generation");
   218038    }
   218039 }
   218040 
   218041 
   218042 
   218043 /* XY_SETUP_BLT::Color Depth */
   218044 
   218045 
   218046 #define GEN5_XY_SETUP_BLT_ColorDepth_bits  2
   218047 #define GEN45_XY_SETUP_BLT_ColorDepth_bits  2
   218048 #define GEN4_XY_SETUP_BLT_ColorDepth_bits  2
   218049 
   218050 static inline uint32_t ATTRIBUTE_PURE
   218051 XY_SETUP_BLT_ColorDepth_bits(const struct gen_device_info *devinfo)
   218052 {
   218053    switch (devinfo->gen) {
   218054    case 10: return 0;
   218055    case 9: return 0;
   218056    case 8: return 0;
   218057    case 7:
   218058       if (devinfo->is_haswell) {
   218059          return 0;
   218060       } else {
   218061          return 0;
   218062       }
   218063    case 6: return 0;
   218064    case 5: return 2;
   218065    case 4:
   218066       if (devinfo->is_g4x) {
   218067          return 2;
   218068       } else {
   218069          return 2;
   218070       }
   218071    default:
   218072       unreachable("Invalid hardware generation");
   218073    }
   218074 }
   218075 
   218076 
   218077 
   218078 #define GEN5_XY_SETUP_BLT_ColorDepth_start  56
   218079 #define GEN45_XY_SETUP_BLT_ColorDepth_start  56
   218080 #define GEN4_XY_SETUP_BLT_ColorDepth_start  56
   218081 
   218082 static inline uint32_t ATTRIBUTE_PURE
   218083 XY_SETUP_BLT_ColorDepth_start(const struct gen_device_info *devinfo)
   218084 {
   218085    switch (devinfo->gen) {
   218086    case 10: return 0;
   218087    case 9: return 0;
   218088    case 8: return 0;
   218089    case 7:
   218090       if (devinfo->is_haswell) {
   218091          return 0;
   218092       } else {
   218093          return 0;
   218094       }
   218095    case 6: return 0;
   218096    case 5: return 56;
   218097    case 4:
   218098       if (devinfo->is_g4x) {
   218099          return 56;
   218100       } else {
   218101          return 56;
   218102       }
   218103    default:
   218104       unreachable("Invalid hardware generation");
   218105    }
   218106 }
   218107 
   218108 
   218109 
   218110 /* XY_SETUP_BLT::Command Type */
   218111 
   218112 
   218113 #define GEN5_XY_SETUP_BLT_CommandType_bits  3
   218114 #define GEN45_XY_SETUP_BLT_CommandType_bits  3
   218115 #define GEN4_XY_SETUP_BLT_CommandType_bits  3
   218116 
   218117 static inline uint32_t ATTRIBUTE_PURE
   218118 XY_SETUP_BLT_CommandType_bits(const struct gen_device_info *devinfo)
   218119 {
   218120    switch (devinfo->gen) {
   218121    case 10: return 0;
   218122    case 9: return 0;
   218123    case 8: return 0;
   218124    case 7:
   218125       if (devinfo->is_haswell) {
   218126          return 0;
   218127       } else {
   218128          return 0;
   218129       }
   218130    case 6: return 0;
   218131    case 5: return 3;
   218132    case 4:
   218133       if (devinfo->is_g4x) {
   218134          return 3;
   218135       } else {
   218136          return 3;
   218137       }
   218138    default:
   218139       unreachable("Invalid hardware generation");
   218140    }
   218141 }
   218142 
   218143 
   218144 
   218145 #define GEN5_XY_SETUP_BLT_CommandType_start  29
   218146 #define GEN45_XY_SETUP_BLT_CommandType_start  29
   218147 #define GEN4_XY_SETUP_BLT_CommandType_start  29
   218148 
   218149 static inline uint32_t ATTRIBUTE_PURE
   218150 XY_SETUP_BLT_CommandType_start(const struct gen_device_info *devinfo)
   218151 {
   218152    switch (devinfo->gen) {
   218153    case 10: return 0;
   218154    case 9: return 0;
   218155    case 8: return 0;
   218156    case 7:
   218157       if (devinfo->is_haswell) {
   218158          return 0;
   218159       } else {
   218160          return 0;
   218161       }
   218162    case 6: return 0;
   218163    case 5: return 29;
   218164    case 4:
   218165       if (devinfo->is_g4x) {
   218166          return 29;
   218167       } else {
   218168          return 29;
   218169       }
   218170    default:
   218171       unreachable("Invalid hardware generation");
   218172    }
   218173 }
   218174 
   218175 
   218176 
   218177 /* XY_SETUP_BLT::DWord Length */
   218178 
   218179 
   218180 #define GEN5_XY_SETUP_BLT_DWordLength_bits  8
   218181 #define GEN45_XY_SETUP_BLT_DWordLength_bits  8
   218182 #define GEN4_XY_SETUP_BLT_DWordLength_bits  8
   218183 
   218184 static inline uint32_t ATTRIBUTE_PURE
   218185 XY_SETUP_BLT_DWordLength_bits(const struct gen_device_info *devinfo)
   218186 {
   218187    switch (devinfo->gen) {
   218188    case 10: return 0;
   218189    case 9: return 0;
   218190    case 8: return 0;
   218191    case 7:
   218192       if (devinfo->is_haswell) {
   218193          return 0;
   218194       } else {
   218195          return 0;
   218196       }
   218197    case 6: return 0;
   218198    case 5: return 8;
   218199    case 4:
   218200       if (devinfo->is_g4x) {
   218201          return 8;
   218202       } else {
   218203          return 8;
   218204       }
   218205    default:
   218206       unreachable("Invalid hardware generation");
   218207    }
   218208 }
   218209 
   218210 
   218211 
   218212 #define GEN5_XY_SETUP_BLT_DWordLength_start  0
   218213 #define GEN45_XY_SETUP_BLT_DWordLength_start  0
   218214 #define GEN4_XY_SETUP_BLT_DWordLength_start  0
   218215 
   218216 static inline uint32_t ATTRIBUTE_PURE
   218217 XY_SETUP_BLT_DWordLength_start(const struct gen_device_info *devinfo)
   218218 {
   218219    switch (devinfo->gen) {
   218220    case 10: return 0;
   218221    case 9: return 0;
   218222    case 8: return 0;
   218223    case 7:
   218224       if (devinfo->is_haswell) {
   218225          return 0;
   218226       } else {
   218227          return 0;
   218228       }
   218229    case 6: return 0;
   218230    case 5: return 0;
   218231    case 4:
   218232       if (devinfo->is_g4x) {
   218233          return 0;
   218234       } else {
   218235          return 0;
   218236       }
   218237    default:
   218238       unreachable("Invalid hardware generation");
   218239    }
   218240 }
   218241 
   218242 
   218243 
   218244 /* XY_SETUP_BLT::Destination Base Address */
   218245 
   218246 
   218247 #define GEN5_XY_SETUP_BLT_DestinationBaseAddress_bits  32
   218248 #define GEN45_XY_SETUP_BLT_DestinationBaseAddress_bits  32
   218249 #define GEN4_XY_SETUP_BLT_DestinationBaseAddress_bits  32
   218250 
   218251 static inline uint32_t ATTRIBUTE_PURE
   218252 XY_SETUP_BLT_DestinationBaseAddress_bits(const struct gen_device_info *devinfo)
   218253 {
   218254    switch (devinfo->gen) {
   218255    case 10: return 0;
   218256    case 9: return 0;
   218257    case 8: return 0;
   218258    case 7:
   218259       if (devinfo->is_haswell) {
   218260          return 0;
   218261       } else {
   218262          return 0;
   218263       }
   218264    case 6: return 0;
   218265    case 5: return 32;
   218266    case 4:
   218267       if (devinfo->is_g4x) {
   218268          return 32;
   218269       } else {
   218270          return 32;
   218271       }
   218272    default:
   218273       unreachable("Invalid hardware generation");
   218274    }
   218275 }
   218276 
   218277 
   218278 
   218279 #define GEN5_XY_SETUP_BLT_DestinationBaseAddress_start  128
   218280 #define GEN45_XY_SETUP_BLT_DestinationBaseAddress_start  128
   218281 #define GEN4_XY_SETUP_BLT_DestinationBaseAddress_start  128
   218282 
   218283 static inline uint32_t ATTRIBUTE_PURE
   218284 XY_SETUP_BLT_DestinationBaseAddress_start(const struct gen_device_info *devinfo)
   218285 {
   218286    switch (devinfo->gen) {
   218287    case 10: return 0;
   218288    case 9: return 0;
   218289    case 8: return 0;
   218290    case 7:
   218291       if (devinfo->is_haswell) {
   218292          return 0;
   218293       } else {
   218294          return 0;
   218295       }
   218296    case 6: return 0;
   218297    case 5: return 128;
   218298    case 4:
   218299       if (devinfo->is_g4x) {
   218300          return 128;
   218301       } else {
   218302          return 128;
   218303       }
   218304    default:
   218305       unreachable("Invalid hardware generation");
   218306    }
   218307 }
   218308 
   218309 
   218310 
   218311 /* XY_SETUP_BLT::Destination Pitch */
   218312 
   218313 
   218314 #define GEN5_XY_SETUP_BLT_DestinationPitch_bits  16
   218315 #define GEN45_XY_SETUP_BLT_DestinationPitch_bits  16
   218316 #define GEN4_XY_SETUP_BLT_DestinationPitch_bits  16
   218317 
   218318 static inline uint32_t ATTRIBUTE_PURE
   218319 XY_SETUP_BLT_DestinationPitch_bits(const struct gen_device_info *devinfo)
   218320 {
   218321    switch (devinfo->gen) {
   218322    case 10: return 0;
   218323    case 9: return 0;
   218324    case 8: return 0;
   218325    case 7:
   218326       if (devinfo->is_haswell) {
   218327          return 0;
   218328       } else {
   218329          return 0;
   218330       }
   218331    case 6: return 0;
   218332    case 5: return 16;
   218333    case 4:
   218334       if (devinfo->is_g4x) {
   218335          return 16;
   218336       } else {
   218337          return 16;
   218338       }
   218339    default:
   218340       unreachable("Invalid hardware generation");
   218341    }
   218342 }
   218343 
   218344 
   218345 
   218346 #define GEN5_XY_SETUP_BLT_DestinationPitch_start  32
   218347 #define GEN45_XY_SETUP_BLT_DestinationPitch_start  32
   218348 #define GEN4_XY_SETUP_BLT_DestinationPitch_start  32
   218349 
   218350 static inline uint32_t ATTRIBUTE_PURE
   218351 XY_SETUP_BLT_DestinationPitch_start(const struct gen_device_info *devinfo)
   218352 {
   218353    switch (devinfo->gen) {
   218354    case 10: return 0;
   218355    case 9: return 0;
   218356    case 8: return 0;
   218357    case 7:
   218358       if (devinfo->is_haswell) {
   218359          return 0;
   218360       } else {
   218361          return 0;
   218362       }
   218363    case 6: return 0;
   218364    case 5: return 32;
   218365    case 4:
   218366       if (devinfo->is_g4x) {
   218367          return 32;
   218368       } else {
   218369          return 32;
   218370       }
   218371    default:
   218372       unreachable("Invalid hardware generation");
   218373    }
   218374 }
   218375 
   218376 
   218377 
   218378 /* XY_SETUP_BLT::Foreground Color */
   218379 
   218380 
   218381 #define GEN5_XY_SETUP_BLT_ForegroundColor_bits  32
   218382 #define GEN45_XY_SETUP_BLT_ForegroundColor_bits  32
   218383 #define GEN4_XY_SETUP_BLT_ForegroundColor_bits  32
   218384 
   218385 static inline uint32_t ATTRIBUTE_PURE
   218386 XY_SETUP_BLT_ForegroundColor_bits(const struct gen_device_info *devinfo)
   218387 {
   218388    switch (devinfo->gen) {
   218389    case 10: return 0;
   218390    case 9: return 0;
   218391    case 8: return 0;
   218392    case 7:
   218393       if (devinfo->is_haswell) {
   218394          return 0;
   218395       } else {
   218396          return 0;
   218397       }
   218398    case 6: return 0;
   218399    case 5: return 32;
   218400    case 4:
   218401       if (devinfo->is_g4x) {
   218402          return 32;
   218403       } else {
   218404          return 32;
   218405       }
   218406    default:
   218407       unreachable("Invalid hardware generation");
   218408    }
   218409 }
   218410 
   218411 
   218412 
   218413 #define GEN5_XY_SETUP_BLT_ForegroundColor_start  192
   218414 #define GEN45_XY_SETUP_BLT_ForegroundColor_start  192
   218415 #define GEN4_XY_SETUP_BLT_ForegroundColor_start  192
   218416 
   218417 static inline uint32_t ATTRIBUTE_PURE
   218418 XY_SETUP_BLT_ForegroundColor_start(const struct gen_device_info *devinfo)
   218419 {
   218420    switch (devinfo->gen) {
   218421    case 10: return 0;
   218422    case 9: return 0;
   218423    case 8: return 0;
   218424    case 7:
   218425       if (devinfo->is_haswell) {
   218426          return 0;
   218427       } else {
   218428          return 0;
   218429       }
   218430    case 6: return 0;
   218431    case 5: return 192;
   218432    case 4:
   218433       if (devinfo->is_g4x) {
   218434          return 192;
   218435       } else {
   218436          return 192;
   218437       }
   218438    default:
   218439       unreachable("Invalid hardware generation");
   218440    }
   218441 }
   218442 
   218443 
   218444 
   218445 /* XY_SETUP_BLT::Mono Source Transparency Mode */
   218446 
   218447 
   218448 #define GEN5_XY_SETUP_BLT_MonoSourceTransparencyMode_bits  1
   218449 #define GEN45_XY_SETUP_BLT_MonoSourceTransparencyMode_bits  1
   218450 #define GEN4_XY_SETUP_BLT_MonoSourceTransparencyMode_bits  1
   218451 
   218452 static inline uint32_t ATTRIBUTE_PURE
   218453 XY_SETUP_BLT_MonoSourceTransparencyMode_bits(const struct gen_device_info *devinfo)
   218454 {
   218455    switch (devinfo->gen) {
   218456    case 10: return 0;
   218457    case 9: return 0;
   218458    case 8: return 0;
   218459    case 7:
   218460       if (devinfo->is_haswell) {
   218461          return 0;
   218462       } else {
   218463          return 0;
   218464       }
   218465    case 6: return 0;
   218466    case 5: return 1;
   218467    case 4:
   218468       if (devinfo->is_g4x) {
   218469          return 1;
   218470       } else {
   218471          return 1;
   218472       }
   218473    default:
   218474       unreachable("Invalid hardware generation");
   218475    }
   218476 }
   218477 
   218478 
   218479 
   218480 #define GEN5_XY_SETUP_BLT_MonoSourceTransparencyMode_start  60
   218481 #define GEN45_XY_SETUP_BLT_MonoSourceTransparencyMode_start  61
   218482 #define GEN4_XY_SETUP_BLT_MonoSourceTransparencyMode_start  61
   218483 
   218484 static inline uint32_t ATTRIBUTE_PURE
   218485 XY_SETUP_BLT_MonoSourceTransparencyMode_start(const struct gen_device_info *devinfo)
   218486 {
   218487    switch (devinfo->gen) {
   218488    case 10: return 0;
   218489    case 9: return 0;
   218490    case 8: return 0;
   218491    case 7:
   218492       if (devinfo->is_haswell) {
   218493          return 0;
   218494       } else {
   218495          return 0;
   218496       }
   218497    case 6: return 0;
   218498    case 5: return 60;
   218499    case 4:
   218500       if (devinfo->is_g4x) {
   218501          return 61;
   218502       } else {
   218503          return 61;
   218504       }
   218505    default:
   218506       unreachable("Invalid hardware generation");
   218507    }
   218508 }
   218509 
   218510 
   218511 
   218512 /* XY_SETUP_BLT::Pattern Base Address */
   218513 
   218514 
   218515 #define GEN5_XY_SETUP_BLT_PatternBaseAddress_bits  32
   218516 #define GEN45_XY_SETUP_BLT_PatternBaseAddress_bits  32
   218517 #define GEN4_XY_SETUP_BLT_PatternBaseAddress_bits  32
   218518 
   218519 static inline uint32_t ATTRIBUTE_PURE
   218520 XY_SETUP_BLT_PatternBaseAddress_bits(const struct gen_device_info *devinfo)
   218521 {
   218522    switch (devinfo->gen) {
   218523    case 10: return 0;
   218524    case 9: return 0;
   218525    case 8: return 0;
   218526    case 7:
   218527       if (devinfo->is_haswell) {
   218528          return 0;
   218529       } else {
   218530          return 0;
   218531       }
   218532    case 6: return 0;
   218533    case 5: return 32;
   218534    case 4:
   218535       if (devinfo->is_g4x) {
   218536          return 32;
   218537       } else {
   218538          return 32;
   218539       }
   218540    default:
   218541       unreachable("Invalid hardware generation");
   218542    }
   218543 }
   218544 
   218545 
   218546 
   218547 #define GEN5_XY_SETUP_BLT_PatternBaseAddress_start  224
   218548 #define GEN45_XY_SETUP_BLT_PatternBaseAddress_start  224
   218549 #define GEN4_XY_SETUP_BLT_PatternBaseAddress_start  224
   218550 
   218551 static inline uint32_t ATTRIBUTE_PURE
   218552 XY_SETUP_BLT_PatternBaseAddress_start(const struct gen_device_info *devinfo)
   218553 {
   218554    switch (devinfo->gen) {
   218555    case 10: return 0;
   218556    case 9: return 0;
   218557    case 8: return 0;
   218558    case 7:
   218559       if (devinfo->is_haswell) {
   218560          return 0;
   218561       } else {
   218562          return 0;
   218563       }
   218564    case 6: return 0;
   218565    case 5: return 224;
   218566    case 4:
   218567       if (devinfo->is_g4x) {
   218568          return 224;
   218569       } else {
   218570          return 224;
   218571       }
   218572    default:
   218573       unreachable("Invalid hardware generation");
   218574    }
   218575 }
   218576 
   218577 
   218578 
   218579 /* XY_SETUP_BLT::Raster Operation */
   218580 
   218581 
   218582 #define GEN5_XY_SETUP_BLT_RasterOperation_bits  8
   218583 #define GEN45_XY_SETUP_BLT_RasterOperation_bits  8
   218584 #define GEN4_XY_SETUP_BLT_RasterOperation_bits  8
   218585 
   218586 static inline uint32_t ATTRIBUTE_PURE
   218587 XY_SETUP_BLT_RasterOperation_bits(const struct gen_device_info *devinfo)
   218588 {
   218589    switch (devinfo->gen) {
   218590    case 10: return 0;
   218591    case 9: return 0;
   218592    case 8: return 0;
   218593    case 7:
   218594       if (devinfo->is_haswell) {
   218595          return 0;
   218596       } else {
   218597          return 0;
   218598       }
   218599    case 6: return 0;
   218600    case 5: return 8;
   218601    case 4:
   218602       if (devinfo->is_g4x) {
   218603          return 8;
   218604       } else {
   218605          return 8;
   218606       }
   218607    default:
   218608       unreachable("Invalid hardware generation");
   218609    }
   218610 }
   218611 
   218612 
   218613 
   218614 #define GEN5_XY_SETUP_BLT_RasterOperation_start  48
   218615 #define GEN45_XY_SETUP_BLT_RasterOperation_start  48
   218616 #define GEN4_XY_SETUP_BLT_RasterOperation_start  48
   218617 
   218618 static inline uint32_t ATTRIBUTE_PURE
   218619 XY_SETUP_BLT_RasterOperation_start(const struct gen_device_info *devinfo)
   218620 {
   218621    switch (devinfo->gen) {
   218622    case 10: return 0;
   218623    case 9: return 0;
   218624    case 8: return 0;
   218625    case 7:
   218626       if (devinfo->is_haswell) {
   218627          return 0;
   218628       } else {
   218629          return 0;
   218630       }
   218631    case 6: return 0;
   218632    case 5: return 48;
   218633    case 4:
   218634       if (devinfo->is_g4x) {
   218635          return 48;
   218636       } else {
   218637          return 48;
   218638       }
   218639    default:
   218640       unreachable("Invalid hardware generation");
   218641    }
   218642 }
   218643 
   218644 
   218645 
   218646 /* XY_SETUP_BLT::Tiling Enable */
   218647 
   218648 
   218649 #define GEN5_XY_SETUP_BLT_TilingEnable_bits  1
   218650 #define GEN45_XY_SETUP_BLT_TilingEnable_bits  1
   218651 #define GEN4_XY_SETUP_BLT_TilingEnable_bits  1
   218652 
   218653 static inline uint32_t ATTRIBUTE_PURE
   218654 XY_SETUP_BLT_TilingEnable_bits(const struct gen_device_info *devinfo)
   218655 {
   218656    switch (devinfo->gen) {
   218657    case 10: return 0;
   218658    case 9: return 0;
   218659    case 8: return 0;
   218660    case 7:
   218661       if (devinfo->is_haswell) {
   218662          return 0;
   218663       } else {
   218664          return 0;
   218665       }
   218666    case 6: return 0;
   218667    case 5: return 1;
   218668    case 4:
   218669       if (devinfo->is_g4x) {
   218670          return 1;
   218671       } else {
   218672          return 1;
   218673       }
   218674    default:
   218675       unreachable("Invalid hardware generation");
   218676    }
   218677 }
   218678 
   218679 
   218680 
   218681 #define GEN5_XY_SETUP_BLT_TilingEnable_start  11
   218682 #define GEN45_XY_SETUP_BLT_TilingEnable_start  11
   218683 #define GEN4_XY_SETUP_BLT_TilingEnable_start  11
   218684 
   218685 static inline uint32_t ATTRIBUTE_PURE
   218686 XY_SETUP_BLT_TilingEnable_start(const struct gen_device_info *devinfo)
   218687 {
   218688    switch (devinfo->gen) {
   218689    case 10: return 0;
   218690    case 9: return 0;
   218691    case 8: return 0;
   218692    case 7:
   218693       if (devinfo->is_haswell) {
   218694          return 0;
   218695       } else {
   218696          return 0;
   218697       }
   218698    case 6: return 0;
   218699    case 5: return 11;
   218700    case 4:
   218701       if (devinfo->is_g4x) {
   218702          return 11;
   218703       } else {
   218704          return 11;
   218705       }
   218706    default:
   218707       unreachable("Invalid hardware generation");
   218708    }
   218709 }
   218710 
   218711 
   218712 
   218713 /* XY_SRC_COPY_BLT */
   218714 
   218715 
   218716 #define GEN5_XY_SRC_COPY_BLT_length  8
   218717 #define GEN45_XY_SRC_COPY_BLT_length  8
   218718 #define GEN4_XY_SRC_COPY_BLT_length  8
   218719 
   218720 static inline uint32_t ATTRIBUTE_PURE
   218721 XY_SRC_COPY_BLT_length(const struct gen_device_info *devinfo)
   218722 {
   218723    switch (devinfo->gen) {
   218724    case 10: return 0;
   218725    case 9: return 0;
   218726    case 8: return 0;
   218727    case 7:
   218728       if (devinfo->is_haswell) {
   218729          return 0;
   218730       } else {
   218731          return 0;
   218732       }
   218733    case 6: return 0;
   218734    case 5: return 8;
   218735    case 4:
   218736       if (devinfo->is_g4x) {
   218737          return 8;
   218738       } else {
   218739          return 8;
   218740       }
   218741    default:
   218742       unreachable("Invalid hardware generation");
   218743    }
   218744 }
   218745 
   218746 
   218747 
   218748 /* XY_SRC_COPY_BLT::2D Command Opcode */
   218749 
   218750 
   218751 #define GEN5_XY_SRC_COPY_BLT_2DCommandOpcode_bits  7
   218752 #define GEN45_XY_SRC_COPY_BLT_2DCommandOpcode_bits  7
   218753 #define GEN4_XY_SRC_COPY_BLT_2DCommandOpcode_bits  7
   218754 
   218755 static inline uint32_t ATTRIBUTE_PURE
   218756 XY_SRC_COPY_BLT_2DCommandOpcode_bits(const struct gen_device_info *devinfo)
   218757 {
   218758    switch (devinfo->gen) {
   218759    case 10: return 0;
   218760    case 9: return 0;
   218761    case 8: return 0;
   218762    case 7:
   218763       if (devinfo->is_haswell) {
   218764          return 0;
   218765       } else {
   218766          return 0;
   218767       }
   218768    case 6: return 0;
   218769    case 5: return 7;
   218770    case 4:
   218771       if (devinfo->is_g4x) {
   218772          return 7;
   218773       } else {
   218774          return 7;
   218775       }
   218776    default:
   218777       unreachable("Invalid hardware generation");
   218778    }
   218779 }
   218780 
   218781 
   218782 
   218783 #define GEN5_XY_SRC_COPY_BLT_2DCommandOpcode_start  22
   218784 #define GEN45_XY_SRC_COPY_BLT_2DCommandOpcode_start  22
   218785 #define GEN4_XY_SRC_COPY_BLT_2DCommandOpcode_start  22
   218786 
   218787 static inline uint32_t ATTRIBUTE_PURE
   218788 XY_SRC_COPY_BLT_2DCommandOpcode_start(const struct gen_device_info *devinfo)
   218789 {
   218790    switch (devinfo->gen) {
   218791    case 10: return 0;
   218792    case 9: return 0;
   218793    case 8: return 0;
   218794    case 7:
   218795       if (devinfo->is_haswell) {
   218796          return 0;
   218797       } else {
   218798          return 0;
   218799       }
   218800    case 6: return 0;
   218801    case 5: return 22;
   218802    case 4:
   218803       if (devinfo->is_g4x) {
   218804          return 22;
   218805       } else {
   218806          return 22;
   218807       }
   218808    default:
   218809       unreachable("Invalid hardware generation");
   218810    }
   218811 }
   218812 
   218813 
   218814 
   218815 /* XY_SRC_COPY_BLT::32bpp Byte Mask */
   218816 
   218817 
   218818 #define GEN5_XY_SRC_COPY_BLT_32bppByteMask_bits  2
   218819 #define GEN45_XY_SRC_COPY_BLT_32bppByteMask_bits  2
   218820 #define GEN4_XY_SRC_COPY_BLT_32bppByteMask_bits  2
   218821 
   218822 static inline uint32_t ATTRIBUTE_PURE
   218823 XY_SRC_COPY_BLT_32bppByteMask_bits(const struct gen_device_info *devinfo)
   218824 {
   218825    switch (devinfo->gen) {
   218826    case 10: return 0;
   218827    case 9: return 0;
   218828    case 8: return 0;
   218829    case 7:
   218830       if (devinfo->is_haswell) {
   218831          return 0;
   218832       } else {
   218833          return 0;
   218834       }
   218835    case 6: return 0;
   218836    case 5: return 2;
   218837    case 4:
   218838       if (devinfo->is_g4x) {
   218839          return 2;
   218840       } else {
   218841          return 2;
   218842       }
   218843    default:
   218844       unreachable("Invalid hardware generation");
   218845    }
   218846 }
   218847 
   218848 
   218849 
   218850 #define GEN5_XY_SRC_COPY_BLT_32bppByteMask_start  20
   218851 #define GEN45_XY_SRC_COPY_BLT_32bppByteMask_start  20
   218852 #define GEN4_XY_SRC_COPY_BLT_32bppByteMask_start  20
   218853 
   218854 static inline uint32_t ATTRIBUTE_PURE
   218855 XY_SRC_COPY_BLT_32bppByteMask_start(const struct gen_device_info *devinfo)
   218856 {
   218857    switch (devinfo->gen) {
   218858    case 10: return 0;
   218859    case 9: return 0;
   218860    case 8: return 0;
   218861    case 7:
   218862       if (devinfo->is_haswell) {
   218863          return 0;
   218864       } else {
   218865          return 0;
   218866       }
   218867    case 6: return 0;
   218868    case 5: return 20;
   218869    case 4:
   218870       if (devinfo->is_g4x) {
   218871          return 20;
   218872       } else {
   218873          return 20;
   218874       }
   218875    default:
   218876       unreachable("Invalid hardware generation");
   218877    }
   218878 }
   218879 
   218880 
   218881 
   218882 /* XY_SRC_COPY_BLT::Clipping Enabled */
   218883 
   218884 
   218885 #define GEN5_XY_SRC_COPY_BLT_ClippingEnabled_bits  1
   218886 #define GEN45_XY_SRC_COPY_BLT_ClippingEnabled_bits  1
   218887 #define GEN4_XY_SRC_COPY_BLT_ClippingEnabled_bits  1
   218888 
   218889 static inline uint32_t ATTRIBUTE_PURE
   218890 XY_SRC_COPY_BLT_ClippingEnabled_bits(const struct gen_device_info *devinfo)
   218891 {
   218892    switch (devinfo->gen) {
   218893    case 10: return 0;
   218894    case 9: return 0;
   218895    case 8: return 0;
   218896    case 7:
   218897       if (devinfo->is_haswell) {
   218898          return 0;
   218899       } else {
   218900          return 0;
   218901       }
   218902    case 6: return 0;
   218903    case 5: return 1;
   218904    case 4:
   218905       if (devinfo->is_g4x) {
   218906          return 1;
   218907       } else {
   218908          return 1;
   218909       }
   218910    default:
   218911       unreachable("Invalid hardware generation");
   218912    }
   218913 }
   218914 
   218915 
   218916 
   218917 #define GEN5_XY_SRC_COPY_BLT_ClippingEnabled_start  62
   218918 #define GEN45_XY_SRC_COPY_BLT_ClippingEnabled_start  62
   218919 #define GEN4_XY_SRC_COPY_BLT_ClippingEnabled_start  62
   218920 
   218921 static inline uint32_t ATTRIBUTE_PURE
   218922 XY_SRC_COPY_BLT_ClippingEnabled_start(const struct gen_device_info *devinfo)
   218923 {
   218924    switch (devinfo->gen) {
   218925    case 10: return 0;
   218926    case 9: return 0;
   218927    case 8: return 0;
   218928    case 7:
   218929       if (devinfo->is_haswell) {
   218930          return 0;
   218931       } else {
   218932          return 0;
   218933       }
   218934    case 6: return 0;
   218935    case 5: return 62;
   218936    case 4:
   218937       if (devinfo->is_g4x) {
   218938          return 62;
   218939       } else {
   218940          return 62;
   218941       }
   218942    default:
   218943       unreachable("Invalid hardware generation");
   218944    }
   218945 }
   218946 
   218947 
   218948 
   218949 /* XY_SRC_COPY_BLT::Color Depth */
   218950 
   218951 
   218952 #define GEN5_XY_SRC_COPY_BLT_ColorDepth_bits  3
   218953 #define GEN45_XY_SRC_COPY_BLT_ColorDepth_bits  2
   218954 #define GEN4_XY_SRC_COPY_BLT_ColorDepth_bits  2
   218955 
   218956 static inline uint32_t ATTRIBUTE_PURE
   218957 XY_SRC_COPY_BLT_ColorDepth_bits(const struct gen_device_info *devinfo)
   218958 {
   218959    switch (devinfo->gen) {
   218960    case 10: return 0;
   218961    case 9: return 0;
   218962    case 8: return 0;
   218963    case 7:
   218964       if (devinfo->is_haswell) {
   218965          return 0;
   218966       } else {
   218967          return 0;
   218968       }
   218969    case 6: return 0;
   218970    case 5: return 3;
   218971    case 4:
   218972       if (devinfo->is_g4x) {
   218973          return 2;
   218974       } else {
   218975          return 2;
   218976       }
   218977    default:
   218978       unreachable("Invalid hardware generation");
   218979    }
   218980 }
   218981 
   218982 
   218983 
   218984 #define GEN5_XY_SRC_COPY_BLT_ColorDepth_start  56
   218985 #define GEN45_XY_SRC_COPY_BLT_ColorDepth_start  56
   218986 #define GEN4_XY_SRC_COPY_BLT_ColorDepth_start  56
   218987 
   218988 static inline uint32_t ATTRIBUTE_PURE
   218989 XY_SRC_COPY_BLT_ColorDepth_start(const struct gen_device_info *devinfo)
   218990 {
   218991    switch (devinfo->gen) {
   218992    case 10: return 0;
   218993    case 9: return 0;
   218994    case 8: return 0;
   218995    case 7:
   218996       if (devinfo->is_haswell) {
   218997          return 0;
   218998       } else {
   218999          return 0;
   219000       }
   219001    case 6: return 0;
   219002    case 5: return 56;
   219003    case 4:
   219004       if (devinfo->is_g4x) {
   219005          return 56;
   219006       } else {
   219007          return 56;
   219008       }
   219009    default:
   219010       unreachable("Invalid hardware generation");
   219011    }
   219012 }
   219013 
   219014 
   219015 
   219016 /* XY_SRC_COPY_BLT::Command Type */
   219017 
   219018 
   219019 #define GEN5_XY_SRC_COPY_BLT_CommandType_bits  3
   219020 #define GEN45_XY_SRC_COPY_BLT_CommandType_bits  3
   219021 #define GEN4_XY_SRC_COPY_BLT_CommandType_bits  3
   219022 
   219023 static inline uint32_t ATTRIBUTE_PURE
   219024 XY_SRC_COPY_BLT_CommandType_bits(const struct gen_device_info *devinfo)
   219025 {
   219026    switch (devinfo->gen) {
   219027    case 10: return 0;
   219028    case 9: return 0;
   219029    case 8: return 0;
   219030    case 7:
   219031       if (devinfo->is_haswell) {
   219032          return 0;
   219033       } else {
   219034          return 0;
   219035       }
   219036    case 6: return 0;
   219037    case 5: return 3;
   219038    case 4:
   219039       if (devinfo->is_g4x) {
   219040          return 3;
   219041       } else {
   219042          return 3;
   219043       }
   219044    default:
   219045       unreachable("Invalid hardware generation");
   219046    }
   219047 }
   219048 
   219049 
   219050 
   219051 #define GEN5_XY_SRC_COPY_BLT_CommandType_start  29
   219052 #define GEN45_XY_SRC_COPY_BLT_CommandType_start  29
   219053 #define GEN4_XY_SRC_COPY_BLT_CommandType_start  29
   219054 
   219055 static inline uint32_t ATTRIBUTE_PURE
   219056 XY_SRC_COPY_BLT_CommandType_start(const struct gen_device_info *devinfo)
   219057 {
   219058    switch (devinfo->gen) {
   219059    case 10: return 0;
   219060    case 9: return 0;
   219061    case 8: return 0;
   219062    case 7:
   219063       if (devinfo->is_haswell) {
   219064          return 0;
   219065       } else {
   219066          return 0;
   219067       }
   219068    case 6: return 0;
   219069    case 5: return 29;
   219070    case 4:
   219071       if (devinfo->is_g4x) {
   219072          return 29;
   219073       } else {
   219074          return 29;
   219075       }
   219076    default:
   219077       unreachable("Invalid hardware generation");
   219078    }
   219079 }
   219080 
   219081 
   219082 
   219083 /* XY_SRC_COPY_BLT::DWord Length */
   219084 
   219085 
   219086 #define GEN5_XY_SRC_COPY_BLT_DWordLength_bits  8
   219087 #define GEN45_XY_SRC_COPY_BLT_DWordLength_bits  8
   219088 #define GEN4_XY_SRC_COPY_BLT_DWordLength_bits  8
   219089 
   219090 static inline uint32_t ATTRIBUTE_PURE
   219091 XY_SRC_COPY_BLT_DWordLength_bits(const struct gen_device_info *devinfo)
   219092 {
   219093    switch (devinfo->gen) {
   219094    case 10: return 0;
   219095    case 9: return 0;
   219096    case 8: return 0;
   219097    case 7:
   219098       if (devinfo->is_haswell) {
   219099          return 0;
   219100       } else {
   219101          return 0;
   219102       }
   219103    case 6: return 0;
   219104    case 5: return 8;
   219105    case 4:
   219106       if (devinfo->is_g4x) {
   219107          return 8;
   219108       } else {
   219109          return 8;
   219110       }
   219111    default:
   219112       unreachable("Invalid hardware generation");
   219113    }
   219114 }
   219115 
   219116 
   219117 
   219118 #define GEN5_XY_SRC_COPY_BLT_DWordLength_start  0
   219119 #define GEN45_XY_SRC_COPY_BLT_DWordLength_start  0
   219120 #define GEN4_XY_SRC_COPY_BLT_DWordLength_start  0
   219121 
   219122 static inline uint32_t ATTRIBUTE_PURE
   219123 XY_SRC_COPY_BLT_DWordLength_start(const struct gen_device_info *devinfo)
   219124 {
   219125    switch (devinfo->gen) {
   219126    case 10: return 0;
   219127    case 9: return 0;
   219128    case 8: return 0;
   219129    case 7:
   219130       if (devinfo->is_haswell) {
   219131          return 0;
   219132       } else {
   219133          return 0;
   219134       }
   219135    case 6: return 0;
   219136    case 5: return 0;
   219137    case 4:
   219138       if (devinfo->is_g4x) {
   219139          return 0;
   219140       } else {
   219141          return 0;
   219142       }
   219143    default:
   219144       unreachable("Invalid hardware generation");
   219145    }
   219146 }
   219147 
   219148 
   219149 
   219150 /* XY_SRC_COPY_BLT::Destination Base Address */
   219151 
   219152 
   219153 #define GEN5_XY_SRC_COPY_BLT_DestinationBaseAddress_bits  32
   219154 #define GEN45_XY_SRC_COPY_BLT_DestinationBaseAddress_bits  32
   219155 #define GEN4_XY_SRC_COPY_BLT_DestinationBaseAddress_bits  32
   219156 
   219157 static inline uint32_t ATTRIBUTE_PURE
   219158 XY_SRC_COPY_BLT_DestinationBaseAddress_bits(const struct gen_device_info *devinfo)
   219159 {
   219160    switch (devinfo->gen) {
   219161    case 10: return 0;
   219162    case 9: return 0;
   219163    case 8: return 0;
   219164    case 7:
   219165       if (devinfo->is_haswell) {
   219166          return 0;
   219167       } else {
   219168          return 0;
   219169       }
   219170    case 6: return 0;
   219171    case 5: return 32;
   219172    case 4:
   219173       if (devinfo->is_g4x) {
   219174          return 32;
   219175       } else {
   219176          return 32;
   219177       }
   219178    default:
   219179       unreachable("Invalid hardware generation");
   219180    }
   219181 }
   219182 
   219183 
   219184 
   219185 #define GEN5_XY_SRC_COPY_BLT_DestinationBaseAddress_start  128
   219186 #define GEN45_XY_SRC_COPY_BLT_DestinationBaseAddress_start  128
   219187 #define GEN4_XY_SRC_COPY_BLT_DestinationBaseAddress_start  128
   219188 
   219189 static inline uint32_t ATTRIBUTE_PURE
   219190 XY_SRC_COPY_BLT_DestinationBaseAddress_start(const struct gen_device_info *devinfo)
   219191 {
   219192    switch (devinfo->gen) {
   219193    case 10: return 0;
   219194    case 9: return 0;
   219195    case 8: return 0;
   219196    case 7:
   219197       if (devinfo->is_haswell) {
   219198          return 0;
   219199       } else {
   219200          return 0;
   219201       }
   219202    case 6: return 0;
   219203    case 5: return 128;
   219204    case 4:
   219205       if (devinfo->is_g4x) {
   219206          return 128;
   219207       } else {
   219208          return 128;
   219209       }
   219210    default:
   219211       unreachable("Invalid hardware generation");
   219212    }
   219213 }
   219214 
   219215 
   219216 
   219217 /* XY_SRC_COPY_BLT::Destination Pitch */
   219218 
   219219 
   219220 #define GEN5_XY_SRC_COPY_BLT_DestinationPitch_bits  16
   219221 #define GEN45_XY_SRC_COPY_BLT_DestinationPitch_bits  16
   219222 #define GEN4_XY_SRC_COPY_BLT_DestinationPitch_bits  16
   219223 
   219224 static inline uint32_t ATTRIBUTE_PURE
   219225 XY_SRC_COPY_BLT_DestinationPitch_bits(const struct gen_device_info *devinfo)
   219226 {
   219227    switch (devinfo->gen) {
   219228    case 10: return 0;
   219229    case 9: return 0;
   219230    case 8: return 0;
   219231    case 7:
   219232       if (devinfo->is_haswell) {
   219233          return 0;
   219234       } else {
   219235          return 0;
   219236       }
   219237    case 6: return 0;
   219238    case 5: return 16;
   219239    case 4:
   219240       if (devinfo->is_g4x) {
   219241          return 16;
   219242       } else {
   219243          return 16;
   219244       }
   219245    default:
   219246       unreachable("Invalid hardware generation");
   219247    }
   219248 }
   219249 
   219250 
   219251 
   219252 #define GEN5_XY_SRC_COPY_BLT_DestinationPitch_start  32
   219253 #define GEN45_XY_SRC_COPY_BLT_DestinationPitch_start  32
   219254 #define GEN4_XY_SRC_COPY_BLT_DestinationPitch_start  32
   219255 
   219256 static inline uint32_t ATTRIBUTE_PURE
   219257 XY_SRC_COPY_BLT_DestinationPitch_start(const struct gen_device_info *devinfo)
   219258 {
   219259    switch (devinfo->gen) {
   219260    case 10: return 0;
   219261    case 9: return 0;
   219262    case 8: return 0;
   219263    case 7:
   219264       if (devinfo->is_haswell) {
   219265          return 0;
   219266       } else {
   219267          return 0;
   219268       }
   219269    case 6: return 0;
   219270    case 5: return 32;
   219271    case 4:
   219272       if (devinfo->is_g4x) {
   219273          return 32;
   219274       } else {
   219275          return 32;
   219276       }
   219277    default:
   219278       unreachable("Invalid hardware generation");
   219279    }
   219280 }
   219281 
   219282 
   219283 
   219284 /* XY_SRC_COPY_BLT::Destination Tiling Enable */
   219285 
   219286 
   219287 #define GEN5_XY_SRC_COPY_BLT_DestinationTilingEnable_bits  1
   219288 #define GEN45_XY_SRC_COPY_BLT_DestinationTilingEnable_bits  1
   219289 #define GEN4_XY_SRC_COPY_BLT_DestinationTilingEnable_bits  1
   219290 
   219291 static inline uint32_t ATTRIBUTE_PURE
   219292 XY_SRC_COPY_BLT_DestinationTilingEnable_bits(const struct gen_device_info *devinfo)
   219293 {
   219294    switch (devinfo->gen) {
   219295    case 10: return 0;
   219296    case 9: return 0;
   219297    case 8: return 0;
   219298    case 7:
   219299       if (devinfo->is_haswell) {
   219300          return 0;
   219301       } else {
   219302          return 0;
   219303       }
   219304    case 6: return 0;
   219305    case 5: return 1;
   219306    case 4:
   219307       if (devinfo->is_g4x) {
   219308          return 1;
   219309       } else {
   219310          return 1;
   219311       }
   219312    default:
   219313       unreachable("Invalid hardware generation");
   219314    }
   219315 }
   219316 
   219317 
   219318 
   219319 #define GEN5_XY_SRC_COPY_BLT_DestinationTilingEnable_start  11
   219320 #define GEN45_XY_SRC_COPY_BLT_DestinationTilingEnable_start  11
   219321 #define GEN4_XY_SRC_COPY_BLT_DestinationTilingEnable_start  11
   219322 
   219323 static inline uint32_t ATTRIBUTE_PURE
   219324 XY_SRC_COPY_BLT_DestinationTilingEnable_start(const struct gen_device_info *devinfo)
   219325 {
   219326    switch (devinfo->gen) {
   219327    case 10: return 0;
   219328    case 9: return 0;
   219329    case 8: return 0;
   219330    case 7:
   219331       if (devinfo->is_haswell) {
   219332          return 0;
   219333       } else {
   219334          return 0;
   219335       }
   219336    case 6: return 0;
   219337    case 5: return 11;
   219338    case 4:
   219339       if (devinfo->is_g4x) {
   219340          return 11;
   219341       } else {
   219342          return 11;
   219343       }
   219344    default:
   219345       unreachable("Invalid hardware generation");
   219346    }
   219347 }
   219348 
   219349 
   219350 
   219351 /* XY_SRC_COPY_BLT::Destination X1 Coordinate */
   219352 
   219353 
   219354 #define GEN5_XY_SRC_COPY_BLT_DestinationX1Coordinate_bits  16
   219355 #define GEN45_XY_SRC_COPY_BLT_DestinationX1Coordinate_bits  16
   219356 #define GEN4_XY_SRC_COPY_BLT_DestinationX1Coordinate_bits  16
   219357 
   219358 static inline uint32_t ATTRIBUTE_PURE
   219359 XY_SRC_COPY_BLT_DestinationX1Coordinate_bits(const struct gen_device_info *devinfo)
   219360 {
   219361    switch (devinfo->gen) {
   219362    case 10: return 0;
   219363    case 9: return 0;
   219364    case 8: return 0;
   219365    case 7:
   219366       if (devinfo->is_haswell) {
   219367          return 0;
   219368       } else {
   219369          return 0;
   219370       }
   219371    case 6: return 0;
   219372    case 5: return 16;
   219373    case 4:
   219374       if (devinfo->is_g4x) {
   219375          return 16;
   219376       } else {
   219377          return 16;
   219378       }
   219379    default:
   219380       unreachable("Invalid hardware generation");
   219381    }
   219382 }
   219383 
   219384 
   219385 
   219386 #define GEN5_XY_SRC_COPY_BLT_DestinationX1Coordinate_start  64
   219387 #define GEN45_XY_SRC_COPY_BLT_DestinationX1Coordinate_start  64
   219388 #define GEN4_XY_SRC_COPY_BLT_DestinationX1Coordinate_start  64
   219389 
   219390 static inline uint32_t ATTRIBUTE_PURE
   219391 XY_SRC_COPY_BLT_DestinationX1Coordinate_start(const struct gen_device_info *devinfo)
   219392 {
   219393    switch (devinfo->gen) {
   219394    case 10: return 0;
   219395    case 9: return 0;
   219396    case 8: return 0;
   219397    case 7:
   219398       if (devinfo->is_haswell) {
   219399          return 0;
   219400       } else {
   219401          return 0;
   219402       }
   219403    case 6: return 0;
   219404    case 5: return 64;
   219405    case 4:
   219406       if (devinfo->is_g4x) {
   219407          return 64;
   219408       } else {
   219409          return 64;
   219410       }
   219411    default:
   219412       unreachable("Invalid hardware generation");
   219413    }
   219414 }
   219415 
   219416 
   219417 
   219418 /* XY_SRC_COPY_BLT::Destination X2 Coordinate */
   219419 
   219420 
   219421 #define GEN5_XY_SRC_COPY_BLT_DestinationX2Coordinate_bits  16
   219422 #define GEN45_XY_SRC_COPY_BLT_DestinationX2Coordinate_bits  16
   219423 #define GEN4_XY_SRC_COPY_BLT_DestinationX2Coordinate_bits  16
   219424 
   219425 static inline uint32_t ATTRIBUTE_PURE
   219426 XY_SRC_COPY_BLT_DestinationX2Coordinate_bits(const struct gen_device_info *devinfo)
   219427 {
   219428    switch (devinfo->gen) {
   219429    case 10: return 0;
   219430    case 9: return 0;
   219431    case 8: return 0;
   219432    case 7:
   219433       if (devinfo->is_haswell) {
   219434          return 0;
   219435       } else {
   219436          return 0;
   219437       }
   219438    case 6: return 0;
   219439    case 5: return 16;
   219440    case 4:
   219441       if (devinfo->is_g4x) {
   219442          return 16;
   219443       } else {
   219444          return 16;
   219445       }
   219446    default:
   219447       unreachable("Invalid hardware generation");
   219448    }
   219449 }
   219450 
   219451 
   219452 
   219453 #define GEN5_XY_SRC_COPY_BLT_DestinationX2Coordinate_start  96
   219454 #define GEN45_XY_SRC_COPY_BLT_DestinationX2Coordinate_start  96
   219455 #define GEN4_XY_SRC_COPY_BLT_DestinationX2Coordinate_start  96
   219456 
   219457 static inline uint32_t ATTRIBUTE_PURE
   219458 XY_SRC_COPY_BLT_DestinationX2Coordinate_start(const struct gen_device_info *devinfo)
   219459 {
   219460    switch (devinfo->gen) {
   219461    case 10: return 0;
   219462    case 9: return 0;
   219463    case 8: return 0;
   219464    case 7:
   219465       if (devinfo->is_haswell) {
   219466          return 0;
   219467       } else {
   219468          return 0;
   219469       }
   219470    case 6: return 0;
   219471    case 5: return 96;
   219472    case 4:
   219473       if (devinfo->is_g4x) {
   219474          return 96;
   219475       } else {
   219476          return 96;
   219477       }
   219478    default:
   219479       unreachable("Invalid hardware generation");
   219480    }
   219481 }
   219482 
   219483 
   219484 
   219485 /* XY_SRC_COPY_BLT::Destination Y1 Coordinate */
   219486 
   219487 
   219488 #define GEN5_XY_SRC_COPY_BLT_DestinationY1Coordinate_bits  16
   219489 #define GEN45_XY_SRC_COPY_BLT_DestinationY1Coordinate_bits  16
   219490 #define GEN4_XY_SRC_COPY_BLT_DestinationY1Coordinate_bits  16
   219491 
   219492 static inline uint32_t ATTRIBUTE_PURE
   219493 XY_SRC_COPY_BLT_DestinationY1Coordinate_bits(const struct gen_device_info *devinfo)
   219494 {
   219495    switch (devinfo->gen) {
   219496    case 10: return 0;
   219497    case 9: return 0;
   219498    case 8: return 0;
   219499    case 7:
   219500       if (devinfo->is_haswell) {
   219501          return 0;
   219502       } else {
   219503          return 0;
   219504       }
   219505    case 6: return 0;
   219506    case 5: return 16;
   219507    case 4:
   219508       if (devinfo->is_g4x) {
   219509          return 16;
   219510       } else {
   219511          return 16;
   219512       }
   219513    default:
   219514       unreachable("Invalid hardware generation");
   219515    }
   219516 }
   219517 
   219518 
   219519 
   219520 #define GEN5_XY_SRC_COPY_BLT_DestinationY1Coordinate_start  80
   219521 #define GEN45_XY_SRC_COPY_BLT_DestinationY1Coordinate_start  80
   219522 #define GEN4_XY_SRC_COPY_BLT_DestinationY1Coordinate_start  80
   219523 
   219524 static inline uint32_t ATTRIBUTE_PURE
   219525 XY_SRC_COPY_BLT_DestinationY1Coordinate_start(const struct gen_device_info *devinfo)
   219526 {
   219527    switch (devinfo->gen) {
   219528    case 10: return 0;
   219529    case 9: return 0;
   219530    case 8: return 0;
   219531    case 7:
   219532       if (devinfo->is_haswell) {
   219533          return 0;
   219534       } else {
   219535          return 0;
   219536       }
   219537    case 6: return 0;
   219538    case 5: return 80;
   219539    case 4:
   219540       if (devinfo->is_g4x) {
   219541          return 80;
   219542       } else {
   219543          return 80;
   219544       }
   219545    default:
   219546       unreachable("Invalid hardware generation");
   219547    }
   219548 }
   219549 
   219550 
   219551 
   219552 /* XY_SRC_COPY_BLT::Destination Y2 Coordinate */
   219553 
   219554 
   219555 #define GEN5_XY_SRC_COPY_BLT_DestinationY2Coordinate_bits  16
   219556 #define GEN45_XY_SRC_COPY_BLT_DestinationY2Coordinate_bits  16
   219557 #define GEN4_XY_SRC_COPY_BLT_DestinationY2Coordinate_bits  16
   219558 
   219559 static inline uint32_t ATTRIBUTE_PURE
   219560 XY_SRC_COPY_BLT_DestinationY2Coordinate_bits(const struct gen_device_info *devinfo)
   219561 {
   219562    switch (devinfo->gen) {
   219563    case 10: return 0;
   219564    case 9: return 0;
   219565    case 8: return 0;
   219566    case 7:
   219567       if (devinfo->is_haswell) {
   219568          return 0;
   219569       } else {
   219570          return 0;
   219571       }
   219572    case 6: return 0;
   219573    case 5: return 16;
   219574    case 4:
   219575       if (devinfo->is_g4x) {
   219576          return 16;
   219577       } else {
   219578          return 16;
   219579       }
   219580    default:
   219581       unreachable("Invalid hardware generation");
   219582    }
   219583 }
   219584 
   219585 
   219586 
   219587 #define GEN5_XY_SRC_COPY_BLT_DestinationY2Coordinate_start  112
   219588 #define GEN45_XY_SRC_COPY_BLT_DestinationY2Coordinate_start  112
   219589 #define GEN4_XY_SRC_COPY_BLT_DestinationY2Coordinate_start  112
   219590 
   219591 static inline uint32_t ATTRIBUTE_PURE
   219592 XY_SRC_COPY_BLT_DestinationY2Coordinate_start(const struct gen_device_info *devinfo)
   219593 {
   219594    switch (devinfo->gen) {
   219595    case 10: return 0;
   219596    case 9: return 0;
   219597    case 8: return 0;
   219598    case 7:
   219599       if (devinfo->is_haswell) {
   219600          return 0;
   219601       } else {
   219602          return 0;
   219603       }
   219604    case 6: return 0;
   219605    case 5: return 112;
   219606    case 4:
   219607       if (devinfo->is_g4x) {
   219608          return 112;
   219609       } else {
   219610          return 112;
   219611       }
   219612    default:
   219613       unreachable("Invalid hardware generation");
   219614    }
   219615 }
   219616 
   219617 
   219618 
   219619 /* XY_SRC_COPY_BLT::Raster Operation */
   219620 
   219621 
   219622 #define GEN5_XY_SRC_COPY_BLT_RasterOperation_bits  8
   219623 #define GEN45_XY_SRC_COPY_BLT_RasterOperation_bits  8
   219624 #define GEN4_XY_SRC_COPY_BLT_RasterOperation_bits  8
   219625 
   219626 static inline uint32_t ATTRIBUTE_PURE
   219627 XY_SRC_COPY_BLT_RasterOperation_bits(const struct gen_device_info *devinfo)
   219628 {
   219629    switch (devinfo->gen) {
   219630    case 10: return 0;
   219631    case 9: return 0;
   219632    case 8: return 0;
   219633    case 7:
   219634       if (devinfo->is_haswell) {
   219635          return 0;
   219636       } else {
   219637          return 0;
   219638       }
   219639    case 6: return 0;
   219640    case 5: return 8;
   219641    case 4:
   219642       if (devinfo->is_g4x) {
   219643          return 8;
   219644       } else {
   219645          return 8;
   219646       }
   219647    default:
   219648       unreachable("Invalid hardware generation");
   219649    }
   219650 }
   219651 
   219652 
   219653 
   219654 #define GEN5_XY_SRC_COPY_BLT_RasterOperation_start  48
   219655 #define GEN45_XY_SRC_COPY_BLT_RasterOperation_start  48
   219656 #define GEN4_XY_SRC_COPY_BLT_RasterOperation_start  48
   219657 
   219658 static inline uint32_t ATTRIBUTE_PURE
   219659 XY_SRC_COPY_BLT_RasterOperation_start(const struct gen_device_info *devinfo)
   219660 {
   219661    switch (devinfo->gen) {
   219662    case 10: return 0;
   219663    case 9: return 0;
   219664    case 8: return 0;
   219665    case 7:
   219666       if (devinfo->is_haswell) {
   219667          return 0;
   219668       } else {
   219669          return 0;
   219670       }
   219671    case 6: return 0;
   219672    case 5: return 48;
   219673    case 4:
   219674       if (devinfo->is_g4x) {
   219675          return 48;
   219676       } else {
   219677          return 48;
   219678       }
   219679    default:
   219680       unreachable("Invalid hardware generation");
   219681    }
   219682 }
   219683 
   219684 
   219685 
   219686 /* XY_SRC_COPY_BLT::Source Base Address */
   219687 
   219688 
   219689 #define GEN5_XY_SRC_COPY_BLT_SourceBaseAddress_bits  32
   219690 #define GEN45_XY_SRC_COPY_BLT_SourceBaseAddress_bits  32
   219691 #define GEN4_XY_SRC_COPY_BLT_SourceBaseAddress_bits  32
   219692 
   219693 static inline uint32_t ATTRIBUTE_PURE
   219694 XY_SRC_COPY_BLT_SourceBaseAddress_bits(const struct gen_device_info *devinfo)
   219695 {
   219696    switch (devinfo->gen) {
   219697    case 10: return 0;
   219698    case 9: return 0;
   219699    case 8: return 0;
   219700    case 7:
   219701       if (devinfo->is_haswell) {
   219702          return 0;
   219703       } else {
   219704          return 0;
   219705       }
   219706    case 6: return 0;
   219707    case 5: return 32;
   219708    case 4:
   219709       if (devinfo->is_g4x) {
   219710          return 32;
   219711       } else {
   219712          return 32;
   219713       }
   219714    default:
   219715       unreachable("Invalid hardware generation");
   219716    }
   219717 }
   219718 
   219719 
   219720 
   219721 #define GEN5_XY_SRC_COPY_BLT_SourceBaseAddress_start  224
   219722 #define GEN45_XY_SRC_COPY_BLT_SourceBaseAddress_start  224
   219723 #define GEN4_XY_SRC_COPY_BLT_SourceBaseAddress_start  224
   219724 
   219725 static inline uint32_t ATTRIBUTE_PURE
   219726 XY_SRC_COPY_BLT_SourceBaseAddress_start(const struct gen_device_info *devinfo)
   219727 {
   219728    switch (devinfo->gen) {
   219729    case 10: return 0;
   219730    case 9: return 0;
   219731    case 8: return 0;
   219732    case 7:
   219733       if (devinfo->is_haswell) {
   219734          return 0;
   219735       } else {
   219736          return 0;
   219737       }
   219738    case 6: return 0;
   219739    case 5: return 224;
   219740    case 4:
   219741       if (devinfo->is_g4x) {
   219742          return 224;
   219743       } else {
   219744          return 224;
   219745       }
   219746    default:
   219747       unreachable("Invalid hardware generation");
   219748    }
   219749 }
   219750 
   219751 
   219752 
   219753 /* XY_SRC_COPY_BLT::Source Pitch */
   219754 
   219755 
   219756 #define GEN5_XY_SRC_COPY_BLT_SourcePitch_bits  16
   219757 #define GEN45_XY_SRC_COPY_BLT_SourcePitch_bits  16
   219758 #define GEN4_XY_SRC_COPY_BLT_SourcePitch_bits  16
   219759 
   219760 static inline uint32_t ATTRIBUTE_PURE
   219761 XY_SRC_COPY_BLT_SourcePitch_bits(const struct gen_device_info *devinfo)
   219762 {
   219763    switch (devinfo->gen) {
   219764    case 10: return 0;
   219765    case 9: return 0;
   219766    case 8: return 0;
   219767    case 7:
   219768       if (devinfo->is_haswell) {
   219769          return 0;
   219770       } else {
   219771          return 0;
   219772       }
   219773    case 6: return 0;
   219774    case 5: return 16;
   219775    case 4:
   219776       if (devinfo->is_g4x) {
   219777          return 16;
   219778       } else {
   219779          return 16;
   219780       }
   219781    default:
   219782       unreachable("Invalid hardware generation");
   219783    }
   219784 }
   219785 
   219786 
   219787 
   219788 #define GEN5_XY_SRC_COPY_BLT_SourcePitch_start  192
   219789 #define GEN45_XY_SRC_COPY_BLT_SourcePitch_start  192
   219790 #define GEN4_XY_SRC_COPY_BLT_SourcePitch_start  192
   219791 
   219792 static inline uint32_t ATTRIBUTE_PURE
   219793 XY_SRC_COPY_BLT_SourcePitch_start(const struct gen_device_info *devinfo)
   219794 {
   219795    switch (devinfo->gen) {
   219796    case 10: return 0;
   219797    case 9: return 0;
   219798    case 8: return 0;
   219799    case 7:
   219800       if (devinfo->is_haswell) {
   219801          return 0;
   219802       } else {
   219803          return 0;
   219804       }
   219805    case 6: return 0;
   219806    case 5: return 192;
   219807    case 4:
   219808       if (devinfo->is_g4x) {
   219809          return 192;
   219810       } else {
   219811          return 192;
   219812       }
   219813    default:
   219814       unreachable("Invalid hardware generation");
   219815    }
   219816 }
   219817 
   219818 
   219819 
   219820 /* XY_SRC_COPY_BLT::Source Tiling Enable */
   219821 
   219822 
   219823 #define GEN5_XY_SRC_COPY_BLT_SourceTilingEnable_bits  1
   219824 #define GEN45_XY_SRC_COPY_BLT_SourceTilingEnable_bits  1
   219825 #define GEN4_XY_SRC_COPY_BLT_SourceTilingEnable_bits  1
   219826 
   219827 static inline uint32_t ATTRIBUTE_PURE
   219828 XY_SRC_COPY_BLT_SourceTilingEnable_bits(const struct gen_device_info *devinfo)
   219829 {
   219830    switch (devinfo->gen) {
   219831    case 10: return 0;
   219832    case 9: return 0;
   219833    case 8: return 0;
   219834    case 7:
   219835       if (devinfo->is_haswell) {
   219836          return 0;
   219837       } else {
   219838          return 0;
   219839       }
   219840    case 6: return 0;
   219841    case 5: return 1;
   219842    case 4:
   219843       if (devinfo->is_g4x) {
   219844          return 1;
   219845       } else {
   219846          return 1;
   219847       }
   219848    default:
   219849       unreachable("Invalid hardware generation");
   219850    }
   219851 }
   219852 
   219853 
   219854 
   219855 #define GEN5_XY_SRC_COPY_BLT_SourceTilingEnable_start  15
   219856 #define GEN45_XY_SRC_COPY_BLT_SourceTilingEnable_start  15
   219857 #define GEN4_XY_SRC_COPY_BLT_SourceTilingEnable_start  15
   219858 
   219859 static inline uint32_t ATTRIBUTE_PURE
   219860 XY_SRC_COPY_BLT_SourceTilingEnable_start(const struct gen_device_info *devinfo)
   219861 {
   219862    switch (devinfo->gen) {
   219863    case 10: return 0;
   219864    case 9: return 0;
   219865    case 8: return 0;
   219866    case 7:
   219867       if (devinfo->is_haswell) {
   219868          return 0;
   219869       } else {
   219870          return 0;
   219871       }
   219872    case 6: return 0;
   219873    case 5: return 15;
   219874    case 4:
   219875       if (devinfo->is_g4x) {
   219876          return 15;
   219877       } else {
   219878          return 15;
   219879       }
   219880    default:
   219881       unreachable("Invalid hardware generation");
   219882    }
   219883 }
   219884 
   219885 
   219886 
   219887 /* XY_SRC_COPY_BLT::Source X1 Coordinate */
   219888 
   219889 
   219890 #define GEN5_XY_SRC_COPY_BLT_SourceX1Coordinate_bits  16
   219891 #define GEN45_XY_SRC_COPY_BLT_SourceX1Coordinate_bits  16
   219892 #define GEN4_XY_SRC_COPY_BLT_SourceX1Coordinate_bits  16
   219893 
   219894 static inline uint32_t ATTRIBUTE_PURE
   219895 XY_SRC_COPY_BLT_SourceX1Coordinate_bits(const struct gen_device_info *devinfo)
   219896 {
   219897    switch (devinfo->gen) {
   219898    case 10: return 0;
   219899    case 9: return 0;
   219900    case 8: return 0;
   219901    case 7:
   219902       if (devinfo->is_haswell) {
   219903          return 0;
   219904       } else {
   219905          return 0;
   219906       }
   219907    case 6: return 0;
   219908    case 5: return 16;
   219909    case 4:
   219910       if (devinfo->is_g4x) {
   219911          return 16;
   219912       } else {
   219913          return 16;
   219914       }
   219915    default:
   219916       unreachable("Invalid hardware generation");
   219917    }
   219918 }
   219919 
   219920 
   219921 
   219922 #define GEN5_XY_SRC_COPY_BLT_SourceX1Coordinate_start  160
   219923 #define GEN45_XY_SRC_COPY_BLT_SourceX1Coordinate_start  160
   219924 #define GEN4_XY_SRC_COPY_BLT_SourceX1Coordinate_start  160
   219925 
   219926 static inline uint32_t ATTRIBUTE_PURE
   219927 XY_SRC_COPY_BLT_SourceX1Coordinate_start(const struct gen_device_info *devinfo)
   219928 {
   219929    switch (devinfo->gen) {
   219930    case 10: return 0;
   219931    case 9: return 0;
   219932    case 8: return 0;
   219933    case 7:
   219934       if (devinfo->is_haswell) {
   219935          return 0;
   219936       } else {
   219937          return 0;
   219938       }
   219939    case 6: return 0;
   219940    case 5: return 160;
   219941    case 4:
   219942       if (devinfo->is_g4x) {
   219943          return 160;
   219944       } else {
   219945          return 160;
   219946       }
   219947    default:
   219948       unreachable("Invalid hardware generation");
   219949    }
   219950 }
   219951 
   219952 
   219953 
   219954 /* XY_SRC_COPY_BLT::Source Y1 Coordinate */
   219955 
   219956 
   219957 #define GEN5_XY_SRC_COPY_BLT_SourceY1Coordinate_bits  16
   219958 #define GEN45_XY_SRC_COPY_BLT_SourceY1Coordinate_bits  16
   219959 #define GEN4_XY_SRC_COPY_BLT_SourceY1Coordinate_bits  16
   219960 
   219961 static inline uint32_t ATTRIBUTE_PURE
   219962 XY_SRC_COPY_BLT_SourceY1Coordinate_bits(const struct gen_device_info *devinfo)
   219963 {
   219964    switch (devinfo->gen) {
   219965    case 10: return 0;
   219966    case 9: return 0;
   219967    case 8: return 0;
   219968    case 7:
   219969       if (devinfo->is_haswell) {
   219970          return 0;
   219971       } else {
   219972          return 0;
   219973       }
   219974    case 6: return 0;
   219975    case 5: return 16;
   219976    case 4:
   219977       if (devinfo->is_g4x) {
   219978          return 16;
   219979       } else {
   219980          return 16;
   219981       }
   219982    default:
   219983       unreachable("Invalid hardware generation");
   219984    }
   219985 }
   219986 
   219987 
   219988 
   219989 #define GEN5_XY_SRC_COPY_BLT_SourceY1Coordinate_start  176
   219990 #define GEN45_XY_SRC_COPY_BLT_SourceY1Coordinate_start  176
   219991 #define GEN4_XY_SRC_COPY_BLT_SourceY1Coordinate_start  176
   219992 
   219993 static inline uint32_t ATTRIBUTE_PURE
   219994 XY_SRC_COPY_BLT_SourceY1Coordinate_start(const struct gen_device_info *devinfo)
   219995 {
   219996    switch (devinfo->gen) {
   219997    case 10: return 0;
   219998    case 9: return 0;
   219999    case 8: return 0;
   220000    case 7:
   220001       if (devinfo->is_haswell) {
   220002          return 0;
   220003       } else {
   220004          return 0;
   220005       }
   220006    case 6: return 0;
   220007    case 5: return 176;
   220008    case 4:
   220009       if (devinfo->is_g4x) {
   220010          return 176;
   220011       } else {
   220012          return 176;
   220013       }
   220014    default:
   220015       unreachable("Invalid hardware generation");
   220016    }
   220017 }
   220018 
   220019 
   220020 
   220021 /* XY_TEXT_IMMEDIATE_BLT */
   220022 
   220023 
   220024 #define GEN5_XY_TEXT_IMMEDIATE_BLT_length  3
   220025 #define GEN45_XY_TEXT_IMMEDIATE_BLT_length  3
   220026 #define GEN4_XY_TEXT_IMMEDIATE_BLT_length  3
   220027 
   220028 static inline uint32_t ATTRIBUTE_PURE
   220029 XY_TEXT_IMMEDIATE_BLT_length(const struct gen_device_info *devinfo)
   220030 {
   220031    switch (devinfo->gen) {
   220032    case 10: return 0;
   220033    case 9: return 0;
   220034    case 8: return 0;
   220035    case 7:
   220036       if (devinfo->is_haswell) {
   220037          return 0;
   220038       } else {
   220039          return 0;
   220040       }
   220041    case 6: return 0;
   220042    case 5: return 3;
   220043    case 4:
   220044       if (devinfo->is_g4x) {
   220045          return 3;
   220046       } else {
   220047          return 3;
   220048       }
   220049    default:
   220050       unreachable("Invalid hardware generation");
   220051    }
   220052 }
   220053 
   220054 
   220055 
   220056 /* XY_TEXT_IMMEDIATE_BLT::2D Command Opcode */
   220057 
   220058 
   220059 #define GEN5_XY_TEXT_IMMEDIATE_BLT_2DCommandOpcode_bits  7
   220060 #define GEN45_XY_TEXT_IMMEDIATE_BLT_2DCommandOpcode_bits  7
   220061 #define GEN4_XY_TEXT_IMMEDIATE_BLT_2DCommandOpcode_bits  7
   220062 
   220063 static inline uint32_t ATTRIBUTE_PURE
   220064 XY_TEXT_IMMEDIATE_BLT_2DCommandOpcode_bits(const struct gen_device_info *devinfo)
   220065 {
   220066    switch (devinfo->gen) {
   220067    case 10: return 0;
   220068    case 9: return 0;
   220069    case 8: return 0;
   220070    case 7:
   220071       if (devinfo->is_haswell) {
   220072          return 0;
   220073       } else {
   220074          return 0;
   220075       }
   220076    case 6: return 0;
   220077    case 5: return 7;
   220078    case 4:
   220079       if (devinfo->is_g4x) {
   220080          return 7;
   220081       } else {
   220082          return 7;
   220083       }
   220084    default:
   220085       unreachable("Invalid hardware generation");
   220086    }
   220087 }
   220088 
   220089 
   220090 
   220091 #define GEN5_XY_TEXT_IMMEDIATE_BLT_2DCommandOpcode_start  22
   220092 #define GEN45_XY_TEXT_IMMEDIATE_BLT_2DCommandOpcode_start  22
   220093 #define GEN4_XY_TEXT_IMMEDIATE_BLT_2DCommandOpcode_start  22
   220094 
   220095 static inline uint32_t ATTRIBUTE_PURE
   220096 XY_TEXT_IMMEDIATE_BLT_2DCommandOpcode_start(const struct gen_device_info *devinfo)
   220097 {
   220098    switch (devinfo->gen) {
   220099    case 10: return 0;
   220100    case 9: return 0;
   220101    case 8: return 0;
   220102    case 7:
   220103       if (devinfo->is_haswell) {
   220104          return 0;
   220105       } else {
   220106          return 0;
   220107       }
   220108    case 6: return 0;
   220109    case 5: return 22;
   220110    case 4:
   220111       if (devinfo->is_g4x) {
   220112          return 22;
   220113       } else {
   220114          return 22;
   220115       }
   220116    default:
   220117       unreachable("Invalid hardware generation");
   220118    }
   220119 }
   220120 
   220121 
   220122 
   220123 /* XY_TEXT_IMMEDIATE_BLT::32bpp Byte Mask */
   220124 
   220125 
   220126 #define GEN5_XY_TEXT_IMMEDIATE_BLT_32bppByteMask_bits  2
   220127 #define GEN45_XY_TEXT_IMMEDIATE_BLT_32bppByteMask_bits  2
   220128 #define GEN4_XY_TEXT_IMMEDIATE_BLT_32bppByteMask_bits  2
   220129 
   220130 static inline uint32_t ATTRIBUTE_PURE
   220131 XY_TEXT_IMMEDIATE_BLT_32bppByteMask_bits(const struct gen_device_info *devinfo)
   220132 {
   220133    switch (devinfo->gen) {
   220134    case 10: return 0;
   220135    case 9: return 0;
   220136    case 8: return 0;
   220137    case 7:
   220138       if (devinfo->is_haswell) {
   220139          return 0;
   220140       } else {
   220141          return 0;
   220142       }
   220143    case 6: return 0;
   220144    case 5: return 2;
   220145    case 4:
   220146       if (devinfo->is_g4x) {
   220147          return 2;
   220148       } else {
   220149          return 2;
   220150       }
   220151    default:
   220152       unreachable("Invalid hardware generation");
   220153    }
   220154 }
   220155 
   220156 
   220157 
   220158 #define GEN5_XY_TEXT_IMMEDIATE_BLT_32bppByteMask_start  20
   220159 #define GEN45_XY_TEXT_IMMEDIATE_BLT_32bppByteMask_start  20
   220160 #define GEN4_XY_TEXT_IMMEDIATE_BLT_32bppByteMask_start  20
   220161 
   220162 static inline uint32_t ATTRIBUTE_PURE
   220163 XY_TEXT_IMMEDIATE_BLT_32bppByteMask_start(const struct gen_device_info *devinfo)
   220164 {
   220165    switch (devinfo->gen) {
   220166    case 10: return 0;
   220167    case 9: return 0;
   220168    case 8: return 0;
   220169    case 7:
   220170       if (devinfo->is_haswell) {
   220171          return 0;
   220172       } else {
   220173          return 0;
   220174       }
   220175    case 6: return 0;
   220176    case 5: return 20;
   220177    case 4:
   220178       if (devinfo->is_g4x) {
   220179          return 20;
   220180       } else {
   220181          return 20;
   220182       }
   220183    default:
   220184       unreachable("Invalid hardware generation");
   220185    }
   220186 }
   220187 
   220188 
   220189 
   220190 /* XY_TEXT_IMMEDIATE_BLT::Command Type */
   220191 
   220192 
   220193 #define GEN5_XY_TEXT_IMMEDIATE_BLT_CommandType_bits  3
   220194 #define GEN45_XY_TEXT_IMMEDIATE_BLT_CommandType_bits  3
   220195 #define GEN4_XY_TEXT_IMMEDIATE_BLT_CommandType_bits  3
   220196 
   220197 static inline uint32_t ATTRIBUTE_PURE
   220198 XY_TEXT_IMMEDIATE_BLT_CommandType_bits(const struct gen_device_info *devinfo)
   220199 {
   220200    switch (devinfo->gen) {
   220201    case 10: return 0;
   220202    case 9: return 0;
   220203    case 8: return 0;
   220204    case 7:
   220205       if (devinfo->is_haswell) {
   220206          return 0;
   220207       } else {
   220208          return 0;
   220209       }
   220210    case 6: return 0;
   220211    case 5: return 3;
   220212    case 4:
   220213       if (devinfo->is_g4x) {
   220214          return 3;
   220215       } else {
   220216          return 3;
   220217       }
   220218    default:
   220219       unreachable("Invalid hardware generation");
   220220    }
   220221 }
   220222 
   220223 
   220224 
   220225 #define GEN5_XY_TEXT_IMMEDIATE_BLT_CommandType_start  29
   220226 #define GEN45_XY_TEXT_IMMEDIATE_BLT_CommandType_start  29
   220227 #define GEN4_XY_TEXT_IMMEDIATE_BLT_CommandType_start  29
   220228 
   220229 static inline uint32_t ATTRIBUTE_PURE
   220230 XY_TEXT_IMMEDIATE_BLT_CommandType_start(const struct gen_device_info *devinfo)
   220231 {
   220232    switch (devinfo->gen) {
   220233    case 10: return 0;
   220234    case 9: return 0;
   220235    case 8: return 0;
   220236    case 7:
   220237       if (devinfo->is_haswell) {
   220238          return 0;
   220239       } else {
   220240          return 0;
   220241       }
   220242    case 6: return 0;
   220243    case 5: return 29;
   220244    case 4:
   220245       if (devinfo->is_g4x) {
   220246          return 29;
   220247       } else {
   220248          return 29;
   220249       }
   220250    default:
   220251       unreachable("Invalid hardware generation");
   220252    }
   220253 }
   220254 
   220255 
   220256 
   220257 /* XY_TEXT_IMMEDIATE_BLT::DWord Length */
   220258 
   220259 
   220260 #define GEN5_XY_TEXT_IMMEDIATE_BLT_DWordLength_bits  8
   220261 #define GEN45_XY_TEXT_IMMEDIATE_BLT_DWordLength_bits  8
   220262 #define GEN4_XY_TEXT_IMMEDIATE_BLT_DWordLength_bits  8
   220263 
   220264 static inline uint32_t ATTRIBUTE_PURE
   220265 XY_TEXT_IMMEDIATE_BLT_DWordLength_bits(const struct gen_device_info *devinfo)
   220266 {
   220267    switch (devinfo->gen) {
   220268    case 10: return 0;
   220269    case 9: return 0;
   220270    case 8: return 0;
   220271    case 7:
   220272       if (devinfo->is_haswell) {
   220273          return 0;
   220274       } else {
   220275          return 0;
   220276       }
   220277    case 6: return 0;
   220278    case 5: return 8;
   220279    case 4:
   220280       if (devinfo->is_g4x) {
   220281          return 8;
   220282       } else {
   220283          return 8;
   220284       }
   220285    default:
   220286       unreachable("Invalid hardware generation");
   220287    }
   220288 }
   220289 
   220290 
   220291 
   220292 #define GEN5_XY_TEXT_IMMEDIATE_BLT_DWordLength_start  0
   220293 #define GEN45_XY_TEXT_IMMEDIATE_BLT_DWordLength_start  0
   220294 #define GEN4_XY_TEXT_IMMEDIATE_BLT_DWordLength_start  0
   220295 
   220296 static inline uint32_t ATTRIBUTE_PURE
   220297 XY_TEXT_IMMEDIATE_BLT_DWordLength_start(const struct gen_device_info *devinfo)
   220298 {
   220299    switch (devinfo->gen) {
   220300    case 10: return 0;
   220301    case 9: return 0;
   220302    case 8: return 0;
   220303    case 7:
   220304       if (devinfo->is_haswell) {
   220305          return 0;
   220306       } else {
   220307          return 0;
   220308       }
   220309    case 6: return 0;
   220310    case 5: return 0;
   220311    case 4:
   220312       if (devinfo->is_g4x) {
   220313          return 0;
   220314       } else {
   220315          return 0;
   220316       }
   220317    default:
   220318       unreachable("Invalid hardware generation");
   220319    }
   220320 }
   220321 
   220322 
   220323 
   220324 /* XY_TEXT_IMMEDIATE_BLT::Destination Pitch */
   220325 
   220326 
   220327 #define GEN5_XY_TEXT_IMMEDIATE_BLT_DestinationPitch_bits  16
   220328 #define GEN45_XY_TEXT_IMMEDIATE_BLT_DestinationPitch_bits  16
   220329 #define GEN4_XY_TEXT_IMMEDIATE_BLT_DestinationPitch_bits  16
   220330 
   220331 static inline uint32_t ATTRIBUTE_PURE
   220332 XY_TEXT_IMMEDIATE_BLT_DestinationPitch_bits(const struct gen_device_info *devinfo)
   220333 {
   220334    switch (devinfo->gen) {
   220335    case 10: return 0;
   220336    case 9: return 0;
   220337    case 8: return 0;
   220338    case 7:
   220339       if (devinfo->is_haswell) {
   220340          return 0;
   220341       } else {
   220342          return 0;
   220343       }
   220344    case 6: return 0;
   220345    case 5: return 16;
   220346    case 4:
   220347       if (devinfo->is_g4x) {
   220348          return 16;
   220349       } else {
   220350          return 16;
   220351       }
   220352    default:
   220353       unreachable("Invalid hardware generation");
   220354    }
   220355 }
   220356 
   220357 
   220358 
   220359 #define GEN5_XY_TEXT_IMMEDIATE_BLT_DestinationPitch_start  32
   220360 #define GEN45_XY_TEXT_IMMEDIATE_BLT_DestinationPitch_start  32
   220361 #define GEN4_XY_TEXT_IMMEDIATE_BLT_DestinationPitch_start  32
   220362 
   220363 static inline uint32_t ATTRIBUTE_PURE
   220364 XY_TEXT_IMMEDIATE_BLT_DestinationPitch_start(const struct gen_device_info *devinfo)
   220365 {
   220366    switch (devinfo->gen) {
   220367    case 10: return 0;
   220368    case 9: return 0;
   220369    case 8: return 0;
   220370    case 7:
   220371       if (devinfo->is_haswell) {
   220372          return 0;
   220373       } else {
   220374          return 0;
   220375       }
   220376    case 6: return 0;
   220377    case 5: return 32;
   220378    case 4:
   220379       if (devinfo->is_g4x) {
   220380          return 32;
   220381       } else {
   220382          return 32;
   220383       }
   220384    default:
   220385       unreachable("Invalid hardware generation");
   220386    }
   220387 }
   220388 
   220389 
   220390 
   220391 /* XY_TEXT_IMMEDIATE_BLT::Destination X1 Coordinate */
   220392 
   220393 
   220394 #define GEN5_XY_TEXT_IMMEDIATE_BLT_DestinationX1Coordinate_bits  16
   220395 #define GEN45_XY_TEXT_IMMEDIATE_BLT_DestinationX1Coordinate_bits  16
   220396 #define GEN4_XY_TEXT_IMMEDIATE_BLT_DestinationX1Coordinate_bits  16
   220397 
   220398 static inline uint32_t ATTRIBUTE_PURE
   220399 XY_TEXT_IMMEDIATE_BLT_DestinationX1Coordinate_bits(const struct gen_device_info *devinfo)
   220400 {
   220401    switch (devinfo->gen) {
   220402    case 10: return 0;
   220403    case 9: return 0;
   220404    case 8: return 0;
   220405    case 7:
   220406       if (devinfo->is_haswell) {
   220407          return 0;
   220408       } else {
   220409          return 0;
   220410       }
   220411    case 6: return 0;
   220412    case 5: return 16;
   220413    case 4:
   220414       if (devinfo->is_g4x) {
   220415          return 16;
   220416       } else {
   220417          return 16;
   220418       }
   220419    default:
   220420       unreachable("Invalid hardware generation");
   220421    }
   220422 }
   220423 
   220424 
   220425 
   220426 #define GEN5_XY_TEXT_IMMEDIATE_BLT_DestinationX1Coordinate_start  32
   220427 #define GEN45_XY_TEXT_IMMEDIATE_BLT_DestinationX1Coordinate_start  32
   220428 #define GEN4_XY_TEXT_IMMEDIATE_BLT_DestinationX1Coordinate_start  32
   220429 
   220430 static inline uint32_t ATTRIBUTE_PURE
   220431 XY_TEXT_IMMEDIATE_BLT_DestinationX1Coordinate_start(const struct gen_device_info *devinfo)
   220432 {
   220433    switch (devinfo->gen) {
   220434    case 10: return 0;
   220435    case 9: return 0;
   220436    case 8: return 0;
   220437    case 7:
   220438       if (devinfo->is_haswell) {
   220439          return 0;
   220440       } else {
   220441          return 0;
   220442       }
   220443    case 6: return 0;
   220444    case 5: return 32;
   220445    case 4:
   220446       if (devinfo->is_g4x) {
   220447          return 32;
   220448       } else {
   220449          return 32;
   220450       }
   220451    default:
   220452       unreachable("Invalid hardware generation");
   220453    }
   220454 }
   220455 
   220456 
   220457 
   220458 /* XY_TEXT_IMMEDIATE_BLT::Destination X2 Coordinate */
   220459 
   220460 
   220461 #define GEN5_XY_TEXT_IMMEDIATE_BLT_DestinationX2Coordinate_bits  16
   220462 #define GEN45_XY_TEXT_IMMEDIATE_BLT_DestinationX2Coordinate_bits  16
   220463 #define GEN4_XY_TEXT_IMMEDIATE_BLT_DestinationX2Coordinate_bits  16
   220464 
   220465 static inline uint32_t ATTRIBUTE_PURE
   220466 XY_TEXT_IMMEDIATE_BLT_DestinationX2Coordinate_bits(const struct gen_device_info *devinfo)
   220467 {
   220468    switch (devinfo->gen) {
   220469    case 10: return 0;
   220470    case 9: return 0;
   220471    case 8: return 0;
   220472    case 7:
   220473       if (devinfo->is_haswell) {
   220474          return 0;
   220475       } else {
   220476          return 0;
   220477       }
   220478    case 6: return 0;
   220479    case 5: return 16;
   220480    case 4:
   220481       if (devinfo->is_g4x) {
   220482          return 16;
   220483       } else {
   220484          return 16;
   220485       }
   220486    default:
   220487       unreachable("Invalid hardware generation");
   220488    }
   220489 }
   220490 
   220491 
   220492 
   220493 #define GEN5_XY_TEXT_IMMEDIATE_BLT_DestinationX2Coordinate_start  64
   220494 #define GEN45_XY_TEXT_IMMEDIATE_BLT_DestinationX2Coordinate_start  64
   220495 #define GEN4_XY_TEXT_IMMEDIATE_BLT_DestinationX2Coordinate_start  64
   220496 
   220497 static inline uint32_t ATTRIBUTE_PURE
   220498 XY_TEXT_IMMEDIATE_BLT_DestinationX2Coordinate_start(const struct gen_device_info *devinfo)
   220499 {
   220500    switch (devinfo->gen) {
   220501    case 10: return 0;
   220502    case 9: return 0;
   220503    case 8: return 0;
   220504    case 7:
   220505       if (devinfo->is_haswell) {
   220506          return 0;
   220507       } else {
   220508          return 0;
   220509       }
   220510    case 6: return 0;
   220511    case 5: return 64;
   220512    case 4:
   220513       if (devinfo->is_g4x) {
   220514          return 64;
   220515       } else {
   220516          return 64;
   220517       }
   220518    default:
   220519       unreachable("Invalid hardware generation");
   220520    }
   220521 }
   220522 
   220523 
   220524 
   220525 /* XY_TEXT_IMMEDIATE_BLT::Destination Y1 Coordinate */
   220526 
   220527 
   220528 #define GEN5_XY_TEXT_IMMEDIATE_BLT_DestinationY1Coordinate_bits  16
   220529 #define GEN45_XY_TEXT_IMMEDIATE_BLT_DestinationY1Coordinate_bits  16
   220530 #define GEN4_XY_TEXT_IMMEDIATE_BLT_DestinationY1Coordinate_bits  16
   220531 
   220532 static inline uint32_t ATTRIBUTE_PURE
   220533 XY_TEXT_IMMEDIATE_BLT_DestinationY1Coordinate_bits(const struct gen_device_info *devinfo)
   220534 {
   220535    switch (devinfo->gen) {
   220536    case 10: return 0;
   220537    case 9: return 0;
   220538    case 8: return 0;
   220539    case 7:
   220540       if (devinfo->is_haswell) {
   220541          return 0;
   220542       } else {
   220543          return 0;
   220544       }
   220545    case 6: return 0;
   220546    case 5: return 16;
   220547    case 4:
   220548       if (devinfo->is_g4x) {
   220549          return 16;
   220550       } else {
   220551          return 16;
   220552       }
   220553    default:
   220554       unreachable("Invalid hardware generation");
   220555    }
   220556 }
   220557 
   220558 
   220559 
   220560 #define GEN5_XY_TEXT_IMMEDIATE_BLT_DestinationY1Coordinate_start  48
   220561 #define GEN45_XY_TEXT_IMMEDIATE_BLT_DestinationY1Coordinate_start  48
   220562 #define GEN4_XY_TEXT_IMMEDIATE_BLT_DestinationY1Coordinate_start  48
   220563 
   220564 static inline uint32_t ATTRIBUTE_PURE
   220565 XY_TEXT_IMMEDIATE_BLT_DestinationY1Coordinate_start(const struct gen_device_info *devinfo)
   220566 {
   220567    switch (devinfo->gen) {
   220568    case 10: return 0;
   220569    case 9: return 0;
   220570    case 8: return 0;
   220571    case 7:
   220572       if (devinfo->is_haswell) {
   220573          return 0;
   220574       } else {
   220575          return 0;
   220576       }
   220577    case 6: return 0;
   220578    case 5: return 48;
   220579    case 4:
   220580       if (devinfo->is_g4x) {
   220581          return 48;
   220582       } else {
   220583          return 48;
   220584       }
   220585    default:
   220586       unreachable("Invalid hardware generation");
   220587    }
   220588 }
   220589 
   220590 
   220591 
   220592 /* XY_TEXT_IMMEDIATE_BLT::Destination Y2 Coordinate */
   220593 
   220594 
   220595 #define GEN5_XY_TEXT_IMMEDIATE_BLT_DestinationY2Coordinate_bits  16
   220596 #define GEN45_XY_TEXT_IMMEDIATE_BLT_DestinationY2Coordinate_bits  16
   220597 #define GEN4_XY_TEXT_IMMEDIATE_BLT_DestinationY2Coordinate_bits  16
   220598 
   220599 static inline uint32_t ATTRIBUTE_PURE
   220600 XY_TEXT_IMMEDIATE_BLT_DestinationY2Coordinate_bits(const struct gen_device_info *devinfo)
   220601 {
   220602    switch (devinfo->gen) {
   220603    case 10: return 0;
   220604    case 9: return 0;
   220605    case 8: return 0;
   220606    case 7:
   220607       if (devinfo->is_haswell) {
   220608          return 0;
   220609       } else {
   220610          return 0;
   220611       }
   220612    case 6: return 0;
   220613    case 5: return 16;
   220614    case 4:
   220615       if (devinfo->is_g4x) {
   220616          return 16;
   220617       } else {
   220618          return 16;
   220619       }
   220620    default:
   220621       unreachable("Invalid hardware generation");
   220622    }
   220623 }
   220624 
   220625 
   220626 
   220627 #define GEN5_XY_TEXT_IMMEDIATE_BLT_DestinationY2Coordinate_start  80
   220628 #define GEN45_XY_TEXT_IMMEDIATE_BLT_DestinationY2Coordinate_start  80
   220629 #define GEN4_XY_TEXT_IMMEDIATE_BLT_DestinationY2Coordinate_start  80
   220630 
   220631 static inline uint32_t ATTRIBUTE_PURE
   220632 XY_TEXT_IMMEDIATE_BLT_DestinationY2Coordinate_start(const struct gen_device_info *devinfo)
   220633 {
   220634    switch (devinfo->gen) {
   220635    case 10: return 0;
   220636    case 9: return 0;
   220637    case 8: return 0;
   220638    case 7:
   220639       if (devinfo->is_haswell) {
   220640          return 0;
   220641       } else {
   220642          return 0;
   220643       }
   220644    case 6: return 0;
   220645    case 5: return 80;
   220646    case 4:
   220647       if (devinfo->is_g4x) {
   220648          return 80;
   220649       } else {
   220650          return 80;
   220651       }
   220652    default:
   220653       unreachable("Invalid hardware generation");
   220654    }
   220655 }
   220656 
   220657 
   220658 
   220659 /* XY_TEXT_IMMEDIATE_BLT::Packing */
   220660 
   220661 
   220662 #define GEN5_XY_TEXT_IMMEDIATE_BLT_Packing_bits  1
   220663 #define GEN45_XY_TEXT_IMMEDIATE_BLT_Packing_bits  1
   220664 #define GEN4_XY_TEXT_IMMEDIATE_BLT_Packing_bits  1
   220665 
   220666 static inline uint32_t ATTRIBUTE_PURE
   220667 XY_TEXT_IMMEDIATE_BLT_Packing_bits(const struct gen_device_info *devinfo)
   220668 {
   220669    switch (devinfo->gen) {
   220670    case 10: return 0;
   220671    case 9: return 0;
   220672    case 8: return 0;
   220673    case 7:
   220674       if (devinfo->is_haswell) {
   220675          return 0;
   220676       } else {
   220677          return 0;
   220678       }
   220679    case 6: return 0;
   220680    case 5: return 1;
   220681    case 4:
   220682       if (devinfo->is_g4x) {
   220683          return 1;
   220684       } else {
   220685          return 1;
   220686       }
   220687    default:
   220688       unreachable("Invalid hardware generation");
   220689    }
   220690 }
   220691 
   220692 
   220693 
   220694 #define GEN5_XY_TEXT_IMMEDIATE_BLT_Packing_start  16
   220695 #define GEN45_XY_TEXT_IMMEDIATE_BLT_Packing_start  16
   220696 #define GEN4_XY_TEXT_IMMEDIATE_BLT_Packing_start  16
   220697 
   220698 static inline uint32_t ATTRIBUTE_PURE
   220699 XY_TEXT_IMMEDIATE_BLT_Packing_start(const struct gen_device_info *devinfo)
   220700 {
   220701    switch (devinfo->gen) {
   220702    case 10: return 0;
   220703    case 9: return 0;
   220704    case 8: return 0;
   220705    case 7:
   220706       if (devinfo->is_haswell) {
   220707          return 0;
   220708       } else {
   220709          return 0;
   220710       }
   220711    case 6: return 0;
   220712    case 5: return 16;
   220713    case 4:
   220714       if (devinfo->is_g4x) {
   220715          return 16;
   220716       } else {
   220717          return 16;
   220718       }
   220719    default:
   220720       unreachable("Invalid hardware generation");
   220721    }
   220722 }
   220723 
   220724 
   220725 
   220726 /* XY_TEXT_IMMEDIATE_BLT::Tiling Enable */
   220727 
   220728 
   220729 #define GEN5_XY_TEXT_IMMEDIATE_BLT_TilingEnable_bits  1
   220730 #define GEN45_XY_TEXT_IMMEDIATE_BLT_TilingEnable_bits  1
   220731 #define GEN4_XY_TEXT_IMMEDIATE_BLT_TilingEnable_bits  1
   220732 
   220733 static inline uint32_t ATTRIBUTE_PURE
   220734 XY_TEXT_IMMEDIATE_BLT_TilingEnable_bits(const struct gen_device_info *devinfo)
   220735 {
   220736    switch (devinfo->gen) {
   220737    case 10: return 0;
   220738    case 9: return 0;
   220739    case 8: return 0;
   220740    case 7:
   220741       if (devinfo->is_haswell) {
   220742          return 0;
   220743       } else {
   220744          return 0;
   220745       }
   220746    case 6: return 0;
   220747    case 5: return 1;
   220748    case 4:
   220749       if (devinfo->is_g4x) {
   220750          return 1;
   220751       } else {
   220752          return 1;
   220753       }
   220754    default:
   220755       unreachable("Invalid hardware generation");
   220756    }
   220757 }
   220758 
   220759 
   220760 
   220761 #define GEN5_XY_TEXT_IMMEDIATE_BLT_TilingEnable_start  11
   220762 #define GEN45_XY_TEXT_IMMEDIATE_BLT_TilingEnable_start  11
   220763 #define GEN4_XY_TEXT_IMMEDIATE_BLT_TilingEnable_start  11
   220764 
   220765 static inline uint32_t ATTRIBUTE_PURE
   220766 XY_TEXT_IMMEDIATE_BLT_TilingEnable_start(const struct gen_device_info *devinfo)
   220767 {
   220768    switch (devinfo->gen) {
   220769    case 10: return 0;
   220770    case 9: return 0;
   220771    case 8: return 0;
   220772    case 7:
   220773       if (devinfo->is_haswell) {
   220774          return 0;
   220775       } else {
   220776          return 0;
   220777       }
   220778    case 6: return 0;
   220779    case 5: return 11;
   220780    case 4:
   220781       if (devinfo->is_g4x) {
   220782          return 11;
   220783       } else {
   220784          return 11;
   220785       }
   220786    default:
   220787       unreachable("Invalid hardware generation");
   220788    }
   220789 }
   220790 
   220791 
   220792 
   220793 #ifdef __cplusplus
   220794 }
   220795 #endif
   220796 
   220797 #endif /* GENX_BITS_H */