On Thu, 26 Aug 2021, Patrick McGehearty via Gcc-patches wrote:
> The only complex divide routines in $HOME/usr/lib64/libgcc_s.so.1 are:
> __divdc3, __divsc3, __divtc3
Because no symbol versions are assigned to the KFmode symbols in the .ver
files, so they are only exported from libgcc.a.
I think the exclusion of decimal FP arithmetic from shared libgcc is
deliberate (both to faciliate using the libdfp version instead for some
purposes, and maybe also to reduce libgcc_s library size and maybe TLS
usage), but I don't know if the exclusion of KFmode arithmetic is also
deliberate.
> When I link the version with the call to __divkc3 into an executable,
> the executable contains __divkc3. I just can't tell where the linker
> is finding it.
In libgcc.a, I expect.
> These values were supposed to be created by gcc/c-family/c-cppbuiltin.c.
> They depend on KF being part of
> FOR_EACH_MODE_IN_CLASS (mode_iter, MODE_FLOAT)
> {
> const char *name = GET_MODE_NAME (mode);
> ...
> }
>
> Apparently KF is not one of the mode names when building in this
> environment. I've spent some time trying to understand where/how
> the MODE_FLOAT class is constructed, but I have not been able to
> pinpoint what's going wrong.
So that's a key issue to resolve (but presumably this is working for some
people building libgcc for powerpc64le).
> When I compile/link cdivchkld.c with -mabi=ieeelongdouble -lm
> I get cdivchkld.c:(.text+0x3c4): undefined reference to `__fmaxieee128'
> caused by the reference in the code to LDBL_MAX_EXP.
You need glibc 2.32 or later for __fmaxieee128 (and, generally, for IEEE
long double support in glibc for powerpc64le).
> I am concerned that in some IBM environments, the build process will
> fall back to using the code in libgcc/libgcc2.c for IBM 128bit float
> complex divide. In that case, the current 1/__LIBGCC_TF_EPSILON__
> value will generate an infinity result which would be
> suboptimal. Changing __LIBGCC_TF_EPSILON__ to __LIBGCC_DF_EPSILON__
> for all platforms avoids the overflow without changing the final
> answers. It only has the effect of doing some scaling without possible
> overflow/underflow when it is not necessary.
>
> I propose for my next patch I change libgcc/libgcc2.c to use
> __LIBGCC_DF_EPSILON__ instead of __LIBGCC_TF_EPSILON__
I think it's only appropriate to do that in the __LIBGCC_TF_MANT_DIG__ ==
106 case.
--
Joseph S. Myers
[email protected]