comparison gcc/config/lm32/lm32.h @ 67:f6334be47118

update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 22 Mar 2011 17:18:12 +0900
parents 77e2b8dfacca
children 04ced10e8804
comparison
equal deleted inserted replaced
65:65488c3d617d 67:f6334be47118
1 /* Definitions of target machine for GNU compiler, Lattice Mico32 architecture. 1 /* Definitions of target machine for GNU compiler, Lattice Mico32 architecture.
2 Contributed by Jon Beniston <jon@beniston.com> 2 Contributed by Jon Beniston <jon@beniston.com>
3 3
4 Copyright (C) 2009 Free Software Foundation, Inc. 4 Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
5 5
6 This file is part of GCC. 6 This file is part of GCC.
7 7
8 GCC is free software; you can redistribute it and/or modify it 8 GCC is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published 9 under the terms of the GNU General Public License as published
52 #define ASM_SPEC "\ 52 #define ASM_SPEC "\
53 %{mmultiply-enabled} \ 53 %{mmultiply-enabled} \
54 %{mdivide-enabled} \ 54 %{mdivide-enabled} \
55 %{mbarrel-shift-enabled} \ 55 %{mbarrel-shift-enabled} \
56 %{msign-extend-enabled} \ 56 %{msign-extend-enabled} \
57 %{muser-extend-enabled} \ 57 %{muser-enabled} \
58 %{v} \
59 " 58 "
60 59
61 /* Let link script define all link options. 60 /* Let link script define all link options.
62 Default to using simulator link script. */ 61 Default to using simulator link script. */
63 62
66 #undef ENDFILE_SPEC 65 #undef ENDFILE_SPEC
67 #define ENDFILE_SPEC "" 66 #define ENDFILE_SPEC ""
68 #undef LIB_SPEC 67 #undef LIB_SPEC
69 #define LIB_SPEC "%{!T*:-T sim.ld}" 68 #define LIB_SPEC "%{!T*:-T sim.ld}"
70 69
71 #define OVERRIDE_OPTIONS lm32_override_options()
72
73 extern int target_flags;
74
75 /* Add -G xx support. */
76
77 #undef SWITCH_TAKES_ARG
78 #define SWITCH_TAKES_ARG(CHAR) \
79 (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G')
80
81 #undef CC1_SPEC 70 #undef CC1_SPEC
82 #define CC1_SPEC "%{G*}" 71 #define CC1_SPEC "%{G*}"
83 72
84 /*---------------------------------*/ 73 /*---------------------------------*/
85 /* Target machine storage layout. */ 74 /* Target machine storage layout. */
86 /*---------------------------------*/ 75 /*---------------------------------*/
87 76
88 #define BITS_BIG_ENDIAN 0 77 #define BITS_BIG_ENDIAN 0
89 #define BYTES_BIG_ENDIAN 1 78 #define BYTES_BIG_ENDIAN 1
90 #define WORDS_BIG_ENDIAN 1 79 #define WORDS_BIG_ENDIAN 1
91 #define LIBGCC2_WORDS_BIG_ENDIAN 1
92 80
93 #define BITS_PER_UNIT 8 81 #define BITS_PER_UNIT 8
94 #define BITS_PER_WORD 32 82 #define BITS_PER_WORD 32
95 #define UNITS_PER_WORD 4 83 #define UNITS_PER_WORD 4
96 84
229 #define REGNO_OK_FOR_BASE_P(REGNO) \ 217 #define REGNO_OK_FOR_BASE_P(REGNO) \
230 (G_REG_P (REGNO) || G_REG_P ((unsigned) reg_renumber[REGNO])) 218 (G_REG_P (REGNO) || G_REG_P ((unsigned) reg_renumber[REGNO]))
231 219
232 #define REGNO_OK_FOR_INDEX_P(REGNO) 0 220 #define REGNO_OK_FOR_INDEX_P(REGNO) 0
233 221
234 #define PREFERRED_RELOAD_CLASS(X,CLASS) (CLASS)
235
236 /*----------------------------------------*/ 222 /*----------------------------------------*/
237 /* Stack Layout and Calling Conventions. */ 223 /* Stack Layout and Calling Conventions. */
238 /*----------------------------------------*/ 224 /*----------------------------------------*/
239 225
240 #define STACK_GROWS_DOWNWARD 1 226 #define STACK_GROWS_DOWNWARD 1
250 #define STACK_POINTER_REGNUM SP_REGNUM 236 #define STACK_POINTER_REGNUM SP_REGNUM
251 237
252 #define FRAME_POINTER_REGNUM FP_REGNUM 238 #define FRAME_POINTER_REGNUM FP_REGNUM
253 239
254 #define ARG_POINTER_REGNUM FRAME_POINTER_REGNUM 240 #define ARG_POINTER_REGNUM FRAME_POINTER_REGNUM
241
242 #define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (SImode, RA_REGNUM)
255 243
256 #define RETURN_ADDR_RTX(count, frame) \ 244 #define RETURN_ADDR_RTX(count, frame) \
257 lm32_return_addr_rtx (count, frame) 245 lm32_return_addr_rtx (count, frame)
258 246
259 /* FIXME - This is not yet supported. */ 247 /* FIXME - This is not yet supported. */
271 /* Function argument passing. */ 259 /* Function argument passing. */
272 /*-----------------------------*/ 260 /*-----------------------------*/
273 261
274 #define ACCUMULATE_OUTGOING_ARGS 1 262 #define ACCUMULATE_OUTGOING_ARGS 1
275 263
276 #define RETURN_POPS_ARGS(DECL, FUNTYPE, SIZE) 0
277
278 /*--------------------------------*/ 264 /*--------------------------------*/
279 /* Passing Arguments in Registers */ 265 /* Passing Arguments in Registers */
280 /*--------------------------------*/ 266 /*--------------------------------*/
281 267
282 /* The first argument register. */ 268 /* The first argument register. */
283 #define LM32_FIRST_ARG_REG 1 269 #define LM32_FIRST_ARG_REG 1
284 270
285 /* The number of (integer) argument register available. */ 271 /* The number of (integer) argument register available. */
286 #define LM32_NUM_ARG_REGS 8 272 #define LM32_NUM_ARG_REGS 8
287 273
288 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
289 lm32_function_arg ((CUM), (MODE), (TYPE), (NAMED))
290
291 #define CUMULATIVE_ARGS int 274 #define CUMULATIVE_ARGS int
292 275
293 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT,N_NAMED_ARGS) \ 276 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT,N_NAMED_ARGS) \
294 (CUM) = 0 277 (CUM) = 0
295
296 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
297 (CUM) += LM32_NUM_REGS2 (MODE, TYPE)
298 278
299 #define FUNCTION_ARG_REGNO_P(r) \ 279 #define FUNCTION_ARG_REGNO_P(r) \
300 (((r) >= LM32_FIRST_ARG_REG) && ((r) <= LM32_NUM_ARG_REGS)) 280 (((r) >= LM32_FIRST_ARG_REG) && ((r) <= LM32_NUM_ARG_REGS))
301 281
302 /*--------------------*/ 282 /*--------------------*/
369 #define REG_OK_FOR_BASE_P(X) STRICT_REG_OK_FOR_BASE_P(X) 349 #define REG_OK_FOR_BASE_P(X) STRICT_REG_OK_FOR_BASE_P(X)
370 #else 350 #else
371 #define REG_OK_FOR_BASE_P(X) NONSTRICT_REG_OK_FOR_BASE_P(X) 351 #define REG_OK_FOR_BASE_P(X) NONSTRICT_REG_OK_FOR_BASE_P(X)
372 #endif 352 #endif
373 353
374 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \ 354 #define LEGITIMATE_CONSTANT_P(X) lm32_legitimate_constant_p (X)
375 if (GET_CODE (ADDR) == PLUS) goto LABEL; \
376
377 #define LEGITIMATE_CONSTANT_P(X) lm32_legitimate_constant_p
378 355
379 /*-------------------------*/ 356 /*-------------------------*/
380 /* Condition Code Status. */ 357 /* Condition Code Status. */
381 /*-------------------------*/ 358 /*-------------------------*/
382 359
436 413
437 /* Override default implementation in elfos.h to support -G. */ 414 /* Override default implementation in elfos.h to support -G. */
438 #undef ASM_OUTPUT_ALIGNED_LOCAL 415 #undef ASM_OUTPUT_ALIGNED_LOCAL
439 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ 416 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
440 do { \ 417 do { \
441 if ((SIZE) <= g_switch_value) \ 418 if ((SIZE) <= (unsigned HOST_WIDE_INT) g_switch_value) \
442 switch_to_section (sbss_section); \ 419 switch_to_section (sbss_section); \
443 else \ 420 else \
444 switch_to_section (bss_section); \ 421 switch_to_section (bss_section); \
445 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \ 422 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
446 if (!flag_inhibit_size_directive) \ 423 if (!flag_inhibit_size_directive) \
453 /* Override default implementation in elfos.h to support -G. */ 430 /* Override default implementation in elfos.h to support -G. */
454 #undef ASM_OUTPUT_ALIGNED_COMMON 431 #undef ASM_OUTPUT_ALIGNED_COMMON
455 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ 432 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
456 do \ 433 do \
457 { \ 434 { \
458 if ((SIZE) <= g_switch_value) \ 435 if ((SIZE) <= (unsigned HOST_WIDE_INT) g_switch_value) \
459 { \ 436 { \
460 switch_to_section (sbss_section); \ 437 switch_to_section (sbss_section); \
461 (*targetm.asm_out.globalize_label) (FILE, NAME); \ 438 (*targetm.asm_out.globalize_label) (FILE, NAME); \
462 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \ 439 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
463 if (!flag_inhibit_size_directive) \ 440 if (!flag_inhibit_size_directive) \
545 /* Debugging. */ 522 /* Debugging. */
546 /*-------------*/ 523 /*-------------*/
547 524
548 #define DBX_REGISTER_NUMBER(REGNO) (REGNO) 525 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
549 526
550 #define CAN_DEBUG_WITHOUT_FP
551
552 #define DEFAULT_GDB_EXTENSIONS 1 527 #define DEFAULT_GDB_EXTENSIONS 1
553 528
554 /*--------*/ 529 /*--------*/
555 /* Misc. */ 530 /* Misc. */
556 /*--------*/ 531 /*--------*/