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

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sun Jan 14 08:49:58 GMT 2024


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

--- Comment #97 from Dmitry Selyutin <ghostmansd at gmail.com> ---
(In reply to Dmitry Selyutin from comment #95)
> Folks, could you, please, elaborate, why it's done on a generic integer
> class? I've been thinking rather of this approach:
> 
> struct oppc_reg {
>     struct oppc_int value;
>     uint64_t flags;
> };
> 
> ...where assignments to registers (and similar stuff) have the flags
> updated.

Like this:

if (a = b) then
    RA <- 0b0
else
    X <- 0b0

void
oppc_cocojamboo(void) {
    struct oppc_int a;
    struct oppc_int b;
    struct oppc_int X;
    if (
        /* (a = b) */
        oppc_eq(
            &a,
            &b
        )
    ) {
        /* RA <- 0b0 */
        oppc_assign(
            /* (RA) */
            &ctx->gpr[OPPC_GPR_RA]->value,
            /* 0b0 */
            &(struct oppc_int){
                .count = 1,
                .array = {0x0},
            }
        );
        &ctx->gpr[OPPC_GPR_RA]->flags |= OPPC_GPR_UPDATED;
    } else {
        /* X <- 0b0 */
        oppc_assign(
            &X,
            /* 0b0 */
            &(struct oppc_int){
                .count = 1,
                .array = {0x0},
            }
        );
    }
}

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


More information about the libre-soc-bugs mailing list