mirror of
git://sourceware.org/git/glibc.git
synced 2024-12-27 04:41:02 +08:00
4e9bf327ad
The i386 implementations of nearbyint functions, and x86_64
nearbyintl, contain code to mask the "inexact" exception. However,
the fnstenv instruction has the effect of masking all exceptions, so
this masking code has been redundant since fnstenv was added to those
implementations (by commit 846d9a4a3acdb4939ca7bf6aed48f9f6f26911be;
commit 71d1b0166b
added the test
math/test-nearbyint-except-2.c that verifies these functions do work
when called with "inexact" traps enabled); this patch removes the
redundant code.
Tested for x86_64 and x86.
* sysdeps/i386/fpu/s_nearbyint.S (__nearbyint): Do not mask
"inexact" exceptions after fnstenv.
* sysdeps/i386/fpu/s_nearbyintf.S (__nearbyintf): Likewise.
* sysdeps/i386/fpu/s_nearbyintl.S (__nearbyintl): Likewise.
* sysdeps/x86_64/fpu/s_nearbyintl.S (__nearbyintl): Likewise.
20 lines
361 B
ArmAsm
20 lines
361 B
ArmAsm
/*
|
|
* 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(__nearbyintl)
|
|
fldt 8(%rsp)
|
|
fnstenv -28(%rsp)
|
|
frndint
|
|
fnstsw
|
|
andl $0x1, %eax
|
|
orl %eax, -24(%rsp)
|
|
fldenv -28(%rsp)
|
|
ret
|
|
END (__nearbyintl)
|
|
weak_alias (__nearbyintl, nearbyintl)
|