This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
These use the x87 fpu and passed all tests. Does anybody have a better implementation using only the SSE unit? Ok to commit? Andreas 2008-03-09 Andreas Jaeger <aj@suse.de> * sysdeps/x86_64/fpu/s_nearbyintf.S: Implementation of nearbyint. * sysdeps/x86_64/fpu/s_nearbyint.S: Likewise. * sysdeps/x86_64/fpu/s_rintf.S: Implementation of rint. * sysdeps/x86_64/fpu/s_rint.S: Likewise. ============================================================ Index: sysdeps/x86_64/fpu/s_nearbyint.S --- sysdeps/x86_64/fpu/s_nearbyint.S created +++ sysdeps/x86_64/fpu/s_nearbyint.S 2008-03-09 15:43:31.000000000 +0100 1.1 @@ -0,0 +1,24 @@ +/* + * Written by J.T. Conklin <jtc@netbsd.org>. + * Public domain. + */ +/* Adapted for use as nearbyint by Ulrich Drepper <drepper@cygnus.com>. */ + +#include <machine/asm.h> + +ENTRY(__nearbyint) + movsd %xmm0,-16(%rsp) + fldl -16(%rsp) + fnstcw -4(%rsp) + movl -4(%rsp), %eax + orl $0x20, %eax + movl %eax, -8(%rsp) + fldcw -8(%rsp) + frndint + fstpl -16(%rsp) + movsd -16(%rsp),%xmm0 + fclex + fldcw -4(%rsp) + ret +END (__nearbyint) +weak_alias (__nearbyint, nearbyint) ============================================================ Index: sysdeps/x86_64/fpu/s_nearbyintf.S --- sysdeps/x86_64/fpu/s_nearbyintf.S created +++ sysdeps/x86_64/fpu/s_nearbyintf.S 2008-03-09 15:44:22.000000000 +0100 1.1 @@ -0,0 +1,24 @@ +/* + * Written by J.T. Conklin <jtc@netbsd.org>. + * Public domain. + */ +/* Adapted for use as nearbyint by Ulrich Drepper <drepper@cygnus.com>. */ + +#include <machine/asm.h> + +ENTRY(__nearbyintf) + movss %xmm0,-16(%rsp) + flds -16(%rsp) + fnstcw -4(%rsp) + movl -4(%rsp), %eax + orl $0x20, %eax + movl %eax, -8(%rsp) + fldcw -8(%rsp) + frndint + fstps -16(%rsp) + movss -16(%rsp),%xmm0 + fclex + fldcw -4(%rsp) + ret +END (__nearbyintf) +weak_alias (__nearbyintf, nearbyintf) ============================================================ Index: sysdeps/x86_64/fpu/s_rint.S --- sysdeps/x86_64/fpu/s_rint.S created +++ sysdeps/x86_64/fpu/s_rint.S 2008-03-09 15:34:59.000000000 +0100 1.1 @@ -0,0 +1,18 @@ +/* + * Written by J.T. Conklin <jtc@netbsd.org>. + * Public domain. + */ +/* Adopted for x86-64 by Andreas Jaeger <aj@suse.de>. */ + +#include <machine/asm.h> + + +ENTRY(__rint) + movsd %xmm0,-8(%rsp) + fldl -8(%rsp) + frndint + fstpl -8(%rsp) + movsd -8(%rsp),%xmm0 + ret +END (__rint) +weak_alias (__rint, rint) ============================================================ Index: sysdeps/x86_64/fpu/s_rintf.S --- sysdeps/x86_64/fpu/s_rintf.S created +++ sysdeps/x86_64/fpu/s_rintf.S 2008-03-09 15:36:42.000000000 +0100 1.1 @@ -0,0 +1,18 @@ +/* + * Written by J.T. Conklin <jtc@netbsd.org>. + * Public domain. + */ +/* Adopted for x86-64 by Andreas Jaeger <aj@suse.de>. */ + +#include <machine/asm.h> + + +ENTRY(__rintf) + movss %xmm0,-8(%rsp) + flds -8(%rsp) + frndint + fstps -8(%rsp) + movss -8(%rsp),%xmm0 + ret +END (__rintf) +weak_alias (__rintf, rintf) -- Andreas Jaeger, Director Platform / openSUSE, aj@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Maxfeldstr. 5, 90409 Nürnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
Attachment:
pgp00000.pgp
Description: PGP signature
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |