The i386 target is the last one still using softfloat-native. Compared to softfloat, it is faster but lacks exception handling, float80 (except on x86 hosts) and float128, as well as correctness (use NaN propagation from the host, different corner cases, etc.). It's API has also diverged from softfloat, meaning it's not easily possible to select softfloat or softfloat-native at build-time.
This patch series adjust softfloat, softfloat-native, and target-i386, so that it's possible to build this target with either implementation. It's only a transient state until softfloat-native is definitely removed. This also mean that some code changes in target-i386 are not the best possible, as writing code that work on both is sometimes difficult. This will have to be fixed after the softfloat removal. For the trigonometic and logarithmic functions, which are not (yet) available in softfloat (neither in softfloat-native actually), I have chosen to convert the floatx80 value to double and use the host function. This limits the precision to float64, but anyway the current code was already using the double version of these functions (instead of the long double version for floatx80 precision). I have tested these patches by using the GNU libc testsuite, and comparing the results before and after. This patch series already globally improve the testsuite results, though on some trigonometric functions some tests are now failing and some tests are now passing, due to precision issues. In any case, these precision issues are limited to the last two bits of the 80-bit value, so it's safe to ignore this issue for now. I already have another patch series in preparation, which does the actual softfloat removal, clean the generic and target-i386 codes, add exception support, and add a softfloat log2() function. However it's the following step, and I prefer first to get this patch series discussed and hopefully accepted before. Aurelien Jarno (20): softfloat: fix floatx80 handling of NaN softfloat: fix floatx80_is_infinity() softfloat: add floatx80 constants softfloat: add pi constants softfloat-native: add a few constant values softfloat: add floatx80_compare*() functions softfloat: fix float*_scalnb() corner cases softfloat-native: fix float*_scalbn() functions softfloat-native: add float*_is_any_nan() functions target-i386: fix helper_fscale() wrt softfloat target-i386: fix helper_fbld_ST0() wrt softfloat target-i386: fix helper_fxtract() wrt softfloat target-i386: fix helper_fdiv() wrt softfloat target-i386: fix helper_fsqrt() wrt softfloat target-i386: replace approx_rsqrt and approx_rcp by softfloat ops target-i386: add CPU86_LDouble <-> double conversion functions target-i386: fix logarithmic and trigonometric helpers wrt softfloat target-i386: fix helper_fprem() and helper_fprem1() wrt softfloat target-i386: fix constants wrt softfloat target-i386: switch to softfloat configure | 9 +-- fpu/softfloat-native.c | 26 ++++++ fpu/softfloat-native.h | 36 +++++++- fpu/softfloat-specialize.h | 19 +++-- fpu/softfloat.c | 93 +++++++++++++++++++- fpu/softfloat.h | 14 +++- target-i386/exec.h | 20 +++++ target-i386/op_helper.c | 205 ++++++++++++++++++++++++++----------------- target-i386/ops_sse.h | 36 +++++--- 9 files changed, 342 insertions(+), 116 deletions(-) -- 1.7.2.3