[Libre-soc-bugs] [Bug 980] Implement C-based Power ISA pseudocode compiler

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sat Jan 13 20:11:12 GMT 2024


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

--- Comment #90 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Dmitry Selyutin from comment #86)
> A huge update. Many operations are now supported. From now on, every integer
> should be represented by a structure which will look like this:
> 
> struct oppc_int {
>     uint64_t bits;
>     uint64_t value[];
> };

and an "ok" flag. this is absolutely essential.

struct oppc_int {
    uint64_t bits;
    uint64_t value[];
    bool ok;   // set when value is modified
 };


> To clarify about function calls and integer type. I have no intent to
> provide a completely __working__ C code in scope of this task. This would
> require to implement an analogue of SelectableInt, invent context with all
> the registers and states, etc. etc. It will never fit the time constraints,
> and certainly already doesn't fit the budget.

yyep, not a surprise at all.  it took me 6-8 weeks to do SV for spike.

> The idea at this stage is:
> 1. Emit the code which is valid C code.
> 2. Check whether it's buildable with some stubs instead of functions and
> context.
> 
> This is it. This is just a task "take pseudocode and emit C code", not "make
> a fully-blown decoder and simulator". Any objections?

none here as long as the data structure includes that "ok" flag
and is initially clear and is set by any oppc_* operation.

basically if *ALL* the functions oppc_add oppc_assign oppc_le
set the ok flag on their return result then the desired behaviour
is achieved with NO NEED for the compiler to even know that the
ok flag exists.

do NOT attempt to get the compiler to emit code that sets the ok flag.

let the oppc_{arithmetic*} functions handle it.

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


More information about the libre-soc-bugs mailing list