Revert "sv_binutils: generate register categories mapping"
authorDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Tue, 12 Apr 2022 16:30:45 +0000 (16:30 +0000)
committerDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Tue, 12 Apr 2022 16:30:45 +0000 (16:30 +0000)
This reverts commit b2943e73797b6544e15ea43a14cf57b2275509d6.

src/openpower/sv/sv_binutils.py

index 8b3dbf6c062ce83b8ee083e9ef97d910e22ba272..e11c9f4738f7f590f3b6b0eabd94316dd09e75c7 100644 (file)
@@ -334,18 +334,6 @@ class Codegen(_enum.Enum):
             yield f"#define SVP64_NAME_MAX {max(map(lambda entry: len(entry.name), entries))}"
             yield ""
 
-            yield "enum svp64_reg_category {"
-            yield "    SVP64_REG_CATEGORY_UNKNOWN,"
-            yield "    SVP64_REG_CATEGORY_GPR,"
-            yield "    SVP64_REG_CATEGORY_FPR,"
-            yield "    SVP64_REG_CATEGORY_CR_3BIT,"
-            yield "    SVP64_REG_CATEGORY_CR_5BIT,"
-            yield "};"
-            yield ""
-
-            yield "enum svp64_reg_category"
-            yield "svp64_reg_category(unsigned char type);"
-
             yield "#ifdef __cplusplus"
             yield "}"
             yield "#endif"
@@ -371,45 +359,6 @@ class Codegen(_enum.Enum):
             yield "    sizeof (svp64_entries) / sizeof (svp64_entries[0]);"
             yield ""
 
-            yield "#ifndef BC"
-            yield "#define BC CRB"
-            yield "#endif"
-            yield ""
-            yield "enum svp64_reg_category"
-            yield "svp64_reg_category(unsigned char type)"
-            yield "{"
-            yield "    size_t i;"
-            yield "    static struct {"
-            yield "        unsigned char type;"
-            yield "        unsigned char category;"
-            yield "    } const table[] = {"
-            yield "        {BF  , SVP64_REG_CATEGORY_CR_3BIT},"
-            yield "        {BFA , SVP64_REG_CATEGORY_CR_3BIT},"
-            yield "        {BA  , SVP64_REG_CATEGORY_CR_5BIT},"
-            yield "        {BB  , SVP64_REG_CATEGORY_CR_5BIT},"
-            yield "        {BC  , SVP64_REG_CATEGORY_CR_5BIT},"
-            yield "        {BI  , SVP64_REG_CATEGORY_CR_5BIT},"
-            yield "        {BT  , SVP64_REG_CATEGORY_CR_5BIT},"
-            yield "        {RA  , SVP64_REG_CATEGORY_GPR},"
-            yield "        {RB  , SVP64_REG_CATEGORY_GPR},"
-            yield "        {RC  , SVP64_REG_CATEGORY_GPR},"
-            yield "        {RS  , SVP64_REG_CATEGORY_GPR},"
-            yield "        {RT  , SVP64_REG_CATEGORY_GPR},"
-            yield "        {FRA , SVP64_REG_CATEGORY_FPR},"
-            yield "        {FRB , SVP64_REG_CATEGORY_FPR},"
-            yield "        {FRC , SVP64_REG_CATEGORY_FPR},"
-            yield "        {FRS , SVP64_REG_CATEGORY_FPR},"
-            yield "        {FRT , SVP64_REG_CATEGORY_FPR},"
-            yield "    };"
-            yield ""
-            yield "    for (i = 0; i < sizeof (table) / sizeof (table[0]); ++i) {"
-            yield "        if (table[i].type == type)"
-            yield "            return (enum svp64_reg_category)table[i].category;"
-            yield "    }"
-            yield ""
-            yield "    return SVP64_REG_CATEGORY_UNKNOWN;"
-            yield "}"
-
         return {
             Codegen.PPC_SVP64_H: ppc_svp64_h,
             Codegen.PPC_SVP64_OPC_C: ppc_svp64_opc_c,