comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jrcarter@acm.org>
Subject: Re: 64 bit integers
Date: Wed, 29 May 2002 18:07:54 GMT
Date: 2002-05-29T18:07:54+00:00	[thread overview]
Message-ID: <3CF518F8.AA7A49ED@acm.org> (raw)
In-Reply-To: 3CF4F374.5010306@yahoo.com

David Rasmussen wrote:
> 
> 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?

Yes, you can be reasonably sure. If you need to be completely sure, then
you need to evaluate the object code output by candidate compilers.

> 
> 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?

This depends a lot on what you want to do and what you mean by "be as
fast". It will probably be faster to get to a correct program in Ada
than in C/++, for example.

If you're talking about the speed of the generated code for dealing with
integers, it still depends. If you want overflow checking, for example,
the Ada code will probably be faster than the C/++ code, since in C/++
you will have to manually include overflow checks, and they will always
be executed. In Ada, the compiler automatically includes the checks, and
can optimize them away when they are unnecessary.

-- 
Jeff Carter
"You couldn't catch clap in a brothel, silly English K...niggets."
Monty Python & the Holy Grail



      parent reply	other threads:[~2002-05-29 18:07 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
2002-05-29 18:07 ` Jeffrey Carter [this message]
replies disabled

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