* emit-rtl.c (widen_memory_access): New.
[official-gcc.git] / gcc / ada / s-unstyp.ads
blob0b315a84c1f0918629a0d89a6643edf11e0706f6
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUNTIME COMPONENTS --
4 -- --
5 -- S Y S T E M . U N S I G N E D _ T Y P E S --
6 -- --
7 -- S p e c --
8 -- --
9 -- $Revision: 1.20 $
10 -- --
11 -- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
12 -- --
13 -- GNAT is free software; you can redistribute it and/or modify it under --
14 -- terms of the GNU General Public License as published by the Free Soft- --
15 -- ware Foundation; either version 2, or (at your option) any later ver- --
16 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
19 -- for more details. You should have received a copy of the GNU General --
20 -- Public License distributed with GNAT; see file COPYING. If not, write --
21 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
22 -- MA 02111-1307, USA. --
23 -- --
24 -- As a special exception, if other files instantiate generics from this --
25 -- unit, or you link this unit with other files to produce an executable, --
26 -- this unit does not by itself cause the resulting executable to be --
27 -- covered by the GNU General Public License. This exception does not --
28 -- however invalidate any other reasons why the executable file might be --
29 -- covered by the GNU Public License. --
30 -- --
31 -- GNAT was originally developed by the GNAT team at New York University. --
32 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
33 -- --
34 ------------------------------------------------------------------------------
36 -- This package contains definitions of standard unsigned types that
37 -- correspond in size to the standard signed types declared in Standard.
38 -- and (unlike the types in Interfaces have corresponding names). It
39 -- also contains some related definitions for other specialized types
40 -- used only by the expander.
42 package System.Unsigned_Types is
43 pragma Pure (Unsigned_Types);
45 type Short_Short_Unsigned is mod 2 ** Short_Short_Integer'Size;
46 type Short_Unsigned is mod 2 ** Short_Integer'Size;
47 type Unsigned is mod 2 ** Integer'Size;
48 type Long_Unsigned is mod 2 ** Long_Integer'Size;
49 type Long_Long_Unsigned is mod 2 ** Long_Long_Integer'Size;
51 type Float_Unsigned is mod 2 ** Float'Size;
52 -- Used in the implementation of Is_Negative intrinsic (see Exp_Intr)
54 type Packed_Byte is mod 2 ** 8;
55 for Packed_Byte'Size use 8;
56 -- Component type for Packed_Butes array
58 type Packed_Bytes1 is array (Natural range <>) of Packed_Byte;
59 for Packed_Bytes1'Alignment use 1;
60 -- This is the type used to implement packed arrays where no alignment
61 -- is required. This includes the cases of 1,2,4 (where we use direct
62 -- masking operations), and all odd component sizes (where the clusters
63 -- are not aligned anyway, see, e.g. System.Pack_07 in file s-pack07
64 -- for details.
66 type Packed_Bytes2 is new Packed_Bytes1;
67 for Packed_Bytes2'Alignment use 2;
68 -- This is the type used to implement packed arrays where an alignment
69 -- of 2 is helpful for maximum efficiency of the get and set routines
70 -- in the corresponding library unit. This is true of all component
71 -- sizes that are even but not divisible by 4 (other than 2 for which
72 -- we use direct masking operations). In such cases, the clusters can
73 -- be assumed to be 2-byte aligned if the array is aligned. See for
74 -- example System.Pack_10 in file s-pack10).
76 type Packed_Bytes4 is new Packed_Bytes1;
77 for Packed_Bytes4'Alignment use Integer'Min (4, Standard'Maximum_Alignment);
78 -- This is the type used to implement packed arrays where an alignment
79 -- of 4 is helpful for maximum efficiency of the get and set routines
80 -- in the corresponding library unit. This is true of all component
81 -- sizes that are divisible by 4 (other than powers of 2, which are
82 -- either handled by direct masking or not packed at all). In such cases
83 -- the clusters can be assumed to be 4-byte aligned if the array is
84 -- aligned (see System.Pack_12 in file s-pack12 as an example).
86 type Bits_1 is mod 2**1;
87 type Bits_2 is mod 2**2;
88 type Bits_4 is mod 2**4;
89 -- Types used for packed array conversions
91 subtype Bytes_F is Packed_Bytes4 (1 .. Float'Size / 8);
92 -- Type used in implementation of Is_Negative instrinsic (see Exp_Intr)
94 function Shift_Left
95 (Value : Short_Short_Unsigned;
96 Amount : Natural)
97 return Short_Short_Unsigned;
99 function Shift_Right
100 (Value : Short_Short_Unsigned;
101 Amount : Natural)
102 return Short_Short_Unsigned;
104 function Shift_Right_Arithmetic
105 (Value : Short_Short_Unsigned;
106 Amount : Natural)
107 return Short_Short_Unsigned;
109 function Rotate_Left
110 (Value : Short_Short_Unsigned;
111 Amount : Natural)
112 return Short_Short_Unsigned;
114 function Rotate_Right
115 (Value : Short_Short_Unsigned;
116 Amount : Natural)
117 return Short_Short_Unsigned;
119 function Shift_Left
120 (Value : Short_Unsigned;
121 Amount : Natural)
122 return Short_Unsigned;
124 function Shift_Right
125 (Value : Short_Unsigned;
126 Amount : Natural)
127 return Short_Unsigned;
129 function Shift_Right_Arithmetic
130 (Value : Short_Unsigned;
131 Amount : Natural)
132 return Short_Unsigned;
134 function Rotate_Left
135 (Value : Short_Unsigned;
136 Amount : Natural)
137 return Short_Unsigned;
139 function Rotate_Right
140 (Value : Short_Unsigned;
141 Amount : Natural)
142 return Short_Unsigned;
144 function Shift_Left
145 (Value : Unsigned;
146 Amount : Natural)
147 return Unsigned;
149 function Shift_Right
150 (Value : Unsigned;
151 Amount : Natural)
152 return Unsigned;
154 function Shift_Right_Arithmetic
155 (Value : Unsigned;
156 Amount : Natural)
157 return Unsigned;
159 function Rotate_Left
160 (Value : Unsigned;
161 Amount : Natural)
162 return Unsigned;
164 function Rotate_Right
165 (Value : Unsigned;
166 Amount : Natural)
167 return Unsigned;
169 function Shift_Left
170 (Value : Long_Unsigned;
171 Amount : Natural)
172 return Long_Unsigned;
174 function Shift_Right
175 (Value : Long_Unsigned;
176 Amount : Natural)
177 return Long_Unsigned;
179 function Shift_Right_Arithmetic
180 (Value : Long_Unsigned;
181 Amount : Natural)
182 return Long_Unsigned;
184 function Rotate_Left
185 (Value : Long_Unsigned;
186 Amount : Natural)
187 return Long_Unsigned;
189 function Rotate_Right
190 (Value : Long_Unsigned;
191 Amount : Natural)
192 return Long_Unsigned;
194 function Shift_Left
195 (Value : Long_Long_Unsigned;
196 Amount : Natural)
197 return Long_Long_Unsigned;
199 function Shift_Right
200 (Value : Long_Long_Unsigned;
201 Amount : Natural)
202 return Long_Long_Unsigned;
204 function Shift_Right_Arithmetic
205 (Value : Long_Long_Unsigned;
206 Amount : Natural)
207 return Long_Long_Unsigned;
209 function Rotate_Left
210 (Value : Long_Long_Unsigned;
211 Amount : Natural)
212 return Long_Long_Unsigned;
214 function Rotate_Right
215 (Value : Long_Long_Unsigned;
216 Amount : Natural)
217 return Long_Long_Unsigned;
219 pragma Import (Intrinsic, Shift_Left);
220 pragma Import (Intrinsic, Shift_Right);
221 pragma Import (Intrinsic, Shift_Right_Arithmetic);
222 pragma Import (Intrinsic, Rotate_Left);
223 pragma Import (Intrinsic, Rotate_Right);
225 -- The following definitions are obsolsecent. They were needed by the
226 -- previous version of the compiler and runtime, but are not needed
227 -- by the current version. We retain them to help with bootstrap path
228 -- problems. Also they seem harmless, and if any user programs have
229 -- been (rather improperly) using these types, why discombobulate them?
231 subtype Packed_Bytes is Packed_Bytes4;
232 subtype Packed_Bytes_Unaligned is Packed_Bytes1;
234 end System.Unsigned_Types;