[Libre-soc-bugs] [Bug 838] sync or at least statically check fields.text, power_decoder, trans/svp64, CSVs between each other

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Aug 5 15:01:14 BST 2022


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

--- Comment #19 from Dmitry Selyutin <ghostmansd at gmail.com> ---
This seems to do the trick. A bit hacky, and I'm not sure of this entirely, but
it did achieved the results for some codes I checked in binutils.

class Record:
    ppc: PPCRecord
    svp64: SVP64Record
    section: Section

    @property
    @_functools.lru_cache(maxsize=1)
    def opcodes(self):
        fields = []
        (start, end) = self.section.bitsel
        if self.section.opcode:
            fields += [(self.section.opcode, 0, 5)]
            fields += [(self.ppc.opcode, start, end)]
        else:
            fields += [(self.ppc.opcode, start, end)]
        yield Opcode(fields)

        if self.ppc.rc is RC.RC:
            yield Opcode(fields + [(1, 31, 31)])

I'm not sure of whether we should output it this way; the thing is that we have
one record shared for two instruction, with Rc set and without. Perhaps this
should be refactored a bit, these are distinct instructions; it's only our CSVs
which happen to treat these as a single entity (that said, they're also
correct, because logically it's one entry).

Anyway, I'll proceed to replacing some bits soon. I'll start with binutils,
because I don't want to break anything. Some code will be removed, especially
the part where we call get_svp64_csv manually on well-known CSVs. This will be
replaced with the new database and all classes around.

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


More information about the libre-soc-bugs mailing list