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 with Ada
.Unchecked_Conversion
;
42 package System
.Aux_DEC
is
45 subtype Short_Address
is Address
;
46 -- In some versions of System.Aux_DEC, notably that for VMS on the
47 -- ia64, there are two address types (64-bit and 32-bit), and the
48 -- name Short_Address is used for the short address form. To avoid
49 -- difficulties (in regression tests and elsewhere) with units that
50 -- reference Short_Address, it is provided for other targets as a
51 -- synonym for the normal Address type, and, as in the case where
52 -- the lengths are different, Address and Short_Address can be
53 -- freely inter-converted.
55 type Integer_8
is range -2 ** (8 - 1) .. +2 ** (8 - 1) - 1;
56 for Integer_8
'Size use 8;
58 type Integer_16
is range -2 ** (16 - 1) .. +2 ** (16 - 1) - 1;
59 for Integer_16
'Size use 16;
61 type Integer_32
is range -2 ** (32 - 1) .. +2 ** (32 - 1) - 1;
62 for Integer_32
'Size use 32;
64 type Integer_64
is range -2 ** (64 - 1) .. +2 ** (64 - 1) - 1;
65 for Integer_64
'Size use 64;
67 type Largest_Integer
is range Min_Int
.. Max_Int
;
69 type AST_Handler
is private;
71 No_AST_Handler
: constant AST_Handler
;
74 (Type_Class_Enumeration
,
76 Type_Class_Fixed_Point
,
77 Type_Class_Floating_Point
,
81 Type_Class_Task
, -- also in Ada 95 protected
84 function "not" (Left
: Largest_Integer
) return Largest_Integer
;
85 function "and" (Left
, Right
: Largest_Integer
) return Largest_Integer
;
86 function "or" (Left
, Right
: Largest_Integer
) return Largest_Integer
;
87 function "xor" (Left
, Right
: Largest_Integer
) return Largest_Integer
;
89 Address_Zero
: constant Address
;
90 No_Addr
: constant Address
;
91 Address_Size
: constant := Standard
'Address_Size;
92 Short_Address_Size
: constant := Standard
'Address_Size;
94 function "+" (Left
: Address
; Right
: Integer) return Address
;
95 function "+" (Left
: Integer; Right
: Address
) return Address
;
96 function "-" (Left
: Address
; Right
: Address
) return Integer;
97 function "-" (Left
: Address
; Right
: Integer) return Address
;
100 type Target
is private;
101 function Fetch_From_Address
(A
: Address
) return Target
;
104 type Target
is private;
105 procedure Assign_To_Address
(A
: Address
; T
: Target
);
107 -- Floating point type declarations for VAX floating point data types
109 pragma Warnings
(Off
);
111 type F_Float
is digits 6;
112 pragma Float_Representation
(VAX_Float
, F_Float
);
114 type D_Float
is digits 9;
115 pragma Float_Representation
(Vax_Float
, D_Float
);
117 type G_Float
is digits 15;
118 pragma Float_Representation
(Vax_Float
, G_Float
);
120 -- Floating point type declarations for IEEE floating point data types
122 type IEEE_Single_Float
is digits 6;
123 pragma Float_Representation
(IEEE_Float
, IEEE_Single_Float
);
125 type IEEE_Double_Float
is digits 15;
126 pragma Float_Representation
(IEEE_Float
, IEEE_Double_Float
);
128 pragma Warnings
(On
);
130 Non_Ada_Error
: exception;
132 -- Hardware-oriented types and functions
134 type Bit_Array
is array (Integer range <>) of Boolean;
135 pragma Pack
(Bit_Array
);
137 subtype Bit_Array_8
is Bit_Array
(0 .. 7);
138 subtype Bit_Array_16
is Bit_Array
(0 .. 15);
139 subtype Bit_Array_32
is Bit_Array
(0 .. 31);
140 subtype Bit_Array_64
is Bit_Array
(0 .. 63);
142 type Unsigned_Byte
is range 0 .. 255;
143 for Unsigned_Byte
'Size use 8;
145 function "not" (Left
: Unsigned_Byte
) return Unsigned_Byte
;
146 function "and" (Left
, Right
: Unsigned_Byte
) return Unsigned_Byte
;
147 function "or" (Left
, Right
: Unsigned_Byte
) return Unsigned_Byte
;
148 function "xor" (Left
, Right
: Unsigned_Byte
) return Unsigned_Byte
;
150 function To_Unsigned_Byte
(X
: Bit_Array_8
) return Unsigned_Byte
;
151 function To_Bit_Array_8
(X
: Unsigned_Byte
) return Bit_Array_8
;
153 type Unsigned_Byte_Array
is array (Integer range <>) of Unsigned_Byte
;
155 type Unsigned_Word
is range 0 .. 65535;
156 for Unsigned_Word
'Size use 16;
158 function "not" (Left
: Unsigned_Word
) return Unsigned_Word
;
159 function "and" (Left
, Right
: Unsigned_Word
) return Unsigned_Word
;
160 function "or" (Left
, Right
: Unsigned_Word
) return Unsigned_Word
;
161 function "xor" (Left
, Right
: Unsigned_Word
) return Unsigned_Word
;
163 function To_Unsigned_Word
(X
: Bit_Array_16
) return Unsigned_Word
;
164 function To_Bit_Array_16
(X
: Unsigned_Word
) return Bit_Array_16
;
166 type Unsigned_Word_Array
is array (Integer range <>) of Unsigned_Word
;
168 type Unsigned_Longword
is range -2_147_483_648
.. 2_147_483_647
;
169 for Unsigned_Longword
'Size use 32;
171 function "not" (Left
: Unsigned_Longword
) return Unsigned_Longword
;
172 function "and" (Left
, Right
: Unsigned_Longword
) return Unsigned_Longword
;
173 function "or" (Left
, Right
: Unsigned_Longword
) return Unsigned_Longword
;
174 function "xor" (Left
, Right
: Unsigned_Longword
) return Unsigned_Longword
;
176 function To_Unsigned_Longword
(X
: Bit_Array_32
) return Unsigned_Longword
;
177 function To_Bit_Array_32
(X
: Unsigned_Longword
) return Bit_Array_32
;
179 type Unsigned_Longword_Array
is
180 array (Integer range <>) of Unsigned_Longword
;
182 type Unsigned_32
is range 0 .. 4_294_967_295
;
183 for Unsigned_32
'Size use 32;
185 function "not" (Left
: Unsigned_32
) return Unsigned_32
;
186 function "and" (Left
, Right
: Unsigned_32
) return Unsigned_32
;
187 function "or" (Left
, Right
: Unsigned_32
) return Unsigned_32
;
188 function "xor" (Left
, Right
: Unsigned_32
) return Unsigned_32
;
190 function To_Unsigned_32
(X
: Bit_Array_32
) return Unsigned_32
;
191 function To_Bit_Array_32
(X
: Unsigned_32
) return Bit_Array_32
;
193 type Unsigned_Quadword
is record
194 L0
: Unsigned_Longword
;
195 L1
: Unsigned_Longword
;
198 for Unsigned_Quadword
'Size use 64;
199 for Unsigned_Quadword
'Alignment use
200 Integer'Min (8, Standard
'Maximum_Alignment);
202 function "not" (Left
: Unsigned_Quadword
) return Unsigned_Quadword
;
203 function "and" (Left
, Right
: Unsigned_Quadword
) return Unsigned_Quadword
;
204 function "or" (Left
, Right
: Unsigned_Quadword
) return Unsigned_Quadword
;
205 function "xor" (Left
, Right
: Unsigned_Quadword
) return Unsigned_Quadword
;
207 function To_Unsigned_Quadword
(X
: Bit_Array_64
) return Unsigned_Quadword
;
208 function To_Bit_Array_64
(X
: Unsigned_Quadword
) return Bit_Array_64
;
210 type Unsigned_Quadword_Array
is
211 array (Integer range <>) of Unsigned_Quadword
;
213 function To_Address
(X
: Integer) return Address
;
214 pragma Pure_Function
(To_Address
);
216 function To_Address_Long
(X
: Unsigned_Longword
) return Address
;
217 pragma Pure_Function
(To_Address_Long
);
219 function To_Integer
(X
: Address
) return Integer;
221 function To_Unsigned_Longword
(X
: Address
) return Unsigned_Longword
;
222 function To_Unsigned_Longword
(X
: AST_Handler
) return Unsigned_Longword
;
224 -- Conventional names for static subtypes of type UNSIGNED_LONGWORD
226 subtype Unsigned_1
is Unsigned_Longword
range 0 .. 2** 1-1;
227 subtype Unsigned_2
is Unsigned_Longword
range 0 .. 2** 2-1;
228 subtype Unsigned_3
is Unsigned_Longword
range 0 .. 2** 3-1;
229 subtype Unsigned_4
is Unsigned_Longword
range 0 .. 2** 4-1;
230 subtype Unsigned_5
is Unsigned_Longword
range 0 .. 2** 5-1;
231 subtype Unsigned_6
is Unsigned_Longword
range 0 .. 2** 6-1;
232 subtype Unsigned_7
is Unsigned_Longword
range 0 .. 2** 7-1;
233 subtype Unsigned_8
is Unsigned_Longword
range 0 .. 2** 8-1;
234 subtype Unsigned_9
is Unsigned_Longword
range 0 .. 2** 9-1;
235 subtype Unsigned_10
is Unsigned_Longword
range 0 .. 2**10-1;
236 subtype Unsigned_11
is Unsigned_Longword
range 0 .. 2**11-1;
237 subtype Unsigned_12
is Unsigned_Longword
range 0 .. 2**12-1;
238 subtype Unsigned_13
is Unsigned_Longword
range 0 .. 2**13-1;
239 subtype Unsigned_14
is Unsigned_Longword
range 0 .. 2**14-1;
240 subtype Unsigned_15
is Unsigned_Longword
range 0 .. 2**15-1;
241 subtype Unsigned_16
is Unsigned_Longword
range 0 .. 2**16-1;
242 subtype Unsigned_17
is Unsigned_Longword
range 0 .. 2**17-1;
243 subtype Unsigned_18
is Unsigned_Longword
range 0 .. 2**18-1;
244 subtype Unsigned_19
is Unsigned_Longword
range 0 .. 2**19-1;
245 subtype Unsigned_20
is Unsigned_Longword
range 0 .. 2**20-1;
246 subtype Unsigned_21
is Unsigned_Longword
range 0 .. 2**21-1;
247 subtype Unsigned_22
is Unsigned_Longword
range 0 .. 2**22-1;
248 subtype Unsigned_23
is Unsigned_Longword
range 0 .. 2**23-1;
249 subtype Unsigned_24
is Unsigned_Longword
range 0 .. 2**24-1;
250 subtype Unsigned_25
is Unsigned_Longword
range 0 .. 2**25-1;
251 subtype Unsigned_26
is Unsigned_Longword
range 0 .. 2**26-1;
252 subtype Unsigned_27
is Unsigned_Longword
range 0 .. 2**27-1;
253 subtype Unsigned_28
is Unsigned_Longword
range 0 .. 2**28-1;
254 subtype Unsigned_29
is Unsigned_Longword
range 0 .. 2**29-1;
255 subtype Unsigned_30
is Unsigned_Longword
range 0 .. 2**30-1;
256 subtype Unsigned_31
is Unsigned_Longword
range 0 .. 2**31-1;
258 -- Function for obtaining global symbol values
260 function Import_Value
(Symbol
: String) return Unsigned_Longword
;
261 function Import_Address
(Symbol
: String) return Address
;
262 function Import_Largest_Value
(Symbol
: String) return Largest_Integer
;
264 pragma Import
(Intrinsic
, Import_Value
);
265 pragma Import
(Intrinsic
, Import_Address
);
266 pragma Import
(Intrinsic
, Import_Largest_Value
);
268 -- For the following declarations, note that the declaration without
269 -- a Retry_Count parameter means to retry infinitely. A value of zero
270 -- for the Retry_Count parameter means do not retry.
272 -- Interlocked-instruction procedures
274 procedure Clear_Interlocked
275 (Bit
: in out Boolean;
276 Old_Value
: out Boolean);
278 procedure Set_Interlocked
279 (Bit
: in out Boolean;
280 Old_Value
: out Boolean);
282 type Aligned_Word
is record
283 Value
: Short_Integer;
286 for Aligned_Word
'Alignment use
287 Integer'Min (2, Standard
'Maximum_Alignment);
289 procedure Clear_Interlocked
290 (Bit
: in out Boolean;
291 Old_Value
: out Boolean;
292 Retry_Count
: Natural;
293 Success_Flag
: out Boolean);
295 procedure Set_Interlocked
296 (Bit
: in out Boolean;
297 Old_Value
: out Boolean;
298 Retry_Count
: Natural;
299 Success_Flag
: out Boolean);
301 procedure Add_Interlocked
302 (Addend
: Short_Integer;
303 Augend
: in out Aligned_Word
;
306 type Aligned_Integer
is record
310 for Aligned_Integer
'Alignment use
311 Integer'Min (4, Standard
'Maximum_Alignment);
313 type Aligned_Long_Integer
is record
314 Value
: Long_Integer;
317 for Aligned_Long_Integer
'Alignment use
318 Integer'Min (8, Standard
'Maximum_Alignment);
320 -- For the following declarations, note that the declaration without
321 -- a Retry_Count parameter mean to retry infinitely. A value of zero
322 -- for the Retry_Count means do not retry.
325 (To
: in out Aligned_Integer
;
329 (To
: in out Aligned_Integer
;
331 Retry_Count
: Natural;
332 Old_Value
: out Integer;
333 Success_Flag
: out Boolean);
336 (To
: in out Aligned_Long_Integer
;
337 Amount
: Long_Integer);
340 (To
: in out Aligned_Long_Integer
;
341 Amount
: Long_Integer;
342 Retry_Count
: Natural;
343 Old_Value
: out Long_Integer;
344 Success_Flag
: out Boolean);
347 (To
: in out Aligned_Integer
;
351 (To
: in out Aligned_Integer
;
353 Retry_Count
: Natural;
354 Old_Value
: out Integer;
355 Success_Flag
: out Boolean);
358 (To
: in out Aligned_Long_Integer
;
359 From
: Long_Integer);
362 (To
: in out Aligned_Long_Integer
;
364 Retry_Count
: Natural;
365 Old_Value
: out Long_Integer;
366 Success_Flag
: out Boolean);
369 (To
: in out Aligned_Integer
;
373 (To
: in out Aligned_Integer
;
375 Retry_Count
: Natural;
376 Old_Value
: out Integer;
377 Success_Flag
: out Boolean);
380 (To
: in out Aligned_Long_Integer
;
381 From
: Long_Integer);
384 (To
: in out Aligned_Long_Integer
;
386 Retry_Count
: Natural;
387 Old_Value
: out Long_Integer;
388 Success_Flag
: out Boolean);
391 (Fail_No_Lock
, OK_Not_First
, OK_First
);
398 type Remq_Status
is (
413 Status
: out Insq_Status
);
418 Status
: out Remq_Status
);
423 Status
: out Insq_Status
);
428 Status
: out Remq_Status
);
432 Address_Zero
: constant Address
:= Null_Address
;
433 No_Addr
: constant Address
:= Null_Address
;
435 -- An AST_Handler value is from a typing point of view simply a pointer
436 -- to a procedure taking a single 64bit parameter. However, this
437 -- is a bit misleading, because the data that this pointer references is
438 -- highly stylized. See body of System.AST_Handling for full details.
440 type AST_Handler
is access procedure (Param
: Long_Integer);
441 No_AST_Handler
: constant AST_Handler
:= null;
443 -- Other operators have incorrect profiles. It would be nice to make
444 -- them intrinsic, since the backend can handle them, but the front
445 -- end is not prepared to deal with them, so at least inline them.
447 pragma Inline_Always
("+");
448 pragma Inline_Always
("-");
449 pragma Inline_Always
("not");
450 pragma Inline_Always
("and");
451 pragma Inline_Always
("or");
452 pragma Inline_Always
("xor");
454 -- Other inlined subprograms
456 pragma Inline_Always
(Fetch_From_Address
);
457 pragma Inline_Always
(Assign_To_Address
);
459 -- Synchronization related subprograms. Mechanism is explicitly set
460 -- so that the critical parameters are passed by reference.
461 -- Without this, the parameters are passed by copy, creating load/store
462 -- race conditions. We also inline them, since this seems more in the
463 -- spirit of the original (hardware intrinsic) routines.
465 pragma Export_Procedure
467 External
=> "system__aux_dec__clear_interlocked__1",
468 Parameter_Types
=> (Boolean, Boolean),
469 Mechanism
=> (Reference
, Reference
));
470 pragma Export_Procedure
472 External
=> "system__aux_dec__clear_interlocked__2",
473 Parameter_Types
=> (Boolean, Boolean, Natural, Boolean),
474 Mechanism
=> (Reference
, Reference
, Value
, Reference
));
475 pragma Inline_Always
(Clear_Interlocked
);
477 pragma Export_Procedure
479 External
=> "system__aux_dec__set_interlocked__1",
480 Parameter_Types
=> (Boolean, Boolean),
481 Mechanism
=> (Reference
, Reference
));
482 pragma Export_Procedure
484 External
=> "system__aux_dec__set_interlocked__2",
485 Parameter_Types
=> (Boolean, Boolean, Natural, Boolean),
486 Mechanism
=> (Reference
, Reference
, Value
, Reference
));
487 pragma Inline_Always
(Set_Interlocked
);
489 pragma Export_Procedure
491 External
=> "system__aux_dec__add_interlocked__1",
492 Mechanism
=> (Value
, Reference
, Reference
));
493 pragma Inline_Always
(Add_Interlocked
);
495 pragma Export_Procedure
497 External
=> "system__aux_dec__add_atomic__1",
498 Parameter_Types
=> (Aligned_Integer
, Integer),
499 Mechanism
=> (Reference
, Value
));
500 pragma Export_Procedure
502 External
=> "system__aux_dec__add_atomic__2",
503 Parameter_Types
=> (Aligned_Integer
, Integer, Natural, Integer, Boolean),
504 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
505 pragma Export_Procedure
507 External
=> "system__aux_dec__add_atomic__3",
508 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer),
509 Mechanism
=> (Reference
, Value
));
510 pragma Export_Procedure
512 External
=> "system__aux_dec__add_atomic__4",
513 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer, Natural,
514 Long_Integer, Boolean),
515 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
516 pragma Inline_Always
(Add_Atomic
);
518 pragma Export_Procedure
520 External
=> "system__aux_dec__and_atomic__1",
521 Parameter_Types
=> (Aligned_Integer
, Integer),
522 Mechanism
=> (Reference
, Value
));
523 pragma Export_Procedure
525 External
=> "system__aux_dec__and_atomic__2",
526 Parameter_Types
=> (Aligned_Integer
, Integer, Natural, Integer, Boolean),
527 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
528 pragma Export_Procedure
530 External
=> "system__aux_dec__and_atomic__3",
531 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer),
532 Mechanism
=> (Reference
, Value
));
533 pragma Export_Procedure
535 External
=> "system__aux_dec__and_atomic__4",
536 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer, Natural,
537 Long_Integer, Boolean),
538 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
539 pragma Inline_Always
(And_Atomic
);
541 pragma Export_Procedure
543 External
=> "system__aux_dec__or_atomic__1",
544 Parameter_Types
=> (Aligned_Integer
, Integer),
545 Mechanism
=> (Reference
, Value
));
546 pragma Export_Procedure
548 External
=> "system__aux_dec__or_atomic__2",
549 Parameter_Types
=> (Aligned_Integer
, Integer, Natural, Integer, Boolean),
550 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
551 pragma Export_Procedure
553 External
=> "system__aux_dec__or_atomic__3",
554 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer),
555 Mechanism
=> (Reference
, Value
));
556 pragma Export_Procedure
558 External
=> "system__aux_dec__or_atomic__4",
559 Parameter_Types
=> (Aligned_Long_Integer
, Long_Integer, Natural,
560 Long_Integer, Boolean),
561 Mechanism
=> (Reference
, Value
, Value
, Reference
, Reference
));
562 pragma Inline_Always
(Or_Atomic
);
564 -- Provide proper unchecked conversion definitions for transfer
565 -- functions. Note that we need this level of indirection because
566 -- the formal parameter name is X and not Source (and this is indeed
567 -- detectable by a program)
569 function To_Unsigned_Byte_A
is new
570 Ada
.Unchecked_Conversion
(Bit_Array_8
, Unsigned_Byte
);
572 function To_Unsigned_Byte
(X
: Bit_Array_8
) return Unsigned_Byte
573 renames To_Unsigned_Byte_A
;
575 function To_Bit_Array_8_A
is new
576 Ada
.Unchecked_Conversion
(Unsigned_Byte
, Bit_Array_8
);
578 function To_Bit_Array_8
(X
: Unsigned_Byte
) return Bit_Array_8
579 renames To_Bit_Array_8_A
;
581 function To_Unsigned_Word_A
is new
582 Ada
.Unchecked_Conversion
(Bit_Array_16
, Unsigned_Word
);
584 function To_Unsigned_Word
(X
: Bit_Array_16
) return Unsigned_Word
585 renames To_Unsigned_Word_A
;
587 function To_Bit_Array_16_A
is new
588 Ada
.Unchecked_Conversion
(Unsigned_Word
, Bit_Array_16
);
590 function To_Bit_Array_16
(X
: Unsigned_Word
) return Bit_Array_16
591 renames To_Bit_Array_16_A
;
593 function To_Unsigned_Longword_A
is new
594 Ada
.Unchecked_Conversion
(Bit_Array_32
, Unsigned_Longword
);
596 function To_Unsigned_Longword
(X
: Bit_Array_32
) return Unsigned_Longword
597 renames To_Unsigned_Longword_A
;
599 function To_Bit_Array_32_A
is new
600 Ada
.Unchecked_Conversion
(Unsigned_Longword
, Bit_Array_32
);
602 function To_Bit_Array_32
(X
: Unsigned_Longword
) return Bit_Array_32
603 renames To_Bit_Array_32_A
;
605 function To_Unsigned_32_A
is new
606 Ada
.Unchecked_Conversion
(Bit_Array_32
, Unsigned_32
);
608 function To_Unsigned_32
(X
: Bit_Array_32
) return Unsigned_32
609 renames To_Unsigned_32_A
;
611 function To_Bit_Array_32_A
is new
612 Ada
.Unchecked_Conversion
(Unsigned_32
, Bit_Array_32
);
614 function To_Bit_Array_32
(X
: Unsigned_32
) return Bit_Array_32
615 renames To_Bit_Array_32_A
;
617 function To_Unsigned_Quadword_A
is new
618 Ada
.Unchecked_Conversion
(Bit_Array_64
, Unsigned_Quadword
);
620 function To_Unsigned_Quadword
(X
: Bit_Array_64
) return Unsigned_Quadword
621 renames To_Unsigned_Quadword_A
;
623 function To_Bit_Array_64_A
is new
624 Ada
.Unchecked_Conversion
(Unsigned_Quadword
, Bit_Array_64
);
626 function To_Bit_Array_64
(X
: Unsigned_Quadword
) return Bit_Array_64
627 renames To_Bit_Array_64_A
;
629 pragma Warnings
(Off
);
630 -- Turn warnings off. This is needed for systems with 64-bit integers,
631 -- where some of these operations are of dubious meaning, but we do not
632 -- want warnings when we compile on such systems.
634 function To_Address_A
is new
635 Ada
.Unchecked_Conversion
(Integer, Address
);
636 pragma Pure_Function
(To_Address_A
);
638 function To_Address
(X
: Integer) return Address
639 renames To_Address_A
;
640 pragma Pure_Function
(To_Address
);
642 function To_Address_Long_A
is new
643 Ada
.Unchecked_Conversion
(Unsigned_Longword
, Address
);
644 pragma Pure_Function
(To_Address_Long_A
);
646 function To_Address_Long
(X
: Unsigned_Longword
) return Address
647 renames To_Address_Long_A
;
648 pragma Pure_Function
(To_Address_Long
);
650 function To_Integer_A
is new
651 Ada
.Unchecked_Conversion
(Address
, Integer);
653 function To_Integer
(X
: Address
) return Integer
654 renames To_Integer_A
;
656 function To_Unsigned_Longword_A
is new
657 Ada
.Unchecked_Conversion
(Address
, Unsigned_Longword
);
659 function To_Unsigned_Longword
(X
: Address
) return Unsigned_Longword
660 renames To_Unsigned_Longword_A
;
662 function To_Unsigned_Longword_A
is new
663 Ada
.Unchecked_Conversion
(AST_Handler
, Unsigned_Longword
);
665 function To_Unsigned_Longword
(X
: AST_Handler
) return Unsigned_Longword
666 renames To_Unsigned_Longword_A
;
668 pragma Warnings
(On
);