Bug 13742 - [m68k] Use of fsincos is incorrect for large input on m68k
Summary: [m68k] Use of fsincos is incorrect for large input on m68k
Status: UNCONFIRMED
Alias: None
Product: glibc
Classification: Unclassified
Component: math (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Andreas Schwab
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-24 16:12 UTC by Carlos O'Donell
Modified: 2017-12-04 18:50 UTC (History)
4 users (show)

See Also:
Host: m68k-*-*
Target: m68k-linux-gnu
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos O'Donell 2012-02-24 16:12:32 UTC
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.