This is the mail archive of the glibc-bugs@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]

[Bug ports/13742] New: Use of fsincos is incorrect for large input on m68k


http://sourceware.org/bugzilla/show_bug.cgi?id=13742

             Bug #: 13742
           Summary: Use of fsincos is incorrect for large input on m68k
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ports
        AssignedTo: unassigned@sourceware.org
        ReportedBy: carlos@systemhalted.org
                CC: carlos@systemhalted.org, roland@gnu.org,
                    schwab@linux-m68k.org
    Classification: Unclassified
            Target: m68k-linux-gnu


This bug:
http://sourceware.org/bugzilla/show_bug.cgi?id=13658

Raises the question of the accuracy of hardware fsincos instructions for large
inputs.

It would appear that this bug, present on x86 and x86_64, would also effect
m68k since it uses a fsincos instruction with limited accuracy at high input
values.

A quick grep shows:
sysdeps/m68k/m680x0/fpu/s_csin.c:      __asm ("fsincos%.x %2,%1:%0" : "=f"
(sin_rx), "=f" (cos_rx)
sysdeps/m68k/m680x0/fpu/bits/mathinline.h:  __asm ("fsincos%.x %2,%1:%0"       
                                        \
sysdeps/m68k/m680x0/fpu/k_sin.c:  __asm__ __volatile__ ("fsincosx %2,%0:%1" :
"=f" (cos_x), "=f" (sin_x)
sysdeps/m68k/m680x0/fpu/k_sin.c:  __asm__ __volatile__ ("fsincosx %2,%0:%1" :
"=f" (cos_y), "=f" (sin_y)
sysdeps/m68k/m680x0/fpu/s_ccosh.c:      __asm ("fsincos%.x %2,%1:%0" : "=f"
(sin_ix), "=f" (cos_ix)
sysdeps/m68k/m680x0/fpu/s_csinh.c:      __asm ("fsincos%.x %2,%1:%0" : "=f"
(sin_ix), "=f" (cos_ix)
sysdeps/m68k/m680x0/fpu/k_cos.c:  __asm__ __volatile__ ("fsincosx %2,%0:%1" :
"=f" (cos_x), "=f" (sin_x)
sysdeps/m68k/m680x0/fpu/k_cos.c:  __asm__ __volatile__ ("fsincosx %2,%0:%1" :
"=f" (cos_y), "=f" (sin_y)
sysdeps/m68k/m680x0/fpu/s_cexp.c:         __asm ("fsincos%.x %2,%1:%0" : "=f"
(sin_ix), "=f" (cos_ix)

A quick inspection does not show any input argument reduction.

The M68000PM/AD REV.1 states loss of accuracy if the input is > 10^20.

Therefore it seems to me that the m68k port also suffers the same problems as
x86 and x86_64.

-- 
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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]