INNER CODE UNIT · Python
match_sdot_patten
PaddlePaddle/Paddle-Lite · lite/tools/convert_arm_sdot_to_machine_code.py:36
def match_sdot_patten(line):
matched = re.search(
r'sdot\s+v(.*?).4s\s*,\s*v(.*?).16b\s*,\s*v(.*?).4b\[(.*?)\].*', line,
re.M | re.I)
if matched:
# print('matched:', matched.group(1), matched.group(2), matched.group(3), matched.group(4))
vd = int(matched.group(1))
vn = int(matched.group(2))
vm = int(matched.group(3))
idx = int(matched.group(4))
return compute_sdot_vec_elem(vd, vn, vm, idx)
else:
return line
def parser_file(file_in, file_out):
out = open(file_out, 'w')
if os.path.exists(file_in):