comp.lang.ada
 help / color / mirror / Atom feed
From: Optikos <ZUERCHER_Andreas@outlook.com>
Subject: Re: Creating several types from a base type and conversion
Date: Sun, 19 Jan 2020 08:11:03 -0800 (PST)
Date: 2020-01-19T08:11:03-08:00	[thread overview]
Message-ID: <81a31f56-d59d-4133-822d-c0239fd352e8@googlegroups.com> (raw)
In-Reply-To: <516be7e3-4be3-4697-adb0-9fbde4d5b7e6@googlegroups.com>

On Sunday, January 19, 2020 at 5:48:20 AM UTC-6, AdaMagica wrote:
> Am Sonntag, 19. Januar 2020 10:37:21 UTC+1 schrieb Simon Wright:
> > representation clauses where endianness is involved are a lot more
> > confusing than shifts and masks.
> 
> See https://en.wikibooks.org/wiki/Ada_Programming/Attributes/%27Bit_Order
> 
> This is a complete description of how far we can get with endian independence in current Ada. Ada 202x won't change anything in this respect.
> 
> CKWG

No, it is not entirely complete—not entirely capturing the full industrial practice on this little-endian/big-endian topic.  A complete treatment of the topic would include utilizing the build system to swap in either of 2 child packages containing same-named identifiers, such as my aforementioned {ExtractCharWordFromDataWord, EmbedCharWordIntoDataWord, ExtractDataWordFromInstructionWordOpcode, EmbedDataWordIntoInstructionWordOpcode, ExtractDataWordFromInstructionWordImmediate, EmbedDataWordIntoInstructionWordImmediate,  ExtractDataWordFromImmediateForSuchandsuchOpcode, EmbedDataWordIntoImmediateForSuchandsuchOpcode} where
1) one child package has the •little-endian• shifting & masking (via either declarative/representation-clauses or bit-twiddling imperative/OR-&-AND-expressions-&-assignments) variant for each of those identifier names
and
2) the other child package has the •big-endian• shifting & masking (…) variant for each of those identifier names.

Yes, I realize that the build system is (unfortunately!) not standardized in Ada, but (nearly?) all Ada compilers since time began have permitted some technique of choosing which packages to include or exclude from the build so that the linker choses this variant or that variant of same-named identifiers to actually be linked into the executable or dynamically-linked library, preferably on a per-ISA basis or on a conditional-compilation basis.


  parent reply	other threads:[~2020-01-19 16:11 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-18  7:32 Creating several types from a base type and conversion Ken Roberts
2020-01-18 12:16 ` Simon Wright
2020-01-18 12:49   ` Ken Roberts
2020-01-18 14:56     ` Bill Findlay
2020-01-18 16:13       ` Jeffrey R. Carter
2020-01-18 18:20         ` Bill Findlay
2020-01-18 18:32           ` Jeffrey R. Carter
2020-01-18 20:34             ` Simon Wright
2020-01-20 16:38               ` Bill Findlay
2020-01-18 22:20       ` Ken Roberts
2020-01-18 15:09     ` Simon Wright
2020-01-18 22:16       ` Ken Roberts
2020-01-18 22:35         ` Simon Wright
2020-01-18 23:03           ` Ken Roberts
2020-01-18 23:38             ` Simon Wright
2020-01-19  0:12               ` Ken Roberts
2020-01-19  9:37                 ` Simon Wright
2020-01-19 11:48                   ` AdaMagica
2020-01-19 14:51                     ` Simon Wright
2020-01-19 15:24                       ` Niklas Holsti
2020-01-19 16:11                     ` Optikos [this message]
2020-01-19  0:33               ` Ken Roberts
2020-01-19  0:07         ` Niklas Holsti
2020-01-18 15:47     ` Simon Wright
2020-01-21 21:35     ` Shark8
2020-01-21 23:06       ` Niklas Holsti
2020-01-22  1:08         ` Ken Roberts
2020-01-22 14:18           ` Ken Roberts
2020-01-22  8:37       ` Simon Wright
2020-01-22 14:32         ` Shark8
2020-01-22 15:40           ` Simon Wright
2020-01-18 14:17   ` Optikos
2020-01-18 17:57 ` Niklas Holsti
2020-01-18 22:59   ` Ken Roberts
2020-01-19  0:30     ` Niklas Holsti
2020-01-19  1:07       ` Ken Roberts
2020-01-19  3:37 ` Ken Roberts
2020-01-23 21:39 ` Optikos
2020-01-24  9:35   ` Ken Roberts
2020-01-24 10:04     ` AdaMagica
2020-01-24 12:38     ` Optikos
2020-01-24 15:01       ` Ken Roberts
2020-01-24 15:22         ` Simon Wright
2020-01-24 15:40           ` Ken Roberts
2020-01-24 15:54   ` Simon Wright
2020-01-25 10:37 ` Ken Roberts
2020-01-25 10:44   ` Ken Roberts
2020-01-25 20:26   ` Shark8
2020-01-27 14:10 ` Ken 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