Debian Codegraph @

gcc/ada/libgnat/s-pack86.adb

raw
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUN-TIME COMPONENTS --
4 -- --
5 -- S Y S T E M . P A C K _ 8 6 --
6 -- --
7 -- B o d y --
8 -- --
9 -- Copyright (C) 1992-2025, Free Software Foundation, Inc. --
10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. --
17 -- --
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
19 -- additional permissions described in the GCC Runtime Library Exception, --
20 -- version 3.1, as published by the Free Software Foundation. --
21 -- --
22 -- You should have received a copy of the GNU General Public License and --
23 -- a copy of the GCC Runtime Library Exception along with this program; --
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
25 -- <http://www.gnu.org/licenses/>. --
26 -- --
27 -- GNAT was originally developed by the GNAT team at New York University. --
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
29 -- --
30 ------------------------------------------------------------------------------
31
32 with System.Address_To_Access_Conversions;
33 with System.Storage_Elements;
34 with System.Unsigned_Types;
35
36 package body System.Pack_86 is
37
38 -- The high-level idea of the implementation is to overlay a record
39 -- containing components of the same size as that of the component
40 -- of the array, in order words 86 bits, and to access the indexed
41 -- component of the array through the appropriate selected component
42 -- of the record.
43
44 -- The record must be of a fixed size for technical reasons, so we
45 -- effectively overlay a series of contiguous records containing 8
46 -- components (so that their size in bits is a multiple of a byte)
47 -- at the start of the array and access the component in the last
48 -- of them. However, this component in the last record may also be
49 -- mapped to the last component of the array, which means that the
50 -- generated code cannot safely access past it (or its last byte).
51 -- That's why the last record of the series is shortened, so the
52 -- accessed component is always the last component of the record.
53
54 -- A (0) A (N)
55 -- | |
56 -- V V
57 -- ---------------------------------------------------------------
58 -- | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
59 -- ---------------------------------------------------------------
60 --
61 -- component K
62 -- |
63 -- V
64 -- ---------------------------------------------------------
65 -- | | | | |
66 -- ---------------------------------------------------------
67 -- | | | |
68 -- Cluster7 Cluster7 Cluster7 ClusterK
69 --
70 -- where the number of Cluster7 is N / 8 and K is N mod 8.
71
72 subtype Bit_Order is System.Bit_Order;
73 Reverse_Bit_Order : constant Bit_Order :=
74 Bit_Order'Val (1 - Bit_Order'Pos (System.Default_Bit_Order));
75
76 subtype Ofs is System.Storage_Elements.Storage_Offset;
77 subtype Uns is System.Unsigned_Types.Unsigned;
78 subtype N07 is System.Unsigned_Types.Unsigned range 0 .. 7;
79
80 use type System.Storage_Elements.Storage_Offset;
81 use type System.Unsigned_Types.Unsigned;
82
83 --------------
84 -- Cluster0 --
85 --------------
86
87 type Cluster0 is record
88 E0 : Bits_86;
89 end record;
90
91 for Cluster0 use record
92 E0 at 0 range 0 * Bits .. 0 * Bits + Bits - 1;
93 end record;
94
95 for Cluster0'Size use Bits * (1 + 0);
96
97 for Cluster0'Alignment use Integer'Min (Standard'Maximum_Alignment,
98 1 +
99 1 * Boolean'Pos (Bits mod 2 = 0) +
100 2 * Boolean'Pos (Bits mod 4 = 0));
101 -- Use maximum possible alignment, given the bit field size, since this
102 -- will result in the most efficient code possible for the field.
103
104 package AAC0 is new Address_To_Access_Conversions (Cluster0);
105 -- We convert addresses to access values and dereference them instead of
106 -- directly using overlays in order to work around the implementation of
107 -- the RM 13.3(19) clause, which would pessimize the generated code.
108
109 type Rev_Cluster0 is new Cluster0
110 with Bit_Order => Reverse_Bit_Order,
111 Scalar_Storage_Order => Reverse_Bit_Order;
112
113 package Rev_AAC0 is new Address_To_Access_Conversions (Rev_Cluster0);
114
115 -- The following declarations are for the case where the address
116 -- passed to GetU_86 or SetU_86 is not guaranteed to be aligned.
117 -- These routines are used when the packed array is itself a
118 -- component of a packed record, and therefore may not be aligned.
119
120 type Cluster0U is new Cluster0;
121 for Cluster0U'Alignment use 1;
122
123 package AAC0U is new Address_To_Access_Conversions (Cluster0U);
124
125 type Rev_Cluster0U is new Cluster0U
126 with Bit_Order => Reverse_Bit_Order,
127 Scalar_Storage_Order => Reverse_Bit_Order;
128
129 package Rev_AAC0U is new Address_To_Access_Conversions (Rev_Cluster0U);
130
131 --------------
132 -- Cluster1 --
133 --------------
134
135 type Cluster1 is record
136 E0, E1 : Bits_86;
137 end record;
138
139 for Cluster1 use record
140 E0 at 0 range 0 * Bits .. 0 * Bits + Bits - 1;
141 E1 at 0 range 1 * Bits .. 1 * Bits + Bits - 1;
142 end record;
143
144 for Cluster1'Size use Bits * (1 + 1);
145
146 for Cluster1'Alignment use Integer'Min (Standard'Maximum_Alignment,
147 1 +
148 1 * Boolean'Pos (Bits mod 2 = 0) +
149 2 * Boolean'Pos (Bits mod 4 = 0));
150 -- Use maximum possible alignment, given the bit field size, since this
151 -- will result in the most efficient code possible for the field.
152
153 package AAC1 is new Address_To_Access_Conversions (Cluster1);
154 -- We convert addresses to access values and dereference them instead of
155 -- directly using overlays in order to work around the implementation of
156 -- the RM 13.3(19) clause, which would pessimize the generated code.
157
158 type Rev_Cluster1 is new Cluster1
159 with Bit_Order => Reverse_Bit_Order,
160 Scalar_Storage_Order => Reverse_Bit_Order;
161
162 package Rev_AAC1 is new Address_To_Access_Conversions (Rev_Cluster1);
163
164 -- The following declarations are for the case where the address
165 -- passed to GetU_86 or SetU_86 is not guaranteed to be aligned.
166 -- These routines are used when the packed array is itself a
167 -- component of a packed record, and therefore may not be aligned.
168
169 type Cluster1U is new Cluster1;
170 for Cluster1U'Alignment use 1;
171
172 package AAC1U is new Address_To_Access_Conversions (Cluster1U);
173
174 type Rev_Cluster1U is new Cluster1U
175 with Bit_Order => Reverse_Bit_Order,
176 Scalar_Storage_Order => Reverse_Bit_Order;
177
178 package Rev_AAC1U is new Address_To_Access_Conversions (Rev_Cluster1U);
179
180 --------------
181 -- Cluster2 --
182 --------------
183
184 type Cluster2 is record
185 E0, E1, E2 : Bits_86;
186 end record;
187
188 for Cluster2 use record
189 E0 at 0 range 0 * Bits .. 0 * Bits + Bits - 1;
190 E1 at 0 range 1 * Bits .. 1 * Bits + Bits - 1;
191 E2 at 0 range 2 * Bits .. 2 * Bits + Bits - 1;
192 end record;
193
194 for Cluster2'Size use Bits * (1 + 2);
195
196 for Cluster2'Alignment use Integer'Min (Standard'Maximum_Alignment,
197 1 +
198 1 * Boolean'Pos (Bits mod 2 = 0) +
199 2 * Boolean'Pos (Bits mod 4 = 0));
200 -- Use maximum possible alignment, given the bit field size, since this
201 -- will result in the most efficient code possible for the field.
202
203 package AAC2 is new Address_To_Access_Conversions (Cluster2);
204 -- We convert addresses to access values and dereference them instead of
205 -- directly using overlays in order to work around the implementation of
206 -- the RM 13.3(19) clause, which would pessimize the generated code.
207
208 type Rev_Cluster2 is new Cluster2
209 with Bit_Order => Reverse_Bit_Order,
210 Scalar_Storage_Order => Reverse_Bit_Order;
211
212 package Rev_AAC2 is new Address_To_Access_Conversions (Rev_Cluster2);
213
214 -- The following declarations are for the case where the address
215 -- passed to GetU_86 or SetU_86 is not guaranteed to be aligned.
216 -- These routines are used when the packed array is itself a
217 -- component of a packed record, and therefore may not be aligned.
218
219 type Cluster2U is new Cluster2;
220 for Cluster2U'Alignment use 1;
221
222 package AAC2U is new Address_To_Access_Conversions (Cluster2U);
223
224 type Rev_Cluster2U is new Cluster2U
225 with Bit_Order => Reverse_Bit_Order,
226 Scalar_Storage_Order => Reverse_Bit_Order;
227
228 package Rev_AAC2U is new Address_To_Access_Conversions (Rev_Cluster2U);
229
230 --------------
231 -- Cluster3 --
232 --------------
233
234 type Cluster3 is record
235 E0, E1, E2, E3 : Bits_86;
236 end record;
237
238 for Cluster3 use record
239 E0 at 0 range 0 * Bits .. 0 * Bits + Bits - 1;
240 E1 at 0 range 1 * Bits .. 1 * Bits + Bits - 1;
241 E2 at 0 range 2 * Bits .. 2 * Bits + Bits - 1;
242 E3 at 0 range 3 * Bits .. 3 * Bits + Bits - 1;
243 end record;
244
245 for Cluster3'Size use Bits * (1 + 3);
246
247 for Cluster3'Alignment use Integer'Min (Standard'Maximum_Alignment,
248 1 +
249 1 * Boolean'Pos (Bits mod 2 = 0) +
250 2 * Boolean'Pos (Bits mod 4 = 0));
251 -- Use maximum possible alignment, given the bit field size, since this
252 -- will result in the most efficient code possible for the field.
253
254 package AAC3 is new Address_To_Access_Conversions (Cluster3);
255 -- We convert addresses to access values and dereference them instead of
256 -- directly using overlays in order to work around the implementation of
257 -- the RM 13.3(19) clause, which would pessimize the generated code.
258
259 type Rev_Cluster3 is new Cluster3
260 with Bit_Order => Reverse_Bit_Order,
261 Scalar_Storage_Order => Reverse_Bit_Order;
262
263 package Rev_AAC3 is new Address_To_Access_Conversions (Rev_Cluster3);
264
265 -- The following declarations are for the case where the address
266 -- passed to GetU_86 or SetU_86 is not guaranteed to be aligned.
267 -- These routines are used when the packed array is itself a
268 -- component of a packed record, and therefore may not be aligned.
269
270 type Cluster3U is new Cluster3;
271 for Cluster3U'Alignment use 1;
272
273 package AAC3U is new Address_To_Access_Conversions (Cluster3U);
274
275 type Rev_Cluster3U is new Cluster3U
276 with Bit_Order => Reverse_Bit_Order,
277 Scalar_Storage_Order => Reverse_Bit_Order;
278
279 package Rev_AAC3U is new Address_To_Access_Conversions (Rev_Cluster3U);
280
281 --------------
282 -- Cluster4 --
283 --------------
284
285 type Cluster4 is record
286 E0, E1, E2, E3, E4 : Bits_86;
287 end record;
288
289 for Cluster4 use record
290 E0 at 0 range 0 * Bits .. 0 * Bits + Bits - 1;
291 E1 at 0 range 1 * Bits .. 1 * Bits + Bits - 1;
292 E2 at 0 range 2 * Bits .. 2 * Bits + Bits - 1;
293 E3 at 0 range 3 * Bits .. 3 * Bits + Bits - 1;
294 E4 at 0 range 4 * Bits .. 4 * Bits + Bits - 1;
295 end record;
296
297 for Cluster4'Size use Bits * (1 + 4);
298
299 for Cluster4'Alignment use Integer'Min (Standard'Maximum_Alignment,
300 1 +
301 1 * Boolean'Pos (Bits mod 2 = 0) +
302 2 * Boolean'Pos (Bits mod 4 = 0));
303 -- Use maximum possible alignment, given the bit field size, since this
304 -- will result in the most efficient code possible for the field.
305
306 package AAC4 is new Address_To_Access_Conversions (Cluster4);
307 -- We convert addresses to access values and dereference them instead of
308 -- directly using overlays in order to work around the implementation of
309 -- the RM 13.3(19) clause, which would pessimize the generated code.
310
311 type Rev_Cluster4 is new Cluster4
312 with Bit_Order => Reverse_Bit_Order,
313 Scalar_Storage_Order => Reverse_Bit_Order;
314
315 package Rev_AAC4 is new Address_To_Access_Conversions (Rev_Cluster4);
316
317 -- The following declarations are for the case where the address
318 -- passed to GetU_86 or SetU_86 is not guaranteed to be aligned.
319 -- These routines are used when the packed array is itself a
320 -- component of a packed record, and therefore may not be aligned.
321
322 type Cluster4U is new Cluster4;
323 for Cluster4U'Alignment use 1;
324
325 package AAC4U is new Address_To_Access_Conversions (Cluster4U);
326
327 type Rev_Cluster4U is new Cluster4U
328 with Bit_Order => Reverse_Bit_Order,
329 Scalar_Storage_Order => Reverse_Bit_Order;
330
331 package Rev_AAC4U is new Address_To_Access_Conversions (Rev_Cluster4U);
332
333 --------------
334 -- Cluster5 --
335 --------------
336
337 type Cluster5 is record
338 E0, E1, E2, E3, E4, E5 : Bits_86;
339 end record;
340
341 for Cluster5 use record
342 E0 at 0 range 0 * Bits .. 0 * Bits + Bits - 1;
343 E1 at 0 range 1 * Bits .. 1 * Bits + Bits - 1;
344 E2 at 0 range 2 * Bits .. 2 * Bits + Bits - 1;
345 E3 at 0 range 3 * Bits .. 3 * Bits + Bits - 1;
346 E4 at 0 range 4 * Bits .. 4 * Bits + Bits - 1;
347 E5 at 0 range 5 * Bits .. 5 * Bits + Bits - 1;
348 end record;
349
350 for Cluster5'Size use Bits * (1 + 5);
351
352 for Cluster5'Alignment use Integer'Min (Standard'Maximum_Alignment,
353 1 +
354 1 * Boolean'Pos (Bits mod 2 = 0) +
355 2 * Boolean'Pos (Bits mod 4 = 0));
356 -- Use maximum possible alignment, given the bit field size, since this
357 -- will result in the most efficient code possible for the field.
358
359 package AAC5 is new Address_To_Access_Conversions (Cluster5);
360 -- We convert addresses to access values and dereference them instead of
361 -- directly using overlays in order to work around the implementation of
362 -- the RM 13.3(19) clause, which would pessimize the generated code.
363
364 type Rev_Cluster5 is new Cluster5
365 with Bit_Order => Reverse_Bit_Order,
366 Scalar_Storage_Order => Reverse_Bit_Order;
367
368 package Rev_AAC5 is new Address_To_Access_Conversions (Rev_Cluster5);
369
370 -- The following declarations are for the case where the address
371 -- passed to GetU_86 or SetU_86 is not guaranteed to be aligned.
372 -- These routines are used when the packed array is itself a
373 -- component of a packed record, and therefore may not be aligned.
374
375 type Cluster5U is new Cluster5;
376 for Cluster5U'Alignment use 1;
377
378 package AAC5U is new Address_To_Access_Conversions (Cluster5U);
379
380 type Rev_Cluster5U is new Cluster5U
381 with Bit_Order => Reverse_Bit_Order,
382 Scalar_Storage_Order => Reverse_Bit_Order;
383
384 package Rev_AAC5U is new Address_To_Access_Conversions (Rev_Cluster5U);
385
386 --------------
387 -- Cluster6 --
388 --------------
389
390 type Cluster6 is record
391 E0, E1, E2, E3, E4, E5, E6 : Bits_86;
392 end record;
393
394 for Cluster6 use record
395 E0 at 0 range 0 * Bits .. 0 * Bits + Bits - 1;
396 E1 at 0 range 1 * Bits .. 1 * Bits + Bits - 1;
397 E2 at 0 range 2 * Bits .. 2 * Bits + Bits - 1;
398 E3 at 0 range 3 * Bits .. 3 * Bits + Bits - 1;
399 E4 at 0 range 4 * Bits .. 4 * Bits + Bits - 1;
400 E5 at 0 range 5 * Bits .. 5 * Bits + Bits - 1;
401 E6 at 0 range 6 * Bits .. 6 * Bits + Bits - 1;
402 end record;
403
404 for Cluster6'Size use Bits * (1 + 6);
405
406 for Cluster6'Alignment use Integer'Min (Standard'Maximum_Alignment,
407 1 +
408 1 * Boolean'Pos (Bits mod 2 = 0) +
409 2 * Boolean'Pos (Bits mod 4 = 0));
410 -- Use maximum possible alignment, given the bit field size, since this
411 -- will result in the most efficient code possible for the field.
412
413 package AAC6 is new Address_To_Access_Conversions (Cluster6);
414 -- We convert addresses to access values and dereference them instead of
415 -- directly using overlays in order to work around the implementation of
416 -- the RM 13.3(19) clause, which would pessimize the generated code.
417
418 type Rev_Cluster6 is new Cluster6
419 with Bit_Order => Reverse_Bit_Order,
420 Scalar_Storage_Order => Reverse_Bit_Order;
421
422 package Rev_AAC6 is new Address_To_Access_Conversions (Rev_Cluster6);
423
424 -- The following declarations are for the case where the address
425 -- passed to GetU_86 or SetU_86 is not guaranteed to be aligned.
426 -- These routines are used when the packed array is itself a
427 -- component of a packed record, and therefore may not be aligned.
428
429 type Cluster6U is new Cluster6;
430 for Cluster6U'Alignment use 1;
431
432 package AAC6U is new Address_To_Access_Conversions (Cluster6U);
433
434 type Rev_Cluster6U is new Cluster6U
435 with Bit_Order => Reverse_Bit_Order,
436 Scalar_Storage_Order => Reverse_Bit_Order;
437
438 package Rev_AAC6U is new Address_To_Access_Conversions (Rev_Cluster6U);
439
440 --------------
441 -- Cluster7 --
442 --------------
443
444 type Cluster7 is record
445 E0, E1, E2, E3, E4, E5, E6, E7 : Bits_86;
446 end record;
447
448 for Cluster7 use record
449 E0 at 0 range 0 * Bits .. 0 * Bits + Bits - 1;
450 E1 at 0 range 1 * Bits .. 1 * Bits + Bits - 1;
451 E2 at 0 range 2 * Bits .. 2 * Bits + Bits - 1;
452 E3 at 0 range 3 * Bits .. 3 * Bits + Bits - 1;
453 E4 at 0 range 4 * Bits .. 4 * Bits + Bits - 1;
454 E5 at 0 range 5 * Bits .. 5 * Bits + Bits - 1;
455 E6 at 0 range 6 * Bits .. 6 * Bits + Bits - 1;
456 E7 at 0 range 7 * Bits .. 7 * Bits + Bits - 1;
457 end record;
458
459 for Cluster7'Size use Bits * (1 + 7);
460
461 for Cluster7'Alignment use Integer'Min (Standard'Maximum_Alignment,
462 1 +
463 1 * Boolean'Pos (Bits mod 2 = 0) +
464 2 * Boolean'Pos (Bits mod 4 = 0));
465 -- Use maximum possible alignment, given the bit field size, since this
466 -- will result in the most efficient code possible for the field.
467
468 package AAC7 is new Address_To_Access_Conversions (Cluster7);
469 -- We convert addresses to access values and dereference them instead of
470 -- directly using overlays in order to work around the implementation of
471 -- the RM 13.3(19) clause, which would pessimize the generated code.
472
473 type Rev_Cluster7 is new Cluster7
474 with Bit_Order => Reverse_Bit_Order,
475 Scalar_Storage_Order => Reverse_Bit_Order;
476
477 package Rev_AAC7 is new Address_To_Access_Conversions (Rev_Cluster7);
478
479 -- The following declarations are for the case where the address
480 -- passed to GetU_86 or SetU_86 is not guaranteed to be aligned.
481 -- These routines are used when the packed array is itself a
482 -- component of a packed record, and therefore may not be aligned.
483
484 type Cluster7U is new Cluster7;
485 for Cluster7U'Alignment use 1;
486
487 package AAC7U is new Address_To_Access_Conversions (Cluster7U);
488
489 type Rev_Cluster7U is new Cluster7U
490 with Bit_Order => Reverse_Bit_Order,
491 Scalar_Storage_Order => Reverse_Bit_Order;
492
493 package Rev_AAC7U is new Address_To_Access_Conversions (Rev_Cluster7U);
494
495 ------------
496 -- Get_86 --
497 ------------
498
499 function Get_86
500 (Arr : System.Address;
501 N : Natural;
502 Rev_SSO : Boolean) return Bits_86
503 is
504 A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8);
505 C0 : constant AAC0.Object_Pointer := AAC0.To_Pointer (A);
506 C1 : constant AAC1.Object_Pointer := AAC1.To_Pointer (A);
507 C2 : constant AAC2.Object_Pointer := AAC2.To_Pointer (A);
508 C3 : constant AAC3.Object_Pointer := AAC3.To_Pointer (A);
509 C4 : constant AAC4.Object_Pointer := AAC4.To_Pointer (A);
510 C5 : constant AAC5.Object_Pointer := AAC5.To_Pointer (A);
511 C6 : constant AAC6.Object_Pointer := AAC6.To_Pointer (A);
512 C7 : constant AAC7.Object_Pointer := AAC7.To_Pointer (A);
513 RC0 : constant Rev_AAC0.Object_Pointer := Rev_AAC0.To_Pointer (A);
514 RC1 : constant Rev_AAC1.Object_Pointer := Rev_AAC1.To_Pointer (A);
515 RC2 : constant Rev_AAC2.Object_Pointer := Rev_AAC2.To_Pointer (A);
516 RC3 : constant Rev_AAC3.Object_Pointer := Rev_AAC3.To_Pointer (A);
517 RC4 : constant Rev_AAC4.Object_Pointer := Rev_AAC4.To_Pointer (A);
518 RC5 : constant Rev_AAC5.Object_Pointer := Rev_AAC5.To_Pointer (A);
519 RC6 : constant Rev_AAC6.Object_Pointer := Rev_AAC6.To_Pointer (A);
520 RC7 : constant Rev_AAC7.Object_Pointer := Rev_AAC7.To_Pointer (A);
521
522 begin
523 return
524 (if Rev_SSO then
525 (case N07 (Uns (N) mod 8) is
526 when 0 => RC0.E0,
527 when 1 => RC1.E1,
528 when 2 => RC2.E2,
529 when 3 => RC3.E3,
530 when 4 => RC4.E4,
531 when 5 => RC5.E5,
532 when 6 => RC6.E6,
533 when 7 => RC7.E7)
534
535 else
536 (case N07 (Uns (N) mod 8) is
537 when 0 => C0.E0,
538 when 1 => C1.E1,
539 when 2 => C2.E2,
540 when 3 => C3.E3,
541 when 4 => C4.E4,
542 when 5 => C5.E5,
543 when 6 => C6.E6,
544 when 7 => C7.E7)
545 );
546 end Get_86;
547
548 -------------
549 -- GetU_86 --
550 -------------
551
552 function GetU_86
553 (Arr : System.Address;
554 N : Natural;
555 Rev_SSO : Boolean) return Bits_86
556 is
557 A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8);
558 C0 : constant AAC0U.Object_Pointer := AAC0U.To_Pointer (A);
559 C1 : constant AAC1U.Object_Pointer := AAC1U.To_Pointer (A);
560 C2 : constant AAC2U.Object_Pointer := AAC2U.To_Pointer (A);
561 C3 : constant AAC3U.Object_Pointer := AAC3U.To_Pointer (A);
562 C4 : constant AAC4U.Object_Pointer := AAC4U.To_Pointer (A);
563 C5 : constant AAC5U.Object_Pointer := AAC5U.To_Pointer (A);
564 C6 : constant AAC6U.Object_Pointer := AAC6U.To_Pointer (A);
565 C7 : constant AAC7U.Object_Pointer := AAC7U.To_Pointer (A);
566 RC0 : constant Rev_AAC0U.Object_Pointer := Rev_AAC0U.To_Pointer (A);
567 RC1 : constant Rev_AAC1U.Object_Pointer := Rev_AAC1U.To_Pointer (A);
568 RC2 : constant Rev_AAC2U.Object_Pointer := Rev_AAC2U.To_Pointer (A);
569 RC3 : constant Rev_AAC3U.Object_Pointer := Rev_AAC3U.To_Pointer (A);
570 RC4 : constant Rev_AAC4U.Object_Pointer := Rev_AAC4U.To_Pointer (A);
571 RC5 : constant Rev_AAC5U.Object_Pointer := Rev_AAC5U.To_Pointer (A);
572 RC6 : constant Rev_AAC6U.Object_Pointer := Rev_AAC6U.To_Pointer (A);
573 RC7 : constant Rev_AAC7U.Object_Pointer := Rev_AAC7U.To_Pointer (A);
574
575 begin
576 return
577 (if Rev_SSO then
578 (case N07 (Uns (N) mod 8) is
579 when 0 => RC0.E0,
580 when 1 => RC1.E1,
581 when 2 => RC2.E2,
582 when 3 => RC3.E3,
583 when 4 => RC4.E4,
584 when 5 => RC5.E5,
585 when 6 => RC6.E6,
586 when 7 => RC7.E7)
587
588 else
589 (case N07 (Uns (N) mod 8) is
590 when 0 => C0.E0,
591 when 1 => C1.E1,
592 when 2 => C2.E2,
593 when 3 => C3.E3,
594 when 4 => C4.E4,
595 when 5 => C5.E5,
596 when 6 => C6.E6,
597 when 7 => C7.E7)
598 );
599 end GetU_86;
600
601 ------------
602 -- Set_86 --
603 ------------
604
605 procedure Set_86
606 (Arr : System.Address;
607 N : Natural;
608 E : Bits_86;
609 Rev_SSO : Boolean)
610 is
611 A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8);
612 C0 : constant AAC0.Object_Pointer := AAC0.To_Pointer (A);
613 C1 : constant AAC1.Object_Pointer := AAC1.To_Pointer (A);
614 C2 : constant AAC2.Object_Pointer := AAC2.To_Pointer (A);
615 C3 : constant AAC3.Object_Pointer := AAC3.To_Pointer (A);
616 C4 : constant AAC4.Object_Pointer := AAC4.To_Pointer (A);
617 C5 : constant AAC5.Object_Pointer := AAC5.To_Pointer (A);
618 C6 : constant AAC6.Object_Pointer := AAC6.To_Pointer (A);
619 C7 : constant AAC7.Object_Pointer := AAC7.To_Pointer (A);
620 RC0 : constant Rev_AAC0.Object_Pointer := Rev_AAC0.To_Pointer (A);
621 RC1 : constant Rev_AAC1.Object_Pointer := Rev_AAC1.To_Pointer (A);
622 RC2 : constant Rev_AAC2.Object_Pointer := Rev_AAC2.To_Pointer (A);
623 RC3 : constant Rev_AAC3.Object_Pointer := Rev_AAC3.To_Pointer (A);
624 RC4 : constant Rev_AAC4.Object_Pointer := Rev_AAC4.To_Pointer (A);
625 RC5 : constant Rev_AAC5.Object_Pointer := Rev_AAC5.To_Pointer (A);
626 RC6 : constant Rev_AAC6.Object_Pointer := Rev_AAC6.To_Pointer (A);
627 RC7 : constant Rev_AAC7.Object_Pointer := Rev_AAC7.To_Pointer (A);
628
629 begin
630 if Rev_SSO then
631 case N07 (Uns (N) mod 8) is
632 when 0 => RC0.E0 := E;
633 when 1 => RC1.E1 := E;
634 when 2 => RC2.E2 := E;
635 when 3 => RC3.E3 := E;
636 when 4 => RC4.E4 := E;
637 when 5 => RC5.E5 := E;
638 when 6 => RC6.E6 := E;
639 when 7 => RC7.E7 := E;
640 end case;
641 else
642 case N07 (Uns (N) mod 8) is
643 when 0 => C0.E0 := E;
644 when 1 => C1.E1 := E;
645 when 2 => C2.E2 := E;
646 when 3 => C3.E3 := E;
647 when 4 => C4.E4 := E;
648 when 5 => C5.E5 := E;
649 when 6 => C6.E6 := E;
650 when 7 => C7.E7 := E;
651 end case;
652 end if;
653 end Set_86;
654
655 -------------
656 -- SetU_86 --
657 -------------
658
659 procedure SetU_86
660 (Arr : System.Address;
661 N : Natural;
662 E : Bits_86;
663 Rev_SSO : Boolean)
664 is
665 A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8);
666 C0 : constant AAC0U.Object_Pointer := AAC0U.To_Pointer (A);
667 C1 : constant AAC1U.Object_Pointer := AAC1U.To_Pointer (A);
668 C2 : constant AAC2U.Object_Pointer := AAC2U.To_Pointer (A);
669 C3 : constant AAC3U.Object_Pointer := AAC3U.To_Pointer (A);
670 C4 : constant AAC4U.Object_Pointer := AAC4U.To_Pointer (A);
671 C5 : constant AAC5U.Object_Pointer := AAC5U.To_Pointer (A);
672 C6 : constant AAC6U.Object_Pointer := AAC6U.To_Pointer (A);
673 C7 : constant AAC7U.Object_Pointer := AAC7U.To_Pointer (A);
674 RC0 : constant Rev_AAC0U.Object_Pointer := Rev_AAC0U.To_Pointer (A);
675 RC1 : constant Rev_AAC1U.Object_Pointer := Rev_AAC1U.To_Pointer (A);
676 RC2 : constant Rev_AAC2U.Object_Pointer := Rev_AAC2U.To_Pointer (A);
677 RC3 : constant Rev_AAC3U.Object_Pointer := Rev_AAC3U.To_Pointer (A);
678 RC4 : constant Rev_AAC4U.Object_Pointer := Rev_AAC4U.To_Pointer (A);
679 RC5 : constant Rev_AAC5U.Object_Pointer := Rev_AAC5U.To_Pointer (A);
680 RC6 : constant Rev_AAC6U.Object_Pointer := Rev_AAC6U.To_Pointer (A);
681 RC7 : constant Rev_AAC7U.Object_Pointer := Rev_AAC7U.To_Pointer (A);
682
683 begin
684 if Rev_SSO then
685 case N07 (Uns (N) mod 8) is
686 when 0 => RC0.E0 := E;
687 when 1 => RC1.E1 := E;
688 when 2 => RC2.E2 := E;
689 when 3 => RC3.E3 := E;
690 when 4 => RC4.E4 := E;
691 when 5 => RC5.E5 := E;
692 when 6 => RC6.E6 := E;
693 when 7 => RC7.E7 := E;
694 end case;
695 else
696 case N07 (Uns (N) mod 8) is
697 when 0 => C0.E0 := E;
698 when 1 => C1.E1 := E;
699 when 2 => C2.E2 := E;
700 when 3 => C3.E3 := E;
701 when 4 => C4.E4 := E;
702 when 5 => C5.E5 := E;
703 when 6 => C6.E6 := E;
704 when 7 => C7.E7 := E;
705 end case;
706 end if;
707 end SetU_86;
708
709 end System.Pack_86;