Esempio n. 1
0
def main():
    hex_common.read_semantics_file(sys.argv[1])
    hex_common.read_attribs_file(sys.argv[2])
    hex_common.read_overrides_file(sys.argv[3])
    hex_common.calculate_attribs()
    tagregs = hex_common.get_tagregs()
    tagimms = hex_common.get_tagimms()

    with open(sys.argv[4], 'w') as f:
        f.write("#ifndef HEXAGON_TCG_FUNCS_H\n")
        f.write("#define HEXAGON_TCG_FUNCS_H\n\n")

        for tag in hex_common.tags:
            ## Skip the priv instructions
            if ("A_PRIV" in hex_common.attribdict[tag]):
                continue
            ## Skip the guest instructions
            if ("A_GUEST" in hex_common.attribdict[tag]):
                continue
            ## Skip the diag instructions
            if (tag == "Y6_diag"):
                continue
            if (tag == "Y6_diag0"):
                continue
            if (tag == "Y6_diag1"):
                continue

            gen_def_tcg_func(f, tag, tagregs, tagimms)

        f.write("#endif    /* HEXAGON_TCG_FUNCS_H */\n")
Esempio n. 2
0
def main():
    hex_common.read_semantics_file(sys.argv[1])
    hex_common.read_attribs_file(sys.argv[2])
    hex_common.calculate_attribs()
    tagregs = hex_common.get_tagregs()
    tagimms = hex_common.get_tagimms()

    with open(sys.argv[3], 'w') as f:
        f.write("#ifndef HEXAGON_FUNC_TABLE_H\n")
        f.write("#define HEXAGON_FUNC_TABLE_H\n\n")

        f.write("const SemanticInsn opcode_genptr[XX_LAST_OPCODE] = {\n")
        for tag in hex_common.tags:
            ## Skip the priv instructions
            if ("A_PRIV" in hex_common.attribdict[tag]):
                continue
            ## Skip the guest instructions
            if ("A_GUEST" in hex_common.attribdict[tag]):
                continue
            ## Skip the diag instructions
            if (tag == "Y6_diag"):
                continue
            if (tag == "Y6_diag0"):
                continue
            if (tag == "Y6_diag1"):
                continue

            f.write("    [%s] = generate_%s,\n" % (tag, tag))
        f.write("};\n\n")

        f.write("#endif    /* HEXAGON_FUNC_TABLE_H */\n")
Esempio n. 3
0
def main():
    hex_common.read_semantics_file(sys.argv[1])
    hex_common.read_attribs_file(sys.argv[2])
    hex_common.read_overrides_file(sys.argv[3])
    hex_common.read_overrides_file(sys.argv[4])
    hex_common.calculate_attribs()
    tagregs = hex_common.get_tagregs()
    tagimms = hex_common.get_tagimms()

    with open(sys.argv[5], 'w') as f:
        for tag in hex_common.tags:
            ## Skip the priv instructions
            if ("A_PRIV" in hex_common.attribdict[tag]):
                continue
            ## Skip the guest instructions
            if ("A_GUEST" in hex_common.attribdict[tag]):
                continue
            ## Skip the diag instructions
            if (tag == "Y6_diag"):
                continue
            if (tag == "Y6_diag0"):
                continue
            if (tag == "Y6_diag1"):
                continue
            if (hex_common.skip_qemu_helper(tag)):
                continue

            gen_helper_function(f, tag, tagregs, tagimms)
Esempio n. 4
0
def main():
    hex_common.read_semantics_file(sys.argv[1])
    hex_common.read_attribs_file(sys.argv[2])
    hex_common.calculate_attribs()
    tagregs = hex_common.get_tagregs()
    tagimms = hex_common.get_tagimms()

    with open(sys.argv[3], 'w') as f:
        f.write("#ifndef DEF_SHORTCODE\n")
        f.write("#define DEF_SHORTCODE(TAG,SHORTCODE)    /* Nothing */\n")
        f.write("#endif\n")

        for tag in hex_common.tags:
            ## Skip the priv instructions
            if ("A_PRIV" in hex_common.attribdict[tag]):
                continue
            ## Skip the guest instructions
            if ("A_GUEST" in hex_common.attribdict[tag]):
                continue
            ## Skip the diag instructions
            if (tag == "Y6_diag"):
                continue
            if (tag == "Y6_diag0"):
                continue
            if (tag == "Y6_diag1"):
                continue

            gen_shortcode(f, tag)

        f.write("#undef DEF_SHORTCODE\n")
Esempio n. 5
0
def main():
    hex_common.read_semantics_file(sys.argv[1])
    hex_common.read_attribs_file(sys.argv[2])
    hex_common.calculate_attribs()

    ##
    ##     Generate all the attributes associated with each instruction
    ##
    with open(sys.argv[3], 'w') as f:
        for tag in hex_common.tags:
            f.write('OP_ATTRIB(%s,ATTRIBS(%s))\n' % \
                (tag, ','.join(sorted(hex_common.attribdict[tag]))))