This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: exotic floating point formats test
- To: Zack Weinberg <zackw at stanford dot edu>
- Subject: Re: exotic floating point formats test
- From: Kevin Handy <kth at srv dot net>
- Date: Sat, 10 Mar 2001 16:58:40 -0700
- CC: gcc at gcc dot gnu dot org
- Organization: Software Solutions, Inc
- References: <20010309142321.B2238@stanford.edu>
Zack Weinberg wrote:
>
> I'd appreciate knowing what this program prints on a VAX (or an Alpha
> asked to use VAX floating point), an IBM mainframe target, and a C4x
> processor. For reference:
>
> i686-pc-linux-gnu $ ./a.out
> 3.25098346789696250880e+01 46454443 42414040 FEDC BA@@
> sparc-sun-solaris2.7 $ ./a.out
> 3.25098346789696250880e+01 40404142 43444546 @@AB CDEF
>
> [that's little- and big-endian IEEE, respectively]
After changing the format string to be in one quote,
and changing the format from %.2x to %02.2x, I got
the following results (note that there are two
floating point formats for C on the VAX)
VAX/VMS 5.5 D-FLOAT format
$ cc untitled.c
$ link untitled, sys$library:vaxcrtl/lib
$ run untitled
3.25098346789696250880e+01 0243120a 221a302a .C.. ".0*
%NONAME-W-NOMSG, Message number 00000000
VAX/VMS 5.5 G-FLOAT format
$ cc untitled.c/g_float
$ link untitled, sys$library:vaxcrtl/lib
$ run untitled
3.25098346789696250880e+01 60404241 44434645 `@BA DCFE
%NONAME-W-NOMSG, Message number 00000000
> If you want to be clever and come up with floating point numbers that
> generate recognizable, distinct, strings in those formats, that'd be
> even niftier.
>
> Also, does anyone know why c4x.h requests an exotic target float
> format, but xm-c4x.h leaves us in IEEE on the host?
--
If they're not putting secret messages to me in their music, then why
do they keep putting my picture on the other side of the CD's?