qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 17/37] target-ppc: Introduce DFP Add


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 17/37] target-ppc: Introduce DFP Add
Date: Fri, 18 Apr 2014 12:10:55 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 04/18/2014 07:50 AM, Tom Musta wrote:
> +__attribute__ ((unused))
> +static void dfp_run_post_processors(struct PPC_DFP *dfp,
> +                PPC_DFP_PostProc post_processors[], const size_t n)
> +{
> +    int i;
> +
> +    for (i = 0; i < n; i++) {
> +        post_processors[i](dfp);
> +    }
> +}

...

> +PPC_DFP_PostProc ADD_PPs[] = {
> +    dfp_set_FPRF_from_FRT,
> +    dfp_check_for_OX,
> +    dfp_check_for_UX,
> +    dfp_check_for_XX,
> +    dfp_check_for_VXSNAN,
> +    dfp_check_for_VXISI_add,
> +};

Is this really any better than

static void ADD_PPs(struct PPC_DFP *dfp)
{
    dfp_set_FPRF_from_FRT(dfp);
    dfp_check_for_OX(dfp);
    dfp_check_for_UX(dfp);
    dfp_check_for_XX(dfp);
    dfp_check_for_VXSNAN(dfp);
    dfp_check_for_VXISI_add(dfp);
}

The forms seem equally readable to me, with the advantage that we'll get good
branch prediction on direct subroutine calls.  And if the compiler decides that
inlining is profitable, it'll have a chance.


r~



reply via email to

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