comparison gcc/config/picochip/picochip.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 b7f97abdc517
children
comparison
equal deleted inserted replaced
65:65488c3d617d 67:f6334be47118
1 /* Definitions of target machine for GNU compiler for picoChip 1 /* Definitions of target machine for GNU compiler for picoChip
2 Copyright (C) 2001, 2008 Free Software Foundation, Inc. 2 Copyright (C) 2001, 2008, 2009, 2010 Free Software Foundation, Inc.
3 3
4 Contributed by picoChip Designs Ltd. (http://www.picochip.com) 4 Contributed by Picochip Ltd. (http://www.picochip.com)
5 Maintained by Daniel Towner (daniel.towner@picochip.com) and 5 Maintained by Daniel Towner (daniel.towner@picochip.com) and
6 Hariharan Sandanagobalane (hariharan@picochip.com). 6 Hariharan Sandanagobalane (hariharan@picochip.com).
7 7
8 This file is part of GCC. 8 This file is part of GCC.
9 9
58 } \ 58 } \
59 while (0) 59 while (0)
60 60
61 /* Translate requests for particular AEs into their respective ISA 61 /* Translate requests for particular AEs into their respective ISA
62 options. Note that byte access is enabled by default. */ 62 options. Note that byte access is enabled by default. */
63 #define TARGET_OPTION_TRANSLATE_TABLE \ 63 #define DRIVER_SELF_SPECS \
64 { "-mae=ANY", "-mmul-type=none -mno-byte-access" }, \ 64 "%{mae=ANY:-mmul-type=none -mno-byte-access} %<mae=ANY", \
65 { "-mae=ANY2", "-mmul-type=none -mno-byte-access" }, \ 65 "%{mae=ANY2:-mmul-type=none -mno-byte-access} %<mae=ANY2", \
66 { "-mae=ANY3", "-mmul-type=none" }, \ 66 "%{mae=ANY3:-mmul-type=none} %<mae=ANY3", \
67 { "-mae=STAN", "-mmul-type=none -mno-byte-access" }, \ 67 "%{mae=STAN:-mmul-type=none -mno-byte-access} %<mae=STAN", \
68 { "-mae=STAN2", "-mmul-type=mac -mno-byte-access" }, \ 68 "%{mae=STAN2:-mmul-type=mac -mno-byte-access} %<mae=STAN2", \
69 { "-mae=STAN3", "-mmul-type=mac " }, \ 69 "%{mae=STAN3:-mmul-type=mac} %<mae=STAN3", \
70 { "-mae=MAC", "-mmul-type=mac -mno-byte-access" }, \ 70 "%{mae=MAC:-mmul-type=mac -mno-byte-access} %<mae=MAC", \
71 { "-mae=MUL", "-mmul-type=mul" }, \ 71 "%{mae=MUL:-mmul-type=mul} %<mae=MUL", \
72 { "-mae=MEM", "-mmul-type=mul" }, \ 72 "%{mae=MEM:-mmul-type=mul} %<mae=MEM", \
73 { "-mae=MEM2", "-mmul-type=mul" }, \ 73 "%{mae=MEM2:-mmul-type=mul} %<mae=MEM2", \
74 { "-mae=CTRL", "-mmul-type=mul" }, \ 74 "%{mae=CTRL:-mmul-type=mul} %<mae=CTRL", \
75 { "-mae=CTRL2", "-mmul-type=mul" } 75 "%{mae=CTRL2:-mmul-type=mul} %<mae=CTRL2"
76 76
77 /* Specify the default options, so that the multilib build doesn't 77 /* Specify the default options, so that the multilib build doesn't
78 need to provide special cases for the defaults. */ 78 need to provide special cases for the defaults. */
79 #define MULTILIB_DEFAULTS \ 79 #define MULTILIB_DEFAULTS \
80 { "mmul-type=mul", "mbyte-access"} 80 { "mmul-type=mul", "mbyte-access"}
81 81
82 #define TARGET_HAS_BYTE_ACCESS (picochip_has_byte_access) 82 #define TARGET_HAS_BYTE_ACCESS (picochip_has_byte_access)
83 #define TARGET_HAS_MUL_UNIT (picochip_has_mul_unit) 83 #define TARGET_HAS_MUL_UNIT (picochip_has_mul_unit)
84 #define TARGET_HAS_MAC_UNIT (picochip_has_mac_unit) 84 #define TARGET_HAS_MAC_UNIT (picochip_has_mac_unit)
85 #define TARGET_HAS_MULTIPLY (picochip_has_mac_unit || picochip_has_mul_unit) 85 #define TARGET_HAS_MULTIPLY (picochip_has_mac_unit || picochip_has_mul_unit)
86
87 /* Allow some options to be overriden. In particular, the 2nd
88 scheduling pass option is switched off, and a machine dependent
89 reorganisation ensures that it is run later on, after the second
90 jump optimisation. */
91 #define OVERRIDE_OPTIONS picochip_override_options()
92
93 #define CAN_DEBUG_WITHOUT_FP 1
94 86
95 #define TARGET_VERSION fprintf(stderr, "(picoChip)"); 87 #define TARGET_VERSION fprintf(stderr, "(picoChip)");
96 88
97 /* Storage Layout */ 89 /* Storage Layout */
98 90
359 #define REGNO_OK_FOR_BASE_P(REGNO) \ 351 #define REGNO_OK_FOR_BASE_P(REGNO) \
360 (REGNO_REG_CLASS (REGNO) != CC_REGS && REGNO_REG_CLASS (REGNO) != ACC_REGS) 352 (REGNO_REG_CLASS (REGNO) != CC_REGS && REGNO_REG_CLASS (REGNO) != ACC_REGS)
361 353
362 #define REGNO_OK_FOR_INDEX_P(REGNO) 0 354 #define REGNO_OK_FOR_INDEX_P(REGNO) 0
363 355
364 #define PREFERRED_RELOAD_CLASS(X, CLASS) CLASS
365
366 #define CLASS_MAX_NREGS(CLASS, MODE) picochip_class_max_nregs(CLASS, MODE) 356 #define CLASS_MAX_NREGS(CLASS, MODE) picochip_class_max_nregs(CLASS, MODE)
367 357
368 358
369 /* Stack Layout and Calling Conventions */ 359 /* Stack Layout and Calling Conventions */
370 360
404 394
405 #define ACCUMULATE_OUTGOING_ARGS 1 395 #define ACCUMULATE_OUTGOING_ARGS 1
406 396
407 #define PUSH_ARGS 0 397 #define PUSH_ARGS 0
408 398
409 /* Functions don't pop their args. */
410 #define RETURN_POPS_ARGS(FNDECL, FNTYPE, STACK) 0
411
412 /* Passing Arguments in Registers */ 399 /* Passing Arguments in Registers */
413 400
414 /* Store the offset of the next argument. */ 401 /* Store the offset of the next argument. */
415 #define CUMULATIVE_ARGS unsigned 402 #define CUMULATIVE_ARGS unsigned
416 403
417 /* Decide how function arguments are handled. */
418 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
419 picochip_function_arg (CUM, MODE, TYPE, NAMED)
420
421 /* Incoming arguments are always the same as normal arguments, except
422 for a function which uses variadic arguments, in which case all
423 arguments are effectively passed on the stack. */
424 #define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \
425 picochip_incoming_function_arg(CUM, MODE, TYPE, NAMED)
426
427 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT,N_NAMED_ARGS) \ 404 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT,N_NAMED_ARGS) \
428 ((CUM) = 0) 405 ((CUM) = 0)
429
430 #define FUNCTION_ARG_ADVANCE(CUM,MODE,TYPE,NAMED) \
431 (CUM) = picochip_arg_advance (CUM, MODE, TYPE, NAMED)
432
433 /* Originally this used TYPE_ALIGN to determine the
434 alignment. Unfortunately, this fails in some cases, because the
435 type is unknown (e.g., libcall's). Instead, use GET_MODE_ALIGNMENT
436 since the mode is always present. */
437 #define FUNCTION_ARG_BOUNDARY(MODE,TYPE) \
438 picochip_get_function_arg_boundary(MODE)
439 406
440 /* The first 6 registers can hold parameters. */ 407 /* The first 6 registers can hold parameters. */
441 #define FUNCTION_ARG_REGNO_P(REGNO) ((REGNO) < 6) 408 #define FUNCTION_ARG_REGNO_P(REGNO) ((REGNO) < 6)
442 409
443 /* How Scalar Function Values are Returned 410 /* How Scalar Function Values are Returned
574 use periods to generate the name, so we use a ___ separator 541 use periods to generate the name, so we use a ___ separator
575 instead. */ 542 instead. */
576 543
577 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \ 544 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
578 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 15), \ 545 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 15), \
579 sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO))) 546 sprintf ((OUTPUT), "%s___%lu", (NAME), (unsigned long)(LABELNO)))
580 547
581 /* Macros Controlling Initialization Routines */ 548 /* Macros Controlling Initialization Routines */
582 549
583 /* By defining this, the main function won't try to call `__main'. */ 550 /* By defining this, the main function won't try to call `__main'. */
584 #define HAS_INIT_SECTION 551 #define HAS_INIT_SECTION
646 fprintf (stream, ".initWord _L%d\n", value); 613 fprintf (stream, ".initWord _L%d\n", value);
647 614
648 /* Assembler Commands for Alignment */ 615 /* Assembler Commands for Alignment */
649 616
650 #define ASM_OUTPUT_SKIP(STREAM,BYTES) \ 617 #define ASM_OUTPUT_SKIP(STREAM,BYTES) \
651 fprintf(STREAM, ".skip %u\n", BYTES); 618 fprintf(STREAM, ".skip "HOST_WIDE_INT_PRINT_UNSIGNED"\n", BYTES);
652 #define ASM_OUTPUT_ALIGN(STREAM,POWER) \ 619 #define ASM_OUTPUT_ALIGN(STREAM,POWER) \
653 fprintf(STREAM, ".align %u\n", 1 << POWER); 620 fprintf(STREAM, ".align %u\n", 1 << POWER);
654 621
655 /* The elaborator doesn't output zero bytes in the text section. */ 622 /* The elaborator doesn't output zero bytes in the text section. */
656 #define ASM_NO_SKIP_IN_TEXT 1 623 #define ASM_NO_SKIP_IN_TEXT 1