GMP and 64-bit systems
Vincent Lefevre
vincent at vinc17.org
Sun Jun 1 11:51:02 CEST 2008
On 2008-06-01 04:03:20 -0400, librik at panix.com wrote:
> The only acceptable use of "long" is when you need a variable that's
> guaranteed to be longer than a "short",
It is not guaranteed to be longer. I know a C implementation on RISC OS
(Acorn) that had 32-bit short, int and long for efficiency reasons (the
old ARM's could not load/store 16-bit results, and arithmetic on 16-bit
values could also be slow if optimization wasn't possible). Of course,
people complained when they wanted to port code (designed for Unix)
that assumed 16-bit short's. I think you can find discussions about
this in comp.sys.acorn.programmer archives.
> A conclusion: any integer type intended to be 32 bits on 32-bit
> systems and 64 bits on 64-bit systems cannot be a basic C type. It
> must be a typedef type, whose identity is controlled by an #ifdef in
> some header file.
I agree.
--
Vincent Lefèvre <vincent at vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
More information about the gmp-discuss
mailing list