File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -87,17 +87,16 @@ def load_regsmap(archtype: QL_ARCH) -> Sequence[RegEntry]:
8787 QL_ARCH .MIPS : dict (** mips_regs_gpr , ** mips_regs_fpu )
8888 }[archtype ]
8989
90- regmap = []
91- pos = 0
92-
9390 xmlpath = __get_xml_path (archtype )
91+ regsinfo = sorted (__walk_xml_regs (* xmlpath ))
9492
95- for regnum , name , bitsize in __walk_xml_regs ( * xmlpath ):
96- # regs indices might not be consecutive.
97- # extend regmap with null entries if needed
98- if len ( regmap ) < regnum + 1 :
99- regmap . extend ([( None , 0 , 0 )] * ( regnum + 1 - len ( regmap )))
93+ # pre-allocate regmap and occupy it with null entries
94+ last_regnum = regsinfo [ - 1 ][ 0 ]
95+ regmap : Sequence [ RegEntry ] = [( None , 0 , 0 )] * ( last_regnum + 1 )
96+
97+ pos = 0
10098
99+ for regnum , name , bitsize in sorted (regsinfo ):
101100 # reg value size in nibbles
102101 nibbles = bitsize // 4
103102
You can’t perform that action at this time.
0 commit comments