Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/iq2000/iq2000.h @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | f6334be47118 |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* Definitions of target machine for GNU compiler. | 1 /* Definitions of target machine for GNU compiler. |
2 Vitesse IQ2000 processors | 2 Vitesse IQ2000 processors |
3 Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 | 3 Copyright (C) 2003-2017 Free Software Foundation, Inc. |
4 Free Software Foundation, Inc. | |
5 | 4 |
6 This file is part of GCC. | 5 This file is part of GCC. |
7 | 6 |
8 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 |
9 under the terms of the GNU General Public License as published | 8 under the terms of the GNU General Public License as published |
55 #define TARGET_DEBUG_D_MODE 0 | 54 #define TARGET_DEBUG_D_MODE 0 |
56 | 55 |
57 #ifndef IQ2000_ISA_DEFAULT | 56 #ifndef IQ2000_ISA_DEFAULT |
58 #define IQ2000_ISA_DEFAULT 1 | 57 #define IQ2000_ISA_DEFAULT 1 |
59 #endif | 58 #endif |
60 | |
61 #define IQ2000_VERSION "[1.0]" | |
62 | |
63 #ifndef MACHINE_TYPE | |
64 #define MACHINE_TYPE "IQ2000" | |
65 #endif | |
66 | |
67 #ifndef TARGET_VERSION_INTERNAL | |
68 #define TARGET_VERSION_INTERNAL(STREAM) \ | |
69 fprintf (STREAM, " %s %s", IQ2000_VERSION, MACHINE_TYPE) | |
70 #endif | |
71 | |
72 #ifndef TARGET_VERSION | |
73 #define TARGET_VERSION TARGET_VERSION_INTERNAL (stderr) | |
74 #endif | |
75 | 59 |
76 /* Storage Layout. */ | 60 /* Storage Layout. */ |
77 | 61 |
78 #define BITS_BIG_ENDIAN 0 | 62 #define BITS_BIG_ENDIAN 0 |
79 #define BYTES_BIG_ENDIAN 1 | 63 #define BYTES_BIG_ENDIAN 1 |
109 #define DATA_ALIGNMENT(TYPE, ALIGN) \ | 93 #define DATA_ALIGNMENT(TYPE, ALIGN) \ |
110 ((((ALIGN) < BITS_PER_WORD) \ | 94 ((((ALIGN) < BITS_PER_WORD) \ |
111 && (TREE_CODE (TYPE) == ARRAY_TYPE \ | 95 && (TREE_CODE (TYPE) == ARRAY_TYPE \ |
112 || TREE_CODE (TYPE) == UNION_TYPE \ | 96 || TREE_CODE (TYPE) == UNION_TYPE \ |
113 || TREE_CODE (TYPE) == RECORD_TYPE)) ? BITS_PER_WORD : (ALIGN)) | 97 || TREE_CODE (TYPE) == RECORD_TYPE)) ? BITS_PER_WORD : (ALIGN)) |
114 | |
115 #define CONSTANT_ALIGNMENT(EXP, ALIGN) \ | |
116 ((TREE_CODE (EXP) == STRING_CST || TREE_CODE (EXP) == CONSTRUCTOR) \ | |
117 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN)) | |
118 | 98 |
119 #define EMPTY_FIELD_BOUNDARY 32 | 99 #define EMPTY_FIELD_BOUNDARY 32 |
120 | 100 |
121 #define STRUCTURE_SIZE_BOUNDARY 8 | 101 #define STRUCTURE_SIZE_BOUNDARY 8 |
122 | 102 |
174 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, \ | 154 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, \ |
175 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 \ | 155 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 \ |
176 } | 156 } |
177 | 157 |
178 | 158 |
179 /* How Values Fit in Registers. */ | |
180 | |
181 #define HARD_REGNO_NREGS(REGNO, MODE) \ | |
182 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) | |
183 | |
184 #define HARD_REGNO_MODE_OK(REGNO, MODE) \ | |
185 ((REGNO_REG_CLASS (REGNO) == GR_REGS) \ | |
186 ? ((REGNO) & 1) == 0 || GET_MODE_SIZE (MODE) <= 4 \ | |
187 : ((REGNO) & 1) == 0 || GET_MODE_SIZE (MODE) == 4) | |
188 | |
189 #define MODES_TIEABLE_P(MODE1, MODE2) \ | |
190 ((GET_MODE_CLASS (MODE1) == MODE_FLOAT || \ | |
191 GET_MODE_CLASS (MODE1) == MODE_COMPLEX_FLOAT) \ | |
192 == (GET_MODE_CLASS (MODE2) == MODE_FLOAT || \ | |
193 GET_MODE_CLASS (MODE2) == MODE_COMPLEX_FLOAT)) | |
194 | 159 |
195 #define AVOID_CCMODE_COPIES | 160 #define AVOID_CCMODE_COPIES |
196 | 161 |
197 | 162 |
198 /* Register Classes. */ | 163 /* Register Classes. */ |
206 }; | 171 }; |
207 | 172 |
208 #define GENERAL_REGS GR_REGS | 173 #define GENERAL_REGS GR_REGS |
209 | 174 |
210 #define N_REG_CLASSES (int) LIM_REG_CLASSES | 175 #define N_REG_CLASSES (int) LIM_REG_CLASSES |
211 | |
212 #define IRA_COVER_CLASSES \ | |
213 { \ | |
214 GR_REGS, LIM_REG_CLASSES \ | |
215 } | |
216 | 176 |
217 #define REG_CLASS_NAMES \ | 177 #define REG_CLASS_NAMES \ |
218 { \ | 178 { \ |
219 "NO_REGS", \ | 179 "NO_REGS", \ |
220 "GR_REGS", \ | 180 "GR_REGS", \ |
246 : ((GET_MODE_CLASS (GET_MODE (X)) == MODE_INT \ | 206 : ((GET_MODE_CLASS (GET_MODE (X)) == MODE_INT \ |
247 || GET_MODE (X) == VOIDmode) \ | 207 || GET_MODE (X) == VOIDmode) \ |
248 ? (GR_REGS) \ | 208 ? (GR_REGS) \ |
249 : (CLASS)))) | 209 : (CLASS)))) |
250 | 210 |
251 #define CLASS_MAX_NREGS(CLASS, MODE) \ | |
252 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) | |
253 | |
254 | 211 |
255 /* Basic Stack Layout. */ | 212 /* Basic Stack Layout. */ |
256 | 213 |
257 #define STACK_GROWS_DOWNWARD | 214 #define STACK_GROWS_DOWNWARD 1 |
258 | 215 |
259 #define FRAME_GROWS_DOWNWARD 0 | 216 #define FRAME_GROWS_DOWNWARD 0 |
260 | |
261 #define STARTING_FRAME_OFFSET \ | |
262 (crtl->outgoing_args_size) | |
263 | 217 |
264 /* Use the default value zero. */ | 218 /* Use the default value zero. */ |
265 /* #define STACK_POINTER_OFFSET 0 */ | 219 /* #define STACK_POINTER_OFFSET 0 */ |
266 | 220 |
267 #define FIRST_PARM_OFFSET(FNDECL) 0 | 221 #define FIRST_PARM_OFFSET(FNDECL) 0 |
280 : gen_rtx_MEM (Pmode, gen_rtx_REG (Pmode, \ | 234 : gen_rtx_MEM (Pmode, gen_rtx_REG (Pmode, \ |
281 RETURN_ADDRESS_POINTER_REGNUM))) \ | 235 RETURN_ADDRESS_POINTER_REGNUM))) \ |
282 : (rtx) 0) | 236 : (rtx) 0) |
283 | 237 |
284 /* Before the prologue, RA lives in r31. */ | 238 /* Before the prologue, RA lives in r31. */ |
285 #define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (VOIDmode, GP_REG_FIRST + 31) | 239 #define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, GP_REG_FIRST + 31) |
286 | 240 |
287 | 241 |
288 /* Register That Address the Stack Frame. */ | 242 /* Register That Address the Stack Frame. */ |
289 | 243 |
290 #define STACK_POINTER_REGNUM (GP_REG_FIRST + 29) | 244 #define STACK_POINTER_REGNUM (GP_REG_FIRST + 29) |
332 unsigned int fp_arg_words; /* # words for FP args (IQ2000_EABI only). */ | 286 unsigned int fp_arg_words; /* # words for FP args (IQ2000_EABI only). */ |
333 int last_arg_fp; /* Nonzero if last arg was FP (EABI only). */ | 287 int last_arg_fp; /* Nonzero if last arg was FP (EABI only). */ |
334 int fp_code; /* Mode of FP arguments. */ | 288 int fp_code; /* Mode of FP arguments. */ |
335 unsigned int num_adjusts; /* Number of adjustments made. */ | 289 unsigned int num_adjusts; /* Number of adjustments made. */ |
336 /* Adjustments made to args pass in regs. */ | 290 /* Adjustments made to args pass in regs. */ |
337 struct rtx_def * adjust[MAX_ARGS_IN_REGISTERS * 2]; | 291 rtx adjust[MAX_ARGS_IN_REGISTERS * 2]; |
338 } CUMULATIVE_ARGS; | 292 } CUMULATIVE_ARGS; |
339 | 293 |
340 /* Initialize a variable CUM of type CUMULATIVE_ARGS | 294 /* Initialize a variable CUM of type CUMULATIVE_ARGS |
341 for a call to a function whose data type is FNTYPE. | 295 for a call to a function whose data type is FNTYPE. |
342 For a library call, FNTYPE is 0. */ | 296 For a library call, FNTYPE is 0. */ |
343 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \ | 297 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \ |
344 init_cumulative_args (& CUM, FNTYPE, LIBNAME) \ | 298 init_cumulative_args (& CUM, FNTYPE, LIBNAME) \ |
345 | |
346 #define FUNCTION_ARG_PADDING(MODE, TYPE) \ | |
347 (! BYTES_BIG_ENDIAN \ | |
348 ? upward \ | |
349 : (((MODE) == BLKmode \ | |
350 ? ((TYPE) && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \ | |
351 && int_size_in_bytes (TYPE) < (PARM_BOUNDARY / BITS_PER_UNIT))\ | |
352 : (GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY \ | |
353 && (GET_MODE_CLASS (MODE) == MODE_INT))) \ | |
354 ? downward : upward)) | |
355 | 299 |
356 #define FUNCTION_ARG_REGNO_P(N) \ | 300 #define FUNCTION_ARG_REGNO_P(N) \ |
357 (((N) >= GP_ARG_FIRST && (N) <= GP_ARG_LAST)) | 301 (((N) >= GP_ARG_FIRST && (N) <= GP_ARG_LAST)) |
358 | 302 |
359 | 303 |
406 || (GET_CODE (X) == CONST))) | 350 || (GET_CODE (X) == CONST))) |
407 | 351 |
408 #define MAX_REGS_PER_ADDRESS 1 | 352 #define MAX_REGS_PER_ADDRESS 1 |
409 | 353 |
410 #define REG_OK_FOR_INDEX_P(X) 0 | 354 #define REG_OK_FOR_INDEX_P(X) 0 |
411 | |
412 #define LEGITIMATE_CONSTANT_P(X) (1) | |
413 | 355 |
414 | 356 |
415 /* Describing Relative Costs of Operations. */ | 357 /* Describing Relative Costs of Operations. */ |
416 | 358 |
417 #define REGISTER_MOVE_COST(MODE, FROM, TO) 2 | 359 #define REGISTER_MOVE_COST(MODE, FROM, TO) 2 |
565 | 507 |
566 /* Miscellaneous Parameters. */ | 508 /* Miscellaneous Parameters. */ |
567 | 509 |
568 #define CASE_VECTOR_MODE SImode | 510 #define CASE_VECTOR_MODE SImode |
569 | 511 |
570 #define WORD_REGISTER_OPERATIONS | 512 #define WORD_REGISTER_OPERATIONS 1 |
571 | 513 |
572 #define LOAD_EXTEND_OP(MODE) ZERO_EXTEND | 514 #define LOAD_EXTEND_OP(MODE) ZERO_EXTEND |
573 | 515 |
574 #define MOVE_MAX 4 | 516 #define MOVE_MAX 4 |
575 | 517 |
576 #define MAX_MOVE_MAX 8 | 518 #define MAX_MOVE_MAX 8 |
577 | 519 |
578 #define SHIFT_COUNT_TRUNCATED 1 | 520 #define SHIFT_COUNT_TRUNCATED 1 |
579 | 521 |
580 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1 | |
581 | |
582 #define STORE_FLAG_VALUE 1 | 522 #define STORE_FLAG_VALUE 1 |
583 | 523 |
584 #define Pmode SImode | 524 #define Pmode SImode |
585 | 525 |
586 #define FUNCTION_MODE SImode | 526 #define FUNCTION_MODE SImode |
587 | |
588 /* Standard GCC variables that we reference. */ | |
589 | |
590 extern char call_used_regs[]; | |
591 | 527 |
592 /* IQ2000 external variables defined in iq2000.c. */ | 528 /* IQ2000 external variables defined in iq2000.c. */ |
593 | 529 |
594 /* Comparison type. */ | 530 /* Comparison type. */ |
595 enum cmp_type | 531 enum cmp_type |
607 DELAY_NONE, /* No delay slot. */ | 543 DELAY_NONE, /* No delay slot. */ |
608 DELAY_LOAD, /* Load from memory delay. */ | 544 DELAY_LOAD, /* Load from memory delay. */ |
609 DELAY_FCMP /* Delay after doing c.<xx>.{d,s}. */ | 545 DELAY_FCMP /* Delay after doing c.<xx>.{d,s}. */ |
610 }; | 546 }; |
611 | 547 |
612 /* Which processor to schedule for. */ | |
613 | |
614 enum processor_type | |
615 { | |
616 PROCESSOR_DEFAULT, | |
617 PROCESSOR_IQ2000, | |
618 PROCESSOR_IQ10 | |
619 }; | |
620 | |
621 /* Recast the cpu class to be the cpu attribute. */ | 548 /* Recast the cpu class to be the cpu attribute. */ |
622 #define iq2000_cpu_attr ((enum attr_cpu) iq2000_tune) | 549 #define iq2000_cpu_attr ((enum attr_cpu) iq2000_tune) |
623 | 550 |
624 #define BITMASK_UPPER16 ((unsigned long) 0xffff << 16) /* 0xffff0000 */ | 551 #define BITMASK_UPPER16 ((unsigned long) 0xffff << 16) /* 0xffff0000 */ |
625 #define BITMASK_LOWER16 ((unsigned long) 0xffff) /* 0x0000ffff */ | 552 #define BITMASK_LOWER16 ((unsigned long) 0xffff) /* 0x0000ffff */ |
848 #endif | 775 #endif |
849 | 776 |
850 #define SDATA_SECTION_ASM_OP "\t.sdata" /* Small data. */ | 777 #define SDATA_SECTION_ASM_OP "\t.sdata" /* Small data. */ |
851 | 778 |
852 | 779 |
853 /* The target cpu for optimization and scheduling. */ | |
854 extern enum processor_type iq2000_tune; | |
855 | |
856 /* Which instruction set architecture to use. */ | 780 /* Which instruction set architecture to use. */ |
857 extern int iq2000_isa; | 781 extern int iq2000_isa; |
858 | 782 |
859 enum iq2000_builtins | 783 enum iq2000_builtins |
860 { | 784 { |