qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 25/30] target/ppc: Move ADDI, ADDIS to decodetree, impleme


From: Richard Henderson
Subject: Re: [PATCH v3 25/30] target/ppc: Move ADDI, ADDIS to decodetree, implement PADDI
Date: Fri, 30 Apr 2021 07:31:55 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 4/30/21 7:05 AM, Matheus K. Ferst wrote:
+ADDI            000001 10 0--.-- ..................     \
+                001110 ..... ..... ................     @PLS_D

I'm not sure about this. It's a bit surprising to find ADDI here, and the comment that explains why is likely to be ignored after the big copyright header.

You could move the comment closer, and replicate, e.g.

ADDI .... \
     .... @PLS_D # PADDI


I'd prefer to keep a trans_PADDI like

 > static bool trans_PADDI(DisasContext *ctx, arg_PLS_D *a)
 > {
 >     if(!resolve_PLS_D(ctx, a)) {
 >         return false;
 >     }
 >     return trans_ADDI(ctx, a);
 > }

But in this case ADDI probably doesn't use PLS_D.  You could use

static bool trans_PADDI(DisasContext *ctx, arg_PLS_D *a)
{
    arg_D d;
    if (!resolve_PLS_D(ctx, &d, a)) {
        return false;
    }
    return trans_ADDI(ctx, &d);
}

making sure to use int64_t in the offset for arg_D.

It's the middle way between v2 and v3. trans_ADDI code is reused, it'll probably be optimized as a tail call, and resolve_PLS_D is not called when it's not needed.

My version won't tail-call, because of the escaping local storage, but I don't see how you can avoid it.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]