qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 08/10] target-xtensa: implement FP0 conversio


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v3 08/10] target-xtensa: implement FP0 conversions
Date: Wed, 19 Sep 2012 14:59:39 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0

On 09/18/2012 05:23 PM, Max Filippov wrote:
> +uint32_t HELPER(ftoi)(float32 v, uint32_t rounding_mode, uint32_t scale)
> +{
> +    float_status fp_status = {0};
> +
> +    set_float_rounding_mode(rounding_mode, &fp_status);
> +    return float32_to_int32(
> +            float32_scalbn(v, scale, &fp_status), &fp_status);
> +}
> +
> +uint32_t HELPER(ftoui)(float32 v, uint32_t rounding_mode, uint32_t scale)
> +{
> +    float_status fp_status = {0};
> +    float32 res;
> +
> +    set_float_rounding_mode(rounding_mode, &fp_status);
> +
> +    res = float32_scalbn(v, scale, &fp_status);
> +
> +    if (float32_is_neg(v) && !float32_is_any_nan(v)) {
> +        return float32_to_int32(res, &fp_status);
> +    } else {
> +        return float32_to_uint32(res, &fp_status);
> +    }
> +}

Are you really intending to discard any exceptions raised here?


r~



reply via email to

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