comp.lang.ada
 help / color / mirror / Atom feed
From: antonio_duran@hotmail.com (Antonio Duran)
Subject: Re: 64 bit integers
Date: 31 May 2002 01:11:07 -0700
Date: 2002-05-31T08:11:08+00:00	[thread overview]
Message-ID: <e1a50f2.0205310011.67312ebd@posting.google.com> (raw)
In-Reply-To: ad301f$h5p$1@nh.pace.co.uk

"Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org> wrote in message news:<ad301f$h5p$1@nh.pace.co.uk>...
> The only way to be sure is to conduct tests and/or check documentation
> and/or call your vendor. Ada will let you express representation, so you
> should feel confident that you're actually going to get 64 bits, etc. (or an
> error message if the compiler can't support it.) But what you're going to
> get for instructions & registers is not certain. One would hope that a
> reasonable implementation for a machine that supported 64 bit numbers would
> give you what you expect. It would be surprisingly inefficient for a mature,
> reputable compiler to do something else, but at the end of the day you don't
> get any guarantees from the language. Early, inefficient implementations of
> Ada83 often generated subroutine calls to synthesize lots of math operations
> because it was the simplest way to guarantee they satisfied the language
> rules. Hopefully, things are better these days with your compiler. :-) Try
> coding up an example and get the compiler to spit out assembly code & see
> what you get.
> 
> MDC
> --
> Marin David Condic
> Senior Software Engineer
> Pace Micro Technology Americas    www.pacemicro.com
> Enabling the digital revolution
> e-Mail:    marin.condic@pacemicro.com
> 
> 
> "David Rasmussen" <pinkfloydhomer@yahoo.com> wrote in message
> news:3CF4F374.5010306@yahoo.com...
> > Can I be reasonably sure that if I use some sort of 64-bit integer in
> > Ada, that it will be represented by native 64-bit registers on a 64-bit
> > machine, and perhaps even more important, that it will be represented by
> > some very effecient double 32-bit registers scheme on a 32-bit processor?
> >
> > For instance, with GNAT, will it be as fast to use Ada for this kind of
> > thing as it will be to use long long with GNU's C or C++ compiler?
> >
> > /David
> >

What you can expect is that the Ada implementation will choose a
representation that fit the needs for 64 bit integers. If there is a
definite representation or performance requirement you should evaluate
different Ada compiler vendors and products and choose the one that
fits your specific needs.

On the other hand you could be reasonably sure that you can develop
your software (I mean code, test, and debug) using one compiler and,
when you find other that meets your requirements, port easily the code
to that implementation. That is undoubtly a huge advantage over a lot
of nasty #ifdef directives.
 
  Antonio Duran



  reply	other threads:[~2002-05-31  8:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-29 15:27 64 bit integers David Rasmussen
2002-05-29 16:35 ` Marin David Condic
2002-05-31  8:11   ` Antonio Duran [this message]
2002-05-29 18:07 ` Jeffrey Carter
replies disabled

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