aco: don't use python 3.7+ feature in aco_opcodes.py

Use the suggestion from https://stackoverflow.com/questions/11351032/named-tuple-and-default-values-for-optional-keyword-arguments
so the script works on older Python.

Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28831>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2024-04-19 16:48:45 +02:00 committed by Marge Bot
parent fe4f6dd18f
commit 27a3880ada

View file

@ -221,8 +221,10 @@ class Format(IntEnum):
return res
Opcode = namedtuple('Opcode', ['gfx6', 'gfx7', 'gfx8', 'gfx9', 'gfx10', 'gfx11'],
defaults=[-1, -1, -1, -1, -1, -1])
Opcode = namedtuple('Opcode', ['gfx6', 'gfx7', 'gfx8', 'gfx9', 'gfx10', 'gfx11'])
# namedtuple 'defaults' keyword requires python 3.7+. Use an equivalent construct
# to support older versions.
Opcode.__new__.__defaults__=(-1, -1, -1, -1, -1, -1)
class Instruction(object):
"""Class that represents all the information we have about the opcode