Exemplo n.º 1
0
def do_it(o):
    #meat = P.cutoff_comments(g_mul0)
    #meat = P.cutoff_comments(g_mul0_only)
    #meat = P.cutoff_comments(g_mul0_only_immediate_writes)
    #meat = P.cutoff_comments(g_mul0_only_adcx)
    #meat = P.cutoff_comments(g_mul0_only_adox_imm_writes)

    if 0:
        p = list(range(12))
        meat += mul1_code(3, P.cutoff_comments(g_muladd_3), p)
        m4 = P.cutoff_comments(g_muladd_4)
        meat += mul1_code(4, m4, p)
        m5 = P.swap_adox_adcx(m4)
        q = [int(x, 16) for x in g_perm.split(' ')]
        p = P.composition(p, q)
        meat += mul1_code(5, m5, p)
        p = P.composition(p, q)
        meat += mul1_code(6, m4, p)
        p = P.composition(p, q)
        meat += mul1_code(7, m5, p)
    else:
        # benchmark only mul0 and tail
        #meat += P.cutoff_comments(g_tail_after_mul0_delayed_writes)
        #meat += P.cutoff_comments(g_tail_after_mul0_immediate_writes)
        pass

    code = P.cutoff_comments(g_mul01) + P.cutoff_comments(g_mul01_tail)
    code = '\n'.join(code)
    code = P.replace_symbolic_names_wr(code, g_var_map)
    code = code.split('\n')
    code = [replace_ymm_by_xmm(x) for x in code]

    cook_asm(o, code, 'mul8x2_zen')
def do_it(o):
    meat = mul0_code(P.cutoff_comments(g_mul_012))

    p = list(range(12))
    meat += mul1_code(3, P.cutoff_comments(g_muladd_3), p)
    m4 = P.cutoff_comments(g_muladd_4)
    meat += mul1_code(4, m4, p)
    m5 = P.swap_adox_adcx(m4)
    q = [int(x, 16) for x in g_perm.split(' ')]
    p = P.composition(p, q)
    meat += mul1_code(5, m5, p)
    p = P.composition(p, q)
    meat += mul1_code(6, m4, p)
    p = P.composition(p, q)
    meat += mul1_code(7, m5, p)

    cook_asm(o, meat)
def alignment_code(shift):
    p = list(range(12))
    m2 = P.cutoff_comments(E.g_muladd_2)
    m3 = P.swap_adox_adcx(m2)
    code = mul1_code(2, m2, p, shift)
    q = [int(x, 16) for x in E.g_perm.split(' ')]
    for i in range(3, 6):
        p = P.composition(p, q)
        if i & 1:
            code += mul1_code(i, m3, p, shift)
        else:
            code += mul1_code(i, m2, p, shift)

    tail = E.cook_tail(m2)
    p = P.composition(p, q)
    code += mul1_code(6, tail, p, shift)

    return code
Exemplo n.º 4
0
def do_it(o):
    meat = P.cutoff_comments(g_mul_01)
    p = list(range(12))
    m2 = P.cutoff_comments(g_muladd_2)
    m3 = P.swap_adox_adcx(m2)
    meat += mul1_code(2, m2, p)
    q = [int(x, 16) for x in g_perm.split(' ')]
    for i in range(3, 6):
        p = P.composition(p, q)
        if i & 1:
            meat += mul1_code(i, m3, p)
        else:
            meat += mul1_code(i, m2, p)

    tail = cook_tail(m2)
    p = P.composition(p, q)
    meat += mul1_code(6, tail, p)

    P.cook_asm(o, meat, g_var_map, True)