comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Large Integer Overflow - Causing a Bottleneck - Any solution.
Date: Thu, 04 May 2017 17:53:04 +0100
Date: 2017-05-04T17:53:04+01:00	[thread overview]
Message-ID: <lyfugkk1hr.fsf@pushface.org> (raw)
In-Reply-To: 4b7a7a25-d1b2-4fd0-9943-da611e53e307@googlegroups.com

Stephen Davies <joviangm@gmail.com> writes:

> On Wednesday, 3 May 2017 17:18:00 UTC+1, Simon Wright  wrote:
>> Even where a GNAT is built for a machine with 64-bit addresses, it uses
>> 32-bit integers as you have seen.
>> 
>> You could try, near the top of your program (assuming it's just one
>> compilation unit),
>> 
>>    subtype Integer is Long_Integer;
>
> With Gnat, I believe that Long_Integer is still 32-bit and for 64-bit you
> need Long_Long_Integer. Or use "type Int64 is range -(2**63) .. 2**63-1". 

macOS Sierra, GNAT GPL 2016, this:

   package Obyrne is
      subtype Integer is Long_Integer;
      type R is record
         C : Integer;
      end record;
   end Obyrne;

gives

   $ gnatmake -c -u -f -gnatR obyrne.ads
   gcc -c -gnatR obyrne.ads

   Representation information for unit Obyrne (spec)
   -------------------------------------------------

   for R'Size use 64;
   for R'Alignment use 8;
   for R use record
      C at 0 range  0 .. 63;
   end record;

so on that platform I stand by Long_Integer. Might be different on a
32-bit platform, I guess, but I don't have one.


  reply	other threads:[~2017-05-04 16:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-02 14:48 Large Integer Overflow - Causing a Bottleneck - Any solution Austin Obyrne
2017-05-02 20:13 ` Rich
2017-05-03 15:05   ` Luke A. Guest
2017-05-03 16:29     ` Rich
2017-05-03 16:18 ` Simon Wright
2017-05-04 15:49   ` Stephen Davies
2017-05-04 16:53     ` Simon Wright [this message]
2017-05-04 21:56       ` Dennis Lee Bieber
2017-05-05  8:28   ` Austin Obyrne
2017-05-04 21:49 ` Dennis Lee Bieber
replies disabled

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