]> gcc.gnu.org Git - gcc.git/blame - gcc/config/mips/sdemtk.h
Update Copyright years for files modified in 2010.
[gcc.git] / gcc / config / mips / sdemtk.h
CommitLineData
d9dced13
RS
1/* Definitions of target machine for GNU compiler.
2 MIPS SDE version, for use with the SDE C library rather than newlib.
d652f226 3 Copyright (C) 2007, 2008, 2009, 2010
d9dced13
RS
4 Free Software Foundation, Inc.
5
6This file is part of GCC.
7
8GCC is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
5baa7f6f 10the Free Software Foundation; either version 3, or (at your option)
d9dced13
RS
11any later version.
12
13GCC is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
5baa7f6f
RS
19along with GCC; see the file COPYING3. If not see
20<http://www.gnu.org/licenses/>. */
d9dced13
RS
21
22#define TARGET_OS_CPP_BUILTINS() \
23 do \
24 { \
25 builtin_assert ("system=sde"); \
26 builtin_assert ("system=posix"); \
27 builtin_define ("__SDE_MIPS__"); \
28 \
29 /* Deprecated: use __mips_isa_rev >= 2. */ \
30 if (ISA_MIPS32R2) \
31 builtin_define ("__mipsr2"); \
32 \
33 /* Deprecated: use __mips_fpr == 64. */ \
34 if (TARGET_FLOAT64) \
35 builtin_define ("__mipsfp64"); \
36 \
37 if (TARGET_NO_FLOAT) \
9f946bc1 38 builtin_define ("__NO_FLOAT"); \
d9dced13
RS
39 else if (TARGET_SOFT_FLOAT_ABI) \
40 builtin_define ("__SOFT_FLOAT"); \
41 else if (TARGET_SINGLE_FLOAT) \
42 builtin_define ("__SINGLE_FLOAT"); \
43 \
44 if (TARGET_BIG_ENDIAN) \
45 { \
46 builtin_assert ("endian=big"); \
47 builtin_assert ("cpu=mipseb"); \
48 } \
49 else \
50 { \
51 builtin_assert ("endian=little"); \
52 builtin_assert ("cpu=mipsel"); \
53 } \
54 } \
55 while (0)
56
d9dced13
RS
57/* For __clear_cache in libgcc2.c. */
58#ifdef IN_LIBGCC2
59extern void mips_sync_icache (void *beg, unsigned long len);
60#undef CLEAR_INSN_CACHE
61#define CLEAR_INSN_CACHE(beg, end) \
62 mips_sync_icache (beg, end - beg)
63#endif
64
65/* For mips_cache_flush_func in mips.opt. */
66#undef CACHE_FLUSH_FUNC
67#define CACHE_FLUSH_FUNC "mips_sync_icache"
68
69/* For inline code which needs to sync the icache and dcache,
70 noting that the SDE library takes arguments (address, size). */
71#undef MIPS_ICACHE_SYNC
72#define MIPS_ICACHE_SYNC(ADDR, SIZE) \
73 emit_library_call (gen_rtx_SYMBOL_REF (Pmode, mips_cache_flush_func), \
bbbbb16a 74 LCT_NORMAL, VOIDmode, 2, ADDR, Pmode, \
d9dced13
RS
75 SIZE, TYPE_MODE (sizetype))
76
77/* This version of _mcount does not pop 2 words from the stack. */
78#undef FUNCTION_PROFILER
79#define FUNCTION_PROFILER(FILE, LABELNO) \
80 { \
cf5fb4b0 81 mips_push_asm_switch (&mips_noat); \
e538e028
RS
82 /* _mcount treats $2 as the static chain register. */ \
83 if (cfun->static_chain_decl != NULL) \
84 fprintf (FILE, "\tmove\t%s,%s\n", reg_names[2], \
85 reg_names[STATIC_CHAIN_REGNUM]); \
d9dced13
RS
86 /* MIPS16 code passes saved $ra in $v1 instead of $at. */ \
87 fprintf (FILE, "\tmove\t%s,%s\n", \
88 reg_names[GP_REG_FIRST + (TARGET_MIPS16 ? 3 : 1)], \
293593b1 89 reg_names[RETURN_ADDR_REGNUM]); \
d9dced13 90 fprintf (FILE, "\tjal\t_mcount\n"); \
cf5fb4b0 91 mips_pop_asm_switch (&mips_noat); \
e538e028
RS
92 /* _mcount treats $2 as the static chain register. */ \
93 if (cfun->static_chain_decl != NULL) \
94 fprintf (FILE, "\tmove\t%s,%s\n", reg_names[STATIC_CHAIN_REGNUM], \
95 reg_names[2]); \
d9dced13
RS
96 }
97
98/* ...nor does the call sequence preserve $31. */
99#undef MIPS_SAVE_REG_FOR_PROFILING_P
293593b1 100#define MIPS_SAVE_REG_FOR_PROFILING_P(REGNO) ((REGNO) == RETURN_ADDR_REGNUM)
9f946bc1
RS
101
102/* Compile in support for the -mno-float option. */
103#define TARGET_SUPPORTS_NO_FLOAT 1
This page took 0.805187 seconds and 5 git commands to generate.