RFC fpu: experimental conversion of float128_addsub
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest8 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | softfloat: Use mulu64 for mul64To128include/ | +4 | 0 replies | |
| 2/8 | softfloat: Use int128.h for some operationsinclude/ | +20 | 0 replies | |
| 3/8 | softfloat: Tidy a * b + inf returnfpu/ | +2 | 0 replies | |
| 4/8 | softfloat: Add float_cmask and constantsfpu/ | +24 | 0 replies | |
| 5/8 | softfloat: Inline pick_nan_muladd into its callerfpu/ | +35 | 0 replies | |
| 6/8 | int128.h: add bunch of uint128 utility functions (INCOMPLETE)include/ | +122 | 0 replies | |
| 7/8 | tests/fp: add quad support to the benchmark utilitytests/ | +83 | 0 replies | |
| 8/8 | softfloat: implement addsub_floats128 using Uint128 and new style codefpu/ fpu/ include/ | +421 | 1 reply |
Reviews trailers per patch
5 of 8 patches have a Reviewed-by or Acked-by.
| Patch | David Hildenbrand |
|---|---|
| 1/8 | R-b |
| 2/8 | R-b |
| 3/8 | R-b |
| 4/8 | R-b |
| 5/8 | R-b |
| 6/8 | |
| 7/8 | |
| 8/8 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [RFC PATCH 0/8] fpu: experimental conversion of float128_addsub
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(-)
Signature · 1 line
2.20.1