]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/microblaze/microblaze-c.c
tree-core.h: Include symtab.h.
[thirdparty/gcc.git] / gcc / config / microblaze / microblaze-c.c
1 /* Subroutines used for the C front end for Xilinx MicroBlaze.
2 Copyright (C) 2010-2015 Free Software Foundation, Inc.
3
4 Contributed by Michael Eager <eager@eagercon.com>.
5
6 This file is part of GCC.
7
8 GCC is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published
10 by the Free Software Foundation; either version 3, or (at your
11 option) any later version.
12
13 GCC is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
21
22 #include "config.h"
23 #include "system.h"
24 #include "coretypes.h"
25 #include "tm.h"
26 #include "cpplib.h"
27 #include "alias.h"
28 #include "tree.h"
29 #include "c-family/c-common.h"
30 #include "tm_p.h"
31 #include "target.h"
32
33 #define builtin_define(TXT) cpp_define (pfile, TXT)
34 #define builtin_assert(TXT) cpp_assert (pfile, TXT)
35
36 /* Define preprocessor symbols for MicroBlaze.
37 Symbols which do not start with __ are deprecated. */
38
39 void
40 microblaze_cpp_define (cpp_reader *pfile)
41 {
42 builtin_assert ("cpu=microblaze");
43 builtin_assert ("machine=microblaze");
44 builtin_define ("__MICROBLAZE__");
45 builtin_define ("__microblaze__");
46 if (TARGET_LITTLE_ENDIAN)
47 {
48 builtin_define ("_LITTLE_ENDIAN");
49 builtin_define ("__LITTLE_ENDIAN__");
50 builtin_define ("__MICROBLAZEEL__");
51 }
52 else
53 {
54 builtin_define ("_BIG_ENDIAN");
55 builtin_define ("__BIG_ENDIAN__");
56 builtin_define ("__MICROBLAZEEB__");
57 }
58 if (!TARGET_SOFT_MUL)
59 {
60 if (!flag_iso)
61 builtin_define ("HAVE_HW_MUL");
62 builtin_define ("__HAVE_HW_MUL__");
63 }
64 if (TARGET_MULTIPLY_HIGH)
65 {
66 if (!flag_iso)
67 builtin_define ("HAVE_HW_MUL_HIGH");
68 builtin_define ("__HAVE_HW_MUL_HIGH__");
69 }
70 if (!TARGET_SOFT_DIV)
71 {
72 if (!flag_iso)
73 builtin_define ("HAVE_HW_DIV");
74 builtin_define ("__HAVE_HW_DIV__");
75 }
76 if (TARGET_BARREL_SHIFT)
77 {
78 if (!flag_iso)
79 builtin_define ("HAVE_HW_BSHIFT");
80 builtin_define ("__HAVE_HW_BSHIFT__");
81 }
82 if (TARGET_PATTERN_COMPARE)
83 {
84 if (!flag_iso)
85 builtin_define ("HAVE_HW_PCMP");
86 builtin_define ("__HAVE_HW_PCMP__");
87 }
88 if (TARGET_HARD_FLOAT)
89 {
90 if (!flag_iso)
91 builtin_define ("HAVE_HW_FPU");
92 builtin_define ("__HAVE_HW_FPU__");
93 }
94 if (TARGET_FLOAT_CONVERT)
95 {
96 if (!flag_iso)
97 builtin_define ("HAVE_HW_FPU_CONVERT");
98 builtin_define ("__HAVE_HW_FPU_CONVERT__");
99 }
100 if (TARGET_FLOAT_SQRT)
101 {
102 if (!flag_iso)
103 builtin_define ("HAVE_HW_FPU_SQRT");
104 builtin_define ("__HAVE_HW_FPU_SQRT__");
105 }
106 }