From: "Alex Bennée" <alex.bennee@linaro.org>
To: "Emilio G. Cota" <cota@braap.org>
Cc: qemu-devel@nongnu.org, Richard Henderson <richard.henderson@linaro.org>
Subject: Re: [Qemu-devel] [PATCH v6 08/13] hardfloat: implement float32/64 addition and subtraction
Date: Tue, 04 Dec 2018 18:34:18 +0000 [thread overview]
Message-ID: <87bm612lat.fsf@linaro.org> (raw)
In-Reply-To: <20181124235553.17371-9-cota@braap.org>
Emilio G. Cota <cota@braap.org> writes:
> Performance results (single and double precision) for fp-bench:
>
> 1. Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
> - before:
> add-single: 135.07 MFlops
> add-double: 131.60 MFlops
> sub-single: 130.04 MFlops
> sub-double: 133.01 MFlops
> - after:
> add-single: 443.04 MFlops
> add-double: 301.95 MFlops
> sub-single: 411.36 MFlops
> sub-double: 293.15 MFlops
>
> 2. ARM Aarch64 A57 @ 2.4GHz
> - before:
> add-single: 44.79 MFlops
> add-double: 49.20 MFlops
> sub-single: 44.55 MFlops
> sub-double: 49.06 MFlops
> - after:
> add-single: 93.28 MFlops
> add-double: 88.27 MFlops
> sub-single: 91.47 MFlops
> sub-double: 88.27 MFlops
>
> 3. IBM POWER8E @ 2.1 GHz
> - before:
> add-single: 72.59 MFlops
> add-double: 72.27 MFlops
> sub-single: 75.33 MFlops
> sub-double: 70.54 MFlops
> - after:
> add-single: 112.95 MFlops
> add-double: 201.11 MFlops
> sub-single: 116.80 MFlops
> sub-double: 188.72 MFlops
>
> Note that the IBM and ARM machines benefit from having
> HARDFLOAT_2F{32,64}_USE_FP set to 0. Otherwise their performance
> can suffer significantly:
Is this just the latency of pushing the number into a SIMD register and
checking the flags compared to a bitmask check?
> - IBM Power8:
> add-single: [1] 54.94 vs [0] 116.37 MFlops
> add-double: [1] 58.92 vs [0] 201.44 MFlops
> - Aarch64 A57:
> add-single: [1] 80.72 vs [0] 93.24 MFlops
> add-double: [1] 82.10 vs [0] 88.18 MFlops
>
> On the Intel machine, having 2F64 set to 1 pays off, but it
> doesn't for 2F32:
> - Intel i7-6700K:
> add-single: [1] 285.79 vs [0] 426.70 MFlops
> add-double: [1] 302.15 vs [0] 278.82 MFlops
>
> Signed-off-by: Emilio G. Cota <cota@braap.org>
> ---
> fpu/softfloat.c | 117 ++++++++++++++++++++++++++++++++++++++++--------
> 1 file changed, 98 insertions(+), 19 deletions(-)
>
> diff --git a/fpu/softfloat.c b/fpu/softfloat.c
> index 306a12fa8d..cc500b1618 100644
> --- a/fpu/softfloat.c
> +++ b/fpu/softfloat.c
> @@ -1050,49 +1050,128 @@ float16 QEMU_FLATTEN float16_add(float16 a, float16 b, float_status *status)
> return float16_round_pack_canonical(pr, status);
> }
>
> -float32 QEMU_FLATTEN float32_add(float32 a, float32 b, float_status *status)
> +float16 QEMU_FLATTEN float16_sub(float16 a, float16 b, float_status *status)
> +{
> + FloatParts pa = float16_unpack_canonical(a, status);
> + FloatParts pb = float16_unpack_canonical(b, status);
> + FloatParts pr = addsub_floats(pa, pb, true, status);
> +
> + return float16_round_pack_canonical(pr, status);
> +}
Hmm the diff is confusing but the changes look fine in the final code:
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
--
Alex Bennée
next prev parent reply other threads:[~2018-12-04 18:38 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-24 23:55 [Qemu-devel] [PATCH v6 00/13] hardfloat Emilio G. Cota
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 01/13] fp-test: pick TARGET_ARM to get its specialization Emilio G. Cota
2018-12-03 12:13 ` Alex Bennée
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 02/13] softfloat: add float{32, 64}_is_{de, }normal Emilio G. Cota
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 03/13] target/tricore: use float32_is_denormal Emilio G. Cota
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 04/13] softfloat: rename canonicalize to sf_canonicalize Emilio G. Cota
2018-12-03 14:16 ` Alex Bennée
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 05/13] softfloat: add float{32, 64}_is_zero_or_normal Emilio G. Cota
2018-12-03 14:16 ` Alex Bennée
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 06/13] tests/fp: add fp-bench Emilio G. Cota
2018-12-03 14:29 ` Alex Bennée
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 07/13] fpu: introduce hardfloat Emilio G. Cota
2018-11-25 0:25 ` Aleksandar Markovic
2018-11-25 1:25 ` Emilio G. Cota
2018-12-04 12:28 ` Alex Bennée
2018-12-04 13:33 ` Richard Henderson
2018-12-04 13:52 ` Alex Bennée
2018-12-04 17:31 ` Emilio G. Cota
2018-12-04 19:08 ` Alex Bennée
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 08/13] hardfloat: implement float32/64 addition and subtraction Emilio G. Cota
2018-12-04 18:34 ` Alex Bennée [this message]
2018-12-04 20:07 ` Emilio G. Cota
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 09/13] hardfloat: implement float32/64 multiplication Emilio G. Cota
2018-12-05 10:10 ` Alex Bennée
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 10/13] hardfloat: implement float32/64 division Emilio G. Cota
2018-12-05 10:11 ` Alex Bennée
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 11/13] hardfloat: implement float32/64 fused multiply-add Emilio G. Cota
2018-12-05 12:25 ` Alex Bennée
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 12/13] hardfloat: implement float32/64 square root Emilio G. Cota
2018-12-05 12:26 ` Alex Bennée
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 13/13] hardfloat: implement float32/64 comparison Emilio G. Cota
2018-12-05 12:36 ` Alex Bennée
2018-11-27 17:24 ` [Qemu-devel] [PATCH v6 00/13] hardfloat no-reply
2018-11-27 17:52 ` Emilio G. Cota
2018-11-27 17:32 ` no-reply
2018-12-05 12:41 ` Alex Bennée
2018-12-05 16:47 ` Emilio G. Cota
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=87bm612lat.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=cota@braap.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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.