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