mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-13 04:30:07 +00:00
463ac90dab
Include the __sin and __cos functions as local static copies to allow deper optimization of the functions. This change shows an improvement of about 17% in the min case and 12.5% in the mean case for the sincos microbenchmark on x86_64. * sysdeps/ieee754/dbl-64/s_sin.c (__sin)[IN_SINCOS]: Mark function static and don't set or restore rounding. (__cos)[IN_SINCOS]: Likewise. * sysdeps/ieee754/dbl-64/s_sincos.c: Include s_sin.c. (__sincos): Set and restore rounding mode. Remove check for infinite or NaN input.
43 lines
1.3 KiB
C
43 lines
1.3 KiB
C
/* Compute sine and cosine of argument.
|
|
Copyright (C) 1997-2015 Free Software Foundation, Inc.
|
|
This file is part of the GNU C Library.
|
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU Lesser General Public
|
|
License as published by the Free Software Foundation; either
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
License along with the GNU C Library; if not, see
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
#include <errno.h>
|
|
#include <math.h>
|
|
|
|
#include <math_private.h>
|
|
|
|
#define __sin __sin_local
|
|
#define __cos __cos_local
|
|
#define IN_SINCOS 1
|
|
#include "s_sin.c"
|
|
|
|
void
|
|
__sincos (double x, double *sinx, double *cosx)
|
|
{
|
|
SET_RESTORE_ROUND_53BIT (FE_TONEAREST);
|
|
|
|
*sinx = __sin (x);
|
|
*cosx = __cos (x);
|
|
}
|
|
weak_alias (__sincos, sincos)
|
|
#ifdef NO_LONG_DOUBLE
|
|
strong_alias (__sincos, __sincosl)
|
|
weak_alias (__sincos, sincosl)
|
|
#endif
|