1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
5 -- S Y S T E M . A U X _ D E C --
9 -- Copyright (C) 1996-2008, Free Software Foundation, Inc. --
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 2, 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. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, USA. --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
32 ------------------------------------------------------------------------------
34 -- This package contains definitions that are designed to be compatible
35 -- with the extra definitions in package System for DEC Ada implementations.
37 -- These definitions can be used directly by withing this package, or merged
38 -- with System using pragma Extend_System (Aux_DEC)
40 -- This is the VMS 64 bit version
42 with Ada
.Unchecked_Conversion
;
44 package System
.Aux_DEC
is
47 type Short_Integer_Address
is
48 range -2 ** (32 - 1) .. +2 ** (32 - 1) - 1;
49 -- Integer literals cannot appear naked in an address context, as a
50 -- result the bounds of Short_Address cannot be given simply as 2^32 etc.
52 subtype Short_Address
is Address
53 range Address
(Short_Integer_Address
'First) ..
54 Address
(Short_Integer_Address
'Last);
55 for Short_Address
'Object_Size use 32;
56 -- This subtype allows addresses to be converted from 64 bits to 32 bits
57 -- with an appropriate range check. Note that since this is a subtype of
58 -- type System.Address, the same limitations apply to this subtype. Namely
59 -- there are no visible arithmetic operations, and integer literals are
62 Short_Memory_Size
: constant := 2 ** 32;
63 -- Defined for convenience of porting
65 type Integer_8
is range -2 ** (8 - 1) .. +2 ** (8 - 1) - 1;
66 for Integer_8
'Size use 8;
68 type Integer_16
is range -2 ** (16 - 1) .. +2 ** (16 - 1) - 1;
69 for Integer_16
'Size use 16;
71 type Integer_32
is range -2 ** (32 - 1) .. +2 ** (32 - 1) - 1;
72 for Integer_32
'Size use 32;
74 type Integer_64
is range -2 ** (64 - 1) .. +2 ** (64 - 1) - 1;
75 for Integer_64
'Size use 64;
77 type Largest_Integer
is range Min_Int
.. Max_Int
;
79 type AST_Handler
is private;
81 No_AST_Handler
: constant AST_Handler
;
84 (Type_Class_Enumeration
,
86 Type_Class_Fixed_Point
,
87 Type_Class_Floating_Point
,
91 Type_Class_Task
, -- also in Ada 95 protected
94 function "not" (Left
: Largest_Integer
) return Largest_Integer
;
95 function "and" (Left
, Right
: Largest_Integer
) return Largest_Integer
;
96 function "or" (Left
, Right
: Largest_Integer
) return Largest_Integer
;
97 function "xor" (Left
, Right
: Largest_Integer
) return Largest_Integer
;
99 Address_Zero
: constant Address
;
100 No_Addr
: constant Address
;
101 Address_Size
: constant := Standard
'Address_Size;
102 Short_Address_Size
: constant := 32;
104 function "+" (Left
: Address
; Right
: Integer) return Address
;
105 function "+" (Left
: Integer; Right
: Address
) return Address
;
106 function "-" (Left
: Address
; Right
: Address
) return Integer;
107 function "-" (Left
: Address
; Right
: Integer) return Address
;
110 type Target
is private;
111 function Fetch_From_Address
(A
: Address
) return Target
;
114 type Target
is private;
115 procedure Assign_To_Address
(A
: Address
; T
: Target
);
117 -- Floating point type declarations for VAX floating point data types
119 pragma Warnings
(Off
);
121 type F_Float
is digits 6;
122 pragma Float_Representation
(VAX_Float
, F_Float
);
124 type D_Float
is digits 9;
125 pragma Float_Representation
(Vax_Float
, D_Float
);
127 type G_Float
is digits 15;
128 pragma Float_Representation
(Vax_Float
, G_Float
);
130 -- Floating point type declarations for IEEE floating point data types
132 type IEEE_Single_Float
is digits 6;
133 pragma Float_Representation
(IEEE_Float
, IEEE_Single_Float
);
135 type IEEE_Double_Float
is digits 15;
136 pragma Float_Representation
(IEEE_Float
, IEEE_Double_Float
);
138 pragma Warnings
(On
);
140 Non_Ada_Error
: exception;
142 -- Hardware-oriented types and functions
144 type Bit_Array
is array (Integer range <>) of Boolean;
145 pragma Pack
(Bit_Array
);
147 subtype Bit_Array_8
is Bit_Array
(0 .. 7);
148 subtype Bit_Array_16
is Bit_Array
(0 .. 15);
149 subtype Bit_Array_32
is Bit_Array
(0 .. 31);
150 subtype Bit_Array_64
is Bit_Array
(0 .. 63);
152 type Unsigned_Byte
is range 0 .. 255;
153 for Unsigned_Byte
'Size use 8;
155 function "not" (Left
: Unsigned_Byte
) return Unsigned_Byte
;
156 function "and" (Left
, Right
: Unsigned_Byte
) return Unsigned_Byte
;
157 function "or" (Left
, Right
: Unsigned_Byte
) return Unsigned_Byte
;
158 function "xor" (Left
, Right
: Unsigned_Byte
) return Unsigned_Byte
;
160 function To_Unsigned_Byte
(X
: Bit_Array_8
) return Unsigned_Byte
;
161 function To_Bit_Array_8
(X
: Unsigned_Byte
) return Bit_Array_8
;
163 type Unsigned_Byte_Array
is array (Integer range <>) of Unsigned_Byte
;
165 type Unsigned_Word
is range 0 .. 65535;
166 for Unsigned_Word
'Size use 16;
168 function "not" (Left
: Unsigned_Word
) return Unsigned_Word
;
169 function "and" (Left
, Right
: Unsigned_Word
) return Unsigned_Word
;
170 function "or" (Left
, Right
: Unsigned_Word
) return Unsigned_Word
;
171 function "xor" (Left
, Right
: Unsigned_Word
) return Unsigned_Word
;
173 function To_Unsigned_Word
(X
: Bit_Array_16
) return Unsigned_Word
;
174 function To_Bit_Array_16
(X
: Unsigned_Word
) return Bit_Array_16
;
176 type Unsigned_Word_Array
is array (Integer range <>) of Unsigned_Word
;
178 type Unsigned_Longword
is range -2_147_483_648
.. 2_147_483_647
;
179 for Unsigned_Longword
'Size use 32;
181 function "not" (Left
: Unsigned_Longword
) return Unsigned_Longword
;
182 function "and" (Left
, Right
: Unsigned_Longword
) return Unsigned_Longword
;
183 function "or" (Left
, Right
: Unsigned_Longword
) return Unsigned_Longword
;
184 function "xor" (Left
, Right
: Unsigned_Longword
) return Unsigned_Longword
;
186 function To_Unsigned_Longword
(X
: Bit_Array_32
) return Unsigned_Longword
;
187 function To_Bit_Array_32
(X
: Unsigned_Longword
) return Bit_Array_32
;
189 type Unsigned_Longword_Array
is
190 array (Integer range <>) of Unsigned_Longword
;
192 type Unsigned_32
is range 0 .. 4_294_967_295
;
193 for Unsigned_32
'Size use 32;
195 function "not" (Left
: Unsigned_32
) return Unsigned_32
;
196 function "and" (Left
, Right
: Unsigned_32
) return Unsigned_32
;
197 function "or" (Left
, Right
: Unsigned_32
) return Unsigned_32
;
198 function "xor" (Left
, Right
: Unsigned_32
) return Unsigned_32
;
200 function To_Unsigned_32
(X
: Bit_Array_32
) return Unsigned_32
;
201 function To_Bit_Array_32
(X
: Unsigned_32
) return Bit_Array_32
;
203 type Unsigned_Quadword
is record
204 L0
: Unsigned_Longword
;
205 L1
: Unsigned_Longword
;
208 for Unsigned_Quadword
'Size use 64;
209 for Unsigned_Quadword
'Alignment use
210 Integer'Min (8, Standard
'Maximum_Alignment);
212 function "not" (Left
: Unsigned_Quadword
) return Unsigned_Quadword
;
213 function "and" (Left
, Right
: Unsigned_Quadword
) return Unsigned_Quadword
;
214 function "or" (Left
, Right
: Unsigned_Quadword
) return Unsigned_Quadword
;
215 function "xor" (Left
, Right
: Unsigned_Quadword
) return Unsigned_Quadword
;
217 function To_Unsigned_Quadword
(X
: Bit_Array_64
) return Unsigned_Quadword
;
218 function To_Bit_Array_64
(X
: Unsigned_Quadword
) return Bit_Array_64
;
220 type Unsigned_Quadword_Array
is
221 array (Integer range <>) of Unsigned_Quadword
;
223 function To_Address
(X
: Integer) return Address
;
224 pragma Pure_Function
(To_Address
);
226 function To_Address_Long
(X
: Unsigned_Longword
) return Address
;
227 pragma Pure_Function
(To_Address_Long
);
229 function To_Integer
(X
: Address
) return Integer;
231 function To_Unsigned_Longword
(X
: Address
) return Unsigned_Longword
;
232 function To_Unsigned_Longword
(X
: AST_Handler
) return Unsigned_Longword
;
234 -- Conventional names for static subtypes of type UNSIGNED_LONGWORD
236 subtype Unsigned_1
is Unsigned_Longword
range 0 .. 2** 1-1;
237 subtype Unsigned_2
is Unsigned_Longword
range 0 .. 2** 2-1;
238 subtype Unsigned_3
is Unsigned_Longword
range 0 .. 2** 3-1;
239 subtype Unsigned_4
is Unsigned_Longword
range 0 .. 2** 4-1;
240 subtype Unsigned_5
is Unsigned_Longword
range 0 .. 2** 5-1;
241 subtype Unsigned_6
is Unsigned_Longword
range 0 .. 2** 6-1;
242 subtype Unsigned_7
is Unsigned_Longword
range 0 .. 2** 7-1;
243 subtype Unsigned_8
is Unsigned_Longword
range 0 .. 2** 8-1;
244 subtype Unsigned_9
is Unsigned_Longword
range 0 .. 2** 9-1;
245 subtype Unsigned_10
is Unsigned_Longword
range 0 .. 2**10-1;
246 subtype Unsigned_11
is Unsigned_Longword
range 0 .. 2**11-1;
247 subtype Unsigned_12
is Unsigned_Longword
range 0 .. 2**12-1;
248 subtype Unsigned_13
is Unsigned_Longword
range 0 .. 2**13-1;
249 subtype Unsigned_14
is Unsigned_Longword
range 0 .. 2**14-1;
250 subtype Unsigned_15
is Unsigned_Longword
range 0 .. 2**15-1;
251 subtype Unsigned_16
is Unsigned_Longword
range 0 .. 2**16-1;
252 subtype Unsigned_17
is Unsigned_Longword
range 0 .. 2**17-1;
253 subtype Unsigned_18
is Unsigned_Longword
range 0 .. 2**18-1;
254 subtype Unsigned_19
is Unsigned_Longword
range 0 .. 2**19-1;
255 subtype Unsigned_20
is Unsigned_Longword
range 0 .. 2**20-1;
256 subtype Unsigned_21
is Unsigned_Longword
range 0 .. 2**21-1;
257 subtype Unsigned_22
is Unsigned_Longword
range 0 .. 2**22-1;
258 subtype Unsigned_23
is Unsigned_Longword
range 0 .. 2**23-1;
259 subtype Unsigned_24
is Unsigned_Longword
range 0 .. 2**24-1;
260 subtype Unsigned_25
is Unsigned_Longword
range 0 .. 2**25-1;
261 subtype Unsigned_26
is Unsigned_Longword
range 0 .. 2**26-1;
262 subtype Unsigned_27
is Unsigned_Longword
range 0 .. 2**27-1;
263 subtype Unsigned_28
is Unsigned_Longword
range 0 .. 2**28-1;
264 subtype Unsigned_29
is Unsigned_Longword
range 0 .. 2**29-1;
265 subtype Unsigned_30
is Unsigned_Longword
range 0 .. 2**30-1;
266 subtype Unsigned_31
is Unsigned_Longword
range 0 .. 2**31-1;
268 -- Function for obtaining global symbol values
270 function Import_Value
(Symbol
: String) return Unsigned_Longword
;
271 function Import_Address
(Symbol
: String) return Address
;
272 function Import_Largest_Value
(Symbol
: String) return Largest_Integer
;
274 pragma Import
(Intrinsic
, Import_Value
);
275 pragma Import
(Intrinsic
, Import_Address
);
276 pragma Import
(Intrinsic
, Import_Largest_Value
);
278 -- For the following declarations, note that the declaration without
279 -- a Retry_Count parameter means to retry infinitely. A value of zero
280 -- for the Retry_Count parameter means do not retry.
282 -- Interlocked-instruction procedures
284 procedure Clear_Interlocked
285 (Bit
: in out Boolean;
286 Old_Value
: out Boolean);
288 procedure Set_Interlocked
289 (Bit
: in out Boolean;
290 Old_Value
: out Boolean);
292 type Aligned_Word
is record
293 Value
: Short_Integer;
296 for Aligned_Word
'Alignment use
297 Integer'Min (2, Standard
'Maximum_Alignment);
299 procedure Clear_Interlocked
300 (Bit
: in out Boolean;
301 Old_Value
: out Boolean;
302 Retry_Count
: Natural;
303 Success_Flag
: out Boolean);
305 procedure Set_Interlocked
306 (Bit
: in out Boolean;
307 Old_Value
: out Boolean;
308 Retry_Count
: Natural;
309 Success_Flag
: out Boolean);
311 procedure Add_Interlocked
312 (Addend
: Short_Integer;
313 Augend
: in out Aligned_Word
;
316 type Aligned_Integer
is record
320 for Aligned_Integer
'Alignment use
321 Integer'Min (4, Standard
'Maximum_Alignment);
323 type Aligned_Long_Integer
is record
324 Value
: Long_Integer;
327 for Aligned_Long_Integer
'Alignment use
328 Integer'Min (8, Standard
'Maximum_Alignment);
330 -- For the following declarations, note that the declaration without
331 -- a Retry_Count parameter mean to retry infinitely. A value of zero
332 -- for the Retry_Count means do not retry.
335 (To
: in out Aligned_Integer
;
339 (To
: in out Aligned_Integer
;
341 Retry_Count
: Natural;
342 Old_Value
: out Integer;
343 Success_Flag
: out Boolean);
346 (To
: in out Aligned_Long_Integer
;
347 Amount
: Long_Integer);
350 (To
: in out Aligned_Long_Integer
;
351 Amount
: Long_Integer;
352 Retry_Count
: Natural;
353 Old_Value
: out Long_Integer;
354 Success_Flag
: out Boolean);
357 (To
: in out Aligned_Integer
;
361 (To
: in out Aligned_Integer
;
363 Retry_Count
: Natural;
364 Old_Value
: out Integer;
365 Success_Flag
: out Boolean);
368 (To
: in out Aligned_Long_Integer
;
369 From
: Long_Integer);
372 (To
: in out Aligned_Long_Integer
;
374 Retry_Count
: Natural;
375 Old_Value
: out Long_Integer;
376 Success_Flag
: out Boolean);
379 (To
: in out Aligned_Integer
;
383 (To
: in out Aligned_Integer
;
385 Retry_Count
: Natural;
386 Old_Value
: out Integer;
387 Success_Flag
: out Boolean);
390 (To
: in out Aligned_Long_Integer
;
391 From
: Long_Integer);
394 (To
: in out Aligned_Long_Integer
;
396 Retry_Count
: Natural;
397 Old_Value
: out Long_Integer;
398 Success_Flag
: out Boolean);
401 (Fail_No_Lock
, OK_Not_First
, OK_First
);
408 type Remq_Status
is (
423 Status
: out Insq_Status
);
428 Status
: out Remq_Status
);
433 Status
: out Insq_Status
);
438 Status
: out Remq_Status
);
442 Address_Zero
: constant Address
:= Null_Address
;
443 No_Addr
: constant Address
:= Null_Address
;
445 -- An AST_Handler value is from a typing point of view simply a pointer
446 -- to a procedure taking a single 64bit parameter. However, this
447 -- is a bit misleading, because the data that this pointer references is
448 -- highly stylized. See body of System.AST_Handling for full details.
450 type AST_Handler
is access procedure (Param
: Long_Integer);
451 No_AST_Handler
: constant AST_Handler
:= null;
453 -- Other operators have incorrect profiles. It would be nice to make
454 -- them intrinsic, since the backend can handle them, but the front
455 -- end is not prepared to deal with them, so at least inline them.
457 pragma Inline_Always
("+");
458 pragma Inline_Always
("-");
459 pragma Inline_Always
("not");
460 pragma Inline_Always
("and");
461 pragma Inline_Always
("or");
462 pragma Inline_Always
("xor");
464 -- Other inlined subprograms
466 pragma Inline_Always
(Fetch_From_Address
);
467 pragma Inline_Always
(Assign_To_Address
);
469 -- Synchronization related subprograms. Mechanism is explicitly set
470 -- so that the critical parameters are passed by reference.
471 -- Without this, the parameters are passed by copy, creating load/store
472 -- race conditions. We also inline them, since this seems more in the
473 -- spirit of the original (hardware intrinsic) routines.
475 pragma Export_Procedure
477 External
=> "system__aux_dec__clear_interlocked__1",
478 Parameter_Types
=> (Boolean, Boolean),
479 Mechanism
=> (Reference
, Reference
));
480 pragma Export_Procedure
482 External
=> "system__aux_dec__clear_interlocked__2",
483 Parameter_Types
=> (Boolean, Boolean, Natural, Boolean),
484 Mechanism
=> (Reference
, Reference
, Value
, Reference
));
485 pragma Inline_Always
(Clear_Interlocked
);
487 pragma Export_Procedure
489 External
=> "system__aux_dec__set_interlocked__1",
490 Parameter_Types
=> (Boolean, Boolean),
491 Mechanism
=> (Reference
, Reference
));
492 pragma Export_Procedure
494 External
=> "system__aux_dec__set_interlocked__2",
495 Parameter_Types
=> (Boolean, Boolean, Natural, Boolean),
496 Mechanism
=> (Reference
, Reference
, Value
, Reference
));
497 pragma Inline_Always
(Set_Interlocked
);
499 pragma Export_Procedure
501 External
=> "system__aux_dec__add_interlocked__1",
502 Mechanism
=> (Value
, Reference
, Reference
));
503 pragma Inline_Always
(Add_Interlocked
);
505 pragma Export_Procedure
507 External
=> "system__aux_dec__add_atomic__1",
508 Parameter_Types
=> (Aligned_Integer
, Integer),
509 Mechanism
=> (Reference
, Value
));
510 pragma Export_Procedure
512 External
=> "system__aux_dec__add_atomic__2",
513 Parameter_Types
=> (Aligned_Integer
, Integer, Natural, Integer, Boolean),
514 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
515 pragma Export_Procedure
517 External
=> "system__aux_dec__add_atomic__3",
518 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer),
519 Mechanism
=> (Reference
, Value
));
520 pragma Export_Procedure
522 External
=> "system__aux_dec__add_atomic__4",
523 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer, Natural,
524 Long_Integer, Boolean),
525 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
526 pragma Inline_Always
(Add_Atomic
);
528 pragma Export_Procedure
530 External
=> "system__aux_dec__and_atomic__1",
531 Parameter_Types
=> (Aligned_Integer
, Integer),
532 Mechanism
=> (Reference
, Value
));
533 pragma Export_Procedure
535 External
=> "system__aux_dec__and_atomic__2",
536 Parameter_Types
=> (Aligned_Integer
, Integer, Natural, Integer, Boolean),
537 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
538 pragma Export_Procedure
540 External
=> "system__aux_dec__and_atomic__3",
541 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer),
542 Mechanism
=> (Reference
, Value
));
543 pragma Export_Procedure
545 External
=> "system__aux_dec__and_atomic__4",
546 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer, Natural,
547 Long_Integer, Boolean),
548 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
549 pragma Inline_Always
(And_Atomic
);
551 pragma Export_Procedure
553 External
=> "system__aux_dec__or_atomic__1",
554 Parameter_Types
=> (Aligned_Integer
, Integer),
555 Mechanism
=> (Reference
, Value
));
556 pragma Export_Procedure
558 External
=> "system__aux_dec__or_atomic__2",
559 Parameter_Types
=> (Aligned_Integer
, Integer, Natural, Integer, Boolean),
560 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
561 pragma Export_Procedure
563 External
=> "system__aux_dec__or_atomic__3",
564 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer),
565 Mechanism
=> (Reference
, Value
));
566 pragma Export_Procedure
568 External
=> "system__aux_dec__or_atomic__4",
569 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer, Natural,
570 Long_Integer, Boolean),
571 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
572 pragma Inline_Always
(Or_Atomic
);
574 -- Provide proper unchecked conversion definitions for transfer
575 -- functions. Note that we need this level of indirection because
576 -- the formal parameter name is X and not Source (and this is indeed
577 -- detectable by a program)
579 function To_Unsigned_Byte_A
is new
580 Ada
.Unchecked_Conversion
(Bit_Array_8
, Unsigned_Byte
);
582 function To_Unsigned_Byte
(X
: Bit_Array_8
) return Unsigned_Byte
583 renames To_Unsigned_Byte_A
;
585 function To_Bit_Array_8_A
is new
586 Ada
.Unchecked_Conversion
(Unsigned_Byte
, Bit_Array_8
);
588 function To_Bit_Array_8
(X
: Unsigned_Byte
) return Bit_Array_8
589 renames To_Bit_Array_8_A
;
591 function To_Unsigned_Word_A
is new
592 Ada
.Unchecked_Conversion
(Bit_Array_16
, Unsigned_Word
);
594 function To_Unsigned_Word
(X
: Bit_Array_16
) return Unsigned_Word
595 renames To_Unsigned_Word_A
;
597 function To_Bit_Array_16_A
is new
598 Ada
.Unchecked_Conversion
(Unsigned_Word
, Bit_Array_16
);
600 function To_Bit_Array_16
(X
: Unsigned_Word
) return Bit_Array_16
601 renames To_Bit_Array_16_A
;
603 function To_Unsigned_Longword_A
is new
604 Ada
.Unchecked_Conversion
(Bit_Array_32
, Unsigned_Longword
);
606 function To_Unsigned_Longword
(X
: Bit_Array_32
) return Unsigned_Longword
607 renames To_Unsigned_Longword_A
;
609 function To_Bit_Array_32_A
is new
610 Ada
.Unchecked_Conversion
(Unsigned_Longword
, Bit_Array_32
);
612 function To_Bit_Array_32
(X
: Unsigned_Longword
) return Bit_Array_32
613 renames To_Bit_Array_32_A
;
615 function To_Unsigned_32_A
is new
616 Ada
.Unchecked_Conversion
(Bit_Array_32
, Unsigned_32
);
618 function To_Unsigned_32
(X
: Bit_Array_32
) return Unsigned_32
619 renames To_Unsigned_32_A
;
621 function To_Bit_Array_32_A
is new
622 Ada
.Unchecked_Conversion
(Unsigned_32
, Bit_Array_32
);
624 function To_Bit_Array_32
(X
: Unsigned_32
) return Bit_Array_32
625 renames To_Bit_Array_32_A
;
627 function To_Unsigned_Quadword_A
is new
628 Ada
.Unchecked_Conversion
(Bit_Array_64
, Unsigned_Quadword
);
630 function To_Unsigned_Quadword
(X
: Bit_Array_64
) return Unsigned_Quadword
631 renames To_Unsigned_Quadword_A
;
633 function To_Bit_Array_64_A
is new
634 Ada
.Unchecked_Conversion
(Unsigned_Quadword
, Bit_Array_64
);
636 function To_Bit_Array_64
(X
: Unsigned_Quadword
) return Bit_Array_64
637 renames To_Bit_Array_64_A
;
639 pragma Warnings
(Off
);
640 -- Turn warnings off. This is needed for systems with 64-bit integers,
641 -- where some of these operations are of dubious meaning, but we do not
642 -- want warnings when we compile on such systems.
644 function To_Address_A
is new
645 Ada
.Unchecked_Conversion
(Integer, Address
);
646 pragma Pure_Function
(To_Address_A
);
648 function To_Address
(X
: Integer) return Address
649 renames To_Address_A
;
650 pragma Pure_Function
(To_Address
);
652 function To_Address_Long_A
is new
653 Ada
.Unchecked_Conversion
(Unsigned_Longword
, Address
);
654 pragma Pure_Function
(To_Address_Long_A
);
656 function To_Address_Long
(X
: Unsigned_Longword
) return Address
657 renames To_Address_Long_A
;
658 pragma Pure_Function
(To_Address_Long
);
660 function To_Integer_A
is new
661 Ada
.Unchecked_Conversion
(Address
, Integer);
663 function To_Integer
(X
: Address
) return Integer
664 renames To_Integer_A
;
666 function To_Unsigned_Longword_A
is new
667 Ada
.Unchecked_Conversion
(Address
, Unsigned_Longword
);
669 function To_Unsigned_Longword
(X
: Address
) return Unsigned_Longword
670 renames To_Unsigned_Longword_A
;
672 function To_Unsigned_Longword_A
is new
673 Ada
.Unchecked_Conversion
(AST_Handler
, Unsigned_Longword
);
675 function To_Unsigned_Longword
(X
: AST_Handler
) return Unsigned_Longword
676 renames To_Unsigned_Longword_A
;
678 pragma Warnings
(On
);