diff --git a/src/panfrost/bifrost/bi_opcodes.c.py b/src/panfrost/bifrost/bi_opcodes.c.py index d0cda112dcd..cbe0ae458a2 100644 --- a/src/panfrost/bifrost/bi_opcodes.c.py +++ b/src/panfrost/bifrost/bi_opcodes.c.py @@ -29,6 +29,7 @@ struct bi_op_props bi_opcode_props[BI_NUM_OPCODES] = { % for opcode in sorted(mnemonics): <% add = instructions["+" + opcode][0][1] if "+" + opcode in instructions else None + size = typesize(opcode) message = add["message"].upper() if add else "NONE" sr_count = add["staging_count"].upper() if add else "0" sr_read = int(add["staging"] in ["r", "rw"] if add else False) @@ -46,9 +47,10 @@ struct bi_op_props bi_opcode_props[BI_NUM_OPCODES] = { m_not = hasmod(mods, 'not1') %> [BI_OPCODE_${opcode.replace('.', '_').upper()}] = { - "${opcode}", BIFROST_MESSAGE_${message}, BI_SR_COUNT_${sr_count}, - ${sr_read}, ${sr_write}, ${last}, ${branch}, ${table}, ${has_fma}, ${has_add}, - ${clamp}, ${not_result}, ${abs}, ${neg}, ${m_not}, + "${opcode}", BIFROST_MESSAGE_${message}, BI_SIZE_${size}, + BI_SR_COUNT_${sr_count}, ${sr_read}, ${sr_write}, ${last}, ${branch}, + ${table}, ${has_fma}, ${has_add}, ${clamp}, ${not_result}, ${abs}, + ${neg}, ${m_not}, }, % endfor };""" @@ -61,4 +63,4 @@ instructions = parse_instructions(sys.argv[1], include_pseudo = True) ir_instructions = partition_mnemonics(instructions) mnemonics = set(x[1:] for x in instructions.keys()) -print(Template(COPYRIGHT + TEMPLATE).render(ops = ir_instructions, mnemonics = mnemonics, instructions = instructions)) +print(Template(COPYRIGHT + TEMPLATE).render(ops = ir_instructions, mnemonics = mnemonics, instructions = instructions, typesize = typesize)) diff --git a/src/panfrost/bifrost/bi_opcodes.h.py b/src/panfrost/bifrost/bi_opcodes.h.py index 9459eda894c..2c3f915baf9 100644 --- a/src/panfrost/bifrost/bi_opcodes.h.py +++ b/src/panfrost/bifrost/bi_opcodes.h.py @@ -64,11 +64,23 @@ enum bi_sr_count { BI_SR_COUNT_SR_COUNT = 7 }; +enum bi_size { + BI_SIZE_8 = 0, + BI_SIZE_16, + BI_SIZE_24, + BI_SIZE_32, + BI_SIZE_48, + BI_SIZE_64, + BI_SIZE_96, + BI_SIZE_128, +}; + /* Description of an opcode in the IR */ struct bi_op_props { const char *name; enum bifrost_message_type message : 4; + enum bi_size size : 3; enum bi_sr_count sr_count : 3; bool sr_read : 1; bool sr_write : 1;