[Libre-soc-bugs] [Bug 1177] revert unauthorized change to pseudocode language

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Tue Oct 3 05:10:12 BST 2023


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

Jacob Lifshay <programmerjake at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |programmerjake at gmail.com

--- Comment #3 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #1)
> ok i took a look at power isa 3.0 using vex_flags and yes it looks
> like vex_flags is a "gate" to disable writing to RT.

not writing [F]RT is used for all FP traps so the trap handler can see the
original input values rather than e.g. fadd f1, f1, f1 overwriting f1 with junk
making it impossible to read the original value.

this isn't actually needed for cffpr since RT can't overwrite any inputs since
they're in a different register file, but you asked that we retain that
pseudocode anyway.
https://bugs.libre-soc.org/show_bug.cgi?id=1087#c30
> 
> it is therefore reasonable to "special-case" vex_flags just like
> the use of "overflow" in ISACaller to stop RT from being written,

imo a better approach is to have the simulator read all destination registers
(marking the reads as ignored for the in-order pipeline simulator) before
executing the pseudo-code, so *any* conditional overwrites will work without
needing any vex_flags special casing (special casing should be avoided whenever
possible). this also matches what a reasonable reader would expect the
pseudocode to mean, where any unwritten outputs keep their original values.

so, like:
if (RA) = 0 then
    RT <- (RB)

would approximately translate to:
def op_theinsn(self, RA, RB, RT):
    if eq(RA, 0):
        RT = copy_it_icr_the_name(RB)
    return (RT,)

> rather than poison the language by adding extraneous external
> "guidance" in the markdown.

the way i saw it is that the pseudocode still described completely what's
happening, the html comment is not part of the pseudocode and is merely there
to inform our simulator that its overly-simplistic analysis of what registers
need to be passed into the translated pseudocode need RT added too.

> 
> the language is supposed to be self-describing and self-contained.

imo it was even with the html comment.

> for future work please use branches only so that there is an opportunity
> for a full review.

imo our project is to the size where *everyone* should be working in separate
branches and then merging to master only after both someone else okays the
changes *and* CI passes on their branch.

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


More information about the libre-soc-bugs mailing list