1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
5 -- S Y S T E M . A U X _ D E C --
9 -- Copyright (C) 1996-2023, 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 -- For compatibility with systems having short and long addresses
46 type Integer_8
is range -2 ** (8 - 1) .. +2 ** (8 - 1) - 1;
47 for Integer_8
'Size use 8;
49 type Integer_16
is range -2 ** (16 - 1) .. +2 ** (16 - 1) - 1;
50 for Integer_16
'Size use 16;
52 type Integer_32
is range -2 ** (32 - 1) .. +2 ** (32 - 1) - 1;
53 for Integer_32
'Size use 32;
55 type Integer_64
is range -2 ** (64 - 1) .. +2 ** (64 - 1) - 1;
56 for Integer_64
'Size use 64;
58 type Integer_8_Array
is array (Integer range <>) of Integer_8
;
59 type Integer_16_Array
is array (Integer range <>) of Integer_16
;
60 type Integer_32_Array
is array (Integer range <>) of Integer_32
;
61 type Integer_64_Array
is array (Integer range <>) of Integer_64
;
62 -- These array types are not in all versions of DEC System, and in fact it
63 -- is not quite clear why they are in some and not others, but since they
64 -- definitely appear in some versions, we include them unconditionally.
66 type Largest_Integer
is range Min_Int
.. Max_Int
;
68 type AST_Handler
is private;
70 No_AST_Handler
: constant AST_Handler
;
73 (Type_Class_Enumeration
,
75 Type_Class_Fixed_Point
,
76 Type_Class_Floating_Point
,
80 Type_Class_Task
, -- also in Ada 95 protected
83 function "not" (Left
: Largest_Integer
) return Largest_Integer
;
84 function "and" (Left
, Right
: Largest_Integer
) return Largest_Integer
;
85 function "or" (Left
, Right
: Largest_Integer
) return Largest_Integer
;
86 function "xor" (Left
, Right
: Largest_Integer
) return Largest_Integer
;
88 Address_Zero
: constant Address
;
89 No_Addr
: constant Address
;
90 Address_Size
: constant := Standard
'Address_Size;
91 Short_Address_Size
: constant := Standard
'Address_Size;
93 function "+" (Left
: Address
; Right
: Integer) return Address
;
94 function "+" (Left
: Integer; Right
: Address
) return Address
;
95 function "-" (Left
: Address
; Right
: Address
) return Integer;
96 function "-" (Left
: Address
; Right
: Integer) return Address
;
99 type Target
is private;
100 function Fetch_From_Address
(A
: Address
) return Target
;
103 type Target
is private;
104 procedure Assign_To_Address
(A
: Address
; T
: Target
);
106 -- Floating point type declarations for VAX floating point data types
108 type F_Float
is digits 6;
109 type D_Float
is digits 9;
110 type G_Float
is digits 15;
111 -- We provide the type names, but these will be IEEE format, not VAX format
113 -- Floating point type declarations for IEEE floating point data types
115 type IEEE_Single_Float
is digits 6;
116 type IEEE_Double_Float
is digits 15;
118 Non_Ada_Error
: exception;
120 -- Hardware-oriented types and functions
122 type Bit_Array
is array (Integer range <>) of Boolean;
123 pragma Pack
(Bit_Array
);
125 subtype Bit_Array_8
is Bit_Array
(0 .. 7);
126 subtype Bit_Array_16
is Bit_Array
(0 .. 15);
127 subtype Bit_Array_32
is Bit_Array
(0 .. 31);
128 subtype Bit_Array_64
is Bit_Array
(0 .. 63);
130 type Unsigned_Byte
is range 0 .. 255;
131 for Unsigned_Byte
'Size use 8;
133 function "not" (Left
: Unsigned_Byte
) return Unsigned_Byte
;
134 function "and" (Left
, Right
: Unsigned_Byte
) return Unsigned_Byte
;
135 function "or" (Left
, Right
: Unsigned_Byte
) return Unsigned_Byte
;
136 function "xor" (Left
, Right
: Unsigned_Byte
) return Unsigned_Byte
;
138 function To_Unsigned_Byte
(X
: Bit_Array_8
) return Unsigned_Byte
;
139 function To_Bit_Array_8
(X
: Unsigned_Byte
) return Bit_Array_8
;
141 type Unsigned_Byte_Array
is array (Integer range <>) of Unsigned_Byte
;
143 type Unsigned_Word
is range 0 .. 65535;
144 for Unsigned_Word
'Size use 16;
146 function "not" (Left
: Unsigned_Word
) return Unsigned_Word
;
147 function "and" (Left
, Right
: Unsigned_Word
) return Unsigned_Word
;
148 function "or" (Left
, Right
: Unsigned_Word
) return Unsigned_Word
;
149 function "xor" (Left
, Right
: Unsigned_Word
) return Unsigned_Word
;
151 function To_Unsigned_Word
(X
: Bit_Array_16
) return Unsigned_Word
;
152 function To_Bit_Array_16
(X
: Unsigned_Word
) return Bit_Array_16
;
154 type Unsigned_Word_Array
is array (Integer range <>) of Unsigned_Word
;
156 type Unsigned_Longword
is range -2_147_483_648
.. 2_147_483_647
;
157 for Unsigned_Longword
'Size use 32;
159 function "not" (Left
: Unsigned_Longword
) return Unsigned_Longword
;
160 function "and" (Left
, Right
: Unsigned_Longword
) return Unsigned_Longword
;
161 function "or" (Left
, Right
: Unsigned_Longword
) return Unsigned_Longword
;
162 function "xor" (Left
, Right
: Unsigned_Longword
) return Unsigned_Longword
;
164 function To_Unsigned_Longword
(X
: Bit_Array_32
) return Unsigned_Longword
;
165 function To_Bit_Array_32
(X
: Unsigned_Longword
) return Bit_Array_32
;
167 type Unsigned_Longword_Array
is
168 array (Integer range <>) of Unsigned_Longword
;
170 type Unsigned_32
is range 0 .. 4_294_967_295
;
171 for Unsigned_32
'Size use 32;
173 function "not" (Left
: Unsigned_32
) return Unsigned_32
;
174 function "and" (Left
, Right
: Unsigned_32
) return Unsigned_32
;
175 function "or" (Left
, Right
: Unsigned_32
) return Unsigned_32
;
176 function "xor" (Left
, Right
: Unsigned_32
) return Unsigned_32
;
178 function To_Unsigned_32
(X
: Bit_Array_32
) return Unsigned_32
;
179 function To_Bit_Array_32
(X
: Unsigned_32
) return Bit_Array_32
;
181 type Unsigned_Quadword
is record
182 L0
: Unsigned_Longword
;
183 L1
: Unsigned_Longword
;
186 for Unsigned_Quadword
'Size use 64;
187 for Unsigned_Quadword
'Alignment use
188 Integer'Min (8, Standard
'Maximum_Alignment);
190 function "not" (Left
: Unsigned_Quadword
) return Unsigned_Quadword
;
191 function "and" (Left
, Right
: Unsigned_Quadword
) return Unsigned_Quadword
;
192 function "or" (Left
, Right
: Unsigned_Quadword
) return Unsigned_Quadword
;
193 function "xor" (Left
, Right
: Unsigned_Quadword
) return Unsigned_Quadword
;
195 function To_Unsigned_Quadword
(X
: Bit_Array_64
) return Unsigned_Quadword
;
196 function To_Bit_Array_64
(X
: Unsigned_Quadword
) return Bit_Array_64
;
198 type Unsigned_Quadword_Array
is
199 array (Integer range <>) of Unsigned_Quadword
;
201 subtype Address_Int
is Integer;
203 function To_Address
(X
: Integer) return Address
;
204 pragma Pure_Function
(To_Address
);
206 function To_Address_Long
(X
: Unsigned_Longword
) return Address
;
207 pragma Pure_Function
(To_Address_Long
);
209 function To_Integer
(X
: Address
) return Integer;
211 function To_Unsigned_Longword
(X
: Address
) return Unsigned_Longword
;
212 function To_Unsigned_Longword
(X
: AST_Handler
) return Unsigned_Longword
;
214 -- Conventional names for static subtypes of type UNSIGNED_LONGWORD
216 subtype Unsigned_1
is Unsigned_Longword
range 0 .. 2** 1 - 1;
217 subtype Unsigned_2
is Unsigned_Longword
range 0 .. 2** 2 - 1;
218 subtype Unsigned_3
is Unsigned_Longword
range 0 .. 2** 3 - 1;
219 subtype Unsigned_4
is Unsigned_Longword
range 0 .. 2** 4 - 1;
220 subtype Unsigned_5
is Unsigned_Longword
range 0 .. 2** 5 - 1;
221 subtype Unsigned_6
is Unsigned_Longword
range 0 .. 2** 6 - 1;
222 subtype Unsigned_7
is Unsigned_Longword
range 0 .. 2** 7 - 1;
223 subtype Unsigned_8
is Unsigned_Longword
range 0 .. 2** 8 - 1;
224 subtype Unsigned_9
is Unsigned_Longword
range 0 .. 2** 9 - 1;
225 subtype Unsigned_10
is Unsigned_Longword
range 0 .. 2**10 - 1;
226 subtype Unsigned_11
is Unsigned_Longword
range 0 .. 2**11 - 1;
227 subtype Unsigned_12
is Unsigned_Longword
range 0 .. 2**12 - 1;
228 subtype Unsigned_13
is Unsigned_Longword
range 0 .. 2**13 - 1;
229 subtype Unsigned_14
is Unsigned_Longword
range 0 .. 2**14 - 1;
230 subtype Unsigned_15
is Unsigned_Longword
range 0 .. 2**15 - 1;
231 subtype Unsigned_16
is Unsigned_Longword
range 0 .. 2**16 - 1;
232 subtype Unsigned_17
is Unsigned_Longword
range 0 .. 2**17 - 1;
233 subtype Unsigned_18
is Unsigned_Longword
range 0 .. 2**18 - 1;
234 subtype Unsigned_19
is Unsigned_Longword
range 0 .. 2**19 - 1;
235 subtype Unsigned_20
is Unsigned_Longword
range 0 .. 2**20 - 1;
236 subtype Unsigned_21
is Unsigned_Longword
range 0 .. 2**21 - 1;
237 subtype Unsigned_22
is Unsigned_Longword
range 0 .. 2**22 - 1;
238 subtype Unsigned_23
is Unsigned_Longword
range 0 .. 2**23 - 1;
239 subtype Unsigned_24
is Unsigned_Longword
range 0 .. 2**24 - 1;
240 subtype Unsigned_25
is Unsigned_Longword
range 0 .. 2**25 - 1;
241 subtype Unsigned_26
is Unsigned_Longword
range 0 .. 2**26 - 1;
242 subtype Unsigned_27
is Unsigned_Longword
range 0 .. 2**27 - 1;
243 subtype Unsigned_28
is Unsigned_Longword
range 0 .. 2**28 - 1;
244 subtype Unsigned_29
is Unsigned_Longword
range 0 .. 2**29 - 1;
245 subtype Unsigned_30
is Unsigned_Longword
range 0 .. 2**30 - 1;
246 subtype Unsigned_31
is Unsigned_Longword
range 0 .. 2**31 - 1;
248 -- Function for obtaining global symbol values
250 function Import_Value
(Symbol
: String) return Unsigned_Longword
;
251 function Import_Address
(Symbol
: String) return Address
;
252 function Import_Largest_Value
(Symbol
: String) return Largest_Integer
;
254 pragma Import
(Intrinsic
, Import_Value
);
255 pragma Import
(Intrinsic
, Import_Address
);
256 pragma Import
(Intrinsic
, Import_Largest_Value
);
258 -- For the following declarations, note that the declaration without a
259 -- Retry_Count parameter means to retry infinitely. A value of zero for
260 -- the Retry_Count parameter means do not retry.
262 -- Interlocked-instruction procedures
264 procedure Clear_Interlocked
265 (Bit
: in out Boolean;
266 Old_Value
: out Boolean);
268 procedure Set_Interlocked
269 (Bit
: in out Boolean;
270 Old_Value
: out Boolean);
272 type Aligned_Word
is record
273 Value
: Short_Integer;
276 for Aligned_Word
'Alignment use Integer'Min (2, Standard
'Maximum_Alignment);
278 procedure Clear_Interlocked
279 (Bit
: in out Boolean;
280 Old_Value
: out Boolean;
281 Retry_Count
: Natural;
282 Success_Flag
: out Boolean);
284 procedure Set_Interlocked
285 (Bit
: in out Boolean;
286 Old_Value
: out Boolean;
287 Retry_Count
: Natural;
288 Success_Flag
: out Boolean);
290 procedure Add_Interlocked
291 (Addend
: Short_Integer;
292 Augend
: in out Aligned_Word
;
295 type Aligned_Integer
is record
299 for Aligned_Integer
'Alignment use
300 Integer'Min (4, Standard
'Maximum_Alignment);
302 type Aligned_Long_Integer
is record
303 Value
: Long_Integer;
306 for Aligned_Long_Integer
'Alignment use
307 Integer'Min (8, Standard
'Maximum_Alignment);
309 -- For the following declarations, note that the declaration without a
310 -- Retry_Count parameter mean to retry infinitely. A value of zero for
311 -- the Retry_Count means do not retry.
314 (To
: in out Aligned_Integer
;
318 (To
: in out Aligned_Integer
;
320 Retry_Count
: Natural;
321 Old_Value
: out Integer;
322 Success_Flag
: out Boolean);
325 (To
: in out Aligned_Long_Integer
;
326 Amount
: Long_Integer);
329 (To
: in out Aligned_Long_Integer
;
330 Amount
: Long_Integer;
331 Retry_Count
: Natural;
332 Old_Value
: out Long_Integer;
333 Success_Flag
: out Boolean);
336 (To
: in out Aligned_Integer
;
340 (To
: in out Aligned_Integer
;
342 Retry_Count
: Natural;
343 Old_Value
: out Integer;
344 Success_Flag
: out Boolean);
347 (To
: in out Aligned_Long_Integer
;
348 From
: Long_Integer);
351 (To
: in out Aligned_Long_Integer
;
353 Retry_Count
: Natural;
354 Old_Value
: out Long_Integer;
355 Success_Flag
: out Boolean);
358 (To
: in out Aligned_Integer
;
362 (To
: in out Aligned_Integer
;
364 Retry_Count
: Natural;
365 Old_Value
: out Integer;
366 Success_Flag
: out Boolean);
369 (To
: in out Aligned_Long_Integer
;
370 From
: Long_Integer);
373 (To
: in out Aligned_Long_Integer
;
375 Retry_Count
: Natural;
376 Old_Value
: out Long_Integer;
377 Success_Flag
: out Boolean);
379 type Insq_Status
is (Fail_No_Lock
, OK_Not_First
, OK_First
);
386 type Remq_Status
is (
401 Status
: out Insq_Status
);
406 Status
: out Remq_Status
);
411 Status
: out Insq_Status
);
416 Status
: out Remq_Status
);
420 Address_Zero
: constant Address
:= Null_Address
;
421 No_Addr
: constant Address
:= Null_Address
;
423 -- An AST_Handler value is from a typing point of view simply a pointer
424 -- to a procedure taking a single 64 bit parameter. However, this
425 -- is a bit misleading, because the data that this pointer references is
426 -- highly stylized. See body of System.AST_Handling for full details.
428 type AST_Handler
is access procedure (Param
: Long_Integer);
429 No_AST_Handler
: constant AST_Handler
:= null;
431 -- Other operators have incorrect profiles. It would be nice to make
432 -- them intrinsic, since the backend can handle them, but the front
433 -- end is not prepared to deal with them, so at least inline them.
435 pragma Inline_Always
("+");
436 pragma Inline_Always
("-");
437 pragma Inline_Always
("not");
438 pragma Inline_Always
("and");
439 pragma Inline_Always
("or");
440 pragma Inline_Always
("xor");
442 -- Other inlined subprograms
444 pragma Inline_Always
(Fetch_From_Address
);
445 pragma Inline_Always
(Assign_To_Address
);
447 -- Synchronization related subprograms. Mechanism is explicitly set
448 -- so that the critical parameters are passed by reference.
449 -- Without this, the parameters are passed by copy, creating load/store
450 -- race conditions. We also inline them, since this seems more in the
451 -- spirit of the original (hardware intrinsic) routines.
453 pragma Export_Procedure
455 External
=> "system__aux_dec__clear_interlocked__1",
456 Parameter_Types
=> (Boolean, Boolean),
457 Mechanism
=> (Reference
, Reference
));
458 pragma Export_Procedure
460 External
=> "system__aux_dec__clear_interlocked__2",
461 Parameter_Types
=> (Boolean, Boolean, Natural, Boolean),
462 Mechanism
=> (Reference
, Reference
, Value
, Reference
));
463 pragma Inline_Always
(Clear_Interlocked
);
465 pragma Export_Procedure
467 External
=> "system__aux_dec__set_interlocked__1",
468 Parameter_Types
=> (Boolean, Boolean),
469 Mechanism
=> (Reference
, Reference
));
470 pragma Export_Procedure
472 External
=> "system__aux_dec__set_interlocked__2",
473 Parameter_Types
=> (Boolean, Boolean, Natural, Boolean),
474 Mechanism
=> (Reference
, Reference
, Value
, Reference
));
475 pragma Inline_Always
(Set_Interlocked
);
477 pragma Export_Procedure
479 External
=> "system__aux_dec__add_interlocked__1",
480 Mechanism
=> (Value
, Reference
, Reference
));
481 pragma Inline_Always
(Add_Interlocked
);
483 pragma Export_Procedure
485 External
=> "system__aux_dec__add_atomic__1",
486 Parameter_Types
=> (Aligned_Integer
, Integer),
487 Mechanism
=> (Reference
, Value
));
488 pragma Export_Procedure
490 External
=> "system__aux_dec__add_atomic__2",
491 Parameter_Types
=> (Aligned_Integer
, Integer, Natural, Integer, Boolean),
492 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
493 pragma Export_Procedure
495 External
=> "system__aux_dec__add_atomic__3",
496 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer),
497 Mechanism
=> (Reference
, Value
));
498 pragma Export_Procedure
500 External
=> "system__aux_dec__add_atomic__4",
501 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer, Natural,
502 Long_Integer, Boolean),
503 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
504 pragma Inline_Always
(Add_Atomic
);
506 pragma Export_Procedure
508 External
=> "system__aux_dec__and_atomic__1",
509 Parameter_Types
=> (Aligned_Integer
, Integer),
510 Mechanism
=> (Reference
, Value
));
511 pragma Export_Procedure
513 External
=> "system__aux_dec__and_atomic__2",
514 Parameter_Types
=> (Aligned_Integer
, Integer, Natural, Integer, Boolean),
515 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
516 pragma Export_Procedure
518 External
=> "system__aux_dec__and_atomic__3",
519 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer),
520 Mechanism
=> (Reference
, Value
));
521 pragma Export_Procedure
523 External
=> "system__aux_dec__and_atomic__4",
524 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer, Natural,
525 Long_Integer, Boolean),
526 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
527 pragma Inline_Always
(And_Atomic
);
529 pragma Export_Procedure
531 External
=> "system__aux_dec__or_atomic__1",
532 Parameter_Types
=> (Aligned_Integer
, Integer),
533 Mechanism
=> (Reference
, Value
));
534 pragma Export_Procedure
536 External
=> "system__aux_dec__or_atomic__2",
537 Parameter_Types
=> (Aligned_Integer
, Integer, Natural, Integer, Boolean),
538 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
539 pragma Export_Procedure
541 External
=> "system__aux_dec__or_atomic__3",
542 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer),
543 Mechanism
=> (Reference
, Value
));
544 pragma Export_Procedure
546 External
=> "system__aux_dec__or_atomic__4",
547 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer, Natural,
548 Long_Integer, Boolean),
549 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
550 pragma Inline_Always
(Or_Atomic
);
552 -- Provide proper unchecked conversion definitions for transfer
553 -- functions. Note that we need this level of indirection because
554 -- the formal parameter name is X and not Source (and this is indeed
555 -- detectable by a program)
557 function To_Unsigned_Byte_A
is new
558 Ada
.Unchecked_Conversion
(Bit_Array_8
, Unsigned_Byte
);
560 function To_Unsigned_Byte
(X
: Bit_Array_8
) return Unsigned_Byte
561 renames To_Unsigned_Byte_A
;
563 function To_Bit_Array_8_A
is new
564 Ada
.Unchecked_Conversion
(Unsigned_Byte
, Bit_Array_8
);
566 function To_Bit_Array_8
(X
: Unsigned_Byte
) return Bit_Array_8
567 renames To_Bit_Array_8_A
;
569 function To_Unsigned_Word_A
is new
570 Ada
.Unchecked_Conversion
(Bit_Array_16
, Unsigned_Word
);
572 function To_Unsigned_Word
(X
: Bit_Array_16
) return Unsigned_Word
573 renames To_Unsigned_Word_A
;
575 function To_Bit_Array_16_A
is new
576 Ada
.Unchecked_Conversion
(Unsigned_Word
, Bit_Array_16
);
578 function To_Bit_Array_16
(X
: Unsigned_Word
) return Bit_Array_16
579 renames To_Bit_Array_16_A
;
581 function To_Unsigned_Longword_A
is new
582 Ada
.Unchecked_Conversion
(Bit_Array_32
, Unsigned_Longword
);
584 function To_Unsigned_Longword
(X
: Bit_Array_32
) return Unsigned_Longword
585 renames To_Unsigned_Longword_A
;
587 function To_Bit_Array_32_A
is new
588 Ada
.Unchecked_Conversion
(Unsigned_Longword
, Bit_Array_32
);
590 function To_Bit_Array_32
(X
: Unsigned_Longword
) return Bit_Array_32
591 renames To_Bit_Array_32_A
;
593 function To_Unsigned_32_A
is new
594 Ada
.Unchecked_Conversion
(Bit_Array_32
, Unsigned_32
);
596 function To_Unsigned_32
(X
: Bit_Array_32
) return Unsigned_32
597 renames To_Unsigned_32_A
;
599 function To_Bit_Array_32_A
is new
600 Ada
.Unchecked_Conversion
(Unsigned_32
, Bit_Array_32
);
602 function To_Bit_Array_32
(X
: Unsigned_32
) return Bit_Array_32
603 renames To_Bit_Array_32_A
;
605 function To_Unsigned_Quadword_A
is new
606 Ada
.Unchecked_Conversion
(Bit_Array_64
, Unsigned_Quadword
);
608 function To_Unsigned_Quadword
(X
: Bit_Array_64
) return Unsigned_Quadword
609 renames To_Unsigned_Quadword_A
;
611 function To_Bit_Array_64_A
is new
612 Ada
.Unchecked_Conversion
(Unsigned_Quadword
, Bit_Array_64
);
614 function To_Bit_Array_64
(X
: Unsigned_Quadword
) return Bit_Array_64
615 renames To_Bit_Array_64_A
;
617 pragma Warnings
(Off
);
618 -- Turn warnings off. This is needed for systems with 64-bit integers,
619 -- where some of these operations are of dubious meaning, but we do not
620 -- want warnings when we compile on such systems.
622 function To_Address_A
is new
623 Ada
.Unchecked_Conversion
(Integer, Address
);
624 pragma Pure_Function
(To_Address_A
);
626 function To_Address
(X
: Integer) return Address
627 renames To_Address_A
;
628 pragma Pure_Function
(To_Address
);
630 function To_Address_Long_A
is new
631 Ada
.Unchecked_Conversion
(Unsigned_Longword
, Address
);
632 pragma Pure_Function
(To_Address_Long_A
);
634 function To_Address_Long
(X
: Unsigned_Longword
) return Address
635 renames To_Address_Long_A
;
636 pragma Pure_Function
(To_Address_Long
);
638 function To_Integer_A
is new
639 Ada
.Unchecked_Conversion
(Address
, Integer);
641 function To_Integer
(X
: Address
) return Integer
642 renames To_Integer_A
;
644 function To_Unsigned_Longword_A
is new
645 Ada
.Unchecked_Conversion
(Address
, Unsigned_Longword
);
647 function To_Unsigned_Longword
(X
: Address
) return Unsigned_Longword
648 renames To_Unsigned_Longword_A
;
650 function To_Unsigned_Longword_A
is new
651 Ada
.Unchecked_Conversion
(AST_Handler
, Unsigned_Longword
);
653 function To_Unsigned_Longword
(X
: AST_Handler
) return Unsigned_Longword
654 renames To_Unsigned_Longword_A
;
656 pragma Warnings
(On
);