Implement -mmemcpy-strategy= and -mmemset-strategy= options
[official-gcc.git] / gcc / ada / set_targ.ads
bloba14fbcbce3ea3ad079aed81f101d1cdcb1c177ca
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- S E T _ T A R G --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 2013, Free Software Foundation, Inc. --
10 -- --
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. 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 COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
20 -- --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
23 -- --
24 ------------------------------------------------------------------------------
26 -- This package handles setting target dependent parameters. If the -gnatet
27 -- switch is not set, then these values are taken from the back end (via the
28 -- routines in Get_Targ, and the enumerate_modes routine in misc.c). If the
29 -- switch is set, then the values are read from the target.atp file in the
30 -- current directory (usually written with the Write_Target_Dependent_Values
31 -- procedure defined in this package).
33 -- Note that all these values return sizes of C types with corresponding
34 -- names. This allows GNAT to define the corresponding Ada types to have
35 -- the same representation. There is one exception: the representation
36 -- of Wide_Character_Type uses twice the size of a C char, instead of the
37 -- size of wchar_t, since this corresponds to expected Ada usage.
39 with Einfo; use Einfo;
40 with Types; use Types;
42 package Set_Targ is
44 -----------------------------
45 -- Target-Dependent Values --
46 -----------------------------
48 -- The following is a table of target dependent values. In normal operation
49 -- these values are set by calling the appropriate C backend routines that
50 -- interface to back end routines that determine target characteristics.
52 -- If the -gnateT switch is used, then any values that are read from the
53 -- file target.atp in the current directory overwrite values set from the
54 -- back end. This is used by tools other than the compiler, e.g. to do
55 -- semantic analysis of programs that will run on some other target than
56 -- the machine on which the tool is run.
58 -- Note: fields marked with a question mark are boolean fields, where a
59 -- value of 0 is False, and a value of 1 is True.
61 Bits_BE : Nat; -- Bits stored big-endian?
62 Bits_Per_Unit : Pos; -- Bits in a storage unit
63 Bits_Per_Word : Pos; -- Bits in a word
64 Bytes_BE : Nat; -- Bytes stored big-endian?
65 Char_Size : Pos; -- Standard.Character'Size
66 Double_Float_Alignment : Nat; -- Alignment of double float
67 Double_Scalar_Alignment : Nat; -- Alignment of double length scalar
68 Double_Size : Pos; -- Standard.Long_Float'Size
69 Float_Size : Pos; -- Standard.Float'Size
70 Float_Words_BE : Nat; -- Float words stored big-endian?
71 Int_Size : Pos; -- Standard.Integer'Size
72 Long_Double_Size : Pos; -- Standard.Long_Long_Float'Size
73 Long_Long_Size : Pos; -- Standard.Long_Long_Integer'Size
74 Long_Size : Pos; -- Standard.Long_Integer'Size
75 Maximum_Alignment : Pos; -- Maximum permitted alignment
76 Max_Unaligned_Field : Pos; -- Maximum size for unaligned bit field
77 Pointer_Size : Pos; -- System.Address'Size
78 Short_Size : Pos; -- Standard.Short_Integer'Size
79 Strict_Alignment : Nat; -- Strict alignment?
80 System_Allocator_Alignment : Nat; -- Alignment for malloc calls
81 Wchar_T_Size : Pos; -- Interfaces.C.wchar_t'Size
82 Words_BE : Nat; -- Words stored big-endian?
84 -------------------------------------
85 -- Registered Floating-Point Types --
86 -------------------------------------
88 -- This table contains the list of modes supported by the back-end as
89 -- provided by the back end routine enumerate_modes in misc.c. Note that
90 -- we only store floating-point modes (see Register_Float_Type).
92 type FPT_Mode_Entry is record
93 NAME : String_Ptr; -- Name of mode (no null character at end)
94 DIGS : Natural; -- Digits for floating-point type
95 FLOAT_REP : Float_Rep_Kind; -- Float representation
96 SIZE : Natural; -- Size in bits
97 ALIGNMENT : Natural; -- Alignment in bits
98 end record;
100 FPT_Mode_Table : array (1 .. 1000) of FPT_Mode_Entry;
101 Num_FPT_Modes : Natural := 0;
102 -- Table containing the supported modes and number of entries
104 -----------------
105 -- Subprograms --
106 -----------------
108 procedure Write_Target_Dependent_Values;
109 -- This routine writes the file target.atp in the current directory with
110 -- the values of the global target parameters as listed above, and as set
111 -- by prior calls to Initialize/Read_Target_Dependent_Values. The format
112 -- of the target.atp file is as follows
114 -- First come the values of the variables defined in this spec:
116 -- One line per value
118 -- name value
120 -- where name is the name of the parameter, spelled out in full,
121 -- and cased as in the above list, and value is an unsigned decimal
122 -- integer. Two or more blanks separates the name from the value.
124 -- All the variables must be present, in alphabetical order (i.e. the
125 -- same order as the declarations in this spec).
127 -- Then there is a blank line to separate the two parts of the file. Then
128 -- come the lines showing the floating-point types to be registered.
130 -- One line per registered mode
132 -- name digs float_rep size alignment
134 -- where name is the string name of the type (which can have single
135 -- spaces embedded in the name (e.g. long double). The name is followed
136 -- by at least two blanks. The following fields are as described above
137 -- for a Mode_Entry (where float_rep is I/V/A for IEEE-754-Binary,
138 -- Vax_Native, AAMP), fields are separated by at least one blank, and
139 -- a LF character immediately follows the alignment field.
141 end Set_Targ;