aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@adacore.com>2019-09-17 07:59:38 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-09-17 07:59:38 +0000
commit5387a3f55fedbab8c99677c4021061fbaabec3ff (patch)
tree6ca3aee11a6620184bfc81ace12400b32c4bda3e
parent1ed19d98def3515e5b2fb9e68be34da4a78a7fdb (diff)
downloadgcc-5387a3f55fedbab8c99677c4021061fbaabec3ff.zip
gcc-5387a3f55fedbab8c99677c4021061fbaabec3ff.tar.gz
gcc-5387a3f55fedbab8c99677c4021061fbaabec3ff.tar.bz2
[Ada] Refine change for bit-packed slices
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. 2019-09-17 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnat/s-bitfie.ads (Val_Bits, Val_Bytes): Define from Long_Long_Integer'Size. From-SVN: r275773
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/libgnat/s-bitfie.ads8
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index c44a16d..9193e6f 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2019-09-17 Arnaud Charlet <charlet@adacore.com>
+
+ * libgnat/s-bitfie.ads (Val_Bits, Val_Bytes): Define from
+ Long_Long_Integer'Size.
+
2019-09-17 Javier Miranda <miranda@adacore.com>
* exp_ch6.ads (Needs_BIP_Task_Actuals): New subprogram.
diff --git a/gcc/ada/libgnat/s-bitfie.ads b/gcc/ada/libgnat/s-bitfie.ads
index 1b62b9d..a90605b 100644
--- a/gcc/ada/libgnat/s-bitfie.ads
+++ b/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;