qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] [Qemu-devel] [V3 PATCH 09/14] target-ppc: Add ISA 2.06 fc


From: Richard Henderson
Subject: Re: [Qemu-ppc] [Qemu-devel] [V3 PATCH 09/14] target-ppc: Add ISA 2.06 fcfid[u][s] Instructions
Date: Tue, 24 Dec 2013 07:41:14 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

On 12/18/2013 12:49 PM, Tom Musta wrote:
> +#define FPU_FCFI(op, cvtr, is_single)                 \
> +uint64_t helper_##op(CPUPPCState *env, uint64_t arg)  \
> +{                                                     \
> +    CPU_DoubleU farg;                                 \
> +                                                      \
> +    farg.d = cvtr(arg, &env->fp_status);              \
> +                                                      \
> +    if (is_single) {                                  \
> +        farg.d = helper_frsp(env, farg.d);            \
> +    }                                                 \
> +    helper_float_check_status(env);                   \
> +    return farg.ll;                                   \
> +}

This formulation will lead to double-rounding errors for some int64 inputs.
You should convert to single-precision directly, then convert to double.


r~



reply via email to

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