All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Max Filippov <jcmvbkbc@gmail.com>
Cc: Blue Swirl <blauwirbel@gmail.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3 08/10] target-xtensa: implement FP0 conversions
Date: Wed, 19 Sep 2012 14:59:39 -0700	[thread overview]
Message-ID: <505A404B.8050303@twiddle.net> (raw)
In-Reply-To: <1348014239-6233-9-git-send-email-jcmvbkbc@gmail.com>

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	other threads:[~2012-09-19 21:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-19  0:23 [Qemu-devel] [PATCH v3 00/10] target-xtensa: implement FP coprocessor option Max Filippov
2012-09-19  0:23 ` [Qemu-devel] [PATCH v3 01/10] softfloat: make float_muladd_negate_* flags independent Max Filippov
2012-09-19  0:23 ` [Qemu-devel] [PATCH v3 02/10] softfloat: add NO_SIGNALING_NANS Max Filippov
2012-09-19  0:23 ` [Qemu-devel] [PATCH v3 03/10] target-xtensa: handle boolean option in overlays Max Filippov
2012-09-19  0:23 ` [Qemu-devel] [PATCH v3 04/10] target-xtensa: specialize softfloat NaN rules Max Filippov
2012-09-19  0:23 ` [Qemu-devel] [PATCH v3 05/10] target-xtensa: add FP registers Max Filippov
2012-09-19  0:23 ` [Qemu-devel] [PATCH v3 06/10] target-xtensa: implement LSCX and LSCI groups Max Filippov
2012-09-19  0:23 ` [Qemu-devel] [PATCH v3 07/10] target-xtensa: implement FP0 arithmetic Max Filippov
2012-09-19  0:23 ` [Qemu-devel] [PATCH v3 08/10] target-xtensa: implement FP0 conversions Max Filippov
2012-09-19 21:59   ` Richard Henderson [this message]
2012-09-19 22:47     ` Max Filippov
2012-09-19  0:23 ` [Qemu-devel] [PATCH v3 09/10] target-xtensa: implement FP1 group Max Filippov
2012-09-19  0:23 ` [Qemu-devel] [PATCH v3 10/10] target-xtensa: implement coprocessor context option Max Filippov
2012-09-22 18:00 ` [Qemu-devel] [PATCH v3 00/10] target-xtensa: implement FP coprocessor option Blue Swirl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=505A404B.8050303@twiddle.net \
    --to=rth@twiddle.net \
    --cc=blauwirbel@gmail.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.