]>
Commit | Line | Data |
---|---|---|
d34b0d1e | 1 | /* Subroutines used for the C front end for Xilinx MicroBlaze. |
d353bf18 | 2 | Copyright (C) 2010-2015 Free Software Foundation, Inc. |
d34b0d1e | 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" | |
b20a8bb4 | 27 | #include "alias.h" |
28 | #include "symtab.h" | |
d34b0d1e | 29 | #include "tree.h" |
30 | #include "c-family/c-common.h" | |
d34b0d1e | 31 | #include "tm_p.h" |
32 | #include "target.h" | |
33 | ||
34 | #define builtin_define(TXT) cpp_define (pfile, TXT) | |
35 | #define builtin_assert(TXT) cpp_assert (pfile, TXT) | |
36 | ||
37 | /* Define preprocessor symbols for MicroBlaze. | |
38 | Symbols which do not start with __ are deprecated. */ | |
39 | ||
40 | void | |
41 | microblaze_cpp_define (cpp_reader *pfile) | |
42 | { | |
43 | builtin_assert ("cpu=microblaze"); | |
44 | builtin_assert ("machine=microblaze"); | |
45 | builtin_define ("__MICROBLAZE__"); | |
e975e345 | 46 | builtin_define ("__microblaze__"); |
47 | if (TARGET_LITTLE_ENDIAN) | |
48 | { | |
49 | builtin_define ("_LITTLE_ENDIAN"); | |
50 | builtin_define ("__LITTLE_ENDIAN__"); | |
51 | builtin_define ("__MICROBLAZEEL__"); | |
52 | } | |
53 | else | |
54 | { | |
55 | builtin_define ("_BIG_ENDIAN"); | |
56 | builtin_define ("__BIG_ENDIAN__"); | |
57 | builtin_define ("__MICROBLAZEEB__"); | |
58 | } | |
d34b0d1e | 59 | if (!TARGET_SOFT_MUL) |
60 | { | |
61 | if (!flag_iso) | |
62 | builtin_define ("HAVE_HW_MUL"); | |
63 | builtin_define ("__HAVE_HW_MUL__"); | |
64 | } | |
65 | if (TARGET_MULTIPLY_HIGH) | |
66 | { | |
67 | if (!flag_iso) | |
68 | builtin_define ("HAVE_HW_MUL_HIGH"); | |
69 | builtin_define ("__HAVE_HW_MUL_HIGH__"); | |
70 | } | |
71 | if (!TARGET_SOFT_DIV) | |
72 | { | |
73 | if (!flag_iso) | |
74 | builtin_define ("HAVE_HW_DIV"); | |
75 | builtin_define ("__HAVE_HW_DIV__"); | |
76 | } | |
77 | if (TARGET_BARREL_SHIFT) | |
78 | { | |
79 | if (!flag_iso) | |
80 | builtin_define ("HAVE_HW_BSHIFT"); | |
81 | builtin_define ("__HAVE_HW_BSHIFT__"); | |
82 | } | |
83 | if (TARGET_PATTERN_COMPARE) | |
84 | { | |
85 | if (!flag_iso) | |
86 | builtin_define ("HAVE_HW_PCMP"); | |
87 | builtin_define ("__HAVE_HW_PCMP__"); | |
88 | } | |
89 | if (TARGET_HARD_FLOAT) | |
90 | { | |
91 | if (!flag_iso) | |
92 | builtin_define ("HAVE_HW_FPU"); | |
93 | builtin_define ("__HAVE_HW_FPU__"); | |
94 | } | |
95 | if (TARGET_FLOAT_CONVERT) | |
96 | { | |
97 | if (!flag_iso) | |
98 | builtin_define ("HAVE_HW_FPU_CONVERT"); | |
99 | builtin_define ("__HAVE_HW_FPU_CONVERT__"); | |
100 | } | |
101 | if (TARGET_FLOAT_SQRT) | |
102 | { | |
103 | if (!flag_iso) | |
104 | builtin_define ("HAVE_HW_FPU_SQRT"); | |
105 | builtin_define ("__HAVE_HW_FPU_SQRT__"); | |
106 | } | |
107 | } |