public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/5997] Very slow execution of sinf function
[not found] <bug-5997-131@http.sourceware.org/bugzilla/>
@ 2012-02-29 20:23 ` jsm28 at gcc dot gnu.org
2012-06-22 17:30 ` liubov.dmitrieva at gmail dot com
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2012-02-29 20:23 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=5997
Joseph Myers <jsm28 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|aj at suse dot de |unassigned at sourceware
| |dot org
--- Comment #3 from Joseph Myers <jsm28 at gcc dot gnu.org> 2012-02-29 20:23:22 UTC ---
Confirmed with current sources. Given that sinf is not correctly rounding (see
bug 1163) it's quite possible there is a reasonable fix that does not involve a
whole new correctly rounding implementation - although we're generally moving
away from x87 trig instructions as too inaccurate (see bug 13658).
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug math/5997] Very slow execution of sinf function
[not found] <bug-5997-131@http.sourceware.org/bugzilla/>
2012-02-29 20:23 ` [Bug math/5997] Very slow execution of sinf function jsm28 at gcc dot gnu.org
@ 2012-06-22 17:30 ` liubov.dmitrieva at gmail dot com
2013-04-01 12:53 ` siddhesh at redhat dot com
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: liubov.dmitrieva at gmail dot com @ 2012-06-22 17:30 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=5997
--- Comment #4 from Liubov Dmitrieva <liubov.dmitrieva at gmail dot com> 2012-06-22 17:30:32 UTC ---
Created attachment 6469
--> http://sourceware.org/bugzilla/attachment.cgi?id=6469
here is the log of current 2012/06/21 GLIBC IA32 sinf/cosf errors
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug math/5997] Very slow execution of sinf function
[not found] <bug-5997-131@http.sourceware.org/bugzilla/>
2012-02-29 20:23 ` [Bug math/5997] Very slow execution of sinf function jsm28 at gcc dot gnu.org
2012-06-22 17:30 ` liubov.dmitrieva at gmail dot com
@ 2013-04-01 12:53 ` siddhesh at redhat dot com
2013-04-01 12:54 ` siddhesh at redhat dot com
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: siddhesh at redhat dot com @ 2013-04-01 12:53 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=5997
Siddhesh Poyarekar <siddhesh at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |siddhesh at redhat dot com
--- Comment #5 from Siddhesh Poyarekar <siddhesh at redhat dot com> 2013-04-01 12:53:31 UTC ---
FWIW, the function now runs much faster after the multiple precision
improvements. The worst case is only about a 100 times slower now instead of
1000 times.
I've not looked yet, but I think there is a case for capping maximum precision
for worst case computation for sin (and all trigonometric functions) as well,
so this could get even better.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug math/5997] Very slow execution of sinf function
[not found] <bug-5997-131@http.sourceware.org/bugzilla/>
` (2 preceding siblings ...)
2013-04-01 12:53 ` siddhesh at redhat dot com
@ 2013-04-01 12:54 ` siddhesh at redhat dot com
2013-12-03 18:41 ` jsm28 at gcc dot gnu.org
2014-02-05 16:05 ` neleai at seznam dot cz
5 siblings, 0 replies; 9+ messages in thread
From: siddhesh at redhat dot com @ 2013-04-01 12:54 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=5997
--- Comment #6 from Siddhesh Poyarekar <siddhesh at redhat dot com> 2013-04-01 12:54:29 UTC ---
Sorry, wrong bz. Comment 5 should have gone into bug 5781.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug math/5997] Very slow execution of sinf function
[not found] <bug-5997-131@http.sourceware.org/bugzilla/>
` (3 preceding siblings ...)
2013-04-01 12:54 ` siddhesh at redhat dot com
@ 2013-12-03 18:41 ` jsm28 at gcc dot gnu.org
2014-02-05 16:05 ` neleai at seznam dot cz
5 siblings, 0 replies; 9+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2013-12-03 18:41 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=5997
Joseph Myers <jsm28 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug math/5997] Very slow execution of sinf function
[not found] <bug-5997-131@http.sourceware.org/bugzilla/>
` (4 preceding siblings ...)
2013-12-03 18:41 ` jsm28 at gcc dot gnu.org
@ 2014-02-05 16:05 ` neleai at seznam dot cz
5 siblings, 0 replies; 9+ messages in thread
From: neleai at seznam dot cz @ 2014-02-05 16:05 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=5997
Ondrej Bilka <neleai at seznam dot cz> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |john.wilkinson at spirent dot com
--- Comment #7 from Ondrej Bilka <neleai at seznam dot cz> ---
*** Bug 16531 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug math/5997] New: Very slow execution of sinf function
@ 2008-03-29 21:18 jvdelisle at gcc dot gnu dot org
2008-03-29 22:13 ` [Bug math/5997] " fxcoudert at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-03-29 21:18 UTC (permalink / raw)
To: glibc-bugs
With this test case:
#include <stdio.h>
#include <math.h>
unsigned int ta;
main ()
{
double result;
for (ta = 1; ta <= 8000000; ta++)
{
result = sin(ta * 3.14159);
}
printf("result = \t%.13e\n", result);
}
Using sin vs sinf.
sin:
$ time ./a.out
result = -6.9068092664138e-01
real 0m0.782s
user 0m0.778s
sys 0m0.004s
sinf:
$ time ./a.out
result = -6.9068092107773e-01
real 0m8.622s
user 0m8.605s
sys 0m0.009s
The difference in assembly code (-S output):
44,47c44,47
< call sin
< movsd %xmm0, -40(%rbp)
< movq -40(%rbp), %rax
< movq %rax, -8(%rbp)
---
> cvtsd2ss %xmm0, %xmm0
> call sinf
> cvtss2sd %xmm0, %xmm0
> movsd %xmm0, -8(%rbp)
I don't think the conversion functions should account for this huge time
difference. Also with -m32 and sinf I get:
$ time ./a.out
result = -6.9068092664141e-01
real 0m1.157s
user 0m0.765s
sys 0m0.002s
Which is more reasonable.
$ gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-cpu=generic
--host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
I am running latest Fedora 8
See also gfortran bug pr34128.
--
Summary: Very slow execution of sinf function
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: math
AssignedTo: aj at suse dot de
ReportedBy: jvdelisle at gcc dot gnu dot org
CC: glibc-bugs at sources dot redhat dot com
GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-redhat-linux-gnu
http://sourceware.org/bugzilla/show_bug.cgi?id=5997
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug math/5997] Very slow execution of sinf function
2008-03-29 21:18 [Bug math/5997] New: " jvdelisle at gcc dot gnu dot org
@ 2008-03-29 22:13 ` fxcoudert at gcc dot gnu dot org
2008-03-30 0:10 ` jvdelisle at gcc dot gnu dot org
2008-07-14 13:45 ` grugh at centrum dot cz
2 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2008-03-29 22:13 UTC (permalink / raw)
To: glibc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu dot
| |org
http://sourceware.org/bugzilla/show_bug.cgi?id=5997
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug math/5997] Very slow execution of sinf function
2008-03-29 21:18 [Bug math/5997] New: " jvdelisle at gcc dot gnu dot org
2008-03-29 22:13 ` [Bug math/5997] " fxcoudert at gcc dot gnu dot org
@ 2008-03-30 0:10 ` jvdelisle at gcc dot gnu dot org
2008-07-14 13:45 ` grugh at centrum dot cz
2 siblings, 0 replies; 9+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-03-30 0:10 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From jvdelisle at gcc dot gnu dot org 2008-03-30 00:09 -------
On a openSUSE 11.0alpha3, x86_64, glibc 2.7 (20071106 system, the sinf() calls
the ../sysdeps/x86_64/fpu/s_sincosf.c:175 FPU function whereas on a Fedora 8
system with glibc 2.7 the ../sysdeps/ieee754/flt-32/s_sinf.c, line 29 software
implementation of sinf is called.
Any suggestions on how to fix this. We should be using the FPU calls.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=5997
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug math/5997] Very slow execution of sinf function
2008-03-29 21:18 [Bug math/5997] New: " jvdelisle at gcc dot gnu dot org
2008-03-29 22:13 ` [Bug math/5997] " fxcoudert at gcc dot gnu dot org
2008-03-30 0:10 ` jvdelisle at gcc dot gnu dot org
@ 2008-07-14 13:45 ` grugh at centrum dot cz
2 siblings, 0 replies; 9+ messages in thread
From: grugh at centrum dot cz @ 2008-07-14 13:45 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From grugh at centrum dot cz 2008-07-14 13:44 -------
I had a similar problem with sin function. The problem is connected only to
64-bit distribution.
Using of sinl function is temporary solution, but I had to call it usually this
way, because of unwanted optimizations:
volatile long double _x = x; // x is argument for the sin function (type double)
volatile long double result = sinl(_x);
my own bug report (marked as invalid ;-( )
http://sourceware.org/bugzilla/show_bug.cgi?id=5781
I assume that for the 64-bit distribution (x86_64), it should use sin and sinf
from i386 arch (sysdeps\i386\fpu\s_sin.S and sysdeps\i386\fpu\s_sinf.S) and only
sinl implementation is explicit x86_64. But the sin and sinf are now used as
software versions (IBM library).
--
http://sourceware.org/bugzilla/show_bug.cgi?id=5997
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-02-05 16:05 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-5997-131@http.sourceware.org/bugzilla/>
2012-02-29 20:23 ` [Bug math/5997] Very slow execution of sinf function jsm28 at gcc dot gnu.org
2012-06-22 17:30 ` liubov.dmitrieva at gmail dot com
2013-04-01 12:53 ` siddhesh at redhat dot com
2013-04-01 12:54 ` siddhesh at redhat dot com
2013-12-03 18:41 ` jsm28 at gcc dot gnu.org
2014-02-05 16:05 ` neleai at seznam dot cz
2008-03-29 21:18 [Bug math/5997] New: " jvdelisle at gcc dot gnu dot org
2008-03-29 22:13 ` [Bug math/5997] " fxcoudert at gcc dot gnu dot org
2008-03-30 0:10 ` jvdelisle at gcc dot gnu dot org
2008-07-14 13:45 ` grugh at centrum dot cz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).