From: Richard Henderson <richard.henderson@linaro.org>
To: luoyonggang@gmail.com, qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org
Subject: Re: [PATCH] ppc: Use hard-float in ppc fp_hlper as early as possible...
Date: Mon, 4 May 2020 15:10:07 -0700 [thread overview]
Message-ID: <81b2392a-d049-b8d3-30ad-6b9550c63126@linaro.org> (raw)
In-Reply-To: <20200504192954.1387-1-luoyonggang@gmail.com>
On 5/4/20 12:29 PM, luoyonggang@gmail.com wrote:
> Re: [PATCH] ppc: Use hard-float in ppc fp_hlper as early as possible. This would increase the performance better than enable hard-float it in soft-float.c; Just using fadd fsub fmul fdiv as a simple bench demo. With this patch, performance are increased 2x. and 1.3x than the one enable hard-float in soft-float.c Both version are not considerate inexact fp exception yet.
Use a return after the one sentence title to separate it from the body of the
description.
> float64 helper_fadd(CPUPPCState *env, float64 arg1, float64 arg2)
> {
> + CPU_DoubleU u1, u2;
> +
> + u1.d = arg1;
> + u2.d = arg2;
> + CPU_DoubleU retDouble;
> + retDouble.nd = u1.nd + u2.nd;
> + if (likely(float64_is_zero_or_normal(retDouble.d)))
> + {
> + /* TODO: Handling inexact */
> + return retDouble.d;
> + }
First, you need to verify that the current rounding mode is
float_round_nearest_even. Otherwise you are actively computing wrong results
for other rounding modes.
Second, including zero result in your acceptance test misses out on underflow
exceptions.
Third, what is your plan for inexact? There's no point in continuing this
thread unless you fill in the TODO a bit more.
https://cafehayek.com/wp-content/uploads/2014/03/miracle_cartoon.jpg
r~
next prev parent reply other threads:[~2020-05-04 22:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-04 19:29 [PATCH] ppc: Use hard-float in ppc fp_hlper as early as possible. This would increase the performance better than enable hard-float it in soft-float.c; Just using fadd fsub fmul fdiv as a simple bench demo. With this patch, performance are increased 2x. and 1.3x than the one enable hard-float in soft-float.c Both version are not considerate inexact fp exception yet luoyonggang
2020-05-04 20:02 ` 罗勇刚(Yonggang Luo)
2020-05-04 22:10 ` Richard Henderson [this message]
2020-05-04 23:03 ` Aleksandar Markovic
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=81b2392a-d049-b8d3-30ad-6b9550c63126@linaro.org \
--to=richard.henderson@linaro.org \
--cc=luoyonggang@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).