i386/cygwin fpu hard-float [l]{0-2}rint[lf]? implementation pt. 1

Dave Korn dave.korn@artimi.com
Tue Dec 18 21:43:00 GMT 2007

    Hi Jeff,

  Here's part 1 of the new hw fp math functions for x86.  It adds the
implementations themselves.  There's some documentation in the C files, but nothing
trying to chew it yet.  I added the prototypes to math.h unconditionally - it's just
occurred to me as an afterthought that I should probably have put them in
fastmath.h, so I guess I'll need to respin this or just give you a follow-on patch
that rolls back math.h and moves the prototypes across, at your preference.

  It's not customary to post a diff of the regenerated files, but I've attached one
here because I'd like to ask you to eyeball it.  There seems to be a whole lot of
peturbation that I wouldn't expect from the changes I made, I'm not sure if I don't
have something wrong in my autotools environment or if perhaps there are some
differences in how the cygwin versions regenerate?

  I tested it reasonably thoroughly.  The tests I ran included two of BYTE's nbench
benchmarks, whetstone and dhrystone, kahan's paranoia, guenther's tramp-3d and
fourmilabs' fbench.  None showed any differences in results apart from increased
performance.  (They did reveal some existing problems in our implementation,
specifically with -ffast-math, but that's for another day).

  Anyway, here it is.  Subject to whatever you decide about the header prototypes,


2007-12-18  Dave Korn  <dave.korn@artimi.com>

	* libc/include/math.h (llrint, llrintf, rintl, lrintl, llrintl):  Add
	* libm/machine/i386/Makefile.am (LIB_SOURCES):  Add new files sf_rint.c,
	sf_lrint.c, sf_llrint.c, s_rint.c, s_lrint.c, s_llrint.c, sl_rint.c,
	sl_lrint.c and sl_llrint.c.
	(lib_a-s_lrint.$(OBJEXT), lib_a-s_rint.$(OBJEXT), lib_a-sf_lrint.$(OBJEXT),
	lib_a-sf_rint.$(OBJEXT)):  Add explicit dependencies on common sources
	which are directly included by i386 MD implementations when !FAST_MATH.
	* libm/machine/i386/Makefile.in:  Regenerated.
	* libm/machine/i386/s_llrint.c, libm/machine/i386/s_lrint.c,
	libm/machine/i386/s_rint.c, libm/machine/i386/sf_llrint.c,
	libm/machine/i386/sf_lrint.c, libm/machine/i386/sf_rint.c,
	libm/machine/i386/sl_llrint.c, libm/machine/i386/sl_lrint.c,
	libm/machine/i386/sl_rint.c:  New files.

Can't think of a witty .sigline today....
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llrint-patch-part1.diff
Type: application/octet-stream
Size: 17763 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20071218/e50b8eb8/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: llrint-results.txt
URL: <http://sourceware.org/pipermail/newlib/attachments/20071218/e50b8eb8/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llrint-makefile-regen.diff
Type: application/octet-stream
Size: 9636 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20071218/e50b8eb8/attachment-0001.obj>

More information about the Newlib mailing list