From: Bernd.Specht@gmx.com (Bernd Specht)
Subject: Re: Bitmanipulation in Ada
Date: 19 Aug 2004 17:30:17 GMT
Date: 2004-08-19T19:30:17+02:00 [thread overview]
Message-ID: <Xns954AC63A02C0DBerndSpechgmxcom@151.189.20.10> (raw)
In-Reply-To: opscx5geap5afhvo@localhost
"Ed Falis" <falis@verizon.net> wrote in news:opscx5geap5afhvo@localhost:
> On 18 Aug 2004 21:10:30 GMT, Bernd Specht <Bernd.Specht@gmx.com> wrote:
>
>> OK, but this would result in an assignment operation (a memory move on
>> maschine code level). What I want is a real "overlay" (same storage
>> location used for both), so reading the value would not need extra
>> instructions.
>
> In all implementations of which I'm aware (and I've been in the Ada
> compiler business for over 20 years) no code would be generated for an
> unchecked conversion where the source and target have the same size.
Sorry, but that's absolutely *nonsense*
Have a look at Ludovics code:
with Ada.Unchecked_Conversion;
procedure P is
type Byte_Array is array (1 .. Integer'Size) of Boolean;
pragma Pack (Byte_Array);
for Byte_Array'Size use Integer'Size;
function To_Byte_Array is new
Ada.Unchecked_Conversion (Source => Integer, Target => Byte_Array);
I : Integer := 42;
B : Byte_Array := To_Byte_Array (I);
begin
null;
end P;
You agree that "I" and "B" are located at different adresses? Do you
*really* think that you need *no* code to move data from one address to
another??? That's wrong! You need at least *one* instruction, and this can
be time consuming - especially if the data is missaligned and/or the code
runs in a multiprocessor environment.
> You sound like you're looking for things to complain about, by the way.
Sorry - but you seem to be a blatherer.
> (and I've been in the Ada compiler business for over 20 years)
Wow! Be happy.
>
> - Ed
*plonk*
next prev parent reply other threads:[~2004-08-19 17:30 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-18 20:37 Bitmanipulation in Ada Bernd Specht
2004-08-18 20:51 ` Ludovic Brenta
2004-08-18 21:10 ` Bernd Specht
2004-08-18 21:16 ` Ludovic Brenta
2004-08-18 21:18 ` Ed Falis
2004-08-19 17:30 ` Bernd Specht [this message]
2004-08-19 17:44 ` Ed Falis
2004-08-19 0:53 ` Jeffrey Carter
2004-08-19 17:44 ` Bernd Specht
2004-08-19 18:09 ` Martin Dowie
2004-08-19 18:28 ` Bernd Specht
2004-08-19 19:31 ` Martin Dowie
2004-08-19 20:29 ` Martin Dowie
2004-08-20 21:31 ` Bernd Specht
2004-08-19 19:17 ` Jeffrey Carter
2004-08-19 19:57 ` Björn Persson
2004-08-20 0:52 ` Jeffrey Carter
2004-08-19 21:24 ` Francois G. Dorais
2004-08-20 8:55 ` Pascal Obry
2004-08-20 7:26 ` Jean-Pierre Rosen
2004-08-20 21:20 ` Bernd Specht
2004-08-20 21:39 ` Ed Falis
2004-08-18 21:14 ` (see below)
2004-08-18 21:56 ` Martin Dowie
2004-08-19 15:25 ` (see below)
2004-08-19 15:50 ` Martin Dowie
2004-08-18 21:53 ` Martin Dowie
2004-08-18 22:59 ` Björn Persson
2004-08-19 8:08 ` Egil H. H�vik
2004-08-19 17:46 ` Bernd Specht
2004-08-20 20:57 ` Bitordering? was " Alfred Hilscher
2004-08-21 11:34 ` Nick Roberts
2004-08-21 14:00 ` Jim Rogers
2004-08-21 16:54 ` Simon Wright
2004-08-21 16:55 ` Georg Bauhaus
2004-08-23 18:36 ` Alfred Hilscher
2004-08-23 18:47 ` Alfred Hilscher
2004-08-23 22:39 ` Nick Roberts
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox