comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@spectre.mitre.org (Robert I. Eachus)
Subject: Re: Transition from 32 to 64 bit
Date: 21 Sep 94 09:05:54
Date: 1994-09-21T09:05:54+00:00	[thread overview]
Message-ID: <EACHUS.94Sep21090554@spectre.mitre.org> (raw)
In-Reply-To: wbdavis@shooter.nswc.navy.mil's message of Tue, 20 Sep 1994 16:07:16 GMT

In article <1994Sep20.160716.25347@relay.nswc.navy.mil> wbdavis@shooter.nswc.navy.mil (Bill Davis) writes:

  >    I have a large program written in Ada which currently runs on a
  > 32 bit MIPS machine.  I have been requested to move this software
  > to a 64 bit SGI machine.  We are running Verdix compilers on both
  > machines.  I am having trouble because on the MIPS the float type
  > is 32 bits and the long_float is 64 bits.  On the SGI machine the
  > float is 64 bits and the short_float is 32 bits.  Is there any way
  > to get this software running without actually changing all the
  > floats to short_floats and the long_floats to floats in the source
  > code.  If anyone has any suggestions, I would like to hear them.

    Okay:

      1) Use a different compiler.

      2) Create a package that defines:

         type Long_Float is new Standard.Float;
         type Float is new Standard.Short_Float;

         and in every library unit that uses Float or Long_Float put
         in a with clause and renames of the types (so they will hide
         the types from Standard).

      3) Get your compiler vendor to provide you with an alternate
         package STANDARD.  (Not as silly as it sounds, with many
         compilers this is a reasonable option.

      4) Modify the source to use, say Float_6 and Float_14, declared
         in terms of the actual required precision.  Then the port
         becomes easy, and no source changes are required.

    The last solution is, of course, the one taught to all Ada
programmers, so I assume that you are aware of it (and that someone
else wrote the offending software).  It may not seem like an
astonishing revelation that software written non-portably is not
portable, but there are a lot of managers out there who still haven't
figured it out.

    Since confession is good for the soul, I should point out that on
the ADAR project, where portablity is job one, everyone has made the
mistake of using Integer or Float in inappropriate places at one time
or another.  But we treat such occurances as serious bugs.  (There are
some places where you must use the standard types, and others where
they are used to match other standards, so there are places where
Integer and Float are used.)

--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...



  reply	other threads:[~1994-09-21  9:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-09-20 16:07 Transition from 32 to 64 bit Bill Davis
1994-09-21  9:05 ` Robert I. Eachus [this message]
     [not found] ` <35n81h$1fb2@watnews1.watson.ibm.com>
1994-09-22 14:06   ` Robert Dewar
     [not found] <1994Sep21.111428.24972@sydney.DIALix.oz.au>
     [not found] ` <1994Sep21.122657.729@sydney.DIALix.oz.au>
     [not found]   ` <35qgno$ivk@gnat.cs.nyu.edu>
     [not found]     ` <35qp39$8mk@Starbase.NeoSoft.COM>
1994-09-22 14:09       ` Robert Dewar
replies disabled

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