]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/mips/sdemtk.h
config.gcc (mips*-*-linux*): Recognise mipsisa32r2 and set MIPS_ISA_DEFAULT appropria...
[thirdparty/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.
3 Copyright (C) 2007
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
10the Free Software Foundation; either version 2, or (at your option)
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
19along with GCC; see the file COPYING. If not, write to
20the Free Software Foundation, 59 Temple Place - Suite 330,
21Boston, MA 02111-1307, USA. */
22
23#define TARGET_OS_CPP_BUILTINS() \
24 do \
25 { \
26 builtin_assert ("system=sde"); \
27 builtin_assert ("system=posix"); \
28 builtin_define ("__SDE_MIPS__"); \
29 \
30 /* Deprecated: use __mips_isa_rev >= 2. */ \
31 if (ISA_MIPS32R2) \
32 builtin_define ("__mipsr2"); \
33 \
34 /* Deprecated: use __mips_fpr == 64. */ \
35 if (TARGET_FLOAT64) \
36 builtin_define ("__mipsfp64"); \
37 \
38 if (TARGET_NO_FLOAT) \
39 { \
40 builtin_define ("__NO_FLOAT"); \
41 builtin_define ("__mips_no_float"); \
42 } \
43 else if (TARGET_SOFT_FLOAT_ABI) \
44 builtin_define ("__SOFT_FLOAT"); \
45 else if (TARGET_SINGLE_FLOAT) \
46 builtin_define ("__SINGLE_FLOAT"); \
47 \
48 if (TARGET_BIG_ENDIAN) \
49 { \
50 builtin_assert ("endian=big"); \
51 builtin_assert ("cpu=mipseb"); \
52 } \
53 else \
54 { \
55 builtin_assert ("endian=little"); \
56 builtin_assert ("cpu=mipsel"); \
57 } \
58 } \
59 while (0)
60
61#undef SUBTARGET_OVERRIDE_OPTIONS
62#define SUBTARGET_OVERRIDE_OPTIONS \
63 do \
64 { \
65 if (TARGET_NO_FLOAT) \
66 { \
67 target_flags |= MASK_SOFT_FLOAT_ABI; \
68 target_flags_explicit |= MASK_SOFT_FLOAT_ABI; \
69 } \
70 } \
71 while (0)
72
73/* For __clear_cache in libgcc2.c. */
74#ifdef IN_LIBGCC2
75extern void mips_sync_icache (void *beg, unsigned long len);
76#undef CLEAR_INSN_CACHE
77#define CLEAR_INSN_CACHE(beg, end) \
78 mips_sync_icache (beg, end - beg)
79#endif
80
81/* For mips_cache_flush_func in mips.opt. */
82#undef CACHE_FLUSH_FUNC
83#define CACHE_FLUSH_FUNC "mips_sync_icache"
84
85/* For inline code which needs to sync the icache and dcache,
86 noting that the SDE library takes arguments (address, size). */
87#undef MIPS_ICACHE_SYNC
88#define MIPS_ICACHE_SYNC(ADDR, SIZE) \
89 emit_library_call (gen_rtx_SYMBOL_REF (Pmode, mips_cache_flush_func), \
90 0, VOIDmode, 2, ADDR, Pmode, \
91 SIZE, TYPE_MODE (sizetype))
92
93/* This version of _mcount does not pop 2 words from the stack. */
94#undef FUNCTION_PROFILER
95#define FUNCTION_PROFILER(FILE, LABELNO) \
96 { \
97 fprintf (FILE, "\t.set\tnoat\n"); \
98 /* MIPS16 code passes saved $ra in $v1 instead of $at. */ \
99 fprintf (FILE, "\tmove\t%s,%s\n", \
100 reg_names[GP_REG_FIRST + (TARGET_MIPS16 ? 3 : 1)], \
101 reg_names[GP_REG_FIRST + 31]); \
102 fprintf (FILE, "\tjal\t_mcount\n"); \
103 fprintf (FILE, "\t.set\tat\n"); \
104 }
105
106/* ...nor does the call sequence preserve $31. */
107#undef MIPS_SAVE_REG_FOR_PROFILING_P
108#define MIPS_SAVE_REG_FOR_PROFILING_P(REGNO) ((REGNO) == GP_REG_FIRST + 31)