From: fairfield@sldb4.slac.stanford.edu
Subject: Re: DEC Unix 4.0 IEEE floating point on Alpha
Date: 1997/07/24 [thread overview]
Message-ID: <1997Jul24.122022.1@sldb4.slac.stanford.edu> (raw)
In-Reply-To: 5r732p$9n@zam201.zam.kfa-juelich.de
In article <5r732p$9n@zam201.zam.kfa-juelich.de>,
arnold@zam331.kfa-juelich.de (A.Arnold) writes:
>
>>Can someone tell me if it's possible to get the Alpha to read/write
>>IEEE in the right order? I've tried cc with the -ieee switch, but
>>that didn't do anything useful, and I tried gcc, and under VMS, I
>>tried cc/float=ieee ..., all of which yielded the 'backwards' IEEE format.
[...]
> If you want to portably read and write binary data over different platforms,
> you have to do the 'byte mirroring' yourself on architectures that do not
> use the endianess you use in your files (I personally work on Alphas and
> Intels most of the time, so my binary files are 'little endian' and I have
> to convert on a big-endian machine...). For example, the following routine
> converts an array of 4-byte values (doesn't matter if they are floats or
> ints):
Perhaps a better solution is to use the "convert float" routines
available on DU (and OpenVMS). Sorry that I can't recall the exact
name on DU; its a run-time library routine called CVT$CONVERT_FLOAT
on OVMS. By using this routine for all input and output of binary
data, you can maintain a single external source form, e.g.,
big-endian & IEEE floats, etc. The routine does many more
conversions than these, but for the problem at hand...
-Ken
--
Kenneth H. Fairfield | Internet: Fairfield@Slac.Stanford.Edu
SLAC, P.O.Box 4349, MS 46 | DECnet: 45537::FAIRFIELD (45537=SLACVX)
Stanford, CA 94309 | Voice: 415-926-2924 FAX: 415-926-3515
-------------------------------------------------------------------------
These opinions are mine, not SLAC's, Stanford's, nor the DOE's...
next prev parent reply other threads:[~1997-07-24 4:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-07-23 4:00 DEC Unix 4.0 IEEE floating point on Alpha James Nau
1997-07-23 4:00 ` Paul DeMone
1997-07-24 4:00 ` Emmanuel Choquet
1997-07-24 4:00 ` A.Arnold
1997-07-24 4:00 ` fairfield [this message]
1997-07-25 4:00 ` Steve Lionel
1997-07-24 4:00 ` Jim Griffin
1997-07-26 4:00 ` John Hascall
1997-08-05 4:00 ` Eugene Y C Chu
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox