agx: drop encoding_16

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31908>
This commit is contained in:
Alyssa Rosenzweig
2024-10-13 22:32:35 -04:00
parent ce02690902
commit 22a8a0fe6d
4 changed files with 6 additions and 11 deletions
-1
View File
@@ -24,7 +24,6 @@ const struct agx_opcode_info agx_opcodes_info[AGX_NUM_OPCODES] = {
[AGX_OPCODE_${opcode.upper()}] = {
"${opcode}", ${op.srcs}, ${op.dests}, ${" | ".join(imms)},
${make_encoding(op.encoding_32)},
${make_encoding(op.encoding_16)},
AGX_SCHEDULE_CLASS_${op.schedule_class.upper()},
${int(op.is_float)},
${int(op.can_eliminate)},
-1
View File
@@ -72,7 +72,6 @@ struct agx_opcode_info {
unsigned nr_dests;
uint64_t immediates;
struct agx_encoding encoding;
struct agx_encoding encoding_16;
enum agx_schedule_class schedule_class;
bool is_float : 1;
bool can_eliminate : 1;
+3 -6
View File
@@ -11,7 +11,7 @@ VARIABLE = ~0
class Opcode(object):
def __init__(self, name, dests, srcs, imms, is_float, can_eliminate,
can_reorder, schedule_class, encoding_16, encoding_32):
can_reorder, schedule_class, encoding_32):
self.name = name
self.dests = dests if dests != VARIABLE else 0
self.srcs = srcs if srcs != VARIABLE else 0
@@ -22,7 +22,6 @@ class Opcode(object):
self.can_eliminate = can_eliminate
self.can_reorder = can_reorder
self.schedule_class = schedule_class
self.encoding_16 = encoding_16
self.encoding_32 = encoding_32
class Immediate(object):
@@ -47,13 +46,11 @@ class Encoding(object):
assert(length_long == length_short + (4 if length_short > 8 else 2))
def op(name, encoding_32, dests = 1, srcs = 0, imms = [], is_float = False,
can_eliminate = True, can_reorder = True, encoding_16 = None,
schedule_class = "none"):
encoding_16 = Encoding(encoding_16) if encoding_16 is not None else None
can_eliminate = True, can_reorder = True, schedule_class = "none"):
encoding_32 = Encoding(encoding_32) if encoding_32 is not None else None
opcodes[name] = Opcode(name, dests, srcs, imms, is_float, can_eliminate,
can_reorder, schedule_class, encoding_16, encoding_32)
can_reorder, schedule_class, encoding_32)
def immediate(name, ctype = "uint32_t"):
imm = Immediate(name, ctype)
+3 -3
View File
@@ -409,10 +409,10 @@ static void
agx_pack_alu(struct util_dynarray *emission, agx_instr *I)
{
struct agx_opcode_info info = agx_opcodes_info[I->op];
bool is_16 = agx_all_16(I) && info.encoding_16.exact;
struct agx_encoding encoding = info.encoding;
bool is_f16 = (I->op == AGX_OPCODE_HMUL || I->op == AGX_OPCODE_HFMA ||
I->op == AGX_OPCODE_HADD);
struct agx_encoding encoding = is_16 ? info.encoding_16 : info.encoding;
pack_assert_msg(I, encoding.exact, "invalid encoding");
@@ -452,7 +452,7 @@ agx_pack_alu(struct util_dynarray *emission, agx_instr *I)
unsigned src_extend = (src >> 10);
/* Size bit always zero and so omitted for 16-bit */
if (is_16 && !is_cmpsel)
if (is_f16 && !is_cmpsel)
pack_assert(I, (src_short & (1 << 9)) == 0);
if (info.is_float || (I->op == AGX_OPCODE_FCMPSEL && !is_cmpsel)) {