comparison gcc/config/bfin/bfin.h @ 55:77e2b8dfacca gcc-4.4.5

update it from 4.4.3 to 4.5.0
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Fri, 12 Feb 2010 23:39:51 +0900
parents a06113de4d67
children b7f97abdc517
comparison
equal deleted inserted replaced
52:c156f1bd5cd9 55:77e2b8dfacca
1 /* Definitions for the Blackfin port. 1 /* Definitions for the Blackfin port.
2 Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. 2 Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
3 Contributed by Analog Devices. 3 Contributed by Analog Devices.
4 4
5 This file is part of GCC. 5 This file is part of GCC.
6 6
7 GCC is free software; you can redistribute it and/or modify it 7 GCC is free software; you can redistribute it and/or modify it
23 23
24 #define OBJECT_FORMAT_ELF 24 #define OBJECT_FORMAT_ELF
25 25
26 #define BRT 1 26 #define BRT 1
27 #define BRF 0 27 #define BRF 0
28
29 /* CPU type. */
30 typedef enum bfin_cpu_type
31 {
32 BFIN_CPU_UNKNOWN,
33 BFIN_CPU_BF512,
34 BFIN_CPU_BF514,
35 BFIN_CPU_BF516,
36 BFIN_CPU_BF518,
37 BFIN_CPU_BF522,
38 BFIN_CPU_BF523,
39 BFIN_CPU_BF524,
40 BFIN_CPU_BF525,
41 BFIN_CPU_BF526,
42 BFIN_CPU_BF527,
43 BFIN_CPU_BF531,
44 BFIN_CPU_BF532,
45 BFIN_CPU_BF533,
46 BFIN_CPU_BF534,
47 BFIN_CPU_BF536,
48 BFIN_CPU_BF537,
49 BFIN_CPU_BF538,
50 BFIN_CPU_BF539,
51 BFIN_CPU_BF542,
52 BFIN_CPU_BF542M,
53 BFIN_CPU_BF544,
54 BFIN_CPU_BF544M,
55 BFIN_CPU_BF547,
56 BFIN_CPU_BF547M,
57 BFIN_CPU_BF548,
58 BFIN_CPU_BF548M,
59 BFIN_CPU_BF549,
60 BFIN_CPU_BF549M,
61 BFIN_CPU_BF561
62 } bfin_cpu_t;
63
64 /* Value of -mcpu= */
65 extern bfin_cpu_t bfin_cpu_type;
66
67 /* Value of -msi-revision= */
68 extern int bfin_si_revision;
69
70 extern unsigned int bfin_workarounds;
28 71
29 /* Print subsidiary information on the compiler version in use. */ 72 /* Print subsidiary information on the compiler version in use. */
30 #define TARGET_VERSION fprintf (stderr, " (BlackFin bfin)") 73 #define TARGET_VERSION fprintf (stderr, " (BlackFin bfin)")
31 74
32 /* Run-time compilation parameters selecting different hardware subsets. */ 75 /* Run-time compilation parameters selecting different hardware subsets. */
107 builtin_define ("__ADSPBF538__"); \ 150 builtin_define ("__ADSPBF538__"); \
108 break; \ 151 break; \
109 case BFIN_CPU_BF539: \ 152 case BFIN_CPU_BF539: \
110 builtin_define ("__ADSPBF539__"); \ 153 builtin_define ("__ADSPBF539__"); \
111 break; \ 154 break; \
155 case BFIN_CPU_BF542M: \
156 builtin_define ("__ADSPBF542M__"); \
112 case BFIN_CPU_BF542: \ 157 case BFIN_CPU_BF542: \
113 builtin_define ("__ADSPBF542__"); \ 158 builtin_define ("__ADSPBF542__"); \
114 builtin_define ("__ADSPBF54x__"); \ 159 builtin_define ("__ADSPBF54x__"); \
115 break; \ 160 break; \
161 case BFIN_CPU_BF544M: \
162 builtin_define ("__ADSPBF544M__"); \
116 case BFIN_CPU_BF544: \ 163 case BFIN_CPU_BF544: \
117 builtin_define ("__ADSPBF544__"); \ 164 builtin_define ("__ADSPBF544__"); \
118 builtin_define ("__ADSPBF54x__"); \ 165 builtin_define ("__ADSPBF54x__"); \
119 break; \ 166 break; \
167 case BFIN_CPU_BF547M: \
168 builtin_define ("__ADSPBF547M__"); \
169 case BFIN_CPU_BF547: \
170 builtin_define ("__ADSPBF547__"); \
171 builtin_define ("__ADSPBF54x__"); \
172 break; \
173 case BFIN_CPU_BF548M: \
174 builtin_define ("__ADSPBF548M__"); \
120 case BFIN_CPU_BF548: \ 175 case BFIN_CPU_BF548: \
121 builtin_define ("__ADSPBF548__"); \ 176 builtin_define ("__ADSPBF548__"); \
122 builtin_define ("__ADSPBF54x__"); \ 177 builtin_define ("__ADSPBF54x__"); \
123 break; \ 178 break; \
124 case BFIN_CPU_BF547: \ 179 case BFIN_CPU_BF549M: \
125 builtin_define ("__ADSPBF547__"); \ 180 builtin_define ("__ADSPBF549M__"); \
126 builtin_define ("__ADSPBF54x__"); \
127 break; \
128 case BFIN_CPU_BF549: \ 181 case BFIN_CPU_BF549: \
129 builtin_define ("__ADSPBF549__"); \ 182 builtin_define ("__ADSPBF549__"); \
130 builtin_define ("__ADSPBF54x__"); \ 183 builtin_define ("__ADSPBF54x__"); \
131 break; \ 184 break; \
132 case BFIN_CPU_BF561: \ 185 case BFIN_CPU_BF561: \
311 /* Define this if the maximum size of all the outgoing args is to be 364 /* Define this if the maximum size of all the outgoing args is to be
312 accumulated and pushed during the prologue. The amount can be 365 accumulated and pushed during the prologue. The amount can be
313 found in the variable crtl->outgoing_args_size. */ 366 found in the variable crtl->outgoing_args_size. */
314 #define ACCUMULATE_OUTGOING_ARGS 1 367 #define ACCUMULATE_OUTGOING_ARGS 1
315 368
316 /* Value should be nonzero if functions must have frame pointers.
317 Zero means the frame pointer need not be set up (and parms
318 may be accessed via the stack pointer) in functions that seem suitable.
319 This is computed in `reload', in reload1.c.
320 */
321 #define FRAME_POINTER_REQUIRED (bfin_frame_pointer_required ())
322
323 /*#define DATA_ALIGNMENT(TYPE, BASIC-ALIGN) for arrays.. */ 369 /*#define DATA_ALIGNMENT(TYPE, BASIC-ALIGN) for arrays.. */
324 370
325 /* If defined, a C expression to compute the alignment for a local 371 /* If defined, a C expression to compute the alignment for a local
326 variable. TYPE is the data type, and ALIGN is the alignment that 372 variable. TYPE is the data type, and ALIGN is the alignment that
327 the object would ordinarily have. The value of this macro is used 373 the object would ordinarily have. The value of this macro is used
338 #define CONSTANT_ALIGNMENT(EXP, ALIGN) \ 384 #define CONSTANT_ALIGNMENT(EXP, ALIGN) \
339 (TREE_CODE (EXP) == STRING_CST \ 385 (TREE_CODE (EXP) == STRING_CST \
340 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN)) 386 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
341 387
342 #define TRAMPOLINE_SIZE (TARGET_FDPIC ? 30 : 18) 388 #define TRAMPOLINE_SIZE (TARGET_FDPIC ? 30 : 18)
343 #define TRAMPOLINE_TEMPLATE(FILE) \
344 if (TARGET_FDPIC) \
345 { \
346 fprintf(FILE, "\t.dd\t0x00000000\n"); /* 0 */ \
347 fprintf(FILE, "\t.dd\t0x00000000\n"); /* 0 */ \
348 fprintf(FILE, "\t.dd\t0x0000e109\n"); /* p1.l = fn low */ \
349 fprintf(FILE, "\t.dd\t0x0000e149\n"); /* p1.h = fn high */ \
350 fprintf(FILE, "\t.dd\t0x0000e10a\n"); /* p2.l = sc low */ \
351 fprintf(FILE, "\t.dd\t0x0000e14a\n"); /* p2.h = sc high */ \
352 fprintf(FILE, "\t.dw\t0xac4b\n"); /* p3 = [p1 + 4] */ \
353 fprintf(FILE, "\t.dw\t0x9149\n"); /* p1 = [p1] */ \
354 fprintf(FILE, "\t.dw\t0x0051\n"); /* jump (p1)*/ \
355 } \
356 else \
357 { \
358 fprintf(FILE, "\t.dd\t0x0000e109\n"); /* p1.l = fn low */ \
359 fprintf(FILE, "\t.dd\t0x0000e149\n"); /* p1.h = fn high */ \
360 fprintf(FILE, "\t.dd\t0x0000e10a\n"); /* p2.l = sc low */ \
361 fprintf(FILE, "\t.dd\t0x0000e14a\n"); /* p2.h = sc high */ \
362 fprintf(FILE, "\t.dw\t0x0051\n"); /* jump (p1)*/ \
363 }
364
365 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
366 initialize_trampoline (TRAMP, FNADDR, CXT)
367 389
368 /* Definitions for register eliminations. 390 /* Definitions for register eliminations.
369 391
370 This is an array of structures. Each structure initializes one pair 392 This is an array of structures. Each structure initializes one pair
371 of eliminable registers. The "from" register number is given first, 393 of eliminable registers. The "from" register number is given first,
380 402
381 #define ELIMINABLE_REGS \ 403 #define ELIMINABLE_REGS \
382 {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ 404 {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
383 { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ 405 { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
384 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}} \ 406 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}} \
385
386 /* Given FROM and TO register numbers, say whether this elimination is
387 allowed. Frame pointer elimination is automatically handled.
388
389 All other eliminations are valid. */
390
391 #define CAN_ELIMINATE(FROM, TO) \
392 ((TO) == STACK_POINTER_REGNUM ? ! frame_pointer_needed : 1)
393 407
394 /* Define the offset between two registers, one to be eliminated, and the other 408 /* Define the offset between two registers, one to be eliminated, and the other
395 its replacement, at the start of a routine. */ 409 its replacement, at the start of a routine. */
396 410
397 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ 411 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
807 /* The type of the current function; normal functions are of type 821 /* The type of the current function; normal functions are of type
808 SUBROUTINE. */ 822 SUBROUTINE. */
809 typedef enum { 823 typedef enum {
810 SUBROUTINE, INTERRUPT_HANDLER, EXCPT_HANDLER, NMI_HANDLER 824 SUBROUTINE, INTERRUPT_HANDLER, EXCPT_HANDLER, NMI_HANDLER
811 } e_funkind; 825 } e_funkind;
826 #define FUNCTION_RETURN_REGISTERS { REG_RETS, REG_RETI, REG_RETX, REG_RETN }
812 827
813 #define FUNCTION_ARG_REGISTERS { REG_R0, REG_R1, REG_R2, -1 } 828 #define FUNCTION_ARG_REGISTERS { REG_R0, REG_R1, REG_R2, -1 }
814 829
815 /* Flags for the call/call_value rtl operations set up by function_arg */ 830 /* Flags for the call/call_value rtl operations set up by function_arg */
816 #define CALL_NORMAL 0x00000000 /* no special processing */ 831 #define CALL_NORMAL 0x00000000 /* no special processing */
894 #define EH_RETURN_HANDLER_RTX \ 909 #define EH_RETURN_HANDLER_RTX \
895 gen_frame_mem (Pmode, plus_constant (frame_pointer_rtx, UNITS_PER_WORD)) 910 gen_frame_mem (Pmode, plus_constant (frame_pointer_rtx, UNITS_PER_WORD))
896 911
897 /* Addressing Modes */ 912 /* Addressing Modes */
898 913
899 /* Recognize any constant value that is a valid address. */
900 #define CONSTANT_ADDRESS_P(X) (CONSTANT_P (X))
901
902 /* Nonzero if the constant value X is a legitimate general operand. 914 /* Nonzero if the constant value X is a legitimate general operand.
903 symbol_ref are not legitimate and will be put into constant pool. 915 symbol_ref are not legitimate and will be put into constant pool.
904 See force_const_mem(). 916 See force_const_mem().
905 If -mno-pool, all constants are legitimate. 917 If -mno-pool, all constants are legitimate.
906 */ 918 */
907 #define LEGITIMATE_CONSTANT_P(X) bfin_legitimate_constant_p (X) 919 #define LEGITIMATE_CONSTANT_P(X) bfin_legitimate_constant_p (X)
908 920
909 /* A number, the maximum number of registers that can appear in a 921 /* A number, the maximum number of registers that can appear in a
910 valid memory address. Note that it is up to you to specify a 922 valid memory address. Note that it is up to you to specify a
911 value equal to the maximum number that `GO_IF_LEGITIMATE_ADDRESS' 923 value equal to the maximum number that `TARGET_LEGITIMATE_ADDRESS_P'
912 would ever accept. */ 924 would ever accept. */
913 #define MAX_REGS_PER_ADDRESS 1 925 #define MAX_REGS_PER_ADDRESS 1
914 926
915 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
916 that is a valid memory address for an instruction.
917 The MODE argument is the machine mode for the MEM expression
918 that wants to use this address.
919
920 Blackfin addressing modes are as follows:
921
922 [preg]
923 [preg + imm16]
924
925 B [ Preg + uimm15 ]
926 W [ Preg + uimm16m2 ]
927 [ Preg + uimm17m4 ]
928
929 [preg++]
930 [preg--]
931 [--sp]
932 */
933
934 #define LEGITIMATE_MODE_FOR_AUTOINC_P(MODE) \ 927 #define LEGITIMATE_MODE_FOR_AUTOINC_P(MODE) \
935 (GET_MODE_SIZE (MODE) <= 4 || (MODE) == PDImode) 928 (GET_MODE_SIZE (MODE) <= 4 || (MODE) == PDImode)
936
937 #ifdef REG_OK_STRICT
938 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, WIN) \
939 do { \
940 if (bfin_legitimate_address_p (MODE, X, 1)) \
941 goto WIN; \
942 } while (0);
943 #else
944 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, WIN) \
945 do { \
946 if (bfin_legitimate_address_p (MODE, X, 0)) \
947 goto WIN; \
948 } while (0);
949 #endif
950
951 /* Try machine-dependent ways of modifying an illegitimate address
952 to be legitimate. If we find one, return the new, valid address.
953 This macro is used in only one place: `memory_address' in explow.c.
954
955 OLDX is the address as it was before break_out_memory_refs was called.
956 In some cases it is useful to look at this to decide what needs to be done.
957
958 MODE and WIN are passed so that this macro can use
959 GO_IF_LEGITIMATE_ADDRESS.
960
961 It is always safe for this macro to do nothing. It exists to recognize
962 opportunities to optimize the output.
963 */
964 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \
965 do { \
966 rtx _q = legitimize_address(X, OLDX, MODE); \
967 if (_q) { X = _q; goto WIN; } \
968 } while (0)
969 929
970 #define HAVE_POST_INCREMENT 1 930 #define HAVE_POST_INCREMENT 1
971 #define HAVE_POST_DECREMENT 1 931 #define HAVE_POST_DECREMENT 1
972 #define HAVE_PRE_DECREMENT 1 932 #define HAVE_PRE_DECREMENT 1
973 933
983 943
984 #define SYMBOLIC_CONST(X) \ 944 #define SYMBOLIC_CONST(X) \
985 (GET_CODE (X) == SYMBOL_REF \ 945 (GET_CODE (X) == SYMBOL_REF \
986 || GET_CODE (X) == LABEL_REF \ 946 || GET_CODE (X) == LABEL_REF \
987 || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X))) 947 || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X)))
988
989 /*
990 A C statement or compound statement with a conditional `goto
991 LABEL;' executed if memory address X (an RTX) can have different
992 meanings depending on the machine mode of the memory reference it
993 is used for or if the address is valid for some modes but not
994 others.
995
996 Autoincrement and autodecrement addresses typically have
997 mode-dependent effects because the amount of the increment or
998 decrement is the size of the operand being addressed. Some
999 machines have other mode-dependent addresses. Many RISC machines
1000 have no mode-dependent addresses.
1001
1002 You may assume that ADDR is a valid address for the machine.
1003 */
1004 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)
1005 948
1006 #define NOTICE_UPDATE_CC(EXPR, INSN) 0 949 #define NOTICE_UPDATE_CC(EXPR, INSN) 0
1007 950
1008 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits 951 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
1009 is done just by pretending it is already truncated. */ 952 is done just by pretending it is already truncated. */
1326 #define NO_PROFILE_COUNTERS 1 1269 #define NO_PROFILE_COUNTERS 1
1327 1270
1328 #define ASM_OUTPUT_REG_PUSH(FILE, REGNO) fprintf (FILE, "[SP--] = %s;\n", reg_names[REGNO]) 1271 #define ASM_OUTPUT_REG_PUSH(FILE, REGNO) fprintf (FILE, "[SP--] = %s;\n", reg_names[REGNO])
1329 #define ASM_OUTPUT_REG_POP(FILE, REGNO) fprintf (FILE, "%s = [SP++];\n", reg_names[REGNO]) 1272 #define ASM_OUTPUT_REG_POP(FILE, REGNO) fprintf (FILE, "%s = [SP++];\n", reg_names[REGNO])
1330 1273
1331 extern struct rtx_def *bfin_compare_op0, *bfin_compare_op1;
1332 extern struct rtx_def *bfin_cc_rtx, *bfin_rets_rtx; 1274 extern struct rtx_def *bfin_cc_rtx, *bfin_rets_rtx;
1333 1275
1334 /* This works for GAS and some other assemblers. */ 1276 /* This works for GAS and some other assemblers. */
1335 #define SET_ASM_OP ".set " 1277 #define SET_ASM_OP ".set "
1336 1278
1337 /* DBX register number for a given compiler register number */ 1279 /* DBX register number for a given compiler register number */
1338 #define DBX_REGISTER_NUMBER(REGNO) (REGNO) 1280 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
1339 1281
1340 #define SIZE_ASM_OP "\t.size\t" 1282 #define SIZE_ASM_OP "\t.size\t"
1341 1283
1342 extern int splitting_for_sched; 1284 extern int splitting_for_sched, splitting_loops;
1343 1285
1344 #define PRINT_OPERAND_PUNCT_VALID_P(CHAR) ((CHAR) == '!') 1286 #define PRINT_OPERAND_PUNCT_VALID_P(CHAR) ((CHAR) == '!')
1345 1287
1288 #ifndef TARGET_SUPPORTS_SYNC_CALLS
1289 #define TARGET_SUPPORTS_SYNC_CALLS 0
1290 #endif
1291
1346 #endif /* _BFIN_CONFIG */ 1292 #endif /* _BFIN_CONFIG */