INNER CODE UNIT · Python

compute_vsdot_vec_elem

PaddlePaddle/Paddle-Lite · lite/tools/convert_arm_vsdot_to_machine_code.py:28

def compute_vsdot_vec_elem(vd, vn, vm, idx):
    i = 0x0d40fe20 | ((int(vd) & 0x7) << 29) | ((int(vd) & 0x8) << 3) | (
        (int(vn) & 0x7) << 1) | (
            (int(vn) & 0x8) << 20) | (int(vm) << 16) | (int(idx % 2) << 21)
    return '".word 0x{:08x}\\n"'.format(i) + \
           ' /* vsdot.s8 q{vd}, q{vn}, d{vm}[{idx}] */\\\r\n'.format(
               vd=vd, vn=vn, vm=vm, idx=idx)


def match_vsdot_patten(line):
    matched = re.search(
        r'vsdot.s8\s+q(.*?)\s*,\s*q(.*?)\s*,\s*d(.*?)\[(.*?)\].*', line, re.M |
        re.I)
    if matched:
        vd = int(matched.group(1))
        vn = int(matched.group(2))
        vm = int(matched.group(3))
        idx = int(matched.group(4))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…