Linux MIPS Architecture development
 help / color / mirror / Atom feed
* Re: math broken on mips
@ 2002-02-18 19:50 Stephen L Moshier
  2002-02-18 19:50 ` Stephen L Moshier
  2002-02-18 20:18 ` Geoff Keating
  0 siblings, 2 replies; 14+ messages in thread
From: Stephen L Moshier @ 2002-02-18 19:50 UTC (permalink / raw)
  To: Zhang Fuxin; +Cc: linux-mips, libc-alpha


> pow(2,7) = 128.0 when rounding = TONEAREST or UPWARD
>                = 64.1547.. when rounding = DOWNWARD or TOWARDZERO

The libm functions from IBM that were recently installed in glibc come
with this remark in sysdeps/ieee754/dbl-64/MathLib.h:

  /* Assumption: Machine arithmetic operations are performed in       */
  /* round nearest mode of IEEE 754 standard.                         */

These math functions use a doubled-precision Dekker arithmetic which is
very sensitive to rounding rules and arithetic flaws.  Fixing the
routines to give reasonable answers with other rounding modes would not
be practical.

It is customary for a system math library to expect default environment
conditions, and I do not think this design actually violates any
standards. If you want to use non-default arithmetic settings and have
them work portably on various systems, you will have to take defensive steps
to protect your program from damage by the operating system and the system
library.

^ permalink raw reply	[flat|nested] 14+ messages in thread
* math broken on mips
@ 2002-02-18  7:57 Zhang Fuxin
  2002-02-18  8:18 ` H . J . Lu
  0 siblings, 1 reply; 14+ messages in thread
From: Zhang Fuxin @ 2002-02-18  7:57 UTC (permalink / raw)
  To: linux-mips@oss.sgi.com; +Cc: libc-alpha@sources.redhat.com, gcc@gcc.gnu.org

hi,
   There are so many problems on math handling for linux-mips,including:
1. SNaN & QNan handling(both gcc & glibc)
2. gcc2.96 generates wrong code with -O2,at least 
     one will lead to exception handling problem(reported by me)
     one will lead to some 'long long' type mishandling(reported by Atsushi Nemoto)

   (gcc3.1 seems a lot better,but it has problem to compile glibc.I can't even compile
 current glibc cvs code(with dl-conflict.c etc patched) with it. The best result is
 a segment fault when using ld.so.1:
      ../elf/ld.so.1 --library-path ..:../math:../elf:../dlfcn:../nss:../nis:../rt:../resolv:
  ../crypt:../linuxthreads ./rpcgen -Y ../scripts -c rpcsvc/bootparam_prot.x -o 
  xbootparam_prot.T
  make[1]: *** [xbootparam_prot.stmp] Segmentation fault
  )     
3. problems with math-emu
4. other problems to be investigated for its cause,including this one,
  
       pow(2,7) = 128.0 when rounding = TONEAREST or UPWARD
                = 64.1547.. when rounding = DOWNWARD or TOWARDZERO

 when today i find out the above problem I was feeling almost despaired:(

 I want to fix these problems,if i could.But it concerns so many things that i am not
 expert on and no time to dig:(. So any help will be highly appreciated.

 


Regards
            Zhang Fuxin
            fxzhang@ict.ac.cn

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2002-02-19 12:22 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-18 19:50 math broken on mips Stephen L Moshier
2002-02-18 19:50 ` Stephen L Moshier
2002-02-18 20:18 ` Geoff Keating
2002-02-18 20:23   ` Stephen L Moshier
2002-02-18 20:23     ` Stephen L Moshier
2002-02-18 20:45     ` Geoff Keating
2002-02-18 21:06       ` Stephen L Moshier
2002-02-18 21:06         ` Stephen L Moshier
2002-02-18 21:39         ` Ulrich Drepper
2002-02-18 21:39           ` Ulrich Drepper
2002-02-18 20:44   ` Ulrich Drepper
2002-02-18 21:07   ` Andreas Schwab
  -- strict thread matches above, loose matches on Subject: below --
2002-02-18  7:57 Zhang Fuxin
2002-02-18  8:18 ` H . J . Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox