All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: cota@braap.org, "Alex Bennée" <alex.bennee@linaro.org>
Subject: [RFC PATCH  0/8] fpu: experimental conversion of float128_addsub
Date: Tue, 20 Oct 2020 17:37:30 +0100	[thread overview]
Message-ID: <20201020163738.27700-1-alex.bennee@linaro.org> (raw)

Hi Richard,

This is the current state of my experiment to convert a 128 bit float
function (in this case addsub). The actual conversion was fairly
simple (basically a copy & paste with some tweaks for using the
unint128 inline functions). However I ran into a number of stumbles
with the int128.h support including casting of values like ~(Uint128)0
and messing around to handle things like missing __builtin support for
clz. I suspect having some of the #defines expand into uint128_*
functions plays some part in the 4x growth in code compared to the old
version. However the drop in performance is a lot less than that.

In terms of total code churn we replace each deleted line in
softfloat.c with 2 lines of new code although I suspect if we pressed
on we could reduce the diffstat deficit. Debugging the actual failures
was relatively painless with rr and the new code - perhaps because I
just find it easier to follow.

I've included your early patches as that happened to be the state of
my tree when I branched off. If we want to go forward with a more
complete conversion I guess we would need:

  - a more complete int128.h conversion (including fallback for non CONFIG_INT128)
  - seeing if some of the resulting code bloat can be reduced
  - seeing what scope there is for commonality of special case handling

I'm not a fan of having so much duplication but at least I personally
find the code is more readable.

Alex Bennée (3):
  int128.h: add bunch of uint128 utility functions (INCOMPLETE)
  tests/fp: add quad support to the benchmark utility
  softfloat: implement addsub_floats128 using Uint128 and new style code

Richard Henderson (5):
  softfloat: Use mulu64 for mul64To128
  softfloat: Use int128.h for some operations
  softfloat: Tidy a * b + inf return
  softfloat: Add float_cmask and constants
  softfloat: Inline pick_nan_muladd into its caller

 include/fpu/softfloat-macros.h |  80 ++--
 include/qemu/int128.h          | 122 ++++++
 fpu/softfloat.c                | 697 ++++++++++++++++++++-------------
 tests/fp/fp-bench.c            |  88 ++++-
 fpu/softfloat-specialize.c.inc |  39 ++
 5 files changed, 711 insertions(+), 315 deletions(-)

-- 
2.20.1



             reply	other threads:[~2020-10-20 16:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-20 16:37 Alex Bennée [this message]
2020-10-20 16:37 ` [RFC PATCH 1/8] softfloat: Use mulu64 for mul64To128 Alex Bennée
2020-10-20 16:37 ` [RFC PATCH 2/8] softfloat: Use int128.h for some operations Alex Bennée
2020-10-20 16:37 ` [RFC PATCH 3/8] softfloat: Tidy a * b + inf return Alex Bennée
2020-10-20 16:37 ` [RFC PATCH 4/8] softfloat: Add float_cmask and constants Alex Bennée
2020-10-20 16:37 ` [RFC PATCH 5/8] softfloat: Inline pick_nan_muladd into its caller Alex Bennée
2020-10-20 16:37 ` [RFC PATCH 6/8] int128.h: add bunch of uint128 utility functions (INCOMPLETE) Alex Bennée
2020-10-20 16:37 ` [RFC PATCH 7/8] tests/fp: add quad support to the benchmark utility Alex Bennée
2020-10-20 16:37 ` [RFC PATCH 8/8] softfloat: implement addsub_floats128 using Uint128 and new style code Alex Bennée
2020-10-20 18:49   ` Richard Henderson
2020-10-20 17:03 ` [RFC PATCH 0/8] fpu: experimental conversion of float128_addsub no-reply

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=20201020163738.27700-1-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=cota@braap.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.