Merged trunk at revision 161680 into branch.
[official-gcc.git] / gcc / ada / s-auxdec-vms_64.ads
blob1480a441887b74a337953583438f1993b2df8037
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- S Y S T E M . A U X _ D E C --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 1996-2009, 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 ------------------------------------------------------------------------------
32 -- This package contains definitions that are designed to be compatible
33 -- with the extra definitions in package System for DEC Ada implementations.
35 -- These definitions can be used directly by withing this package, or merged
36 -- with System using pragma Extend_System (Aux_DEC)
38 -- This is the VMS 64 bit version
40 with Ada.Unchecked_Conversion;
42 package System.Aux_DEC is
43 pragma Preelaborate;
45 type Short_Integer_Address is
46 range -2 ** (32 - 1) .. +2 ** (32 - 1) - 1;
47 -- Integer literals cannot appear naked in an address context, as a
48 -- result the bounds of Short_Address cannot be given simply as 2^32 etc.
50 subtype Short_Address is Address
51 range Address (Short_Integer_Address'First) ..
52 Address (Short_Integer_Address'Last);
53 for Short_Address'Object_Size use 32;
54 -- This subtype allows addresses to be converted from 64 bits to 32 bits
55 -- with an appropriate range check. Note that since this is a subtype of
56 -- type System.Address, the same limitations apply to this subtype. Namely
57 -- there are no visible arithmetic operations, and integer literals are
58 -- not available.
60 Short_Memory_Size : constant := 2 ** 32;
61 -- Defined for convenience of porting
63 type Integer_8 is range -2 ** (8 - 1) .. +2 ** (8 - 1) - 1;
64 for Integer_8'Size use 8;
66 type Integer_16 is range -2 ** (16 - 1) .. +2 ** (16 - 1) - 1;
67 for Integer_16'Size use 16;
69 type Integer_32 is range -2 ** (32 - 1) .. +2 ** (32 - 1) - 1;
70 for Integer_32'Size use 32;
72 type Integer_64 is range -2 ** (64 - 1) .. +2 ** (64 - 1) - 1;
73 for Integer_64'Size use 64;
75 type Integer_8_Array is array (Integer range <>) of Integer_8;
76 type Integer_16_Array is array (Integer range <>) of Integer_16;
77 type Integer_32_Array is array (Integer range <>) of Integer_32;
78 type Integer_64_Array is array (Integer range <>) of Integer_64;
79 -- These array types are not in all versions of DEC System, and in fact it
80 -- is not quite clear why they are in some and not others, but since they
81 -- definitely appear in some versions, we include them unconditionally.
83 type Largest_Integer is range Min_Int .. Max_Int;
85 type AST_Handler is private;
87 No_AST_Handler : constant AST_Handler;
89 type Type_Class is
90 (Type_Class_Enumeration,
91 Type_Class_Integer,
92 Type_Class_Fixed_Point,
93 Type_Class_Floating_Point,
94 Type_Class_Array,
95 Type_Class_Record,
96 Type_Class_Access,
97 Type_Class_Task, -- also in Ada 95 protected
98 Type_Class_Address);
100 function "not" (Left : Largest_Integer) return Largest_Integer;
101 function "and" (Left, Right : Largest_Integer) return Largest_Integer;
102 function "or" (Left, Right : Largest_Integer) return Largest_Integer;
103 function "xor" (Left, Right : Largest_Integer) return Largest_Integer;
105 Address_Zero : constant Address;
106 No_Addr : constant Address;
107 Address_Size : constant := Standard'Address_Size;
108 Short_Address_Size : constant := 32;
110 function "+" (Left : Address; Right : Integer) return Address;
111 function "+" (Left : Integer; Right : Address) return Address;
112 function "-" (Left : Address; Right : Address) return Integer;
113 function "-" (Left : Address; Right : Integer) return Address;
115 pragma Import (Intrinsic, "+");
116 pragma Import (Intrinsic, "-");
118 generic
119 type Target is private;
120 function Fetch_From_Address (A : Address) return Target;
122 generic
123 type Target is private;
124 procedure Assign_To_Address (A : Address; T : Target);
126 -- Floating point type declarations for VAX floating point data types
128 pragma Warnings (Off);
129 -- ??? needs comment
131 type F_Float is digits 6;
132 pragma Float_Representation (VAX_Float, F_Float);
134 type D_Float is digits 9;
135 pragma Float_Representation (Vax_Float, D_Float);
137 type G_Float is digits 15;
138 pragma Float_Representation (Vax_Float, G_Float);
140 -- Floating point type declarations for IEEE floating point data types
142 type IEEE_Single_Float is digits 6;
143 pragma Float_Representation (IEEE_Float, IEEE_Single_Float);
145 type IEEE_Double_Float is digits 15;
146 pragma Float_Representation (IEEE_Float, IEEE_Double_Float);
148 pragma Warnings (On);
150 Non_Ada_Error : exception;
152 -- Hardware-oriented types and functions
154 type Bit_Array is array (Integer range <>) of Boolean;
155 pragma Pack (Bit_Array);
157 subtype Bit_Array_8 is Bit_Array (0 .. 7);
158 subtype Bit_Array_16 is Bit_Array (0 .. 15);
159 subtype Bit_Array_32 is Bit_Array (0 .. 31);
160 subtype Bit_Array_64 is Bit_Array (0 .. 63);
162 type Unsigned_Byte is range 0 .. 255;
163 for Unsigned_Byte'Size use 8;
165 function "not" (Left : Unsigned_Byte) return Unsigned_Byte;
166 function "and" (Left, Right : Unsigned_Byte) return Unsigned_Byte;
167 function "or" (Left, Right : Unsigned_Byte) return Unsigned_Byte;
168 function "xor" (Left, Right : Unsigned_Byte) return Unsigned_Byte;
170 function To_Unsigned_Byte (X : Bit_Array_8) return Unsigned_Byte;
171 function To_Bit_Array_8 (X : Unsigned_Byte) return Bit_Array_8;
173 type Unsigned_Byte_Array is array (Integer range <>) of Unsigned_Byte;
175 type Unsigned_Word is range 0 .. 65535;
176 for Unsigned_Word'Size use 16;
178 function "not" (Left : Unsigned_Word) return Unsigned_Word;
179 function "and" (Left, Right : Unsigned_Word) return Unsigned_Word;
180 function "or" (Left, Right : Unsigned_Word) return Unsigned_Word;
181 function "xor" (Left, Right : Unsigned_Word) return Unsigned_Word;
183 function To_Unsigned_Word (X : Bit_Array_16) return Unsigned_Word;
184 function To_Bit_Array_16 (X : Unsigned_Word) return Bit_Array_16;
186 type Unsigned_Word_Array is array (Integer range <>) of Unsigned_Word;
188 type Unsigned_Longword is range -2_147_483_648 .. 2_147_483_647;
189 for Unsigned_Longword'Size use 32;
191 function "not" (Left : Unsigned_Longword) return Unsigned_Longword;
192 function "and" (Left, Right : Unsigned_Longword) return Unsigned_Longword;
193 function "or" (Left, Right : Unsigned_Longword) return Unsigned_Longword;
194 function "xor" (Left, Right : Unsigned_Longword) return Unsigned_Longword;
196 function To_Unsigned_Longword (X : Bit_Array_32) return Unsigned_Longword;
197 function To_Bit_Array_32 (X : Unsigned_Longword) return Bit_Array_32;
199 type Unsigned_Longword_Array is
200 array (Integer range <>) of Unsigned_Longword;
202 type Unsigned_32 is range 0 .. 4_294_967_295;
203 for Unsigned_32'Size use 32;
205 function "not" (Left : Unsigned_32) return Unsigned_32;
206 function "and" (Left, Right : Unsigned_32) return Unsigned_32;
207 function "or" (Left, Right : Unsigned_32) return Unsigned_32;
208 function "xor" (Left, Right : Unsigned_32) return Unsigned_32;
210 function To_Unsigned_32 (X : Bit_Array_32) return Unsigned_32;
211 function To_Bit_Array_32 (X : Unsigned_32) return Bit_Array_32;
213 type Unsigned_Quadword is record
214 L0 : Unsigned_Longword;
215 L1 : Unsigned_Longword;
216 end record;
218 for Unsigned_Quadword'Size use 64;
219 for Unsigned_Quadword'Alignment use
220 Integer'Min (8, Standard'Maximum_Alignment);
222 function "not" (Left : Unsigned_Quadword) return Unsigned_Quadword;
223 function "and" (Left, Right : Unsigned_Quadword) return Unsigned_Quadword;
224 function "or" (Left, Right : Unsigned_Quadword) return Unsigned_Quadword;
225 function "xor" (Left, Right : Unsigned_Quadword) return Unsigned_Quadword;
227 function To_Unsigned_Quadword (X : Bit_Array_64) return Unsigned_Quadword;
228 function To_Bit_Array_64 (X : Unsigned_Quadword) return Bit_Array_64;
230 type Unsigned_Quadword_Array is
231 array (Integer range <>) of Unsigned_Quadword;
233 function To_Address (X : Integer) return Short_Address;
234 pragma Pure_Function (To_Address);
236 function To_Address_Long (X : Unsigned_Longword) return Short_Address;
237 pragma Pure_Function (To_Address_Long);
239 function To_Integer (X : Short_Address) return Integer;
241 function To_Unsigned_Longword (X : Short_Address) return Unsigned_Longword;
242 function To_Unsigned_Longword (X : AST_Handler) return Unsigned_Longword;
244 -- Conventional names for static subtypes of type UNSIGNED_LONGWORD
246 subtype Unsigned_1 is Unsigned_Longword range 0 .. 2** 1-1;
247 subtype Unsigned_2 is Unsigned_Longword range 0 .. 2** 2-1;
248 subtype Unsigned_3 is Unsigned_Longword range 0 .. 2** 3-1;
249 subtype Unsigned_4 is Unsigned_Longword range 0 .. 2** 4-1;
250 subtype Unsigned_5 is Unsigned_Longword range 0 .. 2** 5-1;
251 subtype Unsigned_6 is Unsigned_Longword range 0 .. 2** 6-1;
252 subtype Unsigned_7 is Unsigned_Longword range 0 .. 2** 7-1;
253 subtype Unsigned_8 is Unsigned_Longword range 0 .. 2** 8-1;
254 subtype Unsigned_9 is Unsigned_Longword range 0 .. 2** 9-1;
255 subtype Unsigned_10 is Unsigned_Longword range 0 .. 2**10-1;
256 subtype Unsigned_11 is Unsigned_Longword range 0 .. 2**11-1;
257 subtype Unsigned_12 is Unsigned_Longword range 0 .. 2**12-1;
258 subtype Unsigned_13 is Unsigned_Longword range 0 .. 2**13-1;
259 subtype Unsigned_14 is Unsigned_Longword range 0 .. 2**14-1;
260 subtype Unsigned_15 is Unsigned_Longword range 0 .. 2**15-1;
261 subtype Unsigned_16 is Unsigned_Longword range 0 .. 2**16-1;
262 subtype Unsigned_17 is Unsigned_Longword range 0 .. 2**17-1;
263 subtype Unsigned_18 is Unsigned_Longword range 0 .. 2**18-1;
264 subtype Unsigned_19 is Unsigned_Longword range 0 .. 2**19-1;
265 subtype Unsigned_20 is Unsigned_Longword range 0 .. 2**20-1;
266 subtype Unsigned_21 is Unsigned_Longword range 0 .. 2**21-1;
267 subtype Unsigned_22 is Unsigned_Longword range 0 .. 2**22-1;
268 subtype Unsigned_23 is Unsigned_Longword range 0 .. 2**23-1;
269 subtype Unsigned_24 is Unsigned_Longword range 0 .. 2**24-1;
270 subtype Unsigned_25 is Unsigned_Longword range 0 .. 2**25-1;
271 subtype Unsigned_26 is Unsigned_Longword range 0 .. 2**26-1;
272 subtype Unsigned_27 is Unsigned_Longword range 0 .. 2**27-1;
273 subtype Unsigned_28 is Unsigned_Longword range 0 .. 2**28-1;
274 subtype Unsigned_29 is Unsigned_Longword range 0 .. 2**29-1;
275 subtype Unsigned_30 is Unsigned_Longword range 0 .. 2**30-1;
276 subtype Unsigned_31 is Unsigned_Longword range 0 .. 2**31-1;
278 -- Function for obtaining global symbol values
280 function Import_Value (Symbol : String) return Unsigned_Longword;
281 function Import_Address (Symbol : String) return Address;
282 function Import_Largest_Value (Symbol : String) return Largest_Integer;
284 pragma Import (Intrinsic, Import_Value);
285 pragma Import (Intrinsic, Import_Address);
286 pragma Import (Intrinsic, Import_Largest_Value);
288 -- For the following declarations, note that the declaration without
289 -- a Retry_Count parameter means to retry infinitely. A value of zero
290 -- for the Retry_Count parameter means do not retry.
292 -- Interlocked-instruction procedures
294 procedure Clear_Interlocked
295 (Bit : in out Boolean;
296 Old_Value : out Boolean);
298 procedure Set_Interlocked
299 (Bit : in out Boolean;
300 Old_Value : out Boolean);
302 type Aligned_Word is record
303 Value : Short_Integer;
304 end record;
306 for Aligned_Word'Alignment use
307 Integer'Min (2, Standard'Maximum_Alignment);
309 procedure Clear_Interlocked
310 (Bit : in out Boolean;
311 Old_Value : out Boolean;
312 Retry_Count : Natural;
313 Success_Flag : out Boolean);
315 procedure Set_Interlocked
316 (Bit : in out Boolean;
317 Old_Value : out Boolean;
318 Retry_Count : Natural;
319 Success_Flag : out Boolean);
321 procedure Add_Interlocked
322 (Addend : Short_Integer;
323 Augend : in out Aligned_Word;
324 Sign : out Integer);
326 type Aligned_Integer is record
327 Value : Integer;
328 end record;
330 for Aligned_Integer'Alignment use
331 Integer'Min (4, Standard'Maximum_Alignment);
333 type Aligned_Long_Integer is record
334 Value : Long_Integer;
335 end record;
337 for Aligned_Long_Integer'Alignment use
338 Integer'Min (8, Standard'Maximum_Alignment);
340 -- For the following declarations, note that the declaration without
341 -- a Retry_Count parameter mean to retry infinitely. A value of zero
342 -- for the Retry_Count means do not retry.
344 procedure Add_Atomic
345 (To : in out Aligned_Integer;
346 Amount : Integer);
348 procedure Add_Atomic
349 (To : in out Aligned_Integer;
350 Amount : Integer;
351 Retry_Count : Natural;
352 Old_Value : out Integer;
353 Success_Flag : out Boolean);
355 procedure Add_Atomic
356 (To : in out Aligned_Long_Integer;
357 Amount : Long_Integer);
359 procedure Add_Atomic
360 (To : in out Aligned_Long_Integer;
361 Amount : Long_Integer;
362 Retry_Count : Natural;
363 Old_Value : out Long_Integer;
364 Success_Flag : out Boolean);
366 procedure And_Atomic
367 (To : in out Aligned_Integer;
368 From : Integer);
370 procedure And_Atomic
371 (To : in out Aligned_Integer;
372 From : Integer;
373 Retry_Count : Natural;
374 Old_Value : out Integer;
375 Success_Flag : out Boolean);
377 procedure And_Atomic
378 (To : in out Aligned_Long_Integer;
379 From : Long_Integer);
381 procedure And_Atomic
382 (To : in out Aligned_Long_Integer;
383 From : Long_Integer;
384 Retry_Count : Natural;
385 Old_Value : out Long_Integer;
386 Success_Flag : out Boolean);
388 procedure Or_Atomic
389 (To : in out Aligned_Integer;
390 From : Integer);
392 procedure Or_Atomic
393 (To : in out Aligned_Integer;
394 From : Integer;
395 Retry_Count : Natural;
396 Old_Value : out Integer;
397 Success_Flag : out Boolean);
399 procedure Or_Atomic
400 (To : in out Aligned_Long_Integer;
401 From : Long_Integer);
403 procedure Or_Atomic
404 (To : in out Aligned_Long_Integer;
405 From : Long_Integer;
406 Retry_Count : Natural;
407 Old_Value : out Long_Integer;
408 Success_Flag : out Boolean);
410 type Insq_Status is
411 (Fail_No_Lock, OK_Not_First, OK_First);
413 for Insq_Status use
414 (Fail_No_Lock => -1,
415 OK_Not_First => 0,
416 OK_First => +1);
418 type Remq_Status is (
419 Fail_No_Lock,
420 Fail_Was_Empty,
421 OK_Not_Empty,
422 OK_Empty);
424 for Remq_Status use
425 (Fail_No_Lock => -1,
426 Fail_Was_Empty => 0,
427 OK_Not_Empty => +1,
428 OK_Empty => +2);
430 procedure Insqhi
431 (Item : Address;
432 Header : Address;
433 Status : out Insq_Status);
435 procedure Remqhi
436 (Header : Address;
437 Item : out Address;
438 Status : out Remq_Status);
440 procedure Insqti
441 (Item : Address;
442 Header : Address;
443 Status : out Insq_Status);
445 procedure Remqti
446 (Header : Address;
447 Item : out Address;
448 Status : out Remq_Status);
450 private
452 Address_Zero : constant Address := Null_Address;
453 No_Addr : constant Address := Null_Address;
455 -- An AST_Handler value is from a typing point of view simply a pointer
456 -- to a procedure taking a single 64bit parameter. However, this
457 -- is a bit misleading, because the data that this pointer references is
458 -- highly stylized. See body of System.AST_Handling for full details.
460 type AST_Handler is access procedure (Param : Long_Integer);
461 No_AST_Handler : constant AST_Handler := null;
463 -- Other operators have incorrect profiles. It would be nice to make
464 -- them intrinsic, since the backend can handle them, but the front
465 -- end is not prepared to deal with them, so at least inline them.
467 pragma Import (Intrinsic, "not");
468 pragma Import (Intrinsic, "and");
469 pragma Import (Intrinsic, "or");
470 pragma Import (Intrinsic, "xor");
472 -- Other inlined subprograms
474 pragma Inline_Always (Fetch_From_Address);
475 pragma Inline_Always (Assign_To_Address);
477 -- Synchronization related subprograms. Mechanism is explicitly set
478 -- so that the critical parameters are passed by reference.
479 -- Without this, the parameters are passed by copy, creating load/store
480 -- race conditions. We also inline them, since this seems more in the
481 -- spirit of the original (hardware intrinsic) routines.
483 pragma Export_Procedure
484 (Clear_Interlocked,
485 External => "system__aux_dec__clear_interlocked__1",
486 Parameter_Types => (Boolean, Boolean),
487 Mechanism => (Reference, Reference));
488 pragma Export_Procedure
489 (Clear_Interlocked,
490 External => "system__aux_dec__clear_interlocked__2",
491 Parameter_Types => (Boolean, Boolean, Natural, Boolean),
492 Mechanism => (Reference, Reference, Value, Reference));
493 pragma Inline_Always (Clear_Interlocked);
495 pragma Export_Procedure
496 (Set_Interlocked,
497 External => "system__aux_dec__set_interlocked__1",
498 Parameter_Types => (Boolean, Boolean),
499 Mechanism => (Reference, Reference));
500 pragma Export_Procedure
501 (Set_Interlocked,
502 External => "system__aux_dec__set_interlocked__2",
503 Parameter_Types => (Boolean, Boolean, Natural, Boolean),
504 Mechanism => (Reference, Reference, Value, Reference));
505 pragma Inline_Always (Set_Interlocked);
507 pragma Export_Procedure
508 (Add_Interlocked,
509 External => "system__aux_dec__add_interlocked__1",
510 Mechanism => (Value, Reference, Reference));
511 pragma Inline_Always (Add_Interlocked);
513 pragma Export_Procedure
514 (Add_Atomic,
515 External => "system__aux_dec__add_atomic__1",
516 Parameter_Types => (Aligned_Integer, Integer),
517 Mechanism => (Reference, Value));
518 pragma Export_Procedure
519 (Add_Atomic,
520 External => "system__aux_dec__add_atomic__2",
521 Parameter_Types => (Aligned_Integer, Integer, Natural, Integer, Boolean),
522 Mechanism => (Reference, Value, Value, Reference, Reference));
523 pragma Export_Procedure
524 (Add_Atomic,
525 External => "system__aux_dec__add_atomic__3",
526 Parameter_Types => (Aligned_Long_Integer, Long_Integer),
527 Mechanism => (Reference, Value));
528 pragma Export_Procedure
529 (Add_Atomic,
530 External => "system__aux_dec__add_atomic__4",
531 Parameter_Types => (Aligned_Long_Integer, Long_Integer, Natural,
532 Long_Integer, Boolean),
533 Mechanism => (Reference, Value, Value, Reference, Reference));
534 pragma Inline_Always (Add_Atomic);
536 pragma Export_Procedure
537 (And_Atomic,
538 External => "system__aux_dec__and_atomic__1",
539 Parameter_Types => (Aligned_Integer, Integer),
540 Mechanism => (Reference, Value));
541 pragma Export_Procedure
542 (And_Atomic,
543 External => "system__aux_dec__and_atomic__2",
544 Parameter_Types => (Aligned_Integer, Integer, Natural, Integer, Boolean),
545 Mechanism => (Reference, Value, Value, Reference, Reference));
546 pragma Export_Procedure
547 (And_Atomic,
548 External => "system__aux_dec__and_atomic__3",
549 Parameter_Types => (Aligned_Long_Integer, Long_Integer),
550 Mechanism => (Reference, Value));
551 pragma Export_Procedure
552 (And_Atomic,
553 External => "system__aux_dec__and_atomic__4",
554 Parameter_Types => (Aligned_Long_Integer, Long_Integer, Natural,
555 Long_Integer, Boolean),
556 Mechanism => (Reference, Value, Value, Reference, Reference));
557 pragma Inline_Always (And_Atomic);
559 pragma Export_Procedure
560 (Or_Atomic,
561 External => "system__aux_dec__or_atomic__1",
562 Parameter_Types => (Aligned_Integer, Integer),
563 Mechanism => (Reference, Value));
564 pragma Export_Procedure
565 (Or_Atomic,
566 External => "system__aux_dec__or_atomic__2",
567 Parameter_Types => (Aligned_Integer, Integer, Natural, Integer, Boolean),
568 Mechanism => (Reference, Value, Value, Reference, Reference));
569 pragma Export_Procedure
570 (Or_Atomic,
571 External => "system__aux_dec__or_atomic__3",
572 Parameter_Types => (Aligned_Long_Integer, Long_Integer),
573 Mechanism => (Reference, Value));
574 pragma Export_Procedure
575 (Or_Atomic,
576 External => "system__aux_dec__or_atomic__4",
577 Parameter_Types => (Aligned_Long_Integer, Long_Integer, Natural,
578 Long_Integer, Boolean),
579 Mechanism => (Reference, Value, Value, Reference, Reference));
580 pragma Inline_Always (Or_Atomic);
582 -- Inline the VAX Queue Funtions
584 pragma Inline_Always (Insqhi);
585 pragma Inline_Always (Remqhi);
586 pragma Inline_Always (Insqti);
587 pragma Inline_Always (Remqti);
589 -- Provide proper unchecked conversion definitions for transfer
590 -- functions. Note that we need this level of indirection because
591 -- the formal parameter name is X and not Source (and this is indeed
592 -- detectable by a program)
594 function To_Unsigned_Byte_A is new
595 Ada.Unchecked_Conversion (Bit_Array_8, Unsigned_Byte);
597 function To_Unsigned_Byte (X : Bit_Array_8) return Unsigned_Byte
598 renames To_Unsigned_Byte_A;
600 function To_Bit_Array_8_A is new
601 Ada.Unchecked_Conversion (Unsigned_Byte, Bit_Array_8);
603 function To_Bit_Array_8 (X : Unsigned_Byte) return Bit_Array_8
604 renames To_Bit_Array_8_A;
606 function To_Unsigned_Word_A is new
607 Ada.Unchecked_Conversion (Bit_Array_16, Unsigned_Word);
609 function To_Unsigned_Word (X : Bit_Array_16) return Unsigned_Word
610 renames To_Unsigned_Word_A;
612 function To_Bit_Array_16_A is new
613 Ada.Unchecked_Conversion (Unsigned_Word, Bit_Array_16);
615 function To_Bit_Array_16 (X : Unsigned_Word) return Bit_Array_16
616 renames To_Bit_Array_16_A;
618 function To_Unsigned_Longword_A is new
619 Ada.Unchecked_Conversion (Bit_Array_32, Unsigned_Longword);
621 function To_Unsigned_Longword (X : Bit_Array_32) return Unsigned_Longword
622 renames To_Unsigned_Longword_A;
624 function To_Bit_Array_32_A is new
625 Ada.Unchecked_Conversion (Unsigned_Longword, Bit_Array_32);
627 function To_Bit_Array_32 (X : Unsigned_Longword) return Bit_Array_32
628 renames To_Bit_Array_32_A;
630 function To_Unsigned_32_A is new
631 Ada.Unchecked_Conversion (Bit_Array_32, Unsigned_32);
633 function To_Unsigned_32 (X : Bit_Array_32) return Unsigned_32
634 renames To_Unsigned_32_A;
636 function To_Bit_Array_32_A is new
637 Ada.Unchecked_Conversion (Unsigned_32, Bit_Array_32);
639 function To_Bit_Array_32 (X : Unsigned_32) return Bit_Array_32
640 renames To_Bit_Array_32_A;
642 function To_Unsigned_Quadword_A is new
643 Ada.Unchecked_Conversion (Bit_Array_64, Unsigned_Quadword);
645 function To_Unsigned_Quadword (X : Bit_Array_64) return Unsigned_Quadword
646 renames To_Unsigned_Quadword_A;
648 function To_Bit_Array_64_A is new
649 Ada.Unchecked_Conversion (Unsigned_Quadword, Bit_Array_64);
651 function To_Bit_Array_64 (X : Unsigned_Quadword) return Bit_Array_64
652 renames To_Bit_Array_64_A;
654 pragma Warnings (Off);
655 -- Turn warnings off. This is needed for systems with 64-bit integers,
656 -- where some of these operations are of dubious meaning, but we do not
657 -- want warnings when we compile on such systems.
659 function To_Address_A is new
660 Ada.Unchecked_Conversion (Integer, Short_Address);
661 pragma Pure_Function (To_Address_A);
663 function To_Address (X : Integer) return Short_Address
664 renames To_Address_A;
665 pragma Pure_Function (To_Address);
667 function To_Address_Long_A is new
668 Ada.Unchecked_Conversion (Unsigned_Longword, Short_Address);
669 pragma Pure_Function (To_Address_Long_A);
671 function To_Address_Long (X : Unsigned_Longword) return Short_Address
672 renames To_Address_Long_A;
673 pragma Pure_Function (To_Address_Long);
675 function To_Integer_A is new
676 Ada.Unchecked_Conversion (Short_Address, Integer);
678 function To_Integer (X : Short_Address) return Integer
679 renames To_Integer_A;
681 function To_Unsigned_Longword_A is new
682 Ada.Unchecked_Conversion (Short_Address, Unsigned_Longword);
684 function To_Unsigned_Longword (X : Short_Address) return Unsigned_Longword
685 renames To_Unsigned_Longword_A;
687 function To_Unsigned_Longword_A is new
688 Ada.Unchecked_Conversion (AST_Handler, Unsigned_Longword);
690 function To_Unsigned_Longword (X : AST_Handler) return Unsigned_Longword
691 renames To_Unsigned_Longword_A;
693 pragma Warnings (On);
695 end System.Aux_DEC;