Question regarding libm

Manuel Novoa III mjn3 at codepoet.org
Thu Sep 29 19:39:21 UTC 2005


On Thu, Sep 29, 2005 at 08:35:15PM +0200, Jan-Benedict Glaw wrote:
> Hi!
> 
> I'm currently trying to resurrect the former port of uClibc to the VAX
> architecture.
> 
> So far, I've collected a number of patches for binutils, gcc and
> uClibc with allow me to compile libc and libm and link it all together
> (currently I can only manually link, I need to figure out how to make
> GCC emit a working collect1 call, but thats a different story).
> 
> I tried to play with libm and called sin(), just for fun, and got
> this:
> 
> [370436.240000] PID 78: starting thread pc=   10080 new_sp=7FA0CE90 regs->sp=7FF04BD0
> [370436.340000] Arithmetic Fault at PC=   12adb, Floating or Decimal Division by Zero Fault, (code=9)
> [370436.350000]   80c39efc  00010074 00000001 00000000 20000000
> [370436.400000]   80c39f0c  80c39f34 80c39f20 8011afea 00000000
> [370436.460000]   80c39f1c  20000000 00000000 20000000 80c39f5c
> [370436.510000]   80c39f2c  80c39f44 8010502e 00000002 00000008
> [370436.560000]   80c39f3c  80e310a0 80c39f6c 00000000 20400000
> [370436.610000]   80c39f4c  80c39f94 80c39f6c 801050c9 00000000
> [370436.660000]   80c39f5c  00000002 80c39fa4 80c39ff0 00000000
> [370436.710000]   80c39f6c  00000000 27c00000 7fa0cbac 7fa0cb80
> [370436.760000]   80c39f7c  8010550e 00000000 00000000 7ff04edc
> [370436.810000]   80c39f8c  7fa0ce66 00010074 00000003 80c39fa4
> [370436.860000]   80c39f9c  802bb6d6 80c39ff0 00000000 00000000
> [370436.920000]   80c39fac  00000001 7fa0ccec 00000001 00000001
> [370436.980000]   80c39fbc  00000000 00000000 7ff04edc 7fa0ce66
> [370437.030000]   80c39fcc  00010074 00000001 7fa0cbac 7fa0cb80
> [370437.080000]   80c39fdc  80c39ffc 00012adb 03c00004 00000000
> [370437.130000]   80c39fec  802bb6d6 00000009 00012adb 03c00004
> [370437.180000] Call Trace:
> [370437.190000]  [<8011afea>] force_sig+0xc/0x1c
> [370437.210000]  [<8010502e>] arith_handler+0x46/0x48
> [370437.230000]  [<801050c9>] do_irq_excep+0x27/0x100
> [370437.250000]  [<8010550e>] ret_from_syscall+0x0/0x2a
> [370437.280000] 
> [370437.290000] force_sig(8) to main_vax(78)
> Floating point exception
> 
> Debugging doesn't work at this time (dwarft2 emitting isn't working
> :-), but using objdump, it breaks in _fpmaxtostr().
> 
> >From a fast glance at the code, it seems to imply IEEE floating point
> representation, doesn't it? That would be somewhat bad, since VAX does
> have it's own numeric representation...

Currently, _fpmaxtostr() assumes a base 2 representation.  But there's
a compile-time test for that using FLT_RADIX.  Otherwise, it makes no
assumptions about internal representation of float.  It _does_ assume
some IEEE float behavior though.  If you could isolate the problem down
to a particular area of the code, I'd be happy to take a look.

Manuel



More information about the uClibc mailing list