gcc will generate calls to _Qp_cmp when doing some long-double math operations. I don't know exactly what C code triggers it, but pike 7.6 configured with --with-long-double-precisionfails to link because it can't find _Qp_cmp. Fix: Add _Qp_cmp support to /usr/src/lib/libc/sparc64/fpu/fpu_qp.c . NetBSD has working code (although a different way of going about it) at http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/arch/sparc64/softfloat/qp.c , and the official description of the function is at http://www.sparc.com/standards/SCD.2.4.1.ps (although I can't seem to get to it right now) How-To-Repeat: I'm reporting this secondhand, but downloading http://pike.ida.liu.se/pub/pike/latest-stable/Pike-v7.6.24.tar.gz and running "make CONFIGUREARGS=--with-long-double-precision" should be enough to trigger it.
Isn't the functionality of the _Qp_cmp function from NetBSD done by our _Qp_f function (found on line 90 of fpu_qp.c) Along those lines, how come that file defines the macro _QP_CMP and then the function 'int _Qp_f(u_int *a, u_int *b)' from what I can tell by glancing over the code, it's got the functionalty of the _Qp_cmp function, why is it not named as such (especially if it's defined in the sparc standard, i'm looking for it in there now) -R. Tyler Ballance
In the last episode (Dec 22), R. Tyler Ballance said: > Isn't the functionality of the _Qp_cmp function from NetBSD done by > _our Qp_f function (found on line 90 of fpu_qp.c) Probably. It looks like _Qp_cmp does them all in one function, and can also tell you whether two floads are unordered relative to each other. If gcc can be told to never emit calls to _qp_cmp, maybe it won't be needed. Here's a testcase that at least on Solaris 9/gcc-3.4.2 generates a call _to Qp_cmp. The C99 unordered() function from <math.h> is probably what is generating the call in Pike. main() { long double a, b; return __builtin_isunordered(a,b); } > Along those lines, how come that file defines the macro _QP_CMP and > then the function 'int _Qp_f(u_int *a, u_int *b)' from what I can > tell by glancing over the code, it's got the functionalty of the > _Qp_cmp function, why is it not named as such (especially if it's > defined in the sparc standard, i'm looking for it in there now) That's just a macro definition; it pastes the first argument of the macro onto "_Qp_f", so _QP_CMP(eq,0,FCC_EQ) generates a function named _Qp_feq. -- Dan Nelson dnelson@allantgroup.com
Responsible Changed From-To: freebsd-sparc64->stefanf I'll take it.
State Changed From-To: open->patched Fix committed to -current.
State Changed From-To: patched->closed Merged to stable. Thanks for the report.