[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E1A967E.50908@ozlabs.org>
Date: Mon, 11 Jul 2011 16:21:50 +1000
From: Matt Evans <matt@...abs.org>
To: Ben Hutchings <bhutchings@...arflare.com>
CC: netdev@...r.kernel.org,
linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>
Subject: Re: [RFC PATCH 1/1] BPF JIT for PPC64
On 25/06/11 11:58, Ben Hutchings wrote:
> On Fri, 2011-06-24 at 16:02 +1000, Matt Evans wrote:
> [...]
>> + case BPF_S_ALU_ADD_K: /* A += K; */
>> + if (!K)
>> + break;
>> + if (K < 32768)
>> + PPC_ADDI(r_A, r_A, K);
>> + else
>> + PPC_ADDI(r_A, r_A, IMM_L(K));
>> + PPC_ADDIS(r_A, r_A, IMM_HA(K));
>> + break;
>
> Missing braces.
>
>> + case BPF_S_ALU_SUB_X: /* A -= X; */
>> + ctx->seen |= SEEN_XREG;
>> + PPC_SUB(r_A, r_A, r_X);
>> + break;
>> + case BPF_S_ALU_SUB_K: /* A -= K */
>> + if (!K)
>> + break;
>> + if (K < 32768)
>> + PPC_ADDI(r_A, r_A, -K);
>> + else
>> + PPC_ADDI(r_A, r_A, IMM_L(-K));
>> + PPC_ADDIS(r_A, r_A, IMM_HA(-K));
>> + break;
> [...]
>
> Here as well.
Thanks, Ben -- oops! :) Really, just the ADDISes need to be conditional, too.
Cheers,
Matt
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists