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