MCPcopy Create free account
hub / github.com/Inori/GPCS4 / ProcessOpcodes

Function ProcessOpcodes

Tools/ParseOpcode.py:378–403  ·  view source on GitHub ↗
(op_list)

Source from the content-addressed store, hash-verified

376 dst.close()
377
378def ProcessOpcodes(op_list):
379 print('opcode count:{}'.format(len(op_list)))
380
381 op_dic = {}
382 for opcode, encoding, mode, value in op_list:
383
384 if not encoding in op_dic:
385 op_dic[encoding] = []
386
387 op_dic[encoding].append((opcode, value, mode))
388
389 def takeOpValue(element):
390 return element[1]
391
392 for value in op_dic.values():
393 value.sort(key=takeOpValue)
394
395 WriteOpFormat(op_dic)
396 WriteOpEnum(op_dic)
397
398 for encoding, lst in op_dic.items():
399 WriteList(encoding, lst)
400
401 vop3_list = op_dic['GCNENC_VOP3']
402 unique_vop3 = FindUniqueVOP3(op_dic, vop3_list)
403 WriteList('VOP3_UNIQUE', unique_vop3)
404
405
406

Callers 1

mainFunction · 0.85

Calls 7

WriteOpFormatFunction · 0.85
WriteOpEnumFunction · 0.85
WriteListFunction · 0.85
FindUniqueVOP3Function · 0.85
printFunction · 0.50
formatMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected