[Libre-soc-bugs] [Bug 1154] Support basic PowerPC generated assembly

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Wed Sep 13 18:34:31 BST 2023


https://bugs.libre-soc.org/show_bug.cgi?id=1154

--- Comment #15 from Dmitry Selyutin <ghostmansd at gmail.com> ---
It took an awful lot of time, thanks to major refactoring of code generation
and isel and svshape. From now on, we generate a unique opcode for each and
every instruction; no more redundant table which specifies "hey iterate over
multiple records, here's the range as the second table so that you could jump
into the third table".

    [85] = {
        /*
         * PO=22 [0, 1, 2, 3, 4, 5]
         * XO=281 [21, 22, 23, 26, 27, 28, 29, 30, 31]
         */
        .name = "svshape2",
        .opcode = {
            .value = UINT64_C(0x58000419),
            .mask = UINT64_C(0xfc00073f),
        },
        .operands = {
            [0] = UINT8_C(0x2a), /* SVo */
            [1] = UINT8_C(0x0b), /* SVyx */
            [2] = UINT8_C(0x21), /* rmm */
            [3] = UINT8_C(0x1d), /* SVd */
            [4] = UINT8_C(0x1f), /* sk */
            [5] = UINT8_C(0x24), /* mm */
            [6] = UINT8_C(0x00), /* NIL */
        },
    },
    [86] = {
        /*
         * PO=22 [0, 1, 2, 3, 4, 5]
         * XO=25 [26, 27, 28, 29, 30, 31]
         */
        .name = "svshape",
        .opcode = {
            .value = UINT64_C(0x58000019),
            .mask = UINT64_C(0xfc00003f),
        },
        .operands = {
            [0] = UINT8_C(0x1b), /* SVxd */
            [1] = UINT8_C(0x1c), /* SVyd */
            [2] = UINT8_C(0x1d), /* SVzd */
            [3] = UINT8_C(0x1e), /* SVrm */
            [4] = UINT8_C(0x1f), /* vf */
            [5] = UINT8_C(0x00), /* NIL */
        },
    },
    [359] = {
        /*
         * PO=31 [0, 1, 2, 3, 4, 5]
         * XO=15 [26, 27, 28, 29, 30]
         */
        .name = "isel",
        .opcode = {
            .value = UINT64_C(0x7c00001e),
            .mask = UINT64_C(0xfc00003e),
        },
        .operands = {
            [0] = UINT8_C(0x04), /* RT */
            [1] = UINT8_C(0x02), /* RA */
            [2] = UINT8_C(0x05), /* RB */
            [3] = UINT8_C(0x2d), /* BC */
            [4] = UINT8_C(0x00), /* NIL */
        },
    },

The most difficult task was to make svshape2 appear before svshape in a way
that is generic. The table used to be sorted by just (opcode.value,
opcode.mask). Now we check count of bits in mask as well. In hoc signo
uincemus!

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list