[Libre-soc-bugs] [Bug 982] Support PowerPC ABI in ISACaller

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Oct 20 22:13:30 BST 2023


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

--- Comment #108 from Dmitry Selyutin <ghostmansd at gmail.com> ---
Hm hm hm. Luke, if my statements on PC are correct, we might do something like
this (also brutal but perhaps more obvious than CHEAT):


def do_outregs_nia(self, asmop, ins_name, info, outs,
                       ca_en, rc_en, ffirst_hit, ew_dst,
                       rfid=False):
    # snip
    if nia_update and not rfid:
        self.update_pc_next()


def call(self, name, rfid=False):
    # snip

    if asmop in ("sc", "scv") and self.syscall is not None:
        identifier = self.gpr(0)
        arguments = map(self.gpr, range(3, 9))
        result = self.syscall(identifier, *arguments)
        self.gpr.write(3, result, False, self.namespace["XLEN"])

    # snip

    # any modified return results?
    yield from self.do_outregs_nia(asmop, ins_name, info, outs,
                                    carry_en, rc_en, ffirst_hit, ew_dst,
                                    rfid=rfid)

    if asmop in ("sc", "scv") and self.syscall is not None:
        return self.call("rfid")


An alternative is:


def call(self, name):
    # snip
    scemu = (asmop in ("sc", "scv") and self.syscall is not None)
    yield from self.do_outregs_nia(asmop, ins_name, info, outs,
                                    carry_en, rc_en, ffirst_hit, ew_dst,
                                    update_pc=not scemu)

    if scemu:
        self.call("rfid", update_pc=False)

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


More information about the libre-soc-bugs mailing list