Here are run-time target specifications.
| TARGET_CPU_CPP_BUILTINS () | Macro |
This function-like macro expands to a block of code that defines
built-in preprocessor macros and assertions for the target cpu, using
the functions builtin_define, builtin_define_std and
builtin_assert. When the front end
calls this macro it provides a trailing semicolon, and since it has
finished command line option processing your code can use those
results freely.
You can also test for the C dialect being compiled. The variable
|
| TARGET_OS_CPP_BUILTINS () | Macro |
Similarly to TARGET_CPU_CPP_BUILTINS but this macro is optional
and is used for the target operating system instead.
|
| TARGET_OBJFMT_CPP_BUILTINS () | Macro |
Similarly to TARGET_CPU_CPP_BUILTINS but this macro is optional
and is used for the target object format. elfos.h uses this
macro to define __ELF__, so you probably do not need to define
it yourself.
|
| extern int target_flags | Variable |
| This declaration should be present. |
| TARGET_featurename | Macro |
This series of macros is to allow compiler command arguments to
enable or disable the use of optional features of the target machine.
For example, one machine description serves both the 68000 and
the 68020; a command argument tells the compiler whether it should
use 68020-only instructions or not. This command argument works
by means of a macro TARGET_68020 that tests a bit in
target_flags.
Define a macro #define TARGET_MASK_68020 1
#define TARGET_68020 (target_flags & MASK_68020)
One place where these macros are used is in the condition-expressions
of instruction patterns. Note how |
| TARGET_SWITCHES | Macro |
This macro defines names of command options to set and clear
bits in target_flags. Its definition is an initializer
with a subgrouping for each command option.
Each subgrouping contains a string constant, that defines the option
name, a number, which contains the bits to set in
In addition to the description for One of the subgroupings should have a null string. The number in
this grouping is the default value for Here is an example which defines #define TARGET_SWITCHES \
{ { "68020", MASK_68020, "" }, \
{ "68000", -MASK_68020, \
N_("Compile for the 68000") }, \
{ "", MASK_68020, "" }, \
}
|
| TARGET_OPTIONS | Macro |
This macro is similar to TARGET_SWITCHES but defines names of command
options that have values. Its definition is an initializer with a
subgrouping for each command option.
Each subgrouping contains a string constant, that defines the option
name, the address of a variable, a description string, and a value.
Non-empty description strings should be marked with If the value listed in the table is If the value listed in the table is non- Here is an example which defines extern char *m88k_short_data;
#define TARGET_OPTIONS \
{ { "short-data-", &m88k_short_data, \
N_("Specify the size of the short data section"), 0 } }
Here is a variant of the above that allows the user to also specify
just extern char *m88k_short_data;
#define TARGET_OPTIONS \
{ { "short-data-", &m88k_short_data, \
N_("Specify the size of the short data section"), 0 } \
{ "short-data", &m88k_short_data, "", "64" },
}
Here is an example which defines [chip.c]
char *chip_alu = ""; /* Specify default here. */
[chip.h]
extern char *chip_alu;
#define TARGET_OPTIONS \
{ { "no-alu", &chip_alu, "", "" }, \
{ "alu1", &chip_alu, "", "1" }, \
{ "alu2", &chip_alu, "", "2" }, }
#define TARGET_ALU (chip_alu[0] != '\0')
#define TARGET_ALU1 (chip_alu[0] == '1')
#define TARGET_ALU2 (chip_alu[0] == '2')
|
| TARGET_VERSION | Macro |
This macro is a C statement to print on stderr a string
describing the particular machine description choice. Every machine
description should define TARGET_VERSION. For example:
#ifdef MOTOROLA
#define TARGET_VERSION \
fprintf (stderr, " (68k, Motorola syntax)");
#else
#define TARGET_VERSION \
fprintf (stderr, " (68k, MIT syntax)");
#endif
|
| OVERRIDE_OPTIONS | Macro |
Sometimes certain combinations of command options do not make sense on
a particular target machine. You can define a macro
OVERRIDE_OPTIONS to take account of this. This macro, if
defined, is executed once just after all the command options have been
parsed.
Don't use this macro to turn on various extra optimizations for
|
| OPTIMIZATION_OPTIONS (level, size) | Macro |
|
Some machines may desire to change what optimizations are performed for
various optimization levels. This macro, if defined, is executed once
just after the optimization level is determined and before the remainder
of the command options have been parsed. Values set in this macro are
used as the default values for the other command line options.
level is the optimization level specified; 2 if size is nonzero if You should not use this macro to change options that are not machine-specific. These should uniformly selected by the same optimization level on all supported machines. Use this macro to enable machine-specific optimizations. Do not examine |
| CAN_DEBUG_WITHOUT_FP | Macro |
Define this macro if debugging can be performed even without a frame
pointer. If this macro is defined, GCC will turn on the
-fomit-frame-pointer option whenever -O is specified.
|