comparison gcc/config/moxie/moxie.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 04ced10e8804
comparison
equal deleted inserted replaced
65:65488c3d617d 67:f6334be47118
19 <http://www.gnu.org/licenses/>. */ 19 <http://www.gnu.org/licenses/>. */
20 20
21 #ifndef GCC_MOXIE_H 21 #ifndef GCC_MOXIE_H
22 #define GCC_MOXIE_H 22 #define GCC_MOXIE_H
23 23
24 /* This is defined by svr4.h, which is included prior to this file.
25 However, we should undefine it for moxie-elf, since we don't provide
26 functions like access() and mkdir() in newlib. This will have to
27 be defined again for a Linux port. */
28 #undef TARGET_POSIX_IO
29
30 /* Another C string constant used much like `LINK_SPEC'. The difference
31 between the two is that `STARTFILE_SPEC' is used at the very beginning of
32 the command given to the linker.
33
34 If this macro is not defined, a default is provided that loads the standard
35 C startup file from the usual place. See `gcc.c'.
36
37 Defined in svr4.h. */
38 #undef STARTFILE_SPEC 24 #undef STARTFILE_SPEC
39 #define STARTFILE_SPEC "crt0%O%s crti.o%s crtbegin.o%s" 25 #define STARTFILE_SPEC "crt0%O%s crti.o%s crtbegin.o%s"
40 26
41 /* Provide an ENDFILE_SPEC appropriate for svr4. Here we tack on our own 27 /* Provide an ENDFILE_SPEC appropriate for svr4. Here we tack on our own
42 magical crtend.o file (see crtstuff.c) which provides part of the 28 magical crtend.o file (see crtstuff.c) which provides part of the
52 the simulator BSP code. */ 38 the simulator BSP code. */
53 39
54 #undef LIB_SPEC 40 #undef LIB_SPEC
55 #define LIB_SPEC "%{!shared:%{!symbolic:-lc}}" 41 #define LIB_SPEC "%{!shared:%{!symbolic:-lc}}"
56 42
43 #undef LINK_SPEC
44 #define LINK_SPEC "%{h*} %{v:-V} \
45 %{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic}"
46
57 /* Layout of Source Language Data Types */ 47 /* Layout of Source Language Data Types */
58 48
59 #define INT_TYPE_SIZE 32 49 #define INT_TYPE_SIZE 32
60 #define SHORT_TYPE_SIZE 16 50 #define SHORT_TYPE_SIZE 16
61 #define LONG_TYPE_SIZE 32 51 #define LONG_TYPE_SIZE 32
64 #define FLOAT_TYPE_SIZE 32 54 #define FLOAT_TYPE_SIZE 32
65 #define DOUBLE_TYPE_SIZE 64 55 #define DOUBLE_TYPE_SIZE 64
66 #define LONG_DOUBLE_TYPE_SIZE 64 56 #define LONG_DOUBLE_TYPE_SIZE 64
67 57
68 #define DEFAULT_SIGNED_CHAR 1 58 #define DEFAULT_SIGNED_CHAR 1
59
60 #undef SIZE_TYPE
61 #define SIZE_TYPE "unsigned int"
62
63 #undef PTRDIFF_TYPE
64 #define PTRDIFF_TYPE "int"
65
66 #undef WCHAR_TYPE
67 #define WCHAR_TYPE "long int"
68
69 #undef WCHAR_TYPE_SIZE
70 #define WCHAR_TYPE_SIZE BITS_PER_WORD
69 71
70 /* Registers... 72 /* Registers...
71 73
72 $fp - frame pointer 74 $fp - frame pointer
73 $sp - stack pointer 75 $sp - stack pointer
199 /* A C expression for the maximum number of consecutive registers of 201 /* A C expression for the maximum number of consecutive registers of
200 class CLASS needed to hold a value of mode MODE. */ 202 class CLASS needed to hold a value of mode MODE. */
201 #define CLASS_MAX_NREGS(CLASS, MODE) \ 203 #define CLASS_MAX_NREGS(CLASS, MODE) \
202 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) 204 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
203 205
204 /* A C expression that places additional restrictions on the register
205 class to use when it is necessary to copy value X into a register
206 in class CLASS. */
207 #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
208
209 /* The Overall Framework of an Assembler File */ 206 /* The Overall Framework of an Assembler File */
210 207
211 #undef ASM_SPEC 208 #undef ASM_SPEC
212 #define ASM_COMMENT_START "#" 209 #define ASM_COMMENT_START "#"
213 #define ASM_APP_ON "" 210 #define ASM_APP_ON ""
233 /* Output and Generation of Labels */ 230 /* Output and Generation of Labels */
234 231
235 #define GLOBAL_ASM_OP "\t.global\t" 232 #define GLOBAL_ASM_OP "\t.global\t"
236 233
237 /* Passing Arguments in Registers */ 234 /* Passing Arguments in Registers */
238
239 /* A C expression that controls whether a function argument is passed
240 in a register, and which register. */
241 #define FUNCTION_ARG(CUM,MODE,TYPE,NAMED) \
242 moxie_function_arg(CUM,MODE,TYPE,NAMED)
243 235
244 /* A C type for declaring a variable that is used as the first 236 /* A C type for declaring a variable that is used as the first
245 argument of `FUNCTION_ARG' and other related values. */ 237 argument of `FUNCTION_ARG' and other related values. */
246 #define CUMULATIVE_ARGS unsigned int 238 #define CUMULATIVE_ARGS unsigned int
247 239
256 for the state at the beginning of the argument list. 248 for the state at the beginning of the argument list.
257 For moxie, the first arg is passed in register 2 (aka $r0). */ 249 For moxie, the first arg is passed in register 2 (aka $r0). */
258 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,FNDECL,N_NAMED_ARGS) \ 250 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,FNDECL,N_NAMED_ARGS) \
259 (CUM = MOXIE_R0) 251 (CUM = MOXIE_R0)
260 252
261 #define MOXIE_FUNCTION_ARG_SIZE(MODE, TYPE) \
262 ((MODE) != BLKmode ? GET_MODE_SIZE (MODE) \
263 : (unsigned) int_size_in_bytes (TYPE))
264
265 #define FUNCTION_ARG_ADVANCE(CUM,MODE,TYPE,NAMED) \
266 (CUM = (CUM < MOXIE_R6 ? \
267 CUM + ((3 + MOXIE_FUNCTION_ARG_SIZE(MODE,TYPE))/4) : CUM ))
268
269 /* How Scalar Function Values Are Returned */ 253 /* How Scalar Function Values Are Returned */
270
271 /* These macros are deprecated, but we still need them for now since
272 the version of gcc we're using doesn't fully support
273 TARGET_FUNCTION_VALUE. */
274 #define FUNCTION_VALUE(VALTYPE, FUNC) \
275 moxie_function_value (VALTYPE, FUNC, 0)
276 #define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) \
277 moxie_function_value (VALTYPE, FUNC, 1)
278
279 /* A C expression to create an RTX representing the place where a
280 library function returns a value of mode MODE. */
281 #define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 2)
282 254
283 /* STACK AND CALLING */ 255 /* STACK AND CALLING */
284 256
285 /* Define this macro if pushing a word onto the stack moves the stack 257 /* Define this macro if pushing a word onto the stack moves the stack
286 pointer to a smaller address. */ 258 pointer to a smaller address. */
313 /* Define this macro as a C expression that is nonzero for registers that are 285 /* Define this macro as a C expression that is nonzero for registers that are
314 used by the epilogue or the return pattern. The stack and frame 286 used by the epilogue or the return pattern. The stack and frame
315 pointer registers are already assumed to be used as needed. */ 287 pointer registers are already assumed to be used as needed. */
316 #define EPILOGUE_USES(R) (R == MOXIE_R5) 288 #define EPILOGUE_USES(R) (R == MOXIE_R5)
317 289
318 #define OVERRIDE_OPTIONS moxie_override_options () 290 /* A C expression whose value is RTL representing the location of the
291 incoming return address at the beginning of any function, before
292 the prologue. */
293 #define INCOMING_RETURN_ADDR_RTX \
294 gen_frame_mem (Pmode, \
295 plus_constant (stack_pointer_rtx, UNITS_PER_WORD))
296
297 /* Describe how we implement __builtin_eh_return. */
298 #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N+2) : INVALID_REGNUM)
299
300 /* Store the return handler into the call frame. */
301 #define EH_RETURN_HANDLER_RTX \
302 gen_frame_mem (Pmode, \
303 plus_constant (frame_pointer_rtx, UNITS_PER_WORD))
319 304
320 /* Storage Layout */ 305 /* Storage Layout */
321 306
322 #define BITS_BIG_ENDIAN 0 307 #define BITS_BIG_ENDIAN 0
323 #define BYTES_BIG_ENDIAN 1 308 #define BYTES_BIG_ENDIAN 1
427 412
428 /* A C expression that is nonzero if REGNO is the number of a hard 413 /* A C expression that is nonzero if REGNO is the number of a hard
429 register in which function arguments are sometimes passed. */ 414 register in which function arguments are sometimes passed. */
430 #define FUNCTION_ARG_REGNO_P(r) (r >= MOXIE_R0 && r <= MOXIE_R5) 415 #define FUNCTION_ARG_REGNO_P(r) (r >= MOXIE_R0 && r <= MOXIE_R5)
431 416
432 /* A C expression that is nonzero if REGNO is the number of a hard
433 register in which the values of called function may come back. */
434 #define FUNCTION_VALUE_REGNO_P(r) (r == MOXIE_R0)
435
436 /* A macro whose definition is the name of the class to which a valid 417 /* A macro whose definition is the name of the class to which a valid
437 base register must belong. A base register is one used in an 418 base register must belong. A base register is one used in an
438 address which is the register value plus a displacement. */ 419 address which is the register value plus a displacement. */
439 #define BASE_REG_CLASS GENERAL_REGS 420 #define BASE_REG_CLASS GENERAL_REGS
440 421
441 #define INDEX_REG_CLASS NO_REGS 422 #define INDEX_REG_CLASS NO_REGS
442 423
443 #define HARD_REGNO_OK_FOR_BASE_P(NUM) \ 424 #define HARD_REGNO_OK_FOR_BASE_P(NUM) \
444 ((NUM) >= 0 && (NUM) < FIRST_PSEUDO_REGISTER \ 425 ((unsigned) (NUM) < FIRST_PSEUDO_REGISTER \
445 && (REGNO_REG_CLASS(NUM) == GENERAL_REGS \ 426 && (REGNO_REG_CLASS(NUM) == GENERAL_REGS \
446 || (NUM) == HARD_FRAME_POINTER_REGNUM)) 427 || (NUM) == HARD_FRAME_POINTER_REGNUM))
447 428
448 /* A C expression which is nonzero if register number NUM is suitable 429 /* A C expression which is nonzero if register number NUM is suitable
449 for use as a base register in operand addresses. */ 430 for use as a base register in operand addresses. */
466 #define MOVE_MAX 4 447 #define MOVE_MAX 4
467 #define TRULY_NOOP_TRUNCATION(op,ip) 1 448 #define TRULY_NOOP_TRUNCATION(op,ip) 1
468 449
469 /* All load operations zero extend. */ 450 /* All load operations zero extend. */
470 #define LOAD_EXTEND_OP(MEM) ZERO_EXTEND 451 #define LOAD_EXTEND_OP(MEM) ZERO_EXTEND
471
472 #define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
473 452
474 /* A C expression that is nonzero if X is a legitimate constant for 453 /* A C expression that is nonzero if X is a legitimate constant for
475 an immediate operand on the target machine. */ 454 an immediate operand on the target machine. */
476 #define LEGITIMATE_CONSTANT_P(X) 1 455 #define LEGITIMATE_CONSTANT_P(X) 1
477 456