qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Lyon <christophe.lyon@st.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 2/3] target-arm: fix support for vrecpe.
Date: Thu, 17 Feb 2011 18:51:47 +0100	[thread overview]
Message-ID: <4D5D6033.8000807@st.com> (raw)
In-Reply-To: <AANLkTikUKMx2iWGhz-V8nCG++TrK2w0CBe_kONqzmCv_@mail.gmail.com>


>> +    float_status *s = &env->vfp.standard_fp_status;
>> +    float64 one = int64_to_float64(1, s);
> You don't need to create a variable for this, float64_one
> will do what you want.
OK

 
>> +    /* q = (int)(a * 512.0) */
>> +    float64 x512 = int64_to_float64(512, s);
>> +    float64 q = float64_mul(x512, a, s);
>> +    int64_t q_int = float64_to_int64_round_to_zero(q, s);
>> +
>> +    /* r = 1.0 / (((double)q + 0.5) / 512.0) */
>> +    q = int64_to_float64(q_int, s);
>> +    float64 half = float64_div(one, int64_to_float64(2, s), s);
> ...and a runtime division just to get a constant 0.5?
> Better to just make_float64() on the appropriate bit
> pattern, I think.

It makes sense.
Then, what about using the right bit patterns for 512 and 256?

Actually, for these last two, I mimicked recps and rsqrts which build constants 2 and 3. I could add another patch to address this point.
 

>> +    if (float32_is_any_nan(a)) {
>> +        return float32_default_nan;
> This won't set InvalidOp if the input is a signalling NaN.
Thanks for the notice, I have no means of testing those cases.

Christophe.

  reply	other threads:[~2011-02-17 17:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-16 17:59 [Qemu-devel] [PATCH v3 0/3] ARM: fix Neon vrecpe and vrsqrte instructions christophe.lyon
2011-02-16 17:59 ` [Qemu-devel] [PATCH 1/3] softfloat: export float32_default_nan, and float32_infinity. Add float32_set_sign() christophe.lyon
2011-02-17 12:56   ` Peter Maydell
2011-02-16 17:59 ` [Qemu-devel] [PATCH 2/3] target-arm: fix support for vrecpe christophe.lyon
2011-02-17 12:23   ` Peter Maydell
2011-02-17 17:51     ` Christophe Lyon [this message]
2011-02-17 18:35       ` Peter Maydell
2011-02-16 17:59 ` [Qemu-devel] [PATCH 3/3] target-arm: fix support for vrsqrte christophe.lyon
2011-02-17 12:49   ` Peter Maydell

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=4D5D6033.8000807@st.com \
    --to=christophe.lyon@st.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).