annotate gcc/config/m32r/m32r-opts.h @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Definitions for option handling for Renesas M32R cpu.
kono
parents:
diff changeset
2 Copyright (C) 1996-2017 Free Software Foundation, Inc.
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 This file is part of GCC.
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify it
kono
parents:
diff changeset
7 under the terms of the GNU General Public License as published
kono
parents:
diff changeset
8 by the Free Software Foundation; either version 3, or (at your
kono
parents:
diff changeset
9 option) any later version.
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful, but WITHOUT
kono
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
kono
parents:
diff changeset
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
kono
parents:
diff changeset
14 License for more details.
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
17 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
18 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 #ifndef M32R_OPTS_H
kono
parents:
diff changeset
21 #define M32R_OPTS_H
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 /* Code Models
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 Code models are used to select between two choices of two separate
kono
parents:
diff changeset
26 possibilities (address space size, call insn to use):
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 small: addresses use 24 bits, use bl to make calls
kono
parents:
diff changeset
29 medium: addresses use 32 bits, use bl to make calls (*1)
kono
parents:
diff changeset
30 large: addresses use 32 bits, use seth/add3/jl to make calls (*2)
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 The fourth is "addresses use 24 bits, use seth/add3/jl to make calls" but
kono
parents:
diff changeset
33 using this one doesn't make much sense.
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 (*1) The linker may eventually be able to relax seth/add3 -> ld24.
kono
parents:
diff changeset
36 (*2) The linker may eventually be able to relax seth/add3/jl -> bl.
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 Internally these are recorded as TARGET_ADDR{24,32} and
kono
parents:
diff changeset
39 TARGET_CALL{26,32}.
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 The __model__ attribute can be used to select the code model to use when
kono
parents:
diff changeset
42 accessing particular objects. */
kono
parents:
diff changeset
43
kono
parents:
diff changeset
44 enum m32r_model { M32R_MODEL_SMALL, M32R_MODEL_MEDIUM, M32R_MODEL_LARGE };
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 #define TARGET_MODEL_SMALL (m32r_model_selected == M32R_MODEL_SMALL)
kono
parents:
diff changeset
47 #define TARGET_MODEL_MEDIUM (m32r_model_selected == M32R_MODEL_MEDIUM)
kono
parents:
diff changeset
48 #define TARGET_MODEL_LARGE (m32r_model_selected == M32R_MODEL_LARGE)
kono
parents:
diff changeset
49 #define TARGET_ADDR24 (m32r_model_selected == M32R_MODEL_SMALL)
kono
parents:
diff changeset
50 #define TARGET_ADDR32 (! TARGET_ADDR24)
kono
parents:
diff changeset
51 #define TARGET_CALL26 (! TARGET_CALL32)
kono
parents:
diff changeset
52 #define TARGET_CALL32 (m32r_model_selected == M32R_MODEL_LARGE)
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 /* The default is the small model. */
kono
parents:
diff changeset
55 #ifndef M32R_MODEL_DEFAULT
kono
parents:
diff changeset
56 #define M32R_MODEL_DEFAULT M32R_MODEL_SMALL
kono
parents:
diff changeset
57 #endif
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 /* Small Data Area
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 The SDA consists of sections .sdata, .sbss, and .scommon.
kono
parents:
diff changeset
62 .scommon isn't a real section, symbols in it have their section index
kono
parents:
diff changeset
63 set to SHN_M32R_SCOMMON, though support for it exists in the linker script.
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 Two switches control the SDA:
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67 -G NNN - specifies the maximum size of variable to go in the SDA
kono
parents:
diff changeset
68
kono
parents:
diff changeset
69 -msdata=foo - specifies how such variables are handled
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 -msdata=none - small data area is disabled
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 -msdata=sdata - small data goes in the SDA, special code isn't
kono
parents:
diff changeset
74 generated to use it, and special relocs aren't
kono
parents:
diff changeset
75 generated
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 -msdata=use - small data goes in the SDA, special code is generated
kono
parents:
diff changeset
78 to use the SDA and special relocs are generated
kono
parents:
diff changeset
79
kono
parents:
diff changeset
80 The SDA is not multilib'd, it isn't necessary.
kono
parents:
diff changeset
81 MULTILIB_EXTRA_OPTS is set in tmake_file to -msdata=sdata so multilib'd
kono
parents:
diff changeset
82 libraries have small data in .sdata/SHN_M32R_SCOMMON so programs that use
kono
parents:
diff changeset
83 -msdata=use will successfully link with them (references in header files
kono
parents:
diff changeset
84 will cause the compiler to emit code that refers to library objects in
kono
parents:
diff changeset
85 .data). ??? There can be a problem if the user passes a -G value greater
kono
parents:
diff changeset
86 than the default and a library object in a header file is that size.
kono
parents:
diff changeset
87 The default is 8 so this should be rare - if it occurs the user
kono
parents:
diff changeset
88 is required to rebuild the libraries or use a smaller value for -G. */
kono
parents:
diff changeset
89
kono
parents:
diff changeset
90 /* Maximum size of variables that go in .sdata/.sbss.
kono
parents:
diff changeset
91 The -msdata=foo switch also controls how small variables are handled. */
kono
parents:
diff changeset
92 #ifndef SDATA_DEFAULT_SIZE
kono
parents:
diff changeset
93 #define SDATA_DEFAULT_SIZE 8
kono
parents:
diff changeset
94 #endif
kono
parents:
diff changeset
95
kono
parents:
diff changeset
96 enum m32r_sdata { M32R_SDATA_NONE, M32R_SDATA_SDATA, M32R_SDATA_USE };
kono
parents:
diff changeset
97
kono
parents:
diff changeset
98 #define TARGET_SDATA_NONE (m32r_sdata_selected == M32R_SDATA_NONE)
kono
parents:
diff changeset
99 #define TARGET_SDATA_SDATA (m32r_sdata_selected == M32R_SDATA_SDATA)
kono
parents:
diff changeset
100 #define TARGET_SDATA_USE (m32r_sdata_selected == M32R_SDATA_USE)
kono
parents:
diff changeset
101
kono
parents:
diff changeset
102 /* Default is to disable the SDA
kono
parents:
diff changeset
103 [for upward compatibility with previous toolchains]. */
kono
parents:
diff changeset
104 #ifndef M32R_SDATA_DEFAULT
kono
parents:
diff changeset
105 #define M32R_SDATA_DEFAULT M32R_SDATA_NONE
kono
parents:
diff changeset
106 #endif
kono
parents:
diff changeset
107
kono
parents:
diff changeset
108 #endif