intel/decoder: don't consider header fields past dword0

v2: use ULL

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4134>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4134>
This commit is contained in:
Lionel Landwerlin 2020-03-10 17:49:30 +02:00 committed by Marge Bot
parent 0c41937440
commit 25a54554b3

View file

@ -1208,10 +1208,12 @@ gen_field_is_header(struct gen_field *field)
{
uint32_t bits;
if (field->start >= 32)
/* Instructions are identified by the first DWord. */
if (field->start >= 32 ||
field->end >= 32)
return false;
bits = (1U << (field->end - field->start + 1)) - 1;
bits = (1ULL << (field->end - field->start + 1)) - 1;
bits <<= field->start;
return (field->parent->opcode_mask & bits) != 0;