public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Refine change for bit-packed slices
@ 2019-09-17  8:06 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2019-09-17  8:06 UTC (permalink / raw)
  To: gcc-patches; +Cc: Arnaud Charlet

[-- Attachment #1: Type: text/plain, Size: 349 bytes --]

We use Long_Long_Integer'Size / 2 instead of 4 * 8 to support
specifying a target configuration file where the largest integer is
32 bits instead of 64.

Tested on x86_64-pc-linux-gnu, committed on trunk

2019-09-17  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* libgnat/s-bitfie.ads (Val_Bits, Val_Bytes): Define from
	Long_Long_Integer'Size.

[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 899 bytes --]

--- gcc/ada/libgnat/s-bitfie.ads
+++ gcc/ada/libgnat/s-bitfie.ads
@@ -36,9 +36,13 @@ package System.Bitfields is
    --  Instances of the generic package in System.Bitfield_Utils. So far
    --  we have just one, which defaults to the natural endianness of the
    --  machine. We might someday want to support Scalar_Storage_Order.
+   --  Note: we use Long_Long_Integer'Size / 2 instead of 32 to support
+   --  specifying a target configuration file where the largest integer is
+   --  32 bits instead of 64.
+
+   Val_Bits  : constant := Long_Long_Integer'Size / 2;
+   Val_Bytes : constant := Val_Bits / System.Storage_Unit;
 
-   Val_Bytes : constant := 4;
-   Val_Bits : constant := Val_Bytes * System.Storage_Unit;
    type Val_2 is mod 2**(Val_Bits * 2) with Alignment => Val_Bytes;
    pragma Provide_Shift_Operators (Val_2);
    type Val is mod 2**Val_Bits with Alignment => Val_Bytes;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-17  8:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-17  8:06 [Ada] Refine change for bit-packed slices Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).