1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
5 -- S Y S T E M . A U X _ D E C --
9 -- Copyright (C) 1996-2010, 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 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. --
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. --
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/>. --
27 -- GNAT was originally developed by the GNAT team at New York University. --
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
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 with Ada
.Unchecked_Conversion
;
40 package System
.Aux_DEC
is
43 subtype Short_Address
is Address
;
44 -- In some versions of System.Aux_DEC, notably that for VMS on IA64, there
45 -- are two address types (64-bit and 32-bit), and the name Short_Address
46 -- is used for the short address form. To avoid difficulties (in regression
47 -- tests and elsewhere) with units that reference Short_Address, it is
48 -- provided for other targets as a synonym for the normal Address type,
49 -- and, as in the case where the lengths are different, Address and
50 -- Short_Address can be freely inter-converted.
52 type Integer_8
is range -2 ** (8 - 1) .. +2 ** (8 - 1) - 1;
53 for Integer_8
'Size use 8;
55 type Integer_16
is range -2 ** (16 - 1) .. +2 ** (16 - 1) - 1;
56 for Integer_16
'Size use 16;
58 type Integer_32
is range -2 ** (32 - 1) .. +2 ** (32 - 1) - 1;
59 for Integer_32
'Size use 32;
61 type Integer_64
is range -2 ** (64 - 1) .. +2 ** (64 - 1) - 1;
62 for Integer_64
'Size use 64;
64 type Integer_8_Array
is array (Integer range <>) of Integer_8
;
65 type Integer_16_Array
is array (Integer range <>) of Integer_16
;
66 type Integer_32_Array
is array (Integer range <>) of Integer_32
;
67 type Integer_64_Array
is array (Integer range <>) of Integer_64
;
68 -- These array types are not in all versions of DEC System, and in fact it
69 -- is not quite clear why they are in some and not others, but since they
70 -- definitely appear in some versions, we include them unconditionally.
72 type Largest_Integer
is range Min_Int
.. Max_Int
;
74 type AST_Handler
is private;
76 No_AST_Handler
: constant AST_Handler
;
79 (Type_Class_Enumeration
,
81 Type_Class_Fixed_Point
,
82 Type_Class_Floating_Point
,
86 Type_Class_Task
, -- also in Ada 95 protected
89 function "not" (Left
: Largest_Integer
) return Largest_Integer
;
90 function "and" (Left
, Right
: Largest_Integer
) return Largest_Integer
;
91 function "or" (Left
, Right
: Largest_Integer
) return Largest_Integer
;
92 function "xor" (Left
, Right
: Largest_Integer
) return Largest_Integer
;
94 Address_Zero
: constant Address
;
95 No_Addr
: constant Address
;
96 Address_Size
: constant := Standard
'Address_Size;
97 Short_Address_Size
: constant := Standard
'Address_Size;
99 function "+" (Left
: Address
; Right
: Integer) return Address
;
100 function "+" (Left
: Integer; Right
: Address
) return Address
;
101 function "-" (Left
: Address
; Right
: Address
) return Integer;
102 function "-" (Left
: Address
; Right
: Integer) return Address
;
105 type Target
is private;
106 function Fetch_From_Address
(A
: Address
) return Target
;
109 type Target
is private;
110 procedure Assign_To_Address
(A
: Address
; T
: Target
);
112 -- Floating point type declarations for VAX floating point data types
114 pragma Warnings
(Off
);
117 type F_Float
is digits 6;
118 pragma Float_Representation
(VAX_Float
, F_Float
);
120 type D_Float
is digits 9;
121 pragma Float_Representation
(Vax_Float
, D_Float
);
123 type G_Float
is digits 15;
124 pragma Float_Representation
(Vax_Float
, G_Float
);
126 -- Floating point type declarations for IEEE floating point data types
128 type IEEE_Single_Float
is digits 6;
129 pragma Float_Representation
(IEEE_Float
, IEEE_Single_Float
);
131 type IEEE_Double_Float
is digits 15;
132 pragma Float_Representation
(IEEE_Float
, IEEE_Double_Float
);
134 pragma Warnings
(On
);
136 Non_Ada_Error
: exception;
138 -- Hardware-oriented types and functions
140 type Bit_Array
is array (Integer range <>) of Boolean;
141 pragma Pack
(Bit_Array
);
143 subtype Bit_Array_8
is Bit_Array
(0 .. 7);
144 subtype Bit_Array_16
is Bit_Array
(0 .. 15);
145 subtype Bit_Array_32
is Bit_Array
(0 .. 31);
146 subtype Bit_Array_64
is Bit_Array
(0 .. 63);
148 type Unsigned_Byte
is range 0 .. 255;
149 for Unsigned_Byte
'Size use 8;
151 function "not" (Left
: Unsigned_Byte
) return Unsigned_Byte
;
152 function "and" (Left
, Right
: Unsigned_Byte
) return Unsigned_Byte
;
153 function "or" (Left
, Right
: Unsigned_Byte
) return Unsigned_Byte
;
154 function "xor" (Left
, Right
: Unsigned_Byte
) return Unsigned_Byte
;
156 function To_Unsigned_Byte
(X
: Bit_Array_8
) return Unsigned_Byte
;
157 function To_Bit_Array_8
(X
: Unsigned_Byte
) return Bit_Array_8
;
159 type Unsigned_Byte_Array
is array (Integer range <>) of Unsigned_Byte
;
161 type Unsigned_Word
is range 0 .. 65535;
162 for Unsigned_Word
'Size use 16;
164 function "not" (Left
: Unsigned_Word
) return Unsigned_Word
;
165 function "and" (Left
, Right
: Unsigned_Word
) return Unsigned_Word
;
166 function "or" (Left
, Right
: Unsigned_Word
) return Unsigned_Word
;
167 function "xor" (Left
, Right
: Unsigned_Word
) return Unsigned_Word
;
169 function To_Unsigned_Word
(X
: Bit_Array_16
) return Unsigned_Word
;
170 function To_Bit_Array_16
(X
: Unsigned_Word
) return Bit_Array_16
;
172 type Unsigned_Word_Array
is array (Integer range <>) of Unsigned_Word
;
174 type Unsigned_Longword
is range -2_147_483_648
.. 2_147_483_647
;
175 for Unsigned_Longword
'Size use 32;
177 function "not" (Left
: Unsigned_Longword
) return Unsigned_Longword
;
178 function "and" (Left
, Right
: Unsigned_Longword
) return Unsigned_Longword
;
179 function "or" (Left
, Right
: Unsigned_Longword
) return Unsigned_Longword
;
180 function "xor" (Left
, Right
: Unsigned_Longword
) return Unsigned_Longword
;
182 function To_Unsigned_Longword
(X
: Bit_Array_32
) return Unsigned_Longword
;
183 function To_Bit_Array_32
(X
: Unsigned_Longword
) return Bit_Array_32
;
185 type Unsigned_Longword_Array
is
186 array (Integer range <>) of Unsigned_Longword
;
188 type Unsigned_32
is range 0 .. 4_294_967_295
;
189 for Unsigned_32
'Size use 32;
191 function "not" (Left
: Unsigned_32
) return Unsigned_32
;
192 function "and" (Left
, Right
: Unsigned_32
) return Unsigned_32
;
193 function "or" (Left
, Right
: Unsigned_32
) return Unsigned_32
;
194 function "xor" (Left
, Right
: Unsigned_32
) return Unsigned_32
;
196 function To_Unsigned_32
(X
: Bit_Array_32
) return Unsigned_32
;
197 function To_Bit_Array_32
(X
: Unsigned_32
) return Bit_Array_32
;
199 type Unsigned_Quadword
is record
200 L0
: Unsigned_Longword
;
201 L1
: Unsigned_Longword
;
204 for Unsigned_Quadword
'Size use 64;
205 for Unsigned_Quadword
'Alignment use
206 Integer'Min (8, Standard
'Maximum_Alignment);
208 function "not" (Left
: Unsigned_Quadword
) return Unsigned_Quadword
;
209 function "and" (Left
, Right
: Unsigned_Quadword
) return Unsigned_Quadword
;
210 function "or" (Left
, Right
: Unsigned_Quadword
) return Unsigned_Quadword
;
211 function "xor" (Left
, Right
: Unsigned_Quadword
) return Unsigned_Quadword
;
213 function To_Unsigned_Quadword
(X
: Bit_Array_64
) return Unsigned_Quadword
;
214 function To_Bit_Array_64
(X
: Unsigned_Quadword
) return Bit_Array_64
;
216 type Unsigned_Quadword_Array
is
217 array (Integer range <>) of Unsigned_Quadword
;
219 function To_Address
(X
: Integer) return Address
;
220 pragma Pure_Function
(To_Address
);
222 function To_Address_Long
(X
: Unsigned_Longword
) return Address
;
223 pragma Pure_Function
(To_Address_Long
);
225 function To_Integer
(X
: Address
) return Integer;
227 function To_Unsigned_Longword
(X
: Address
) return Unsigned_Longword
;
228 function To_Unsigned_Longword
(X
: AST_Handler
) return Unsigned_Longword
;
230 -- Conventional names for static subtypes of type UNSIGNED_LONGWORD
232 subtype Unsigned_1
is Unsigned_Longword
range 0 .. 2** 1-1;
233 subtype Unsigned_2
is Unsigned_Longword
range 0 .. 2** 2-1;
234 subtype Unsigned_3
is Unsigned_Longword
range 0 .. 2** 3-1;
235 subtype Unsigned_4
is Unsigned_Longword
range 0 .. 2** 4-1;
236 subtype Unsigned_5
is Unsigned_Longword
range 0 .. 2** 5-1;
237 subtype Unsigned_6
is Unsigned_Longword
range 0 .. 2** 6-1;
238 subtype Unsigned_7
is Unsigned_Longword
range 0 .. 2** 7-1;
239 subtype Unsigned_8
is Unsigned_Longword
range 0 .. 2** 8-1;
240 subtype Unsigned_9
is Unsigned_Longword
range 0 .. 2** 9-1;
241 subtype Unsigned_10
is Unsigned_Longword
range 0 .. 2**10-1;
242 subtype Unsigned_11
is Unsigned_Longword
range 0 .. 2**11-1;
243 subtype Unsigned_12
is Unsigned_Longword
range 0 .. 2**12-1;
244 subtype Unsigned_13
is Unsigned_Longword
range 0 .. 2**13-1;
245 subtype Unsigned_14
is Unsigned_Longword
range 0 .. 2**14-1;
246 subtype Unsigned_15
is Unsigned_Longword
range 0 .. 2**15-1;
247 subtype Unsigned_16
is Unsigned_Longword
range 0 .. 2**16-1;
248 subtype Unsigned_17
is Unsigned_Longword
range 0 .. 2**17-1;
249 subtype Unsigned_18
is Unsigned_Longword
range 0 .. 2**18-1;
250 subtype Unsigned_19
is Unsigned_Longword
range 0 .. 2**19-1;
251 subtype Unsigned_20
is Unsigned_Longword
range 0 .. 2**20-1;
252 subtype Unsigned_21
is Unsigned_Longword
range 0 .. 2**21-1;
253 subtype Unsigned_22
is Unsigned_Longword
range 0 .. 2**22-1;
254 subtype Unsigned_23
is Unsigned_Longword
range 0 .. 2**23-1;
255 subtype Unsigned_24
is Unsigned_Longword
range 0 .. 2**24-1;
256 subtype Unsigned_25
is Unsigned_Longword
range 0 .. 2**25-1;
257 subtype Unsigned_26
is Unsigned_Longword
range 0 .. 2**26-1;
258 subtype Unsigned_27
is Unsigned_Longword
range 0 .. 2**27-1;
259 subtype Unsigned_28
is Unsigned_Longword
range 0 .. 2**28-1;
260 subtype Unsigned_29
is Unsigned_Longword
range 0 .. 2**29-1;
261 subtype Unsigned_30
is Unsigned_Longword
range 0 .. 2**30-1;
262 subtype Unsigned_31
is Unsigned_Longword
range 0 .. 2**31-1;
264 -- Function for obtaining global symbol values
266 function Import_Value
(Symbol
: String) return Unsigned_Longword
;
267 function Import_Address
(Symbol
: String) return Address
;
268 function Import_Largest_Value
(Symbol
: String) return Largest_Integer
;
270 pragma Import
(Intrinsic
, Import_Value
);
271 pragma Import
(Intrinsic
, Import_Address
);
272 pragma Import
(Intrinsic
, Import_Largest_Value
);
274 -- For the following declarations, note that the declaration without a
275 -- Retry_Count parameter means to retry infinitely. A value of zero for
276 -- the Retry_Count parameter means do not retry.
278 -- Interlocked-instruction procedures
280 procedure Clear_Interlocked
281 (Bit
: in out Boolean;
282 Old_Value
: out Boolean);
284 procedure Set_Interlocked
285 (Bit
: in out Boolean;
286 Old_Value
: out Boolean);
288 type Aligned_Word
is record
289 Value
: Short_Integer;
292 for Aligned_Word
'Alignment use Integer'Min (2, Standard
'Maximum_Alignment);
294 procedure Clear_Interlocked
295 (Bit
: in out Boolean;
296 Old_Value
: out Boolean;
297 Retry_Count
: Natural;
298 Success_Flag
: out Boolean);
300 procedure Set_Interlocked
301 (Bit
: in out Boolean;
302 Old_Value
: out Boolean;
303 Retry_Count
: Natural;
304 Success_Flag
: out Boolean);
306 procedure Add_Interlocked
307 (Addend
: Short_Integer;
308 Augend
: in out Aligned_Word
;
311 type Aligned_Integer
is record
315 for Aligned_Integer
'Alignment use
316 Integer'Min (4, Standard
'Maximum_Alignment);
318 type Aligned_Long_Integer
is record
319 Value
: Long_Integer;
322 for Aligned_Long_Integer
'Alignment use
323 Integer'Min (8, Standard
'Maximum_Alignment);
325 -- For the following declarations, note that the declaration without a
326 -- Retry_Count parameter mean to retry infinitely. A value of zero for
327 -- the Retry_Count means do not retry.
330 (To
: in out Aligned_Integer
;
334 (To
: in out Aligned_Integer
;
336 Retry_Count
: Natural;
337 Old_Value
: out Integer;
338 Success_Flag
: out Boolean);
341 (To
: in out Aligned_Long_Integer
;
342 Amount
: Long_Integer);
345 (To
: in out Aligned_Long_Integer
;
346 Amount
: Long_Integer;
347 Retry_Count
: Natural;
348 Old_Value
: out Long_Integer;
349 Success_Flag
: out Boolean);
352 (To
: in out Aligned_Integer
;
356 (To
: in out Aligned_Integer
;
358 Retry_Count
: Natural;
359 Old_Value
: out Integer;
360 Success_Flag
: out Boolean);
363 (To
: in out Aligned_Long_Integer
;
364 From
: Long_Integer);
367 (To
: in out Aligned_Long_Integer
;
369 Retry_Count
: Natural;
370 Old_Value
: out Long_Integer;
371 Success_Flag
: out Boolean);
374 (To
: in out Aligned_Integer
;
378 (To
: in out Aligned_Integer
;
380 Retry_Count
: Natural;
381 Old_Value
: out Integer;
382 Success_Flag
: out Boolean);
385 (To
: in out Aligned_Long_Integer
;
386 From
: Long_Integer);
389 (To
: in out Aligned_Long_Integer
;
391 Retry_Count
: Natural;
392 Old_Value
: out Long_Integer;
393 Success_Flag
: out Boolean);
395 type Insq_Status
is (Fail_No_Lock
, OK_Not_First
, OK_First
);
402 type Remq_Status
is (
417 Status
: out Insq_Status
);
422 Status
: out Remq_Status
);
427 Status
: out Insq_Status
);
432 Status
: out Remq_Status
);
436 Address_Zero
: constant Address
:= Null_Address
;
437 No_Addr
: constant Address
:= Null_Address
;
439 -- An AST_Handler value is from a typing point of view simply a pointer
440 -- to a procedure taking a single 64 bit parameter. However, this
441 -- is a bit misleading, because the data that this pointer references is
442 -- highly stylized. See body of System.AST_Handling for full details.
444 type AST_Handler
is access procedure (Param
: Long_Integer);
445 No_AST_Handler
: constant AST_Handler
:= null;
447 -- Other operators have incorrect profiles. It would be nice to make
448 -- them intrinsic, since the backend can handle them, but the front
449 -- end is not prepared to deal with them, so at least inline them.
451 pragma Inline_Always
("+");
452 pragma Inline_Always
("-");
453 pragma Inline_Always
("not");
454 pragma Inline_Always
("and");
455 pragma Inline_Always
("or");
456 pragma Inline_Always
("xor");
458 -- Other inlined subprograms
460 pragma Inline_Always
(Fetch_From_Address
);
461 pragma Inline_Always
(Assign_To_Address
);
463 -- Synchronization related subprograms. Mechanism is explicitly set
464 -- so that the critical parameters are passed by reference.
465 -- Without this, the parameters are passed by copy, creating load/store
466 -- race conditions. We also inline them, since this seems more in the
467 -- spirit of the original (hardware intrinsic) routines.
469 pragma Export_Procedure
471 External
=> "system__aux_dec__clear_interlocked__1",
472 Parameter_Types
=> (Boolean, Boolean),
473 Mechanism
=> (Reference
, Reference
));
474 pragma Export_Procedure
476 External
=> "system__aux_dec__clear_interlocked__2",
477 Parameter_Types
=> (Boolean, Boolean, Natural, Boolean),
478 Mechanism
=> (Reference
, Reference
, Value
, Reference
));
479 pragma Inline_Always
(Clear_Interlocked
);
481 pragma Export_Procedure
483 External
=> "system__aux_dec__set_interlocked__1",
484 Parameter_Types
=> (Boolean, Boolean),
485 Mechanism
=> (Reference
, Reference
));
486 pragma Export_Procedure
488 External
=> "system__aux_dec__set_interlocked__2",
489 Parameter_Types
=> (Boolean, Boolean, Natural, Boolean),
490 Mechanism
=> (Reference
, Reference
, Value
, Reference
));
491 pragma Inline_Always
(Set_Interlocked
);
493 pragma Export_Procedure
495 External
=> "system__aux_dec__add_interlocked__1",
496 Mechanism
=> (Value
, Reference
, Reference
));
497 pragma Inline_Always
(Add_Interlocked
);
499 pragma Export_Procedure
501 External
=> "system__aux_dec__add_atomic__1",
502 Parameter_Types
=> (Aligned_Integer
, Integer),
503 Mechanism
=> (Reference
, Value
));
504 pragma Export_Procedure
506 External
=> "system__aux_dec__add_atomic__2",
507 Parameter_Types
=> (Aligned_Integer
, Integer, Natural, Integer, Boolean),
508 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
509 pragma Export_Procedure
511 External
=> "system__aux_dec__add_atomic__3",
512 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer),
513 Mechanism
=> (Reference
, Value
));
514 pragma Export_Procedure
516 External
=> "system__aux_dec__add_atomic__4",
517 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer, Natural,
518 Long_Integer, Boolean),
519 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
520 pragma Inline_Always
(Add_Atomic
);
522 pragma Export_Procedure
524 External
=> "system__aux_dec__and_atomic__1",
525 Parameter_Types
=> (Aligned_Integer
, Integer),
526 Mechanism
=> (Reference
, Value
));
527 pragma Export_Procedure
529 External
=> "system__aux_dec__and_atomic__2",
530 Parameter_Types
=> (Aligned_Integer
, Integer, Natural, Integer, Boolean),
531 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
532 pragma Export_Procedure
534 External
=> "system__aux_dec__and_atomic__3",
535 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer),
536 Mechanism
=> (Reference
, Value
));
537 pragma Export_Procedure
539 External
=> "system__aux_dec__and_atomic__4",
540 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer, Natural,
541 Long_Integer, Boolean),
542 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
543 pragma Inline_Always
(And_Atomic
);
545 pragma Export_Procedure
547 External
=> "system__aux_dec__or_atomic__1",
548 Parameter_Types
=> (Aligned_Integer
, Integer),
549 Mechanism
=> (Reference
, Value
));
550 pragma Export_Procedure
552 External
=> "system__aux_dec__or_atomic__2",
553 Parameter_Types
=> (Aligned_Integer
, Integer, Natural, Integer, Boolean),
554 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
555 pragma Export_Procedure
557 External
=> "system__aux_dec__or_atomic__3",
558 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer),
559 Mechanism
=> (Reference
, Value
));
560 pragma Export_Procedure
562 External
=> "system__aux_dec__or_atomic__4",
563 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer, Natural,
564 Long_Integer, Boolean),
565 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
566 pragma Inline_Always
(Or_Atomic
);
568 -- Provide proper unchecked conversion definitions for transfer
569 -- functions. Note that we need this level of indirection because
570 -- the formal parameter name is X and not Source (and this is indeed
571 -- detectable by a program)
573 function To_Unsigned_Byte_A
is new
574 Ada
.Unchecked_Conversion
(Bit_Array_8
, Unsigned_Byte
);
576 function To_Unsigned_Byte
(X
: Bit_Array_8
) return Unsigned_Byte
577 renames To_Unsigned_Byte_A
;
579 function To_Bit_Array_8_A
is new
580 Ada
.Unchecked_Conversion
(Unsigned_Byte
, Bit_Array_8
);
582 function To_Bit_Array_8
(X
: Unsigned_Byte
) return Bit_Array_8
583 renames To_Bit_Array_8_A
;
585 function To_Unsigned_Word_A
is new
586 Ada
.Unchecked_Conversion
(Bit_Array_16
, Unsigned_Word
);
588 function To_Unsigned_Word
(X
: Bit_Array_16
) return Unsigned_Word
589 renames To_Unsigned_Word_A
;
591 function To_Bit_Array_16_A
is new
592 Ada
.Unchecked_Conversion
(Unsigned_Word
, Bit_Array_16
);
594 function To_Bit_Array_16
(X
: Unsigned_Word
) return Bit_Array_16
595 renames To_Bit_Array_16_A
;
597 function To_Unsigned_Longword_A
is new
598 Ada
.Unchecked_Conversion
(Bit_Array_32
, Unsigned_Longword
);
600 function To_Unsigned_Longword
(X
: Bit_Array_32
) return Unsigned_Longword
601 renames To_Unsigned_Longword_A
;
603 function To_Bit_Array_32_A
is new
604 Ada
.Unchecked_Conversion
(Unsigned_Longword
, Bit_Array_32
);
606 function To_Bit_Array_32
(X
: Unsigned_Longword
) return Bit_Array_32
607 renames To_Bit_Array_32_A
;
609 function To_Unsigned_32_A
is new
610 Ada
.Unchecked_Conversion
(Bit_Array_32
, Unsigned_32
);
612 function To_Unsigned_32
(X
: Bit_Array_32
) return Unsigned_32
613 renames To_Unsigned_32_A
;
615 function To_Bit_Array_32_A
is new
616 Ada
.Unchecked_Conversion
(Unsigned_32
, Bit_Array_32
);
618 function To_Bit_Array_32
(X
: Unsigned_32
) return Bit_Array_32
619 renames To_Bit_Array_32_A
;
621 function To_Unsigned_Quadword_A
is new
622 Ada
.Unchecked_Conversion
(Bit_Array_64
, Unsigned_Quadword
);
624 function To_Unsigned_Quadword
(X
: Bit_Array_64
) return Unsigned_Quadword
625 renames To_Unsigned_Quadword_A
;
627 function To_Bit_Array_64_A
is new
628 Ada
.Unchecked_Conversion
(Unsigned_Quadword
, Bit_Array_64
);
630 function To_Bit_Array_64
(X
: Unsigned_Quadword
) return Bit_Array_64
631 renames To_Bit_Array_64_A
;
633 pragma Warnings
(Off
);
634 -- Turn warnings off. This is needed for systems with 64-bit integers,
635 -- where some of these operations are of dubious meaning, but we do not
636 -- want warnings when we compile on such systems.
638 function To_Address_A
is new
639 Ada
.Unchecked_Conversion
(Integer, Address
);
640 pragma Pure_Function
(To_Address_A
);
642 function To_Address
(X
: Integer) return Address
643 renames To_Address_A
;
644 pragma Pure_Function
(To_Address
);
646 function To_Address_Long_A
is new
647 Ada
.Unchecked_Conversion
(Unsigned_Longword
, Address
);
648 pragma Pure_Function
(To_Address_Long_A
);
650 function To_Address_Long
(X
: Unsigned_Longword
) return Address
651 renames To_Address_Long_A
;
652 pragma Pure_Function
(To_Address_Long
);
654 function To_Integer_A
is new
655 Ada
.Unchecked_Conversion
(Address
, Integer);
657 function To_Integer
(X
: Address
) return Integer
658 renames To_Integer_A
;
660 function To_Unsigned_Longword_A
is new
661 Ada
.Unchecked_Conversion
(Address
, Unsigned_Longword
);
663 function To_Unsigned_Longword
(X
: Address
) return Unsigned_Longword
664 renames To_Unsigned_Longword_A
;
666 function To_Unsigned_Longword_A
is new
667 Ada
.Unchecked_Conversion
(AST_Handler
, Unsigned_Longword
);
669 function To_Unsigned_Longword
(X
: AST_Handler
) return Unsigned_Longword
670 renames To_Unsigned_Longword_A
;
672 pragma Warnings
(On
);