| 1 |
/* Target Definitions for ft32. |
| 2 |
Copyright (C) 2015-2025 Free Software Foundation, Inc. |
| 3 |
Contributed by FTDI <[email protected]> |
| 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 GCC_FT32_H |
| 22 |
#define GCC_FT32_H |
| 23 |
|
| 24 |
#undef STARTFILE_SPEC |
| 25 |
#define STARTFILE_SPEC "crt0%O%s %{msim:crti.o%s} %{!msim:crti-hw.o%s} crtbegin.o%s" |
| 26 |
|
| 27 |
/* Provide an ENDFILE_SPEC appropriate for svr4. Here we tack on our own |
| 28 |
magical crtend.o file (see crtstuff.c) which provides part of the |
| 29 |
support for getting C++ file-scope static object constructed before |
| 30 |
entering `main', followed by the normal svr3/svr4 "finalizer" file, |
| 31 |
which is either `gcrtn.o' or `crtn.o'. */ |
| 32 |
|
| 33 |
#undef ENDFILE_SPEC |
| 34 |
#define ENDFILE_SPEC "crtend.o%s crtn.o%s" |
| 35 |
|
| 36 |
/* Provide a LIB_SPEC appropriate for svr4. Here we tack on the default |
| 37 |
standard C library (unless we are building a shared library) and |
| 38 |
the simulator BSP code. */ |
| 39 |
|
| 40 |
#undef LIB_SPEC |
| 41 |
#define LIB_SPEC "%{!shared:%{!symbolic:-lc}} \ |
| 42 |
%{mcompress:--relax} \ |
| 43 |
%{msim:-Tsim.ld}" |
| 44 |
|
| 45 |
#undef LINK_SPEC |
| 46 |
#define LINK_SPEC "%{h*} %{v:-V} \ |
| 47 |
%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic}" |
| 48 |
|
| 49 |
/* Layout of Source Language Data Types */ |
| 50 |
|
| 51 |
#define INT_TYPE_SIZE 32 |
| 52 |
#define SHORT_TYPE_SIZE 16 |
| 53 |
#define LONG_TYPE_SIZE 32 |
| 54 |
#define LONG_LONG_TYPE_SIZE 64 |
| 55 |
|
| 56 |
#define DEFAULT_SIGNED_CHAR 1 |
| 57 |
|
| 58 |
#undef SIZE_TYPE |
| 59 |
#define SIZE_TYPE "unsigned int" |
| 60 |
|
| 61 |
#undef PTRDIFF_TYPE |
| 62 |
#define PTRDIFF_TYPE "int" |
| 63 |
|
| 64 |
#undef WCHAR_TYPE |
| 65 |
#define WCHAR_TYPE "long int" |
| 66 |
|
| 67 |
#undef WCHAR_TYPE_SIZE |
| 68 |
#define WCHAR_TYPE_SIZE BITS_PER_WORD |
| 69 |
|
| 70 |
#define REGISTER_NAMES { \ |
| 71 |
"$fp", "$sp", "$r0", "$r1", \ |
| 72 |
"$r2", "$r3", "$r4", "$r5", \ |
| 73 |
"$r6", "$r7", "$r8", "$r9", \ |
| 74 |
"$r10", "$r11", "$r12", "$r13", \ |
| 75 |
"$r14", "$r15", "$r16", "$r17", "$r18", "$r19", "$r20", "$r21", "$r22", "$r23", "$r24", "$r25", "$r26", "$r27", "$r28", "$cc", \ |
| 76 |
"?fp", "?ap", "$pc", "?cc" } |
| 77 |
|
| 78 |
#define FT32_FP 0 |
| 79 |
#define FT32_SP 1 |
| 80 |
#define FT32_R0 2 |
| 81 |
#define FT32_R1 3 |
| 82 |
#define FT32_R2 4 |
| 83 |
#define FT32_R3 5 |
| 84 |
#define FT32_R4 6 |
| 85 |
#define FT32_R5 7 |
| 86 |
#define FT32_R6 8 |
| 87 |
#define FT32_R7 9 |
| 88 |
#define FT32_R8 10 |
| 89 |
#define FT32_R9 11 |
| 90 |
#define FT32_R10 12 |
| 91 |
#define FT32_R11 13 |
| 92 |
#define FT32_R12 14 |
| 93 |
#define FT32_R13 15 |
| 94 |
#define FT32_R14 16 |
| 95 |
#define FT32_R15 17 |
| 96 |
#define FT32_R16 18 |
| 97 |
#define FT32_R17 19 |
| 98 |
#define FT32_R18 20 |
| 99 |
#define FT32_R19 21 |
| 100 |
#define FT32_R20 22 |
| 101 |
#define FT32_R21 23 |
| 102 |
#define FT32_R22 24 |
| 103 |
#define FT32_R23 25 |
| 104 |
#define FT32_R24 26 |
| 105 |
#define FT32_R25 27 |
| 106 |
#define FT32_R26 28 |
| 107 |
#define FT32_R27 29 |
| 108 |
#define FT32_R28 30 |
| 109 |
#define FT32_R29 31 |
| 110 |
#define FT32_QAP (32 + 1) |
| 111 |
#define FT32_PC (32 + 2) |
| 112 |
#define FT32_CC (32 + 3) |
| 113 |
#define FIRST_PSEUDO_REGISTER (32 + 4) |
| 114 |
|
| 115 |
enum reg_class |
| 116 |
{ |
| 117 |
NO_REGS, |
| 118 |
GENERAL_REGS, |
| 119 |
SPECIAL_REGS, |
| 120 |
CC_REGS, |
| 121 |
ALL_REGS, |
| 122 |
LIM_REG_CLASSES |
| 123 |
}; |
| 124 |
|
| 125 |
#define REG_CLASS_CONTENTS \ |
| 126 |
{ { 0x00000000, 0x00000000 }, /* Empty */ \ |
| 127 |
{ 0xFFFFFFFF, 0x00000003 }, /* $fp, $sp, $r0 to $r13, ?fp */ \ |
| 128 |
{ 0x00000000, 0x00000004 }, /* $pc */ \ |
| 129 |
{ 0x00000000, 0x00000008 }, /* ?cc */ \ |
| 130 |
{ 0xFFFFFFFF, 0x0000000F } /* All registers */ \ |
| 131 |
} |
| 132 |
|
| 133 |
#define N_REG_CLASSES LIM_REG_CLASSES |
| 134 |
|
| 135 |
#define REG_CLASS_NAMES {\ |
| 136 |
"NO_REGS", \ |
| 137 |
"GENERAL_REGS", \ |
| 138 |
"SPECIAL_REGS", \ |
| 139 |
"CC_REGS", \ |
| 140 |
"ALL_REGS" } |
| 141 |
|
| 142 |
#define FIXED_REGISTERS /* fp sp r0 r1 */ { 1, 1, 0, 0, \ |
| 143 |
/* r2 r3 r4 r5 */ 0, 0, 0, 0, \ |
| 144 |
/* r6 r7 r8 r9 */ 0, 0, 0, 0, \ |
| 145 |
/* r10 r11 r12 r13 */ 0, 0, 0, 0, \ |
| 146 |
/* r14 r15 r16 r17 */ 0, 0, 0, 0, \ |
| 147 |
/* r18 r19 r20 r21 */ 0, 0, 0, 0, \ |
| 148 |
/* r22 r23 r24 r25 */ 0, 0, 0, 0, \ |
| 149 |
/* r26 r27 r28 r29 */ 0, 0, 1, 1, \ |
| 150 |
/* r30 r31 */ 1, 1, 1, 1 } |
| 151 |
|
| 152 |
#define CALL_USED_REGISTERS \ |
| 153 |
/* fp sp r0 r1 */ { 1, 1, 1, 1, \ |
| 154 |
/* r2 r3 r4 r5 */ 1, 1, 1, 1, \ |
| 155 |
/* r6 r7 r8 r9 */ 1, 1, 1, 1, \ |
| 156 |
/* r10 r11 r12 r13 */ 1, 1, 1, 0, \ |
| 157 |
/* r14 r15 r16 r17 */ 0, 0, 0, 0, \ |
| 158 |
/* r18 r19 r20 r21 */ 0, 0, 0, 0, \ |
| 159 |
/* r22 r23 r24 r25 */ 0, 0, 0, 0, \ |
| 160 |
/* r26 r27 r28 r29 */ 0, 0, 1, 1, \ |
| 161 |
/* r30 r31 */ 1, 1, 1, 1 } |
| 162 |
|
| 163 |
/* We can't copy to or from our CC register. */ |
| 164 |
#define AVOID_CCMODE_COPIES 1 |
| 165 |
|
| 166 |
/* A C expression whose value is a register class containing hard |
| 167 |
register REGNO. */ |
| 168 |
#define REGNO_REG_CLASS(R) ((R < FT32_PC) ? GENERAL_REGS : \ |
| 169 |
(R == FT32_CC ? CC_REGS : SPECIAL_REGS)) |
| 170 |
|
| 171 |
/* The Overall Framework of an Assembler File */ |
| 172 |
|
| 173 |
#undef ASM_SPEC |
| 174 |
#define ASM_COMMENT_START "#" |
| 175 |
#define ASM_APP_ON "" |
| 176 |
#define ASM_APP_OFF "" |
| 177 |
|
| 178 |
#define FILE_ASM_OP "\t.file\n" |
| 179 |
|
| 180 |
/* Switch to the text or data segment. */ |
| 181 |
#define TEXT_SECTION_ASM_OP "\t.text" |
| 182 |
#define DATA_SECTION_ASM_OP "\t.data" |
| 183 |
|
| 184 |
/* Assembler Commands for Alignment */ |
| 185 |
|
| 186 |
#define ASM_OUTPUT_ALIGN(STREAM,POWER) \ |
| 187 |
fprintf (STREAM, "\t.p2align\t%d\n", POWER); |
| 188 |
|
| 189 |
/* A C compound statement to output to stdio stream STREAM the |
| 190 |
assembler syntax for an instruction operand X. */ |
| 191 |
#define PRINT_OPERAND(STREAM, X, CODE) ft32_print_operand (STREAM, X, CODE) |
| 192 |
|
| 193 |
#define PRINT_OPERAND_ADDRESS(STREAM ,X) ft32_print_operand_address (STREAM, X) |
| 194 |
|
| 195 |
/* Output and Generation of Labels */ |
| 196 |
|
| 197 |
#define GLOBAL_ASM_OP "\t.global\t" |
| 198 |
|
| 199 |
#define JUMP_TABLES_IN_TEXT_SECTION (TARGET_NOPM ? 0 : 1) |
| 200 |
|
| 201 |
/* This is how to output an element of a case-vector that is absolute. */ |
| 202 |
|
| 203 |
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ |
| 204 |
fprintf (FILE, "\t.long\t.L%d\n", VALUE) \ |
| 205 |
|
| 206 |
/* Passing Arguments in Registers */ |
| 207 |
|
| 208 |
/* A C type for declaring a variable that is used as the first |
| 209 |
argument of `FUNCTION_ARG' and other related values. */ |
| 210 |
#define CUMULATIVE_ARGS unsigned int |
| 211 |
|
| 212 |
/* If defined, the maximum amount of space required for outgoing arguments |
| 213 |
will be computed and placed into the variable |
| 214 |
`current_function_outgoing_args_size'. No space will be pushed |
| 215 |
onto the stack for each call; instead, the function prologue should |
| 216 |
increase the stack frame size by this amount. */ |
| 217 |
#define ACCUMULATE_OUTGOING_ARGS 1 |
| 218 |
|
| 219 |
/* A C statement (sans semicolon) for initializing the variable CUM |
| 220 |
for the state at the beginning of the argument list. |
| 221 |
For ft32, the first arg is passed in register 2 (aka $r0). */ |
| 222 |
#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,FNDECL,N_NAMED_ARGS) \ |
| 223 |
(CUM = FT32_R0) |
| 224 |
|
| 225 |
/* How Scalar Function Values Are Returned */ |
| 226 |
|
| 227 |
/* STACK AND CALLING */ |
| 228 |
|
| 229 |
/* Define this macro if pushing a word onto the stack moves the stack |
| 230 |
pointer to a smaller address. */ |
| 231 |
#define STACK_GROWS_DOWNWARD 1 |
| 232 |
|
| 233 |
/* Offset from the argument pointer register to the first argument's |
| 234 |
address. On some machines it may depend on the data type of the |
| 235 |
function. */ |
| 236 |
#define FIRST_PARM_OFFSET(F) 0 |
| 237 |
|
| 238 |
/* Define this macro to nonzero value if the addresses of local variable slots |
| 239 |
are at negative offsets from the frame pointer. */ |
| 240 |
#define FRAME_GROWS_DOWNWARD 1 |
| 241 |
|
| 242 |
/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, |
| 243 |
the stack pointer does not matter. The value is tested only in |
| 244 |
functions that have frame pointers. |
| 245 |
No definition is equivalent to always zero. */ |
| 246 |
|
| 247 |
#define EXIT_IGNORE_STACK 0 |
| 248 |
|
| 249 |
/* Define this macro as a C expression that is nonzero for registers that are |
| 250 |
used by the epilogue or the return pattern. The stack and frame |
| 251 |
pointer registers are already assumed to be used as needed. */ |
| 252 |
#define EPILOGUE_USES(R) (R == FT32_R5) |
| 253 |
|
| 254 |
/* A C expression whose value is RTL representing the location of the |
| 255 |
incoming return address at the beginning of any function, before |
| 256 |
the prologue. */ |
| 257 |
#define INCOMING_RETURN_ADDR_RTX \ |
| 258 |
gen_frame_mem (Pmode, \ |
| 259 |
plus_constant (Pmode, stack_pointer_rtx, 333 * UNITS_PER_WORD)) |
| 260 |
|
| 261 |
#define RETURN_ADDR_RTX(COUNT, FRAMEADDR) \ |
| 262 |
((COUNT) == 0 \ |
| 263 |
? gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, arg_pointer_rtx, GEN_INT (-4))) \ |
| 264 |
: NULL_RTX) |
| 265 |
|
| 266 |
/* Describe how we implement __builtin_eh_return. */ |
| 267 |
#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N+2) : INVALID_REGNUM) |
| 268 |
|
| 269 |
/* Store the return handler into the call frame. */ |
| 270 |
#define EH_RETURN_HANDLER_RTX \ |
| 271 |
gen_frame_mem (Pmode, \ |
| 272 |
plus_constant (Pmode, frame_pointer_rtx, UNITS_PER_WORD)) |
| 273 |
|
| 274 |
/* Storage Layout */ |
| 275 |
|
| 276 |
#define BITS_BIG_ENDIAN 0 |
| 277 |
#define BYTES_BIG_ENDIAN 0 |
| 278 |
#define WORDS_BIG_ENDIAN 0 |
| 279 |
|
| 280 |
/* Alignment required for a function entry point, in bits. */ |
| 281 |
#define FUNCTION_BOUNDARY 32 |
| 282 |
|
| 283 |
#define BRANCH_COST(speed_p, predictable_p) 2 |
| 284 |
|
| 285 |
/* Define this macro as a C expression which is nonzero if accessing |
| 286 |
less than a word of memory (i.e. a `char' or a `short') is no |
| 287 |
faster than accessing a word of memory. */ |
| 288 |
#define SLOW_BYTE_ACCESS 1 |
| 289 |
|
| 290 |
#define STORE_FLAG_VALUE 1 |
| 291 |
|
| 292 |
#define MOVE_RATIO(speed) ((speed) ? 6 : 2) |
| 293 |
|
| 294 |
/* Number of storage units in a word; normally the size of a |
| 295 |
general-purpose register, a power of two from 1 or 8. */ |
| 296 |
#define UNITS_PER_WORD 4 |
| 297 |
|
| 298 |
/* Define this macro to the minimum alignment enforced by hardware |
| 299 |
for the stack pointer on this machine. The definition is a C |
| 300 |
expression for the desired alignment (measured in bits). */ |
| 301 |
#define STACK_BOUNDARY 32 |
| 302 |
|
| 303 |
/* Normal alignment required for function parameters on the stack, in |
| 304 |
bits. All stack parameters receive at least this much alignment |
| 305 |
regardless of data type. */ |
| 306 |
#define PARM_BOUNDARY 32 |
| 307 |
|
| 308 |
/* Alignment of field after `int : 0' in a structure. */ |
| 309 |
#define EMPTY_FIELD_BOUNDARY 32 |
| 310 |
|
| 311 |
/* No data type wants to be aligned rounder than this. */ |
| 312 |
#define BIGGEST_ALIGNMENT 32 |
| 313 |
|
| 314 |
/* The best alignment to use in cases where we have a choice. */ |
| 315 |
#define FASTEST_ALIGNMENT 32 |
| 316 |
|
| 317 |
/* Align definitions of arrays, unions and structures so that |
| 318 |
initializations and copies can be made more efficient. This is not |
| 319 |
ABI-changing, so it only affects places where we can see the |
| 320 |
definition. Increasing the alignment tends to introduce padding, |
| 321 |
so don't do this when optimizing for size/conserving stack space. */ |
| 322 |
#define FT32_EXPAND_ALIGNMENT(COND, EXP, ALIGN) \ |
| 323 |
(((COND) && ((ALIGN) < BITS_PER_WORD) \ |
| 324 |
&& (TREE_CODE (EXP) == ARRAY_TYPE \ |
| 325 |
|| TREE_CODE (EXP) == UNION_TYPE \ |
| 326 |
|| TREE_CODE (EXP) == RECORD_TYPE)) ? BITS_PER_WORD : (ALIGN)) |
| 327 |
|
| 328 |
/* Make arrays of chars word-aligned for the same reasons. */ |
| 329 |
#define DATA_ALIGNMENT(TYPE, ALIGN) \ |
| 330 |
(TREE_CODE (TYPE) == ARRAY_TYPE \ |
| 331 |
&& TYPE_MODE (TREE_TYPE (TYPE)) == QImode \ |
| 332 |
&& (ALIGN) < FASTEST_ALIGNMENT ? FASTEST_ALIGNMENT : (ALIGN)) |
| 333 |
|
| 334 |
/* Similarly, make sure that objects on the stack are sensibly aligned. */ |
| 335 |
#define LOCAL_ALIGNMENT(EXP, ALIGN) \ |
| 336 |
FT32_EXPAND_ALIGNMENT(/*!flag_conserve_stack*/ 1, EXP, ALIGN) |
| 337 |
|
| 338 |
/* Every structures size must be a multiple of 8 bits. */ |
| 339 |
#define STRUCTURE_SIZE_BOUNDARY 8 |
| 340 |
|
| 341 |
/* Look at the fundamental type that is used for a bit-field and use |
| 342 |
that to impose alignment on the enclosing structure. |
| 343 |
struct s {int a:8}; should have same alignment as "int", not "char". */ |
| 344 |
#define PCC_BITFIELD_TYPE_MATTERS 1 |
| 345 |
|
| 346 |
/* Largest integer machine mode for structures. If undefined, the default |
| 347 |
is GET_MODE_SIZE(DImode). */ |
| 348 |
#define MAX_FIXED_MODE_SIZE 32 |
| 349 |
|
| 350 |
/* Set this nonzero if move instructions will actually fail to work |
| 351 |
when given unaligned data. */ |
| 352 |
#define STRICT_ALIGNMENT 1 |
| 353 |
|
| 354 |
/* Generating Code for Profiling */ |
| 355 |
#define FUNCTION_PROFILER(FILE,LABELNO) (abort (), 0) |
| 356 |
|
| 357 |
/* Trampolines for Nested Functions. */ |
| 358 |
#define TRAMPOLINE_SIZE (2 + 6 + 6 + 2 + 2 + 6) |
| 359 |
|
| 360 |
/* Alignment required for trampolines, in bits. */ |
| 361 |
#define TRAMPOLINE_ALIGNMENT 32 |
| 362 |
|
| 363 |
/* An alias for the machine mode for pointers. */ |
| 364 |
#define Pmode SImode |
| 365 |
|
| 366 |
#define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \ |
| 367 |
do { \ |
| 368 |
if (((MODE) == HImode) \ |
| 369 |
|| ((MODE) == QImode)) \ |
| 370 |
(MODE) = SImode; \ |
| 371 |
} while (0) |
| 372 |
|
| 373 |
/* An alias for the machine mode used for memory references to |
| 374 |
functions being called, in `call' RTL expressions. */ |
| 375 |
#define FUNCTION_MODE QImode |
| 376 |
|
| 377 |
#define STATIC_CHAIN_REGNUM FT32_R28 |
| 378 |
|
| 379 |
/* The register number of the stack pointer register, which must also |
| 380 |
be a fixed register according to `FIXED_REGISTERS'. */ |
| 381 |
#define STACK_POINTER_REGNUM FT32_SP |
| 382 |
|
| 383 |
/* The register number of the frame pointer register, which is used to |
| 384 |
access automatic variables in the stack frame. */ |
| 385 |
#define FRAME_POINTER_REGNUM FT32_FP |
| 386 |
|
| 387 |
/* The register number of the arg pointer register, which is used to |
| 388 |
access the function's argument list. */ |
| 389 |
#define ARG_POINTER_REGNUM FT32_QAP |
| 390 |
|
| 391 |
#define ELIMINABLE_REGS \ |
| 392 |
{{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ |
| 393 |
{ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ |
| 394 |
{FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}} |
| 395 |
|
| 396 |
|
| 397 |
/* This macro returns the initial difference between the specified pair |
| 398 |
of registers. */ |
| 399 |
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ |
| 400 |
do { \ |
| 401 |
(OFFSET) = ft32_initial_elimination_offset ((FROM), (TO)); \ |
| 402 |
} while (0) |
| 403 |
|
| 404 |
/* A C expression that is nonzero if REGNO is the number of a hard |
| 405 |
register in which function arguments are sometimes passed. */ |
| 406 |
#define FUNCTION_ARG_REGNO_P(r) (r >= FT32_R0 && r <= FT32_R5) |
| 407 |
|
| 408 |
/* A macro whose definition is the name of the class to which a valid |
| 409 |
base register must belong. A base register is one used in an |
| 410 |
address which is the register value plus a displacement. */ |
| 411 |
#define BASE_REG_CLASS GENERAL_REGS |
| 412 |
|
| 413 |
#define INDEX_REG_CLASS NO_REGS |
| 414 |
|
| 415 |
#define HARD_REGNO_OK_FOR_BASE_P(NUM) \ |
| 416 |
((unsigned) (NUM) < FIRST_PSEUDO_REGISTER \ |
| 417 |
&& (REGNO_REG_CLASS(NUM) == GENERAL_REGS \ |
| 418 |
|| (NUM) == HARD_FRAME_POINTER_REGNUM)) |
| 419 |
|
| 420 |
/* A C expression which is nonzero if register number NUM is suitable |
| 421 |
for use as a base register in operand addresses. */ |
| 422 |
#ifdef REG_OK_STRICT |
| 423 |
#define REGNO_OK_FOR_BASE_P(NUM) \ |
| 424 |
(HARD_REGNO_OK_FOR_BASE_P(NUM) \ |
| 425 |
|| HARD_REGNO_OK_FOR_BASE_P(reg_renumber[(NUM)])) |
| 426 |
#else |
| 427 |
#define REGNO_OK_FOR_BASE_P(NUM) \ |
| 428 |
((NUM) >= FIRST_PSEUDO_REGISTER || HARD_REGNO_OK_FOR_BASE_P(NUM)) |
| 429 |
#endif |
| 430 |
|
| 431 |
/* A C expression which is nonzero if register number NUM is suitable |
| 432 |
for use as an index register in operand addresses. */ |
| 433 |
#define REGNO_OK_FOR_INDEX_P(NUM) FT32_FP |
| 434 |
|
| 435 |
/* The maximum number of bytes that a single instruction can move |
| 436 |
quickly between memory and registers or between two memory |
| 437 |
locations. */ |
| 438 |
#define MOVE_MAX 4 |
| 439 |
|
| 440 |
/* Define this to be nonzero if shift instructions ignore all but the low-order |
| 441 |
few bits. */ |
| 442 |
#define SHIFT_COUNT_TRUNCATED 1 |
| 443 |
|
| 444 |
/* All load operations zero extend. */ |
| 445 |
#define LOAD_EXTEND_OP(MEM) ZERO_EXTEND |
| 446 |
|
| 447 |
/* A number, the maximum number of registers that can appear in a |
| 448 |
valid memory address. */ |
| 449 |
#define MAX_REGS_PER_ADDRESS 1 |
| 450 |
|
| 451 |
/* An alias for a machine mode name. This is the machine mode that |
| 452 |
elements of a jump-table should have. */ |
| 453 |
#define CASE_VECTOR_MODE SImode |
| 454 |
|
| 455 |
/* Run-time Target Specification */ |
| 456 |
|
| 457 |
#define TARGET_CPU_CPP_BUILTINS() \ |
| 458 |
{ \ |
| 459 |
builtin_define ("__FT32__"); \ |
| 460 |
} |
| 461 |
|
| 462 |
#define HAS_LONG_UNCOND_BRANCH true |
| 463 |
|
| 464 |
#define NO_FUNCTION_CSE 1 |
| 465 |
|
| 466 |
#define ADDR_SPACE_PM 1 |
| 467 |
|
| 468 |
#define REGISTER_TARGET_PRAGMAS() do { \ |
| 469 |
c_register_addr_space ("__flash__", TARGET_NOPM ? 0 : ADDR_SPACE_PM); \ |
| 470 |
} while (0) |
| 471 |
|
| 472 |
extern int ft32_is_mem_pm(rtx o); |
| 473 |
|
| 474 |
#define ASM_OUTPUT_SYMBOL_REF(stream, sym) \ |
| 475 |
do { \ |
| 476 |
assemble_name (stream, XSTR (sym, 0)); \ |
| 477 |
int section_debug = in_section && \ |
| 478 |
(SECTION_STYLE (in_section) == SECTION_NAMED) && \ |
| 479 |
(in_section->named.common.flags & SECTION_DEBUG); \ |
| 480 |
if (!section_debug && SYMBOL_REF_FLAGS (sym) & 0x1000) \ |
| 481 |
asm_fprintf (stream, "-0x800000"); \ |
| 482 |
} while (0) |
| 483 |
|
| 484 |
#endif /* GCC_FT32_H */ |