pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/34571: TME sun3 emulator doesn't consider floating point infinities to be equal



>Number:         34571
>Category:       pkg
>Synopsis:       TME sun3 emulator doesn't consider floating point infinities 
>to be equal
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 20 17:05:00 +0000 2006
>Originator:     Arthur Townsend
>Release:        3.0
>Organization:
>Environment:
3.0 for i386
>Description:
TME doesn't consider extended floating point infinities to be equal (whereas a 
real sun3 does).

>How-To-Repeat:
gcc-3.3.3 testcase 960405-1.c, compiled with hard float on a real sun3 passes.  
compiled with hard float inside the emulator, it fails.  compiled with 
-msoft-float on either a real sun3 or inside TME it fails.  This is likely a 
softfloat implementation, as both -msoft-float and TME's emulation of hardware 
floating point use the same softfloat routines.

The assembly code below (modified from the output of gcc -S 960405-1.c) clearly 
shows comparing infinity to itself.

        .file   "a.c"
        .globl  x
        .data
        .align  4
        .type   x, @object
        .size   x, 12
x:
        .long   0x7fff0000
        .long   0
        .long   0
        .text
        .align  2
        .globl  main
        .type   main, @function
main:
        link.w %fp,#0
        fmove.x x,%fp0
        fcmp.x x,%fp0
        fbne .L3
        jbra .L2
        .align  2
.L3:
        jbsr abort
        .align  2
.L2:
        clr.l -(%sp)
        jbsr exit
        nop
        .size   main, .-main
        .ident  "GCC: (GNU) 3.3.3 (NetBSD nb3 20040520)"

Also note that a real sun3 considers
0x7fff00008000000000000000 infinity the same as 
0x7fff00000000000000000000 infinity.

>Fix:
Modify TME's softfloat routines.  Arguably, its not a problem with the original 
softfloat routines themselves, since different operating systems and processors 
may implement infinity comparisons differently, but since TME is designed to 
emulate a Sun3, then it should do exactly what a Sun3 does, and consider 
infinities equal.




Home | Main Index | Thread Index | Old Index