OpenCores
URL https://opencores.org/ocsvn/zipcpu/zipcpu/trunk

Subversion Repositories zipcpu

[/] [zipcpu/] [trunk/] [sw/] [gcc-zippatch.patch] - Blame information for rev 102

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 102 dgisselq
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/config.sub gcc-5.3.0-zip/config.sub
2
--- gcc-5.3.0-original/config.sub       2015-01-02 04:30:21.000000000 -0500
3
+++ gcc-5.3.0-zip/config.sub    2016-01-30 12:27:56.023073747 -0500
4
@@ -316,7 +316,7 @@
5
        | visium \
6
        | we32k \
7
        | x86 | xc16x | xstormy16 | xtensa \
8
-       | z8k | z80)
9
+       | z8k | z80 | zip)
10
                basic_machine=$basic_machine-unknown
11
                ;;
12
        c54x)
13
@@ -1547,6 +1547,9 @@
14
 # system, and we'll never get to this point.
15
 
16
 case $basic_machine in
17
+       zip-*)
18
+               os=-elf
19
+               ;;
20
        score-*)
21
                os=-elf
22
                ;;
23
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/configure gcc-5.3.0-zip/configure
24
--- gcc-5.3.0-original/configure        2015-05-03 13:29:57.000000000 -0400
25
+++ gcc-5.3.0-zip/configure     2016-01-30 16:19:48.264867231 -0500
26
@@ -3927,6 +3927,8 @@
27
   vax-*-*)
28
     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
29
     ;;
30
+  zip*)
31
+    noconfigdirs="$noconfigdirs target-libffi target-boehm-gc gdb gprof"
32
 esac
33
 
34
 # If we aren't building newlib, then don't build libgloss, since libgloss
35
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/configure.ac gcc-5.3.0-zip/configure.ac
36
--- gcc-5.3.0-original/configure.ac     2015-05-03 13:29:57.000000000 -0400
37
+++ gcc-5.3.0-zip/configure.ac  2016-02-12 10:47:23.847194843 -0500
38
@@ -1274,6 +1274,10 @@
39
   vax-*-*)
40
     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
41
     ;;
42
+  zip*)
43
+    noconfigdirs="$noconfigdirs target-libffi target-boehm-gc gdb gprof"
44
+    unsupported_languages="$unsupported_languages fortran java"
45
+    ;;
46
 esac
47
 
48
 # If we aren't building newlib, then don't build libgloss, since libgloss
49
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/common/config/zip/zip-common.c gcc-5.3.0-zip/gcc/common/config/zip/zip-common.c
50
--- gcc-5.3.0-original/gcc/common/config/zip/zip-common.c       1969-12-31 19:00:00.000000000 -0500
51
+++ gcc-5.3.0-zip/gcc/common/config/zip/zip-common.c    2016-02-14 00:54:31.821055716 -0500
52
@@ -0,0 +1,52 @@
53
+////////////////////////////////////////////////////////////////////////////////
54
+//
55
+// Filename:   common/config/zip/zip-common.c
56
+//
57
+// Project:    Zip CPU backend for the GNU Compiler Collection
58
+//
59
+// Purpose:    To eliminate the frame register automatically.
60
+//
61
+// Creator:    Dan Gisselquist, Ph.D.
62
+//             Gisselquist Technology, LLC
63
+//
64
+////////////////////////////////////////////////////////////////////////////////
65
+//
66
+// Copyright (C) 2016, Gisselquist Technology, LLC
67
+//
68
+// This program is free software (firmware): you can redistribute it and/or
69
+// modify it under the terms of  the GNU General Public License as published
70
+// by the Free Software Foundation, either version 3 of the License, or (at
71
+// your option) any later version.
72
+//
73
+// This program is distributed in the hope that it will be useful, but WITHOUT
74
+// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
75
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
76
+// for more details.
77
+//
78
+// You should have received a copy of the GNU General Public License along
79
+// with this program.  (It's in the $(ROOT)/doc directory, run make with no
80
+// target there if the PDF file isn't present.)  If not, see
81
+// <http://www.gnu.org/licenses/> for a copy.
82
+//
83
+// License:    GPL, v3, as defined and found on www.gnu.org,
84
+//             http://www.gnu.org/licenses/gpl.html
85
+//
86
+//
87
+////////////////////////////////////////////////////////////////////////////////
88
+#include "config.h"
89
+#include "system.h"
90
+#include "coretypes.h"
91
+#include "tm.h"
92
+#include "common/common-target.h"
93
+#include "common/common-target-def.h"
94
+
95
+static const struct default_options zip_option_optimization_table[] =
96
+  {
97
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
98
+    { OPT_LEVELS_NONE, 0, NULL, 0 }
99
+  };
100
+
101
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
102
+#define        TARGET_OPTION_OPTIMIZATION_TABLE        zip_option_optimization_table
103
+
104
+struct gcc_targetm_common      targetm_common = TARGETM_COMMON_INITIALIZER;
105
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/aarch64/aarch64-linux.h gcc-5.3.0-zip/gcc/config/aarch64/aarch64-linux.h
106
--- gcc-5.3.0-original/gcc/config/aarch64/aarch64-linux.h       2016-02-05 15:18:17.489469806 -0500
107
+++ gcc-5.3.0-zip/gcc/config/aarch64/aarch64-linux.h    2015-07-24 12:00:26.000000000 -0400
108
@@ -21,7 +21,7 @@
109
 #ifndef GCC_AARCH64_LINUX_H
110
 #define GCC_AARCH64_LINUX_H
111
 
112
-#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
113
+#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
114
 
115
 #undef  ASAN_CC1_SPEC
116
 #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
117
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/alpha/linux-elf.h gcc-5.3.0-zip/gcc/config/alpha/linux-elf.h
118
--- gcc-5.3.0-original/gcc/config/alpha/linux-elf.h     2016-02-05 15:18:17.489469806 -0500
119
+++ gcc-5.3.0-zip/gcc/config/alpha/linux-elf.h  2015-01-05 07:33:28.000000000 -0500
120
@@ -23,8 +23,8 @@
121
 #define EXTRA_SPECS \
122
 { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
123
 
124
-#define GLIBC_DYNAMIC_LINKER   "/tools/lib/ld-linux.so.2"
125
-#define UCLIBC_DYNAMIC_LINKER "/tools/lib/ld-uClibc.so.0"
126
+#define GLIBC_DYNAMIC_LINKER   "/lib/ld-linux.so.2"
127
+#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
128
 #if DEFAULT_LIBC == LIBC_UCLIBC
129
 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
130
 #elif DEFAULT_LIBC == LIBC_GLIBC
131
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/arm/linux-eabi.h gcc-5.3.0-zip/gcc/config/arm/linux-eabi.h
132
--- gcc-5.3.0-original/gcc/config/arm/linux-eabi.h      2016-02-05 15:18:17.489469806 -0500
133
+++ gcc-5.3.0-zip/gcc/config/arm/linux-eabi.h   2015-01-05 07:33:28.000000000 -0500
134
@@ -68,8 +68,8 @@
135
    GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI.  */
136
 
137
 #undef  GLIBC_DYNAMIC_LINKER
138
-#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/tools/lib/ld-linux.so.3"
139
-#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/tools/lib/ld-linux-armhf.so.3"
140
+#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3"
141
+#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3"
142
 #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT
143
 
144
 #define GLIBC_DYNAMIC_LINKER \
145
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/arm/linux-elf.h gcc-5.3.0-zip/gcc/config/arm/linux-elf.h
146
--- gcc-5.3.0-original/gcc/config/arm/linux-elf.h       2016-02-05 15:18:17.489469806 -0500
147
+++ gcc-5.3.0-zip/gcc/config/arm/linux-elf.h    2015-06-23 05:26:54.000000000 -0400
148
@@ -62,7 +62,7 @@
149
 
150
 #define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
151
 
152
-#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld-linux.so.2"
153
+#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
154
 
155
 #define LINUX_TARGET_LINK_SPEC  "%{h*} \
156
    %{static:-Bstatic} \
157
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/bfin/linux.h gcc-5.3.0-zip/gcc/config/bfin/linux.h
158
--- gcc-5.3.0-original/gcc/config/bfin/linux.h  2016-02-05 15:18:17.489469806 -0500
159
+++ gcc-5.3.0-zip/gcc/config/bfin/linux.h       2015-01-05 07:33:28.000000000 -0500
160
@@ -45,7 +45,7 @@
161
   %{shared:-G -Bdynamic} \
162
   %{!shared: %{!static: \
163
    %{rdynamic:-export-dynamic} \
164
-   -dynamic-linker /tools/lib/ld-uClibc.so.0} \
165
+   -dynamic-linker /lib/ld-uClibc.so.0} \
166
    %{static}} -init __init -fini __fini"
167
 
168
 #undef TARGET_SUPPORTS_SYNC_CALLS
169
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/cris/linux.h gcc-5.3.0-zip/gcc/config/cris/linux.h
170
--- gcc-5.3.0-original/gcc/config/cris/linux.h  2016-02-05 15:18:17.489469806 -0500
171
+++ gcc-5.3.0-zip/gcc/config/cris/linux.h       2015-01-05 07:33:28.000000000 -0500
172
@@ -102,7 +102,7 @@
173
 #undef CRIS_DEFAULT_CPU_VERSION
174
 #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
175
 
176
-#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld.so.1"
177
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
178
 
179
 #undef CRIS_LINK_SUBTARGET_SPEC
180
 #define CRIS_LINK_SUBTARGET_SPEC \
181
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/freebsd-spec.h gcc-5.3.0-zip/gcc/config/freebsd-spec.h
182
--- gcc-5.3.0-original/gcc/config/freebsd-spec.h        2016-02-05 15:18:17.489469806 -0500
183
+++ gcc-5.3.0-zip/gcc/config/freebsd-spec.h     2015-06-25 13:53:14.000000000 -0400
184
@@ -129,9 +129,9 @@
185
 #endif
186
 
187
 #if FBSD_MAJOR < 6
188
-#define FBSD_DYNAMIC_LINKER "/tools/libexec/ld-elf.so.1"
189
+#define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
190
 #else
191
-#define FBSD_DYNAMIC_LINKER "/tools/libexec/ld-elf.so.1"
192
+#define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1"
193
 #endif
194
 
195
 /* NOTE: The freebsd-spec.h header is included also for various
196
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/frv/linux.h gcc-5.3.0-zip/gcc/config/frv/linux.h
197
--- gcc-5.3.0-original/gcc/config/frv/linux.h   2016-02-05 15:18:17.493469779 -0500
198
+++ gcc-5.3.0-zip/gcc/config/frv/linux.h        2015-01-05 07:33:28.000000000 -0500
199
@@ -34,7 +34,7 @@
200
 #define ENDFILE_SPEC \
201
   "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
202
 
203
-#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld.so.1"
204
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
205
 
206
 #undef LINK_SPEC
207
 #define LINK_SPEC "\
208
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/i386/gnu.h gcc-5.3.0-zip/gcc/config/i386/gnu.h
209
--- gcc-5.3.0-original/gcc/config/i386/gnu.h    2016-02-05 15:18:17.493469779 -0500
210
+++ gcc-5.3.0-zip/gcc/config/i386/gnu.h 2015-01-05 07:33:28.000000000 -0500
211
@@ -22,7 +22,7 @@
212
 #define GNU_USER_LINK_EMULATION "elf_i386"
213
 
214
 #undef GNU_USER_DYNAMIC_LINKER
215
-#define GNU_USER_DYNAMIC_LINKER "/tools/lib/ld.so"
216
+#define GNU_USER_DYNAMIC_LINKER "/lib/ld.so"
217
 
218
 #undef STARTFILE_SPEC
219
 #if defined HAVE_LD_PIE
220
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/i386/kfreebsd-gnu64.h gcc-5.3.0-zip/gcc/config/i386/kfreebsd-gnu64.h
221
--- gcc-5.3.0-original/gcc/config/i386/kfreebsd-gnu64.h 2016-02-05 15:18:17.493469779 -0500
222
+++ gcc-5.3.0-zip/gcc/config/i386/kfreebsd-gnu64.h      2015-01-05 07:33:28.000000000 -0500
223
@@ -22,6 +22,6 @@
224
 #define GNU_USER_LINK_EMULATION64 "elf_x86_64_fbsd"
225
 #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64_fbsd"
226
 
227
-#define GLIBC_DYNAMIC_LINKER32 "/tools/lib/ld.so.1"
228
-#define GLIBC_DYNAMIC_LINKER64 "/tools/lib/ld-kfreebsd-x86-64.so.1"
229
-#define GLIBC_DYNAMIC_LINKERX32 "/tools/lib/ld-kfreebsd-x32.so.1"
230
+#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
231
+#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-kfreebsd-x86-64.so.1"
232
+#define GLIBC_DYNAMIC_LINKERX32 "/lib/ld-kfreebsd-x32.so.1"
233
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/i386/kfreebsd-gnu.h gcc-5.3.0-zip/gcc/config/i386/kfreebsd-gnu.h
234
--- gcc-5.3.0-original/gcc/config/i386/kfreebsd-gnu.h   2016-02-05 15:18:17.493469779 -0500
235
+++ gcc-5.3.0-zip/gcc/config/i386/kfreebsd-gnu.h        2015-01-05 07:33:28.000000000 -0500
236
@@ -19,4 +19,4 @@
237
 <http://www.gnu.org/licenses/>.  */
238
 
239
 #define GNU_USER_LINK_EMULATION "elf_i386_fbsd"
240
-#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld.so.1"
241
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
242
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/i386/linux64.h gcc-5.3.0-zip/gcc/config/i386/linux64.h
243
--- gcc-5.3.0-original/gcc/config/i386/linux64.h        2016-02-05 15:18:17.493469779 -0500
244
+++ gcc-5.3.0-zip/gcc/config/i386/linux64.h     2015-01-05 07:33:28.000000000 -0500
245
@@ -27,6 +27,6 @@
246
 #define GNU_USER_LINK_EMULATION64 "elf_x86_64"
247
 #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64"
248
 
249
-#define GLIBC_DYNAMIC_LINKER32 "/tools/lib/ld-linux.so.2"
250
-#define GLIBC_DYNAMIC_LINKER64 "/tools/lib64/ld-linux-x86-64.so.2"
251
-#define GLIBC_DYNAMIC_LINKERX32 "/tools/libx32/ld-linux-x32.so.2"
252
+#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
253
+#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
254
+#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
255
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/i386/linux.h gcc-5.3.0-zip/gcc/config/i386/linux.h
256
--- gcc-5.3.0-original/gcc/config/i386/linux.h  2016-02-05 15:18:17.493469779 -0500
257
+++ gcc-5.3.0-zip/gcc/config/i386/linux.h       2015-01-05 07:33:28.000000000 -0500
258
@@ -20,4 +20,4 @@
259
 <http://www.gnu.org/licenses/>.  */
260
 
261
 #define GNU_USER_LINK_EMULATION "elf_i386"
262
-#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld-linux.so.2"
263
+#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
264
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/ia64/linux.h gcc-5.3.0-zip/gcc/config/ia64/linux.h
265
--- gcc-5.3.0-original/gcc/config/ia64/linux.h  2016-02-05 15:18:17.493469779 -0500
266
+++ gcc-5.3.0-zip/gcc/config/ia64/linux.h       2015-01-05 07:33:28.000000000 -0500
267
@@ -55,7 +55,7 @@
268
 /* Define this for shared library support because it isn't in the main
269
    linux.h file.  */
270
 
271
-#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld-linux-ia64.so.2"
272
+#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
273
 
274
 #undef LINK_SPEC
275
 #define LINK_SPEC "\
276
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/knetbsd-gnu.h gcc-5.3.0-zip/gcc/config/knetbsd-gnu.h
277
--- gcc-5.3.0-original/gcc/config/knetbsd-gnu.h 2016-02-05 15:18:17.493469779 -0500
278
+++ gcc-5.3.0-zip/gcc/config/knetbsd-gnu.h      2015-01-05 07:33:28.000000000 -0500
279
@@ -32,4 +32,4 @@
280
 
281
 
282
 #undef GNU_USER_DYNAMIC_LINKER
283
-#define GNU_USER_DYNAMIC_LINKER "/tools/lib/ld.so.1"
284
+#define GNU_USER_DYNAMIC_LINKER "/lib/ld.so.1"
285
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/kopensolaris-gnu.h gcc-5.3.0-zip/gcc/config/kopensolaris-gnu.h
286
--- gcc-5.3.0-original/gcc/config/kopensolaris-gnu.h    2016-02-05 15:18:17.493469779 -0500
287
+++ gcc-5.3.0-zip/gcc/config/kopensolaris-gnu.h 2015-01-05 07:33:28.000000000 -0500
288
@@ -31,5 +31,4 @@
289
   while (0)
290
 
291
 #undef GNU_USER_DYNAMIC_LINKER
292
-#define GNU_USER_DYNAMIC_LINKER "/tools/lib/ld.so.1"
293
-
294
+#define GNU_USER_DYNAMIC_LINKER "/lib/ld.so.1"
295
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/linux.h gcc-5.3.0-zip/gcc/config/linux.h
296
--- gcc-5.3.0-original/gcc/config/linux.h       2016-02-05 15:18:17.493469779 -0500
297
+++ gcc-5.3.0-zip/gcc/config/linux.h    2015-01-05 07:33:28.000000000 -0500
298
@@ -73,10 +73,10 @@
299
    GLIBC_DYNAMIC_LINKER must be defined for each target using them, or
300
    GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets
301
    supporting both 32-bit and 64-bit compilation.  */
302
-#define UCLIBC_DYNAMIC_LINKER "/tools/lib/ld-uClibc.so.0"
303
-#define UCLIBC_DYNAMIC_LINKER32 "/tools/lib/ld-uClibc.so.0"
304
-#define UCLIBC_DYNAMIC_LINKER64 "/tools/lib/ld64-uClibc.so.0"
305
-#define UCLIBC_DYNAMIC_LINKERX32 "/tools/lib/ldx32-uClibc.so.0"
306
+#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
307
+#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
308
+#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
309
+#define UCLIBC_DYNAMIC_LINKERX32 "/lib/ldx32-uClibc.so.0"
310
 #define BIONIC_DYNAMIC_LINKER "/system/bin/linker"
311
 #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
312
 #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
313
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/lm32/uclinux-elf.h gcc-5.3.0-zip/gcc/config/lm32/uclinux-elf.h
314
--- gcc-5.3.0-original/gcc/config/lm32/uclinux-elf.h    2016-02-05 15:18:17.493469779 -0500
315
+++ gcc-5.3.0-zip/gcc/config/lm32/uclinux-elf.h 2015-01-05 07:33:28.000000000 -0500
316
@@ -67,7 +67,7 @@
317
    %{shared:-shared} \
318
    %{symbolic:-Bsymbolic} \
319
    %{rdynamic:-export-dynamic} \
320
-   -dynamic-linker /tools/lib/ld-linux.so.2"
321
+   -dynamic-linker /lib/ld-linux.so.2"
322
 
323
 #define TARGET_OS_CPP_BUILTINS() GNU_USER_TARGET_OS_CPP_BUILTINS()
324
 
325
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/m68k/linux.h gcc-5.3.0-zip/gcc/config/m68k/linux.h
326
--- gcc-5.3.0-original/gcc/config/m68k/linux.h  2016-02-05 15:18:17.493469779 -0500
327
+++ gcc-5.3.0-zip/gcc/config/m68k/linux.h       2015-01-05 07:33:28.000000000 -0500
328
@@ -71,7 +71,7 @@
329
    When the -shared link option is used a final link is not being
330
    done.  */
331
 
332
-#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld.so.1"
333
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
334
 
335
 #undef LINK_SPEC
336
 #define LINK_SPEC "-m m68kelf %{shared} \
337
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/microblaze/linux.h gcc-5.3.0-zip/gcc/config/microblaze/linux.h
338
--- gcc-5.3.0-original/gcc/config/microblaze/linux.h    2016-02-05 15:18:17.493469779 -0500
339
+++ gcc-5.3.0-zip/gcc/config/microblaze/linux.h 2015-05-28 10:08:19.000000000 -0400
340
@@ -28,7 +28,7 @@
341
 #undef TLS_NEEDS_GOT
342
 #define TLS_NEEDS_GOT 1
343
 
344
-#define DYNAMIC_LINKER "/tools/lib/ld.so.1"
345
+#define DYNAMIC_LINKER "/lib/ld.so.1"
346
 #undef  SUBTARGET_EXTRA_SPECS
347
 #define SUBTARGET_EXTRA_SPECS \
348
   { "dynamic_linker", DYNAMIC_LINKER }
349
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/mips/linux.h gcc-5.3.0-zip/gcc/config/mips/linux.h
350
--- gcc-5.3.0-original/gcc/config/mips/linux.h  2016-02-05 15:18:17.493469779 -0500
351
+++ gcc-5.3.0-zip/gcc/config/mips/linux.h       2015-01-05 07:33:28.000000000 -0500
352
@@ -22,20 +22,20 @@
353
 #define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32"
354
 
355
 #define GLIBC_DYNAMIC_LINKER32 \
356
-  "%{mnan=2008:/tools/lib/ld-linux-mipsn8.so.1;:/tools/lib/ld.so.1}"
357
+  "%{mnan=2008:/lib/ld-linux-mipsn8.so.1;:/lib/ld.so.1}"
358
 #define GLIBC_DYNAMIC_LINKER64 \
359
-  "%{mnan=2008:/tools/lib64/ld-linux-mipsn8.so.1;:/tools/lib64/ld.so.1}"
360
+  "%{mnan=2008:/lib64/ld-linux-mipsn8.so.1;:/lib64/ld.so.1}"
361
 #define GLIBC_DYNAMIC_LINKERN32 \
362
-  "%{mnan=2008:/tools/lib32/ld-linux-mipsn8.so.1;:/tools/lib32/ld.so.1}"
363
+  "%{mnan=2008:/lib32/ld-linux-mipsn8.so.1;:/lib32/ld.so.1}"
364
 
365
 #undef UCLIBC_DYNAMIC_LINKER32
366
 #define UCLIBC_DYNAMIC_LINKER32 \
367
-  "%{mnan=2008:/tools/lib/ld-uClibc-mipsn8.so.0;:/tools/lib/ld-uClibc.so.0}"
368
+  "%{mnan=2008:/lib/ld-uClibc-mipsn8.so.0;:/lib/ld-uClibc.so.0}"
369
 #undef UCLIBC_DYNAMIC_LINKER64
370
 #define UCLIBC_DYNAMIC_LINKER64 \
371
-  "%{mnan=2008:/tools/lib/ld64-uClibc-mipsn8.so.0;:/tools/lib/ld64-uClibc.so.0}"
372
+  "%{mnan=2008:/lib/ld64-uClibc-mipsn8.so.0;:/lib/ld64-uClibc.so.0}"
373
 #define UCLIBC_DYNAMIC_LINKERN32 \
374
-  "%{mnan=2008:/tools/lib32/ld-uClibc-mipsn8.so.0;:/tools/lib32/ld-uClibc.so.0}"
375
+  "%{mnan=2008:/lib32/ld-uClibc-mipsn8.so.0;:/lib32/ld-uClibc.so.0}"
376
 
377
 #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
378
 #define GNU_USER_DYNAMIC_LINKERN32 \
379
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/mn10300/linux.h gcc-5.3.0-zip/gcc/config/mn10300/linux.h
380
--- gcc-5.3.0-original/gcc/config/mn10300/linux.h       2016-02-05 15:18:17.493469779 -0500
381
+++ gcc-5.3.0-zip/gcc/config/mn10300/linux.h    2015-01-05 07:33:28.000000000 -0500
382
@@ -32,7 +32,7 @@
383
 #undef  ASM_SPEC
384
 #define ASM_SPEC ""
385
 
386
-#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld.so.1"
387
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
388
 
389
 #undef  LINK_SPEC
390
 #define LINK_SPEC "%{mrelax:--relax} %{shared:-shared} \
391
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/pa/pa-linux.h gcc-5.3.0-zip/gcc/config/pa/pa-linux.h
392
--- gcc-5.3.0-original/gcc/config/pa/pa-linux.h 2016-02-05 15:18:17.493469779 -0500
393
+++ gcc-5.3.0-zip/gcc/config/pa/pa-linux.h      2015-09-24 20:04:26.000000000 -0400
394
@@ -37,7 +37,7 @@
395
 /* Define this for shared library support because it isn't in the main
396
    linux.h file.  */
397
 
398
-#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld.so.1"
399
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
400
 
401
 #undef LINK_SPEC
402
 #define LINK_SPEC "\
403
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/rs6000/linux64.h gcc-5.3.0-zip/gcc/config/rs6000/linux64.h
404
--- gcc-5.3.0-original/gcc/config/rs6000/linux64.h      2016-02-05 15:18:17.493469779 -0500
405
+++ gcc-5.3.0-zip/gcc/config/rs6000/linux64.h   2015-03-09 19:18:57.000000000 -0400
406
@@ -357,14 +357,14 @@
407
 #undef LINK_OS_DEFAULT_SPEC
408
 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
409
 
410
-#define GLIBC_DYNAMIC_LINKER32 "/tools/lib/ld.so.1"
411
+#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
412
 #ifdef LINUX64_DEFAULT_ABI_ELFv2
413
-#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:/tools/lib64/ld64.so.1;:/tools/lib64/ld64.so.2}"
414
+#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:/lib64/ld64.so.1;:/lib64/ld64.so.2}"
415
 #else
416
-#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:/tools/lib64/ld64.so.2;:/tools/lib64/ld64.so.1}"
417
+#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:/lib64/ld64.so.2;:/lib64/ld64.so.1}"
418
 #endif
419
-#define UCLIBC_DYNAMIC_LINKER32 "/tools/lib/ld-uClibc.so.0"
420
-#define UCLIBC_DYNAMIC_LINKER64 "/tools/lib/ld64-uClibc.so.0"
421
+#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
422
+#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
423
 #if DEFAULT_LIBC == LIBC_UCLIBC
424
 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
425
 #elif DEFAULT_LIBC == LIBC_GLIBC
426
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/rs6000/sysv4.h gcc-5.3.0-zip/gcc/config/rs6000/sysv4.h
427
--- gcc-5.3.0-original/gcc/config/rs6000/sysv4.h        2016-02-05 15:18:17.493469779 -0500
428
+++ gcc-5.3.0-zip/gcc/config/rs6000/sysv4.h     2015-09-24 09:46:45.000000000 -0400
429
@@ -757,8 +757,8 @@
430
 
431
 #define LINK_START_LINUX_SPEC ""
432
 
433
-#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld.so.1"
434
-#define UCLIBC_DYNAMIC_LINKER "/tools/lib/ld-uClibc.so.0"
435
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
436
+#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
437
 #if DEFAULT_LIBC == LIBC_UCLIBC
438
 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
439
 #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
440
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/rs6000/sysv4.h.orig gcc-5.3.0-zip/gcc/config/rs6000/sysv4.h.orig
441
--- gcc-5.3.0-original/gcc/config/rs6000/sysv4.h.orig   2015-09-24 09:46:45.000000000 -0400
442
+++ gcc-5.3.0-zip/gcc/config/rs6000/sysv4.h.orig        1969-12-31 19:00:00.000000000 -0500
443
@@ -1,945 +0,0 @@
444
-/* Target definitions for GNU compiler for PowerPC running System V.4
445
-   Copyright (C) 1995-2015 Free Software Foundation, Inc.
446
-   Contributed by Cygnus Support.
447
-
448
-   This file is part of GCC.
449
-
450
-   GCC is free software; you can redistribute it and/or modify it
451
-   under the terms of the GNU General Public License as published
452
-   by the Free Software Foundation; either version 3, or (at your
453
-   option) any later version.
454
-
455
-   GCC is distributed in the hope that it will be useful, but WITHOUT
456
-   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
457
-   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
458
-   License for more details.
459
-
460
-   Under Section 7 of GPL version 3, you are granted additional
461
-   permissions described in the GCC Runtime Library Exception, version
462
-   3.1, as published by the Free Software Foundation.
463
-
464
-   You should have received a copy of the GNU General Public License and
465
-   a copy of the GCC Runtime Library Exception along with this program;
466
-   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
467
-   <http://www.gnu.org/licenses/>.  */
468
-
469
-/* Header files should be C++ aware in general.  */
470
-#undef  NO_IMPLICIT_EXTERN_C
471
-#define NO_IMPLICIT_EXTERN_C
472
-
473
-/* Yes!  We are ELF.  */
474
-#define        TARGET_OBJECT_FORMAT OBJECT_ELF
475
-
476
-/* Default ABI to compile code for.  */
477
-#define DEFAULT_ABI rs6000_current_abi
478
-
479
-/* Default ABI to use.  */
480
-#define RS6000_ABI_NAME "sysv"
481
-
482
-/* Override rs6000.h definition.  */
483
-#undef ASM_DEFAULT_SPEC
484
-#define        ASM_DEFAULT_SPEC "-mppc"
485
-
486
-#define        TARGET_TOC              ((rs6000_isa_flags & OPTION_MASK_64BIT) \
487
-                                || ((rs6000_isa_flags                  \
488
-                                     & (OPTION_MASK_RELOCATABLE        \
489
-                                        | OPTION_MASK_MINIMAL_TOC))    \
490
-                                    && flag_pic > 1)                   \
491
-                                || DEFAULT_ABI != ABI_V4)
492
-
493
-#define        TARGET_BITFIELD_TYPE    (! TARGET_NO_BITFIELD_TYPE)
494
-#define        TARGET_BIG_ENDIAN       (! TARGET_LITTLE_ENDIAN)
495
-#define        TARGET_PROTOTYPE        target_prototype
496
-#define        TARGET_NO_PROTOTYPE     (! TARGET_PROTOTYPE)
497
-#define        TARGET_NO_TOC           (! TARGET_TOC)
498
-#define        TARGET_NO_EABI          (! TARGET_EABI)
499
-#define        TARGET_REGNAMES         rs6000_regnames
500
-
501
-#ifdef HAVE_AS_REL16
502
-#undef TARGET_SECURE_PLT
503
-#define TARGET_SECURE_PLT      secure_plt
504
-#endif
505
-
506
-#define SDATA_DEFAULT_SIZE 8
507
-
508
-/* The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
509
-   get control in TARGET_OPTION_OVERRIDE.  */
510
-
511
-#define SUBTARGET_OVERRIDE_OPTIONS                                     \
512
-do {                                                                   \
513
-  if (!global_options_set.x_g_switch_value)                            \
514
-    g_switch_value = SDATA_DEFAULT_SIZE;                               \
515
-                                                                       \
516
-  if (rs6000_abi_name == NULL)                                         \
517
-    rs6000_abi_name = RS6000_ABI_NAME;                                 \
518
-                                                                       \
519
-  if (!strcmp (rs6000_abi_name, "sysv"))                               \
520
-    rs6000_current_abi = ABI_V4;                                       \
521
-  else if (!strcmp (rs6000_abi_name, "sysv-noeabi"))                   \
522
-    {                                                                  \
523
-      rs6000_current_abi = ABI_V4;                                     \
524
-      rs6000_isa_flags &= ~ OPTION_MASK_EABI;                          \
525
-    }                                                                  \
526
-  else if (!strcmp (rs6000_abi_name, "sysv-eabi")                      \
527
-          || !strcmp (rs6000_abi_name, "eabi"))                        \
528
-    {                                                                  \
529
-      rs6000_current_abi = ABI_V4;                                     \
530
-      rs6000_isa_flags |= OPTION_MASK_EABI;                            \
531
-    }                                                                  \
532
-  else if (!strcmp (rs6000_abi_name, "aixdesc"))                       \
533
-    rs6000_current_abi = ABI_AIX;                                      \
534
-  else if (!strcmp (rs6000_abi_name, "freebsd")                                \
535
-          || !strcmp (rs6000_abi_name, "linux"))                       \
536
-    {                                                                  \
537
-      if (TARGET_64BIT)                                                        \
538
-       rs6000_current_abi = ABI_AIX;                                   \
539
-      else                                                             \
540
-       rs6000_current_abi = ABI_V4;                                    \
541
-    }                                                                  \
542
-  else if (!strcmp (rs6000_abi_name, "netbsd"))                                \
543
-    rs6000_current_abi = ABI_V4;                                       \
544
-  else if (!strcmp (rs6000_abi_name, "openbsd"))                       \
545
-    rs6000_current_abi = ABI_V4;                                       \
546
-  else if (!strcmp (rs6000_abi_name, "i960-old"))                      \
547
-    {                                                                  \
548
-      rs6000_current_abi = ABI_V4;                                     \
549
-      rs6000_isa_flags |= (OPTION_MASK_LITTLE_ENDIAN | OPTION_MASK_EABI); \
550
-      rs6000_isa_flags &= ~OPTION_MASK_STRICT_ALIGN;                   \
551
-      TARGET_NO_BITFIELD_WORD = 1;                                     \
552
-    }                                                                  \
553
-  else                                                                 \
554
-    {                                                                  \
555
-      rs6000_current_abi = ABI_V4;                                     \
556
-      error ("bad value for -mcall-%s", rs6000_abi_name);              \
557
-    }                                                                  \
558
-                                                                       \
559
-  if (rs6000_sdata_name)                                               \
560
-    {                                                                  \
561
-      if (!strcmp (rs6000_sdata_name, "none"))                         \
562
-       rs6000_sdata = SDATA_NONE;                                      \
563
-      else if (!strcmp (rs6000_sdata_name, "data"))                    \
564
-       rs6000_sdata = SDATA_DATA;                                      \
565
-      else if (!strcmp (rs6000_sdata_name, "default"))                 \
566
-       rs6000_sdata = (TARGET_EABI) ? SDATA_EABI : SDATA_SYSV;         \
567
-      else if (!strcmp (rs6000_sdata_name, "sysv"))                    \
568
-       rs6000_sdata = SDATA_SYSV;                                      \
569
-      else if (!strcmp (rs6000_sdata_name, "eabi"))                    \
570
-       rs6000_sdata = SDATA_EABI;                                      \
571
-      else                                                             \
572
-       error ("bad value for -msdata=%s", rs6000_sdata_name);          \
573
-    }                                                                  \
574
-  else if (DEFAULT_ABI == ABI_V4)                                      \
575
-    {                                                                  \
576
-      rs6000_sdata = SDATA_DATA;                                       \
577
-      rs6000_sdata_name = "data";                                      \
578
-    }                                                                  \
579
-  else                                                                 \
580
-    {                                                                  \
581
-      rs6000_sdata = SDATA_NONE;                                       \
582
-      rs6000_sdata_name = "none";                                      \
583
-    }                                                                  \
584
-                                                                       \
585
-  if (TARGET_RELOCATABLE &&                                            \
586
-      (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV))      \
587
-    {                                                                  \
588
-      rs6000_sdata = SDATA_DATA;                                       \
589
-      error ("-mrelocatable and -msdata=%s are incompatible",          \
590
-            rs6000_sdata_name);                                        \
591
-    }                                                                  \
592
-                                                                       \
593
-  else if (flag_pic && DEFAULT_ABI == ABI_V4                           \
594
-          && (rs6000_sdata == SDATA_EABI                               \
595
-              || rs6000_sdata == SDATA_SYSV))                          \
596
-    {                                                                  \
597
-      rs6000_sdata = SDATA_DATA;                                       \
598
-      error ("-f%s and -msdata=%s are incompatible",                   \
599
-            (flag_pic > 1) ? "PIC" : "pic",                            \
600
-            rs6000_sdata_name);                                        \
601
-    }                                                                  \
602
-                                                                       \
603
-  if ((rs6000_sdata != SDATA_NONE && DEFAULT_ABI != ABI_V4)            \
604
-      || (rs6000_sdata == SDATA_EABI && !TARGET_EABI))                 \
605
-    {                                                                  \
606
-      rs6000_sdata = SDATA_NONE;                                       \
607
-      error ("-msdata=%s and -mcall-%s are incompatible",              \
608
-            rs6000_sdata_name, rs6000_abi_name);                       \
609
-    }                                                                  \
610
-                                                                       \
611
-  targetm.have_srodata_section = rs6000_sdata == SDATA_EABI;           \
612
-                                                                       \
613
-  if (TARGET_RELOCATABLE && !TARGET_MINIMAL_TOC)                       \
614
-    {                                                                  \
615
-      rs6000_isa_flags |= OPTION_MASK_MINIMAL_TOC;                     \
616
-      error ("-mrelocatable and -mno-minimal-toc are incompatible");   \
617
-    }                                                                  \
618
-                                                                       \
619
-  if (TARGET_RELOCATABLE && rs6000_current_abi != ABI_V4)              \
620
-    {                                                                  \
621
-      rs6000_isa_flags &= ~OPTION_MASK_RELOCATABLE;                    \
622
-      error ("-mrelocatable and -mcall-%s are incompatible",           \
623
-            rs6000_abi_name);                                          \
624
-    }                                                                  \
625
-                                                                       \
626
-  if (!TARGET_64BIT && flag_pic > 1 && rs6000_current_abi != ABI_V4)   \
627
-    {                                                                  \
628
-      flag_pic = 0;                                                    \
629
-      error ("-fPIC and -mcall-%s are incompatible",                   \
630
-            rs6000_abi_name);                                          \
631
-    }                                                                  \
632
-                                                                       \
633
-  if (TARGET_SECURE_PLT != secure_plt)                                 \
634
-    {                                                                  \
635
-      error ("-msecure-plt not supported by your assembler");          \
636
-    }                                                                  \
637
-                                                                       \
638
-  /* Treat -fPIC the same as -mrelocatable.  */                                \
639
-  if (flag_pic > 1 && DEFAULT_ABI == ABI_V4)                           \
640
-    {                                                                  \
641
-      rs6000_isa_flags |= OPTION_MASK_RELOCATABLE | OPTION_MASK_MINIMAL_TOC; \
642
-      TARGET_NO_FP_IN_TOC = 1;                                         \
643
-    }                                                                  \
644
-                                                                       \
645
-  else if (TARGET_RELOCATABLE)                                         \
646
-    if (!flag_pic)                                                     \
647
-      flag_pic = 2;                                                    \
648
-} while (0)
649
-
650
-#ifndef RS6000_BI_ARCH
651
-# define SUBSUBTARGET_OVERRIDE_OPTIONS                                 \
652
-do {                                                                   \
653
-  if ((TARGET_DEFAULT ^ rs6000_isa_flags) & OPTION_MASK_64BIT)         \
654
-    error ("-m%s not supported in this configuration",                 \
655
-          (rs6000_isa_flags & OPTION_MASK_64BIT) ? "64" : "32");       \
656
-} while (0)
657
-#endif
658
-
659
-/* Override rs6000.h definition.  */
660
-#undef TARGET_DEFAULT
661
-#define        TARGET_DEFAULT 0
662
-
663
-/* Override rs6000.h definition.  */
664
-#undef PROCESSOR_DEFAULT
665
-#define        PROCESSOR_DEFAULT PROCESSOR_PPC750
666
-
667
-#define FIXED_R2 1
668
-/* System V.4 uses register 13 as a pointer to the small data area,
669
-   so it is not available to the normal user.  */
670
-#define FIXED_R13 1
671
-
672
-/* Override default big endianism definitions in rs6000.h.  */
673
-#undef BYTES_BIG_ENDIAN
674
-#undef WORDS_BIG_ENDIAN
675
-#define        BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN)
676
-#define        WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)
677
-
678
-/* Put jump tables in read-only memory, rather than in .text.  */
679
-#define JUMP_TABLES_IN_TEXT_SECTION 0
680
-
681
-/* Prefix and suffix to use to saving floating point.  */
682
-#define        SAVE_FP_PREFIX "_savefpr_"
683
-#define SAVE_FP_SUFFIX ""
684
-
685
-/* Prefix and suffix to use to restoring floating point.  */
686
-#define        RESTORE_FP_PREFIX "_restfpr_"
687
-#define RESTORE_FP_SUFFIX ""
688
-
689
-/* Type used for size_t, as a string used in a declaration.  */
690
-#undef  SIZE_TYPE
691
-#define SIZE_TYPE "unsigned int"
692
-
693
-/* Type used for ptrdiff_t, as a string used in a declaration.  */
694
-#define PTRDIFF_TYPE "int"
695
-
696
-#undef WCHAR_TYPE
697
-#define WCHAR_TYPE "long int"
698
-
699
-#undef WCHAR_TYPE_SIZE
700
-#define WCHAR_TYPE_SIZE 32
701
-
702
-/* Make int foo : 8 not cause structures to be aligned to an int boundary.  */
703
-/* Override elfos.h definition.  */
704
-#undef PCC_BITFIELD_TYPE_MATTERS
705
-#define        PCC_BITFIELD_TYPE_MATTERS (TARGET_BITFIELD_TYPE)
706
-
707
-#undef BITFIELD_NBYTES_LIMITED
708
-#define        BITFIELD_NBYTES_LIMITED (TARGET_NO_BITFIELD_WORD)
709
-
710
-/* Define this macro to be the value 1 if instructions will fail to
711
-   work if given data not on the nominal alignment.  If instructions
712
-   will merely go slower in that case, define this macro as 0.  */
713
-#undef STRICT_ALIGNMENT
714
-#define        STRICT_ALIGNMENT (TARGET_STRICT_ALIGN)
715
-
716
-/* Define this macro if you wish to preserve a certain alignment for
717
-   the stack pointer, greater than what the hardware enforces.  The
718
-   definition is a C expression for the desired alignment (measured
719
-   in bits).  This macro must evaluate to a value equal to or larger
720
-   than STACK_BOUNDARY.
721
-   For the SYSV ABI and variants the alignment of the stack pointer
722
-   is usually controlled manually in rs6000.c. However, to maintain
723
-   alignment across alloca () in all circumstances,
724
-   PREFERRED_STACK_BOUNDARY needs to be set as well.
725
-   This has the additional advantage of allowing a bigger maximum
726
-   alignment of user objects on the stack.  */
727
-
728
-#undef PREFERRED_STACK_BOUNDARY
729
-#define PREFERRED_STACK_BOUNDARY 128
730
-
731
-/* Real stack boundary as mandated by the appropriate ABI.  */
732
-#define ABI_STACK_BOUNDARY \
733
-  ((TARGET_EABI && !TARGET_ALTIVEC && !TARGET_ALTIVEC_ABI) ? 64 : 128)
734
-
735
-/* An expression for the alignment of a structure field FIELD if the
736
-   alignment computed in the usual way is COMPUTED.  */
737
-#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED)                                  \
738
-       (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED))            \
739
-        ? 128 : COMPUTED)
740
-
741
-#undef  BIGGEST_FIELD_ALIGNMENT
742
-
743
-/* Use ELF style section commands.  */
744
-
745
-#define        TEXT_SECTION_ASM_OP     "\t.section\t\".text\""
746
-
747
-#define        DATA_SECTION_ASM_OP     "\t.section\t\".data\""
748
-
749
-#define        BSS_SECTION_ASM_OP      "\t.section\t\".bss\""
750
-
751
-/* Override elfos.h definition.  */
752
-#undef INIT_SECTION_ASM_OP
753
-#define        INIT_SECTION_ASM_OP "\t.section\t\".init\",\"ax\""
754
-
755
-/* Override elfos.h definition.  */
756
-#undef FINI_SECTION_ASM_OP
757
-#define        FINI_SECTION_ASM_OP "\t.section\t\".fini\",\"ax\""
758
-
759
-#define        TOC_SECTION_ASM_OP "\t.section\t\".got\",\"aw\""
760
-
761
-/* Put PC relative got entries in .got2.  */
762
-#define        MINIMAL_TOC_SECTION_ASM_OP \
763
-  (TARGET_RELOCATABLE || (flag_pic && DEFAULT_ABI == ABI_V4)           \
764
-   ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"")
765
-
766
-#define        SDATA_SECTION_ASM_OP "\t.section\t\".sdata\",\"aw\""
767
-#define        SDATA2_SECTION_ASM_OP "\t.section\t\".sdata2\",\"a\""
768
-#define        SBSS_SECTION_ASM_OP "\t.section\t\".sbss\",\"aw\",@nobits"
769
-
770
-/* Override default elf definitions.  */
771
-#define TARGET_ASM_INIT_SECTIONS rs6000_elf_asm_init_sections
772
-#undef  TARGET_ASM_RELOC_RW_MASK
773
-#define TARGET_ASM_RELOC_RW_MASK rs6000_elf_reloc_rw_mask
774
-#undef TARGET_ASM_SELECT_RTX_SECTION
775
-#define        TARGET_ASM_SELECT_RTX_SECTION rs6000_elf_select_rtx_section
776
-
777
-/* Return nonzero if this entry is to be written into the constant pool
778
-   in a special way.  We do so if this is a SYMBOL_REF, LABEL_REF or a CONST
779
-   containing one of them.  If -mfp-in-toc (the default), we also do
780
-   this for floating-point constants.  We actually can only do this
781
-   if the FP formats of the target and host machines are the same, but
782
-   we can't check that since not every file that uses these target macros
783
-   includes real.h.
784
-
785
-   Unlike AIX, we don't key off of -mminimal-toc, but instead do not
786
-   allow floating point constants in the TOC if -mrelocatable.  */
787
-
788
-#undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
789
-#define        ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE)                        \
790
-  (TARGET_TOC                                                          \
791
-   && (GET_CODE (X) == SYMBOL_REF                                      \
792
-       || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS     \
793
-          && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF)           \
794
-       || GET_CODE (X) == LABEL_REF                                    \
795
-       || (GET_CODE (X) == CONST_INT                                   \
796
-          && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode))      \
797
-       || (!TARGET_NO_FP_IN_TOC                                                \
798
-          && !TARGET_RELOCATABLE                                       \
799
-          && GET_CODE (X) == CONST_DOUBLE                              \
800
-          && SCALAR_FLOAT_MODE_P (GET_MODE (X))                        \
801
-          && BITS_PER_WORD == HOST_BITS_PER_INT)))
802
-
803
-/* These macros generate the special .type and .size directives which
804
-   are used to set the corresponding fields of the linker symbol table
805
-   entries in an ELF object file under SVR4.  These macros also output
806
-   the starting labels for the relevant functions/objects.  */
807
-
808
-/* Write the extra assembler code needed to declare a function properly.
809
-   Some svr4 assemblers need to also have something extra said about the
810
-   function's return value.  We allow for that here.  */
811
-
812
-/* Override elfos.h definition.  */
813
-#undef ASM_DECLARE_FUNCTION_NAME
814
-#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)                    \
815
-  rs6000_elf_declare_function_name ((FILE), (NAME), (DECL))
816
-
817
-/* The USER_LABEL_PREFIX stuff is affected by the -fleading-underscore
818
-   flag.  The LOCAL_LABEL_PREFIX variable is used by dbxelf.h.  */
819
-
820
-#define        LOCAL_LABEL_PREFIX "."
821
-#define        USER_LABEL_PREFIX ""
822
-
823
-#define        ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX)   \
824
-  asm_fprintf (FILE, "%L%s", PREFIX)
825
-
826
-/* Globalizing directive for a label.  */
827
-#define GLOBAL_ASM_OP "\t.globl "
828
-
829
-/* This says how to output assembler code to declare an
830
-   uninitialized internal linkage data object.  Under SVR4,
831
-   the linker seems to want the alignment of data objects
832
-   to depend on their types.  We do exactly that here.  */
833
-
834
-#define        LOCAL_ASM_OP    "\t.local\t"
835
-
836
-#define        LCOMM_ASM_OP    "\t.lcomm\t"
837
-
838
-/* Describe how to emit uninitialized local items.  */
839
-#define        ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN)    \
840
-do {                                                                   \
841
-  if ((DECL) && rs6000_elf_in_small_data_p (DECL))                     \
842
-    {                                                                  \
843
-      switch_to_section (sbss_section);                                        \
844
-      ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT));     \
845
-      ASM_OUTPUT_LABEL (FILE, NAME);                                   \
846
-      ASM_OUTPUT_SKIP (FILE, SIZE);                                    \
847
-      if (!flag_inhibit_size_directive && (SIZE) > 0)                  \
848
-       ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, SIZE);                   \
849
-    }                                                                  \
850
-  else                                                                 \
851
-    {                                                                  \
852
-      fprintf (FILE, "%s", LCOMM_ASM_OP);                              \
853
-      assemble_name ((FILE), (NAME));                                  \
854
-      fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n",         \
855
-              (SIZE), (ALIGN) / BITS_PER_UNIT);                        \
856
-    }                                                                  \
857
-  ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object");                    \
858
-} while (0)
859
-
860
-/* Describe how to emit uninitialized external linkage items.  */
861
-#define        ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN)           \
862
-do {                                                                   \
863
-  ASM_OUTPUT_ALIGNED_DECL_LOCAL (FILE, DECL, NAME, SIZE, ALIGN);       \
864
-} while (0)
865
-
866
-#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
867
-/* To support -falign-* switches we need to use .p2align so
868
-   that alignment directives in code sections will be padded
869
-   with no-op instructions, rather than zeroes.  */
870
-#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)                   \
871
-  if ((LOG) != 0)                                                      \
872
-    {                                                                  \
873
-      if ((MAX_SKIP) == 0)                                             \
874
-       fprintf ((FILE), "\t.p2align %d\n", (LOG));                     \
875
-      else                                                             \
876
-       fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));     \
877
-    }
878
-#endif
879
-
880
-/* This is how to output code to push a register on the stack.
881
-   It need not be very fast code.
882
-
883
-   On the rs6000, we must keep the backchain up to date.  In order
884
-   to simplify things, always allocate 16 bytes for a push (System V
885
-   wants to keep stack aligned to a 16 byte boundary).  */
886
-
887
-#define        ASM_OUTPUT_REG_PUSH(FILE, REGNO)                                \
888
-do {                                                                   \
889
-  if (DEFAULT_ABI == ABI_V4)                                           \
890
-    asm_fprintf (FILE,                                                 \
891
-                "\tstwu %s,-16(%s)\n\tstw %s,12(%s)\n",        \
892
-                reg_names[1], reg_names[1], reg_names[REGNO],          \
893
-                reg_names[1]);                                         \
894
-} while (0)
895
-
896
-/* This is how to output an insn to pop a register from the stack.
897
-   It need not be very fast code.  */
898
-
899
-#define        ASM_OUTPUT_REG_POP(FILE, REGNO)                                 \
900
-do {                                                                   \
901
-  if (DEFAULT_ABI == ABI_V4)                                           \
902
-    asm_fprintf (FILE,                                                 \
903
-                "\tlwz %s,12(%s)\n\taddi %s,%s,16\n",  \
904
-                reg_names[REGNO], reg_names[1], reg_names[1],          \
905
-                reg_names[1]);                                         \
906
-} while (0)
907
-
908
-extern int fixuplabelno;
909
-
910
-/* Handle constructors specially for -mrelocatable.  */
911
-#define TARGET_ASM_CONSTRUCTOR  rs6000_elf_asm_out_constructor
912
-#define TARGET_ASM_DESTRUCTOR   rs6000_elf_asm_out_destructor
913
-
914
-/* This is the end of what might become sysv4.h.  */
915
-
916
-/* Use DWARF 2 debugging information by default.  */
917
-#undef  PREFERRED_DEBUGGING_TYPE
918
-#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
919
-
920
-/* Historically we have also supported stabs debugging.  */
921
-#define DBX_DEBUGGING_INFO 1
922
-
923
-#define TARGET_ENCODE_SECTION_INFO  rs6000_elf_encode_section_info
924
-#define TARGET_IN_SMALL_DATA_P  rs6000_elf_in_small_data_p
925
-
926
-/* The ELF version doesn't encode [DS] or whatever at the end of symbols.  */
927
-
928
-#define        RS6000_OUTPUT_BASENAME(FILE, NAME)      \
929
-    assemble_name (FILE, NAME)
930
-
931
-/* We have to output the stabs for the function name *first*, before
932
-   outputting its label.  */
933
-
934
-#define        DBX_FUNCTION_FIRST
935
-
936
-/* This is the end of what might become sysv4dbx.h.  */
937
-
938
-#define TARGET_OS_SYSV_CPP_BUILTINS()          \
939
-  do                                           \
940
-    {                                          \
941
-      if (rs6000_isa_flags_explicit            \
942
-         & OPTION_MASK_RELOCATABLE)            \
943
-       builtin_define ("_RELOCATABLE");        \
944
-    }                                          \
945
-  while (0)
946
-
947
-#ifndef        TARGET_OS_CPP_BUILTINS
948
-#define TARGET_OS_CPP_BUILTINS()               \
949
-  do                                           \
950
-    {                                          \
951
-      builtin_define_std ("PPC");              \
952
-      builtin_define_std ("unix");             \
953
-      builtin_define ("__svr4__");             \
954
-      builtin_assert ("system=unix");          \
955
-      builtin_assert ("system=svr4");          \
956
-      builtin_assert ("cpu=powerpc");          \
957
-      builtin_assert ("machine=powerpc");      \
958
-      TARGET_OS_SYSV_CPP_BUILTINS ();          \
959
-    }                                          \
960
-  while (0)
961
-#endif
962
-
963
-/* Select one of BIG_OPT, LITTLE_OPT or DEFAULT_OPT depending
964
-   on various -mbig, -mlittle and -mcall- options.  */
965
-#define ENDIAN_SELECT(BIG_OPT, LITTLE_OPT, DEFAULT_OPT)        \
966
-"%{mlittle|mlittle-endian:"    LITTLE_OPT ";"  \
967
-  "mbig|mbig-endian:"          BIG_OPT    ";"  \
968
-  "mcall-i960-old:"            LITTLE_OPT ";"  \
969
-  ":"                          DEFAULT_OPT "}"
970
-
971
-#define DEFAULT_ASM_ENDIAN " -mbig"
972
-
973
-#undef ASM_SPEC
974
-#define        ASM_SPEC "%(asm_cpu) \
975
-%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \
976
-%{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC} \
977
-%{memb|msdata=eabi: -memb}" \
978
-ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
979
-
980
-#ifndef CC1_SECURE_PLT_DEFAULT_SPEC
981
-#define CC1_SECURE_PLT_DEFAULT_SPEC ""
982
-#endif
983
-
984
-/* Pass -G xxx to the compiler.  */
985
-#undef CC1_SPEC
986
-#define        CC1_SPEC "%{G*} %(cc1_cpu)" \
987
-"%{meabi: %{!mcall-*: -mcall-sysv }} \
988
-%{!meabi: %{!mno-eabi: \
989
-    %{mrelocatable: -meabi } \
990
-    %{mcall-freebsd: -mno-eabi } \
991
-    %{mcall-i960-old: -meabi } \
992
-    %{mcall-linux: -mno-eabi } \
993
-    %{mcall-netbsd: -mno-eabi } \
994
-    %{mcall-openbsd: -mno-eabi }}} \
995
-%{msdata: -msdata=default} \
996
-%{mno-sdata: -msdata=none} \
997
-%{!mbss-plt: %{!msecure-plt: %(cc1_secure_plt_default)}} \
998
-%{profile: -p}"
999
-
1000
-/* Default starting address if specified.  */
1001
-#define LINK_START_SPEC "\
1002
-%{mads         : %(link_start_ads)         ; \
1003
-  myellowknife : %(link_start_yellowknife) ; \
1004
-  mmvme        : %(link_start_mvme)        ; \
1005
-  msim         : %(link_start_sim)         ; \
1006
-  mcall-freebsd: %(link_start_freebsd)     ; \
1007
-  mcall-linux  : %(link_start_linux)       ; \
1008
-  mcall-netbsd : %(link_start_netbsd)      ; \
1009
-  mcall-openbsd: %(link_start_openbsd)     ; \
1010
-               : %(link_start_default)     }"
1011
-
1012
-#define LINK_START_DEFAULT_SPEC ""
1013
-
1014
-#undef LINK_SPEC
1015
-#define        LINK_SPEC "\
1016
-%{h*} %{v:-V} %{!msdata=none:%{G*}} %{msdata=none:-G0} \
1017
-%{R*} \
1018
-%(link_shlib) \
1019
-%{!T*: %(link_start) } \
1020
-%(link_os)"
1021
-
1022
-/* Shared libraries are not default.  */
1023
-#define LINK_SHLIB_SPEC "\
1024
-%{!mshlib: %{!shared: %{!symbolic: -dn -Bstatic}}} \
1025
-%{static: } \
1026
-%{shared:-G -dy -z text } \
1027
-%{symbolic:-Bsymbolic -G -dy -z text }"
1028
-
1029
-/* Any specific OS flags.  */
1030
-#define LINK_OS_SPEC "\
1031
-%{mads         : %(link_os_ads)         ; \
1032
-  myellowknife : %(link_os_yellowknife) ; \
1033
-  mmvme        : %(link_os_mvme)        ; \
1034
-  msim         : %(link_os_sim)         ; \
1035
-  mcall-freebsd: %(link_os_freebsd)     ; \
1036
-  mcall-linux  : %(link_os_linux)       ; \
1037
-  mcall-netbsd : %(link_os_netbsd)      ; \
1038
-  mcall-openbsd: %(link_os_openbsd)     ; \
1039
-               : %(link_os_default)     }"
1040
-
1041
-#define LINK_OS_DEFAULT_SPEC ""
1042
-
1043
-#define DRIVER_SELF_SPECS "%{mfpu=none: %<mfpu=* \
1044
-       %<msingle-float %<mdouble-float}"
1045
-
1046
-/* Override rs6000.h definition.  */
1047
-#undef CPP_SPEC
1048
-#define        CPP_SPEC "%{posix: -D_POSIX_SOURCE} \
1049
-%{mads         : %(cpp_os_ads)         ; \
1050
-  myellowknife : %(cpp_os_yellowknife) ; \
1051
-  mmvme        : %(cpp_os_mvme)        ; \
1052
-  msim         : %(cpp_os_sim)         ; \
1053
-  mcall-freebsd: %(cpp_os_freebsd)     ; \
1054
-  mcall-linux  : %(cpp_os_linux)       ; \
1055
-  mcall-netbsd : %(cpp_os_netbsd)      ; \
1056
-  mcall-openbsd: %(cpp_os_openbsd)     ; \
1057
-               : %(cpp_os_default)     }"
1058
-
1059
-#define        CPP_OS_DEFAULT_SPEC ""
1060
-
1061
-#undef STARTFILE_SPEC
1062
-#define        STARTFILE_SPEC "\
1063
-%{mads         : %(startfile_ads)         ; \
1064
-  myellowknife : %(startfile_yellowknife) ; \
1065
-  mmvme        : %(startfile_mvme)        ; \
1066
-  msim         : %(startfile_sim)         ; \
1067
-  mcall-freebsd: %(startfile_freebsd)     ; \
1068
-  mcall-linux  : %(startfile_linux)       ; \
1069
-  mcall-netbsd : %(startfile_netbsd)      ; \
1070
-  mcall-openbsd: %(startfile_openbsd)     ; \
1071
-               : %(startfile_default)     }"
1072
-
1073
-#define        STARTFILE_DEFAULT_SPEC "ecrti.o%s crtbegin.o%s"
1074
-
1075
-#undef LIB_SPEC
1076
-#define        LIB_SPEC "\
1077
-%{mads         : %(lib_ads)         ; \
1078
-  myellowknife : %(lib_yellowknife) ; \
1079
-  mmvme        : %(lib_mvme)        ; \
1080
-  msim         : %(lib_sim)         ; \
1081
-  mcall-freebsd: %(lib_freebsd)     ; \
1082
-  mcall-linux  : %(lib_linux)       ; \
1083
-  mcall-netbsd : %(lib_netbsd)      ; \
1084
-  mcall-openbsd: %(lib_openbsd)     ; \
1085
-               : %(lib_default)     }"
1086
-
1087
-#define LIB_DEFAULT_SPEC "-lc"
1088
-
1089
-#undef ENDFILE_SPEC
1090
-#define        ENDFILE_SPEC "\
1091
-%{mads         : %(endfile_ads)         ; \
1092
-  myellowknife : %(endfile_yellowknife) ; \
1093
-  mmvme        : %(endfile_mvme)        ; \
1094
-  msim         : %(endfile_sim)         ; \
1095
-  mcall-freebsd: %(endfile_freebsd)     ; \
1096
-  mcall-linux  : %(endfile_linux)       ; \
1097
-  mcall-netbsd : %(endfile_netbsd)      ; \
1098
-  mcall-openbsd: %(endfile_openbsd)     ; \
1099
-               : %(crtsavres_default) %(endfile_default)     }"
1100
-
1101
-#define CRTSAVRES_DEFAULT_SPEC ""
1102
-
1103
-#define        ENDFILE_DEFAULT_SPEC "crtend.o%s ecrtn.o%s"
1104
-
1105
-/* Motorola ADS support.  */
1106
-#define LIB_ADS_SPEC "--start-group -lads -lc --end-group"
1107
-
1108
-#define        STARTFILE_ADS_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
1109
-
1110
-#define        ENDFILE_ADS_SPEC "crtend.o%s ecrtn.o%s"
1111
-
1112
-#define LINK_START_ADS_SPEC "-T ads.ld%s"
1113
-
1114
-#define LINK_OS_ADS_SPEC ""
1115
-
1116
-#define CPP_OS_ADS_SPEC ""
1117
-
1118
-/* Motorola Yellowknife support.  */
1119
-#define LIB_YELLOWKNIFE_SPEC "--start-group -lyk -lc --end-group"
1120
-
1121
-#define        STARTFILE_YELLOWKNIFE_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
1122
-
1123
-#define        ENDFILE_YELLOWKNIFE_SPEC "crtend.o%s ecrtn.o%s"
1124
-
1125
-#define LINK_START_YELLOWKNIFE_SPEC "-T yellowknife.ld%s"
1126
-
1127
-#define LINK_OS_YELLOWKNIFE_SPEC ""
1128
-
1129
-#define CPP_OS_YELLOWKNIFE_SPEC ""
1130
-
1131
-/* Motorola MVME support.  */
1132
-#define LIB_MVME_SPEC "--start-group -lmvme -lc --end-group"
1133
-
1134
-#define        STARTFILE_MVME_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
1135
-
1136
-#define        ENDFILE_MVME_SPEC "crtend.o%s ecrtn.o%s"
1137
-
1138
-#define LINK_START_MVME_SPEC "-Ttext 0x40000"
1139
-
1140
-#define LINK_OS_MVME_SPEC ""
1141
-
1142
-#define CPP_OS_MVME_SPEC ""
1143
-
1144
-/* PowerPC simulator based on netbsd system calls support.  */
1145
-#define LIB_SIM_SPEC "--start-group -lsim -lc --end-group"
1146
-
1147
-#define        STARTFILE_SIM_SPEC "ecrti.o%s sim-crt0.o%s crtbegin.o%s"
1148
-
1149
-#define        ENDFILE_SIM_SPEC "crtend.o%s ecrtn.o%s"
1150
-
1151
-#define LINK_START_SIM_SPEC ""
1152
-
1153
-#define LINK_OS_SIM_SPEC "-m elf32ppcsim"
1154
-
1155
-#define CPP_OS_SIM_SPEC ""
1156
-
1157
-/* FreeBSD support.  */
1158
-
1159
-#define CPP_OS_FREEBSD_SPEC    "\
1160
-  -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ \
1161
-  -Acpu=powerpc -Amachine=powerpc"
1162
-
1163
-#define        STARTFILE_FREEBSD_SPEC  FBSD_STARTFILE_SPEC
1164
-#define ENDFILE_FREEBSD_SPEC   FBSD_ENDFILE_SPEC
1165
-#define LIB_FREEBSD_SPEC       FBSD_LIB_SPEC
1166
-#define LINK_START_FREEBSD_SPEC        ""
1167
-
1168
-#define LINK_OS_FREEBSD_SPEC "\
1169
-  %{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \
1170
-  %{v:-V} \
1171
-  %{assert*} %{R*} %{rpath*} %{defsym*} \
1172
-  %{shared:-Bshareable %{h*} %{soname*}} \
1173
-  %{!shared: \
1174
-    %{!static: \
1175
-      %{rdynamic: -export-dynamic} \
1176
-      -dynamic-linker %(fbsd_dynamic_linker) } \
1177
-    %{static:-Bstatic}} \
1178
-  %{symbolic:-Bsymbolic}"
1179
-
1180
-/* GNU/Linux support.  */
1181
-#define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
1182
-%{!mnewlib: %{pthread:-lpthread} %{shared:-lc} \
1183
-%{!shared: %{profile:-lc_p} %{!profile:-lc}}}"
1184
-
1185
-#ifdef HAVE_LD_PIE
1186
-#define        STARTFILE_LINUX_SPEC "\
1187
-%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
1188
-%{mnewlib:ecrti.o%s;:crti.o%s} \
1189
-%{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
1190
-#else
1191
-#define        STARTFILE_LINUX_SPEC "\
1192
-%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
1193
-%{mnewlib:ecrti.o%s;:crti.o%s} \
1194
-%{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
1195
-#endif
1196
-
1197
-#define        ENDFILE_LINUX_SPEC "\
1198
-%{shared|pie:crtendS.o%s;:crtend.o%s} \
1199
-%{mnewlib:ecrtn.o%s;:crtn.o%s}"
1200
-
1201
-#define LINK_START_LINUX_SPEC ""
1202
-
1203
-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
1204
-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
1205
-#if DEFAULT_LIBC == LIBC_UCLIBC
1206
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
1207
-#elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
1208
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
1209
-#else
1210
-#error "Unsupported DEFAULT_LIBC"
1211
-#endif
1212
-#define GNU_USER_DYNAMIC_LINKER \
1213
-  CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
1214
-
1215
-#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
1216
-  %{rdynamic:-export-dynamic} \
1217
-  -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
1218
-
1219
-#if defined(HAVE_LD_EH_FRAME_HDR)
1220
-# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
1221
-#endif
1222
-
1223
-#define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
1224
-%{!undef:                                                        \
1225
-  %{!ansi:                                                       \
1226
-    %{!std=*:-Dunix -D__unix -Dlinux -D__linux}                          \
1227
-    %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}}              \
1228
--Asystem=linux -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
1229
-
1230
-/* NetBSD support.  */
1231
-#define LIB_NETBSD_SPEC "\
1232
--lc"
1233
-
1234
-#define        STARTFILE_NETBSD_SPEC "\
1235
-ncrti.o%s crt0.o%s \
1236
-%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
1237
-
1238
-#define ENDFILE_NETBSD_SPEC "\
1239
-%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
1240
-ncrtn.o%s"
1241
-
1242
-#define LINK_START_NETBSD_SPEC "\
1243
-"
1244
-
1245
-#define LINK_OS_NETBSD_SPEC "\
1246
-%{!shared: %{!static: \
1247
-  %{rdynamic:-export-dynamic} \
1248
-  -dynamic-linker /usr/libexec/ld.elf_so}}"
1249
-
1250
-#define CPP_OS_NETBSD_SPEC "\
1251
--D__powerpc__ -D__NetBSD__ -D__KPRINTF_ATTRIBUTE__"
1252
-
1253
-/* OpenBSD support.  */
1254
-#ifndef        LIB_OPENBSD_SPEC
1255
-#define LIB_OPENBSD_SPEC "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}"
1256
-#endif
1257
-
1258
-#ifndef        STARTFILE_OPENBSD_SPEC
1259
-#define        STARTFILE_OPENBSD_SPEC "\
1260
-%{!shared: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} \
1261
-%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
1262
-#endif
1263
-
1264
-#ifndef        ENDFILE_OPENBSD_SPEC
1265
-#define        ENDFILE_OPENBSD_SPEC "\
1266
-%{!shared:crtend.o%s} %{shared:crtendS.o%s}"
1267
-#endif
1268
-
1269
-#ifndef LINK_START_OPENBSD_SPEC
1270
-#define LINK_START_OPENBSD_SPEC "-Ttext 0x400074"
1271
-#endif
1272
-
1273
-#ifndef LINK_OS_OPENBSD_SPEC
1274
-#define LINK_OS_OPENBSD_SPEC ""
1275
-#endif
1276
-
1277
-#ifndef CPP_OS_OPENBSD_SPEC
1278
-#define CPP_OS_OPENBSD_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
1279
-#endif
1280
-
1281
-/* Define any extra SPECS that the compiler needs to generate.  */
1282
-/* Override rs6000.h definition.  */
1283
-#undef SUBTARGET_EXTRA_SPECS
1284
-#define        SUBTARGET_EXTRA_SPECS                                           \
1285
-  { "crtsavres_default",       CRTSAVRES_DEFAULT_SPEC },               \
1286
-  { "lib_ads",                 LIB_ADS_SPEC },                         \
1287
-  { "lib_yellowknife",         LIB_YELLOWKNIFE_SPEC },                 \
1288
-  { "lib_mvme",                        LIB_MVME_SPEC },                        \
1289
-  { "lib_sim",                 LIB_SIM_SPEC },                         \
1290
-  { "lib_freebsd",             LIB_FREEBSD_SPEC },                     \
1291
-  { "lib_linux",               LIB_LINUX_SPEC },                       \
1292
-  { "lib_netbsd",              LIB_NETBSD_SPEC },                      \
1293
-  { "lib_openbsd",             LIB_OPENBSD_SPEC },                     \
1294
-  { "lib_default",             LIB_DEFAULT_SPEC },                     \
1295
-  { "startfile_ads",           STARTFILE_ADS_SPEC },                   \
1296
-  { "startfile_yellowknife",   STARTFILE_YELLOWKNIFE_SPEC },           \
1297
-  { "startfile_mvme",          STARTFILE_MVME_SPEC },                  \
1298
-  { "startfile_sim",           STARTFILE_SIM_SPEC },                   \
1299
-  { "startfile_freebsd",       STARTFILE_FREEBSD_SPEC },               \
1300
-  { "startfile_linux",         STARTFILE_LINUX_SPEC },                 \
1301
-  { "startfile_netbsd",                STARTFILE_NETBSD_SPEC },                \
1302
-  { "startfile_openbsd",       STARTFILE_OPENBSD_SPEC },               \
1303
-  { "startfile_default",       STARTFILE_DEFAULT_SPEC },               \
1304
-  { "endfile_ads",             ENDFILE_ADS_SPEC },                     \
1305
-  { "endfile_yellowknife",     ENDFILE_YELLOWKNIFE_SPEC },             \
1306
-  { "endfile_mvme",            ENDFILE_MVME_SPEC },                    \
1307
-  { "endfile_sim",             ENDFILE_SIM_SPEC },                     \
1308
-  { "endfile_freebsd",         ENDFILE_FREEBSD_SPEC },                 \
1309
-  { "endfile_linux",           ENDFILE_LINUX_SPEC },                   \
1310
-  { "endfile_netbsd",          ENDFILE_NETBSD_SPEC },                  \
1311
-  { "endfile_openbsd",         ENDFILE_OPENBSD_SPEC },                 \
1312
-  { "endfile_default",         ENDFILE_DEFAULT_SPEC },                 \
1313
-  { "link_shlib",              LINK_SHLIB_SPEC },                      \
1314
-  { "link_start",              LINK_START_SPEC },                      \
1315
-  { "link_start_ads",          LINK_START_ADS_SPEC },                  \
1316
-  { "link_start_yellowknife",  LINK_START_YELLOWKNIFE_SPEC },          \
1317
-  { "link_start_mvme",         LINK_START_MVME_SPEC },                 \
1318
-  { "link_start_sim",          LINK_START_SIM_SPEC },                  \
1319
-  { "link_start_freebsd",      LINK_START_FREEBSD_SPEC },              \
1320
-  { "link_start_linux",                LINK_START_LINUX_SPEC },                \
1321
-  { "link_start_netbsd",       LINK_START_NETBSD_SPEC },               \
1322
-  { "link_start_openbsd",      LINK_START_OPENBSD_SPEC },              \
1323
-  { "link_start_default",      LINK_START_DEFAULT_SPEC },              \
1324
-  { "link_os",                 LINK_OS_SPEC },                         \
1325
-  { "link_os_ads",             LINK_OS_ADS_SPEC },                     \
1326
-  { "link_os_yellowknife",     LINK_OS_YELLOWKNIFE_SPEC },             \
1327
-  { "link_os_mvme",            LINK_OS_MVME_SPEC },                    \
1328
-  { "link_os_sim",             LINK_OS_SIM_SPEC },                     \
1329
-  { "link_os_freebsd",         LINK_OS_FREEBSD_SPEC },                 \
1330
-  { "link_os_linux",           LINK_OS_LINUX_SPEC },                   \
1331
-  { "link_os_netbsd",          LINK_OS_NETBSD_SPEC },                  \
1332
-  { "link_os_openbsd",         LINK_OS_OPENBSD_SPEC },                 \
1333
-  { "link_os_default",         LINK_OS_DEFAULT_SPEC },                 \
1334
-  { "cc1_secure_plt_default",  CC1_SECURE_PLT_DEFAULT_SPEC },          \
1335
-  { "cpp_os_ads",              CPP_OS_ADS_SPEC },                      \
1336
-  { "cpp_os_yellowknife",      CPP_OS_YELLOWKNIFE_SPEC },              \
1337
-  { "cpp_os_mvme",             CPP_OS_MVME_SPEC },                     \
1338
-  { "cpp_os_sim",              CPP_OS_SIM_SPEC },                      \
1339
-  { "cpp_os_freebsd",          CPP_OS_FREEBSD_SPEC },                  \
1340
-  { "cpp_os_linux",            CPP_OS_LINUX_SPEC },                    \
1341
-  { "cpp_os_netbsd",           CPP_OS_NETBSD_SPEC },                   \
1342
-  { "cpp_os_openbsd",          CPP_OS_OPENBSD_SPEC },                  \
1343
-  { "cpp_os_default",          CPP_OS_DEFAULT_SPEC },                  \
1344
-  { "fbsd_dynamic_linker",     FBSD_DYNAMIC_LINKER },                  \
1345
-  SUBSUBTARGET_EXTRA_SPECS
1346
-
1347
-#define        SUBSUBTARGET_EXTRA_SPECS
1348
-
1349
-/* Define this macro as a C expression for the initializer of an
1350
-   array of string to tell the driver program which options are
1351
-   defaults for this target and thus do not need to be handled
1352
-   specially when using `MULTILIB_OPTIONS'.
1353
-
1354
-   Do not define this macro if `MULTILIB_OPTIONS' is not defined in
1355
-   the target makefile fragment or if none of the options listed in
1356
-   `MULTILIB_OPTIONS' are set by default.  *Note Target Fragment::.  */
1357
-
1358
-#define        MULTILIB_DEFAULTS { "mbig", "mcall-sysv" }
1359
-
1360
-/* Define this macro if the code for function profiling should come
1361
-   before the function prologue.  Normally, the profiling code comes
1362
-   after.  */
1363
-#define PROFILE_BEFORE_PROLOGUE 1
1364
-
1365
-/* Function name to call to do profiling.  */
1366
-#define RS6000_MCOUNT "_mcount"
1367
-
1368
-/* Select a format to encode pointers in exception handling data.  CODE
1369
-   is 0 for data, 1 for code labels, 2 for function pointers.  GLOBAL is
1370
-   true if the symbol may be affected by dynamic relocations.  */
1371
-#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)                           \
1372
-  ((flag_pic || TARGET_RELOCATABLE)                                         \
1373
-   ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
1374
-   : DW_EH_PE_absptr)
1375
-
1376
-#define DOUBLE_INT_ASM_OP "\t.quad\t"
1377
-
1378
-/* Generate entries in .fixup for relocatable addresses.  */
1379
-#define RELOCATABLE_NEEDS_FIXUP 1
1380
-
1381
-#define TARGET_ASM_FILE_END rs6000_elf_file_end
1382
-
1383
-#undef TARGET_ASAN_SHADOW_OFFSET
1384
-#define TARGET_ASAN_SHADOW_OFFSET rs6000_asan_shadow_offset
1385
-
1386
-/* This target uses the sysv4.opt file.  */
1387
-#define TARGET_USES_SYSV4_OPT 1
1388
-
1389
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/s390/linux.h gcc-5.3.0-zip/gcc/config/s390/linux.h
1390
--- gcc-5.3.0-original/gcc/config/s390/linux.h  2016-02-05 15:18:17.493469779 -0500
1391
+++ gcc-5.3.0-zip/gcc/config/s390/linux.h       2015-05-11 03:14:10.000000000 -0400
1392
@@ -60,8 +60,8 @@
1393
 #define MULTILIB_DEFAULTS { "m31" }
1394
 #endif
1395
 
1396
-#define GLIBC_DYNAMIC_LINKER32 "/tools/lib/ld.so.1"
1397
-#define GLIBC_DYNAMIC_LINKER64 "/tools/lib/ld64.so.1"
1398
+#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
1399
+#define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1"
1400
 
1401
 #undef  LINK_SPEC
1402
 #define LINK_SPEC \
1403
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/sh/linux.h gcc-5.3.0-zip/gcc/config/sh/linux.h
1404
--- gcc-5.3.0-original/gcc/config/sh/linux.h    2016-02-05 15:18:17.493469779 -0500
1405
+++ gcc-5.3.0-zip/gcc/config/sh/linux.h 2015-01-05 07:33:28.000000000 -0500
1406
@@ -43,7 +43,7 @@
1407
 
1408
 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
1409
 
1410
-#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld-linux.so.2"
1411
+#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
1412
 
1413
 #undef SUBTARGET_LINK_EMUL_SUFFIX
1414
 #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
1415
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/sparc/linux64.h gcc-5.3.0-zip/gcc/config/sparc/linux64.h
1416
--- gcc-5.3.0-original/gcc/config/sparc/linux64.h       2016-02-05 15:18:17.493469779 -0500
1417
+++ gcc-5.3.0-zip/gcc/config/sparc/linux64.h    2015-01-05 07:33:28.000000000 -0500
1418
@@ -84,8 +84,8 @@
1419
    When the -shared link option is used a final link is not being
1420
    done.  */
1421
 
1422
-#define GLIBC_DYNAMIC_LINKER32 "/tools/lib/ld-linux.so.2"
1423
-#define GLIBC_DYNAMIC_LINKER64 "/tools/lib64/ld-linux.so.2"
1424
+#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
1425
+#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2"
1426
 
1427
 #ifdef SPARC_BI_ARCH
1428
 
1429
@@ -193,7 +193,7 @@
1430
 #else /* !SPARC_BI_ARCH */
1431
 
1432
 #undef LINK_SPEC
1433
-#define LINK_SPEC "-m elf64_sparc -Y P,%R/tools/lib64 %{shared:-shared} \
1434
+#define LINK_SPEC "-m elf64_sparc -Y P,%R/usr/lib64 %{shared:-shared} \
1435
   %{!shared: \
1436
     %{!static: \
1437
       %{rdynamic:-export-dynamic} \
1438
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/sparc/linux.h gcc-5.3.0-zip/gcc/config/sparc/linux.h
1439
--- gcc-5.3.0-original/gcc/config/sparc/linux.h 2016-02-05 15:18:17.493469779 -0500
1440
+++ gcc-5.3.0-zip/gcc/config/sparc/linux.h      2015-01-05 07:33:28.000000000 -0500
1441
@@ -83,7 +83,7 @@
1442
    When the -shared link option is used a final link is not being
1443
    done.  */
1444
 
1445
-#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld-linux.so.2"
1446
+#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
1447
 
1448
 #undef  LINK_SPEC
1449
 #define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
1450
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/vax/linux.h gcc-5.3.0-zip/gcc/config/vax/linux.h
1451
--- gcc-5.3.0-original/gcc/config/vax/linux.h   2016-02-05 15:18:17.493469779 -0500
1452
+++ gcc-5.3.0-zip/gcc/config/vax/linux.h        2015-01-05 07:33:28.000000000 -0500
1453
@@ -41,7 +41,7 @@
1454
   %{!shared: \
1455
     %{!static: \
1456
       %{rdynamic:-export-dynamic} \
1457
-      -dynamic-linker /tools/lib/ld.so.1} \
1458
+      -dynamic-linker /lib/ld.so.1} \
1459
     %{static:-static}}"
1460
 
1461
 #undef  WCHAR_TYPE
1462
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/xtensa/linux.h gcc-5.3.0-zip/gcc/config/xtensa/linux.h
1463
--- gcc-5.3.0-original/gcc/config/xtensa/linux.h        2016-02-05 15:18:17.493469779 -0500
1464
+++ gcc-5.3.0-zip/gcc/config/xtensa/linux.h     2015-01-05 07:33:28.000000000 -0500
1465
@@ -44,7 +44,7 @@
1466
   %{mlongcalls:--longcalls} \
1467
   %{mno-longcalls:--no-longcalls}"
1468
 
1469
-#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld.so.1"
1470
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
1471
 
1472
 #undef LINK_SPEC
1473
 #define LINK_SPEC \
1474
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/zip/netbsd.h gcc-5.3.0-zip/gcc/config/zip/netbsd.h
1475
--- gcc-5.3.0-original/gcc/config/zip/netbsd.h  1969-12-31 19:00:00.000000000 -0500
1476
+++ gcc-5.3.0-zip/gcc/config/zip/netbsd.h       2016-01-30 15:04:14.796899050 -0500
1477
@@ -0,0 +1,82 @@
1478
+////////////////////////////////////////////////////////////////////////////////
1479
+//
1480
+// Filename:   netbsd.h
1481
+//
1482
+// Project:    Zip CPU backend for the GNU Compiler Collection
1483
+//
1484
+// Purpose:
1485
+//
1486
+// Creator:    Dan Gisselquist, Ph.D.
1487
+//             Gisselquist Technology, LLC
1488
+//
1489
+////////////////////////////////////////////////////////////////////////////////
1490
+//
1491
+// Copyright (C) 2016, Gisselquist Technology, LLC
1492
+//
1493
+// This program is free software (firmware): you can redistribute it and/or
1494
+// modify it under the terms of  the GNU General Public License as published
1495
+// by the Free Software Foundation, either version 3 of the License, or (at
1496
+// your option) any later version.
1497
+//
1498
+// This program is distributed in the hope that it will be useful, but WITHOUT
1499
+// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
1500
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1501
+// for more details.
1502
+//
1503
+// You should have received a copy of the GNU General Public License along
1504
+// with this program.  (It's in the $(ROOT)/doc directory, run make with no
1505
+// target there if the PDF file isn't present.)  If not, see
1506
+// <http://www.gnu.org/licenses/> for a copy.
1507
+//
1508
+// License:    GPL, v3, as defined and found on www.gnu.org,
1509
+//             http://www.gnu.org/licenses/gpl.html
1510
+//
1511
+//
1512
+////////////////////////////////////////////////////////////////////////////////
1513
+#ifndef        ZIP_NETBSD_H
1514
+#define        ZIP_NETBSD_H
1515
+
1516
+/* Define default target values. */
1517
+
1518
+#undef MACHINE_TYPE
1519
+#define        MACHINE_TYPE    "NetBSD/Zip ELF"
1520
+
1521
+#undef TARGET_OS_CPP_BUILTINS
1522
+#define        TARGET_OS_CPP_BUILTINS()        \
1523
+       do { NETBSD_OS_CPP_BUILTINS_ELF();              \
1524
+       builtin_define("__ZIPCPU__");                   \
1525
+       builtin_assert("cpu=zip");                      \
1526
+       builtin_assert("machine=zip");                  \
1527
+       } while(0);
1528
+
1529
+#undef CPP_SPEC
1530
+#define        CPP_SPEC        NETBSD_CPP_SPEC
1531
+
1532
+#undef STARTFILE_SPEC
1533
+#define        STARTFILE_SPEC  NETBSD_STARTFILE_SPEC
1534
+
1535
+#undef ENDFILE_SPEC
1536
+#define        ENDFILE_SPEC    NETBSD_ENDFILE_SPEC
1537
+
1538
+#undef LIB_SPEC
1539
+#define        LIB_SPEC        NETBSD_LIB_SPEC
1540
+
1541
+#undef TARGET_VERSION
1542
+#define        TARGET_VERSION  fprintf(stderr, " (%s)", MACHINE_TYPE);
1543
+
1544
+/* Make gcc agree with <machine/ansi.h> */
1545
+
1546
+#undef WCHAR_TYPE
1547
+#define        WCHAR_TYPE      "int"
1548
+
1549
+#undef WCHAR_TYPE_SIZE
1550
+#define        WCHAR_TYPE_SIZE 32
1551
+
1552
+#undef WINT_TYPE
1553
+#define        WINT_TYPE       "int"
1554
+
1555
+/* Clean up after the generic Zip/ELF configuration. */
1556
+#undef MD_EXEC_PREFIX
1557
+#undef MD_STARTFILE_PREFIX
1558
+
1559
+#endif /* ZIP_NETBSD_H */
1560
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/zip/t-zip gcc-5.3.0-zip/gcc/config/zip/t-zip
1561
--- gcc-5.3.0-original/gcc/config/zip/t-zip     1969-12-31 19:00:00.000000000 -0500
1562
+++ gcc-5.3.0-zip/gcc/config/zip/t-zip  2016-02-04 19:00:59.939652587 -0500
1563
@@ -0,0 +1,47 @@
1564
+################################################################################
1565
+##
1566
+## Filename:   t-zip
1567
+##
1568
+## Project:    Zip CPU backend for the GNU Compiler Collection
1569
+##
1570
+## Purpose:
1571
+##
1572
+## Creator:    Dan Gisselquist, Ph.D.
1573
+##             Gisselquist Technology, LLC
1574
+##
1575
+################################################################################
1576
+##
1577
+## Copyright (C) 2016, Gisselquist Technology, LLC
1578
+##
1579
+## This program is free software (firmware): you can redistribute it and/or
1580
+## modify it under the terms of  the GNU General Public License as published
1581
+## by the Free Software Foundation, either version 3 of the License, or (at
1582
+## your option) any later version.
1583
+##
1584
+## This program is distributed in the hope that it will be useful, but WITHOUT
1585
+## ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
1586
+## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1587
+## for more details.
1588
+##
1589
+## You should have received a copy of the GNU General Public License along
1590
+## with this program.  (It's in the $(ROOT)/doc directory, run make with no
1591
+## target there if the PDF file isn't present.)  If not, see
1592
+## <http://www.gnu.org/licenses/> for a copy.
1593
+##
1594
+## License:    GPL, v3, as defined and found on www.gnu.org,
1595
+##             http://www.gnu.org/licenses/gpl.html
1596
+##
1597
+##
1598
+################################################################################
1599
+
1600
+FPBIT = fp-bit.c
1601
+DPBIT = dp-bit.c
1602
+
1603
+# dp-bit.c: $(srcdir)/config/fp-bit.c
1604
+       # cat $(srcdir)/config/fp-bit.c > dp-bit.c
1605
+#
1606
+# fp-bit.c: $(srcdir)/config/fp-bit.c
1607
+       # echo '#define FLOAT" > fp-bit.c
1608
+       # cat $(srcdir)/config/fp-bit.c >> fp-bit.c
1609
+
1610
+
1611
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/zip/zip.c gcc-5.3.0-zip/gcc/config/zip/zip.c
1612
--- gcc-5.3.0-original/gcc/config/zip/zip.c     1969-12-31 19:00:00.000000000 -0500
1613
+++ gcc-5.3.0-zip/gcc/config/zip/zip.c  2016-03-05 20:33:58.899277709 -0500
1614
@@ -0,0 +1,2160 @@
1615
+////////////////////////////////////////////////////////////////////////////////
1616
+//
1617
+// Filename:   zip.c
1618
+//
1619
+// Project:    Zip CPU backend for the GNU Compiler Collection
1620
+//
1621
+// Purpose:
1622
+//
1623
+// Creator:    Dan Gisselquist, Ph.D.
1624
+//             Gisselquist Technology, LLC
1625
+//
1626
+////////////////////////////////////////////////////////////////////////////////
1627
+//
1628
+// Copyright (C) 2016, Gisselquist Technology, LLC
1629
+//
1630
+// This program is free software (firmware): you can redistribute it and/or
1631
+// modify it under the terms of  the GNU General Public License as published
1632
+// by the Free Software Foundation, either version 3 of the License, or (at
1633
+// your option) any later version.
1634
+//
1635
+// This program is distributed in the hope that it will be useful, but WITHOUT
1636
+// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
1637
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1638
+// for more details.
1639
+//
1640
+// You should have received a copy of the GNU General Public License along
1641
+// with this program.  (It's in the $(ROOT)/doc directory, run make with no
1642
+// target there if the PDF file isn't present.)  If not, see
1643
+// <http://www.gnu.org/licenses/> for a copy.
1644
+//
1645
+// License:    GPL, v3, as defined and found on www.gnu.org,
1646
+//             http://www.gnu.org/licenses/gpl.html
1647
+//
1648
+//
1649
+////////////////////////////////////////////////////////////////////////////////
1650
+#include "config.h"
1651
+#include "system.h"
1652
+#include "coretypes.h"
1653
+#include "tm.h"
1654
+#include "rtl.h"
1655
+#include "dominance.h"
1656
+#include "cfg.h"
1657
+#include "cfgrtl.h"
1658
+#include "cfganal.h"
1659
+#include "lcm.h"
1660
+#include "cfgbuild.h"
1661
+#include "cfgcleanup.h"
1662
+#include "predict.h"
1663
+#include "basic-block.h"
1664
+#include "df.h"
1665
+#include "hashtab.h"
1666
+#include "hash-set.h"
1667
+#include "machmode.h"
1668
+#include "symtab.h"
1669
+#include "rtlhash.h"
1670
+#include "tree.h"
1671
+#include "regs.h"
1672
+#include "hard-reg-set.h"
1673
+#include "real.h"
1674
+#include "insn-config.h"
1675
+#include "conditions.h"
1676
+#include "output.h"
1677
+#include "insn-attr.h"
1678
+#include "flags.h"
1679
+#include "expr.h"
1680
+#include "function.h"
1681
+#include "recog.h"
1682
+#include "toplev.h"
1683
+#include "ggc.h"
1684
+#include "builtins.h"
1685
+#include "calls.h"
1686
+#include "langhooks.h"
1687
+#include "optabs.h"
1688
+#include "explow.h"
1689
+#include "emit-rtl.h"
1690
+
1691
+// #include "tmp_p.h"
1692
+#include "target.h"
1693
+#include "target-def.h"
1694
+// #include "tm-constrs.h"
1695
+// #include "tm-preds.h"
1696
+
1697
+#include "diagnostic.h"
1698
+// #include "integrate.h"
1699
+
1700
+// static int  zip_arg_partial_bytes(CUMULATIVE_ARGS *, enum machine_mode, tree, bool);
1701
+// static      bool    zip_pass_by_reference(CUMULATIVE_ARGS *, enum machine_mode, const_tree, bool);
1702
+static bool    zip_return_in_memory(const_tree, const_tree);
1703
+static bool    zip_frame_pointer_required(void);
1704
+// static      bool    zip_must_pass_in_stack(enum machine_mode, const_tree);
1705
+
1706
+// static      void    zip_setup_incoming_varargs(CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int);
1707
+static void zip_function_arg_advance(cumulative_args_t ca, enum machine_mode mode,
1708
+               const_tree type, bool named);
1709
+static rtx zip_function_arg(cumulative_args_t ca, enum machine_mode mode, const_tree type, bool named);
1710
+
1711
+static void    zip_asm_trampoline_template(FILE *);
1712
+static void    zip_trampoline_init(rtx, tree, rtx);
1713
+static void    zip_init_builtins(void);
1714
+static tree zip_builtin_decl(unsigned, bool);
1715
+// static void zip_asm_output_anchor(rtx x);
1716
+       void    zip_asm_output_def(FILE *s, const char *n, const char *v);
1717
+       void    zip_update_cc_notice(rtx exp, rtx_insn *insn);
1718
+static rtx     zip_expand_builtin(tree exp, rtx target, rtx subtarget,
1719
+                       enum machine_mode tmode, int    ignore);
1720
+static bool    zip_scalar_mode_supported_p(enum machine_mode mode);
1721
+static bool    zip_libgcc_floating_mode_supported_p(enum machine_mode mode);
1722
+static int     zip_address_cost(rtx addr, enum machine_mode mode, addr_space_t as, bool spd);
1723
+static bool    zip_mode_dependent_address_p(const_rtx addr, addr_space_t);
1724
+static unsigned HOST_WIDE_INT  zip_const_anchor = 0x20000;
1725
+static          HOST_WIDE_INT  zip_min_anchor_offset = -0x20000;
1726
+static          HOST_WIDE_INT  zip_max_anchor_offset =  0x1ffff;
1727
+static          HOST_WIDE_INT  zip_min_mov_offset = -0x1000;
1728
+static          HOST_WIDE_INT  zip_max_mov_offset =  0x0fff;
1729
+static int     zip_sched_issue_rate(void) { return 1; }
1730
+static bool    zip_legitimate_address_p(machine_mode, rtx, bool);
1731
+static bool    zip_legitimate_move_operand_p(machine_mode, rtx, bool);
1732
+       void    zip_debug_rtx_pfx(const char *, const_rtx x);
1733
+       void    zip_debug_rtx(const_rtx x);
1734
+static void    zip_override_options(void);
1735
+static bool    zip_can_eliminate(int from ATTRIBUTE_UNUSED, int to);
1736
+// static      void    zip_canonicalize_comparison(int *, rtx *, rtx *, bool);
1737
+static int     zip_memory_move_cost(machine_mode, reg_class_t, bool);
1738
+
1739
+
1740
+#define        ALL_DEBUG_OFF   true
1741
+#define        ALL_DEBUG_ON    false
1742
+
1743
+enum ZIP_BUILTIN_ID_CODE {
1744
+       ZIP_BUILTIN_RTU,
1745
+       ZIP_BUILTIN_HALT,
1746
+       ZIP_BUILTIN_IDLE,
1747
+       ZIP_BUILTIN_SYSCALL,
1748
+       ZIP_BUILTIN_SAVE_CONTEXT,
1749
+       ZIP_BUILTIN_RESTORE_CONTEXT,
1750
+       ZIP_BUILTIN_BITREV,
1751
+       ZIP_BUILTIN_CC,
1752
+       ZIP_BUILTIN_MAX
1753
+};
1754
+
1755
+static GTY (()) tree   zip_builtins[(int)ZIP_BUILTIN_MAX];
1756
+static enum insn_code  zip_builtins_icode[(int)ZIP_BUILTIN_MAX];
1757
+
1758
+
1759
+#include "gt-zip.h"
1760
+
1761
+/* The Global 'targetm' Variable. */
1762
+struct gcc_target      targetm = TARGET_INITIALIZER;
1763
+
1764
+
1765
+enum   reg_class zip_reg_class(int);
1766
+
1767
+#define        LOSE_AND_RETURN(msgid, x)               \
1768
+       do {                                    \
1769
+               zip_operand_lossage(msgid, x);  \
1770
+               return;                         \
1771
+       } while(0)
1772
+
1773
+/* Per-function machine data. */
1774
+struct GTY(()) machine_function
1775
+{
1776
+       /* number of pretented arguments for varargs */
1777
+       int     pretend_size;
1778
+
1779
+       /* Number of bytes saved on the stack for local variables. */
1780
+       int     local_vars_size;
1781
+
1782
+       /* Number of bytes saved on stack for register save area */
1783
+       int     saved_reg_size;
1784
+       int     save_ret;
1785
+
1786
+       int     sp_fp_offset;
1787
+       bool    fp_needed;
1788
+       int     size_for_adjusting_sp;
1789
+};
1790
+
1791
+/* Allocate a chunk of memory for per-function machine-dependent data. */
1792
+
1793
+static struct machine_function *
1794
+zip_init_machine_status(void) {
1795
+       return ggc_cleared_alloc<machine_function>();
1796
+}
1797
+
1798
+static void
1799
+zip_override_options(void)
1800
+{
1801
+       init_machine_status = zip_init_machine_status;
1802
+}
1803
+
1804
+enum   reg_class
1805
+zip_reg_class(int regno)
1806
+{
1807
+       if (is_ZIP_GENERAL_REG(regno)) {
1808
+               return GENERAL_REGS;
1809
+       } else if (is_ZIP_REG(regno)) {
1810
+               return ALL_REGS;
1811
+       } return NO_REGS;
1812
+}
1813
+
1814
+/* Worker function for TARGET_RETURN_IN_MEMORY. */
1815
+static bool
1816
+zip_return_in_memory(const_tree type, const_tree fntype ATTRIBUTE_UNUSED) {
1817
+       const   HOST_WIDE_INT size = int_size_in_bytes(type);
1818
+       return (size == -1)||(size > UNITS_PER_WORD);
1819
+}
1820
+
1821
+/* Emit an error emssage when we're in an asm, and a fatal error for "normal"
1822
+ * insn.  Formatted output isn't easily implemented, since we use output operand
1823
+ * lossage to output the actual message and handle the categorization of the
1824
+ * error.  */
1825
+
1826
+static void
1827
+zip_operand_lossage(const char *msgid, rtx op) {
1828
+       fprintf(stderr, "Operand lossage??\n");
1829
+       debug_rtx(op);
1830
+       zip_debug_rtx(op);
1831
+       output_operand_lossage("%s", msgid);
1832
+}
1833
+
1834
+/* The PRINT_OPERAND_ADDRESS worker.   */
1835
+void
1836
+zip_print_operand_address(FILE *file, rtx x) {
1837
+       const bool      dbg = ((ALL_DEBUG_ON)||(false))&&(!ALL_DEBUG_OFF);
1838
+
1839
+       if (dbg) zip_debug_rtx(x);
1840
+       switch(GET_CODE(x)) {
1841
+               case REG:
1842
+                       fprintf(file, "(%s)", reg_names[REGNO(x)]);
1843
+                       break;
1844
+               case SYMBOL_REF:
1845
+                       fprintf(file, "%s", XSTR(x,0));
1846
+                       break;
1847
+               case LABEL_REF:
1848
+                       x = LABEL_REF_LABEL(x);
1849
+               case CODE_LABEL:
1850
+                       { char buf[256];
1851
+                       ASM_GENERATE_INTERNAL_LABEL(buf, "L", CODE_LABEL_NUMBER(x));
1852
+#ifdef ASM_OUTPUT_LABEL_REF
1853
+                       ASM_OUTPUT_LABEL_REF(file, buf);
1854
+#else
1855
+                       assemble_name(file, buf);
1856
+#endif
1857
+                       }
1858
+                       break;
1859
+               case PLUS:
1860
+                       if (!REG_P(XEXP(x, 0)))
1861
+                               abort();
1862
+                       if (CONST_INT_P(XEXP(x, 1))) {
1863
+                               if (INTVAL(XEXP(x,1))!=0) {
1864
+                                       fprintf(file, "%ld(%s)",
1865
+                                       INTVAL(XEXP(x, 1)),
1866
+                                       reg_names[REGNO(XEXP(x, 0))]);
1867
+                               } else {
1868
+                                       fprintf(file, "(%s)",
1869
+                                       reg_names[REGNO(XEXP(x, 0))]);
1870
+                               }
1871
+                       } else if (GET_CODE(XEXP(x,1)) == SYMBOL_REF) {
1872
+                               fprintf(file, "%s(%s)", XSTR(x,0),
1873
+                                       reg_names[REGNO(XEXP(x, 0))]);
1874
+                       } else if ((GET_CODE(XEXP(x, 1)) == MINUS)
1875
+                               && (GET_CODE(XEXP(XEXP(x, 1), 0))==SYMBOL_REF)
1876
+                               && (GET_CODE(XEXP(XEXP(x, 1), 1))==SYMBOL_REF)) {
1877
+                               fprintf(file, "%s-%s(%s)",
1878
+                                       XSTR(XEXP(XEXP(x, 1),0),0),
1879
+                                       XSTR(XEXP(XEXP(x, 1),1),0),
1880
+                                       reg_names[REGNO(XEXP(x, 0))]);
1881
+                       } else
1882
+                               fprintf(file, "#INVALID(%s)",
1883
+                                       reg_names[REGNO(XEXP(x, 0))]);
1884
+                       /*
1885
+                       else if (GET_CODE(XEXP(addr, 1)) == LABEL)
1886
+                               fprintf(file, "%s(%s)",
1887
+                                       GET_CODE(XEXP(addr, 1)),
1888
+                                       reg_names[REGNO(GET_CODE(XEXP(addr, 0)))]);
1889
+                       else if ((GET_CODE(XEXP(addr, 1)) == MINUS)
1890
+                               && (GET_CODE(XEXP(GET_CODE(XEXP(addr, 1)), 0))==LABEL)
1891
+                               && (GET_CODE(XEXP(GET_CODE(XEXP(addr, 1)), 1))==LABEL)) {
1892
+                               fprintf(file, "%s-%s(%s)",
1893
+                                       reg_names[REGNO(GET_CODE(XEXP(addr, 0)))]);
1894
+                                       reg_names[REGNO(GET_CODE(XEXP(addr, 0)))]);
1895
+                                       reg_names[REGNO(GET_CODE(XEXP(addr, 0)))]);
1896
+                       }
1897
+                       */
1898
+                       break;
1899
+               // We don't support direct memory addressing within our
1900
+               // instruction set, even though the instructions themselves
1901
+               // would support direct memory addressing of the lower 18 bits
1902
+               // of memory space.
1903
+               case MEM:
1904
+                       if (dbg) zip_debug_rtx(x);
1905
+                       zip_print_operand_address(file, XEXP(x, 0));
1906
+                       break;
1907
+               default:
1908
+                       abort(); break;
1909
+                       // output_addr_const(file, x);
1910
+               break;
1911
+       }
1912
+}
1913
+
1914
+/* The PRINT_OPERAND worker. */
1915
+
1916
+void
1917
+zip_print_operand(FILE *file, rtx x, int code)
1918
+{
1919
+       rtx operand = x;
1920
+       int     rgoff = 0;
1921
+
1922
+       // fprintf(file, "Print Operand!\n");
1923
+
1924
+       /* New code entries should just be added to the switch below.  If
1925
+        * handling is finished, just return.  If handling was just a
1926
+        * modification of the operand, the modified operand should be put in
1927
+        * "operand", and then do a break to let default handling
1928
+        * (zero-modifier) output the operand.
1929
+        */
1930
+       switch(code) {
1931
+               case 0:
1932
+                       /* No code, print as usual. */
1933
+                       break;
1934
+               case 'L':
1935
+                       /* Lower of two registers, print one up */
1936
+                       rgoff = 1;
1937
+                       break;
1938
+               case 'R':
1939
+               case 'H':
1940
+                       /* Higher of a register pair, print normal */
1941
+                       break;
1942
+
1943
+               default:
1944
+                       LOSE_AND_RETURN("invalid operand modifier letter", x);
1945
+       }
1946
+
1947
+       /* Print an operand as without a modifier letter. */
1948
+       switch (GET_CODE(operand)) {
1949
+       case REG:
1950
+               if (REGNO(operand)+rgoff >= FIRST_PSEUDO_REGISTER)
1951
+                       internal_error("internal error: bad register: %d", REGNO(operand));
1952
+               fprintf(file, "%s", reg_names[REGNO(operand)+rgoff]);
1953
+               return;
1954
+       case SCRATCH:
1955
+               LOSE_AND_RETURN("Need a scratch register", x);
1956
+               return;
1957
+
1958
+       case CODE_LABEL:
1959
+       case LABEL_REF:
1960
+       case SYMBOL_REF:
1961
+       case PLUS:
1962
+               PRINT_OPERAND_ADDRESS(file, operand);
1963
+               return;
1964
+       case MEM:
1965
+               PRINT_OPERAND_ADDRESS(file, XEXP(operand, 0));
1966
+               return;
1967
+
1968
+       default:
1969
+               /* No need to handle all strange variants, let
1970
+                * output_addr_const do it for us.
1971
+                */
1972
+               if (CONSTANT_P(operand)) {
1973
+                       output_addr_const(file, operand);
1974
+                       return;
1975
+               }
1976
+
1977
+               LOSE_AND_RETURN("unexpected operand", x);
1978
+       }
1979
+}
1980
+
1981
+static bool
1982
+zip_frame_pointer_required(void)
1983
+{
1984
+       // This should really depend upon whether we have variable sized
1985
+       // arguments in our frame or not.  Once this fails, let's look
1986
+       // at what the problem was and then whether or not we can detect
1987
+       // it.
1988
+       //
1989
+       // Use a GCC global to determine our answer
1990
+       return (frame_pointer_needed);
1991
+//     return (cfun->calls_alloca);
1992
+/*
1993
+       fprintf(stderr, "ZIP_FRAME_POINTER_REQUIRED()\n");
1994
+       if (frame_pointer_needed) {
1995
+               fprintf(stderr, "FRAME_POINTER_NEEDED is true\n");
1996
+               zip_debug_rtx(frame_pointer_rtx);
1997
+               if (frame_pointer_rtx == NULL_RTX)
1998
+                       return true;
1999
+               if (GET_CODE(frame_pointer_rtx)==PLUS) {
2000
+                       if ((REG_P(XEXP(frame_pointer_rtx,0)))
2001
+                               &&(REGNO(XEXP(frame_pointer_rtx, 0))==zip_SP)
2002
+                               &&(CONST_INT_P(XEXP(frame_pointer_rtx,1))))
2003
+                               return false;
2004
+                       if ((REG_P(XEXP(frame_pointer_rtx,1)))
2005
+                               &&(REGNO(XEXP(frame_pointer_rtx, 1))==zip_SP)
2006
+                               &&(CONST_INT_P(XEXP(frame_pointer_rtx,0))))
2007
+                               return false;
2008
+                       return true;
2009
+               } else if ((REG_P(frame_pointer_rtx))
2010
+                               &&(REGNO(frame_pointer_rtx) == zip_SP))
2011
+                       return false;
2012
+               return true;
2013
+       } else return false;
2014
+*/
2015
+}
2016
+
2017
+/* Determine whether or not a register needs to be saved on the stack or not.
2018
+ */
2019
+static bool
2020
+zip_save_reg(int regno) {
2021
+       if (regno == 0)
2022
+               return ((!crtl->is_leaf)
2023
+                       ||((df_regs_ever_live_p(0))&&(!call_used_regs[0])));
2024
+       else if ((regno == zip_GOT)&&(!ZIP_PIC))
2025
+               return  ((df_regs_ever_live_p(regno))
2026
+                               &&(!call_used_regs[regno]));
2027
+       else if (regno == zip_FP)
2028
+               return((zip_frame_pointer_required())||((df_regs_ever_live_p(regno))
2029
+                               &&(!call_used_regs[regno])));
2030
+       else if (regno < zip_FP)
2031
+               return  ((df_regs_ever_live_p(regno))
2032
+                               &&(!call_used_regs[regno]));
2033
+       return false;
2034
+}
2035
+
2036
+/* Compute the size of the local area and the size to be adjusted by the
2037
+ * prologue and epilogue.
2038
+ *
2039
+ * Here's what we are looking at (top is the current, bottom is the last ...)
2040
+ *
2041
+ *     Stack Pointer ->
2042
+ *                     Local variables (could be variable size)
2043
+ *     Frame Pointer ->        (= Stack Pointer + sp_fp_offset)
2044
+ *                     Saved return address, if saved
2045
+ *                     Other Saved registers
2046
+ *                     Saved frame pointer (if used)
2047
+ *                     Saved R12, if used
2048
+ *                     (Stack pointer is not saved)
2049
+ *     Original stack pointer ->       (= Stack_Pointer +size_for_adjusting_sp)
2050
+ *                     Called arguments (not passed in registers)
2051
+ *                     Return arguments (not R1, args.pretend_args_size)
2052
+ *             (Prior function's stack frame ... )
2053
+ *
2054
+ */
2055
+static void
2056
+zip_compute_frame(void) {
2057
+       int     regno;
2058
+       int     args_size;
2059
+
2060
+       // gcc_assert(crtl);
2061
+       gcc_assert(cfun);
2062
+       gcc_assert(cfun->machine);
2063
+
2064
+       args_size=(ACCUMULATE_OUTGOING_ARGS ? crtl->outgoing_args_size : 0);
2065
+
2066
+       if(crtl->args.pretend_args_size > 0) {
2067
+               args_size += crtl->args.pretend_args_size;
2068
+               // printf("%s pretend_args_size : %d\n", current_function_name(),
2069
+                       // crtl->args.pretend_args_size);
2070
+               cfun->machine->pretend_size = crtl->args.pretend_args_size;
2071
+       }
2072
+
2073
+       cfun->machine->local_vars_size = get_frame_size();
2074
+
2075
+       // Save callee-saved registers.
2076
+       cfun->machine->saved_reg_size = 0;
2077
+       for(regno=0; regno < FIRST_PSEUDO_REGISTER; regno++) {
2078
+               if (zip_save_reg(regno))
2079
+                       cfun->machine->saved_reg_size ++;
2080
+       }
2081
+
2082
+       cfun->machine->fp_needed = (zip_frame_pointer_required());
2083
+
2084
+       if ((cfun->machine->fp_needed)&&
2085
+                       (!df_regs_ever_live_p(zip_FP))) {
2086
+               cfun->machine->saved_reg_size ++;
2087
+       }
2088
+
2089
+       cfun->machine->sp_fp_offset = args_size + cfun->machine->local_vars_size;
2090
+       cfun->machine->size_for_adjusting_sp = cfun->machine->local_vars_size
2091
+                       + cfun->machine->saved_reg_size
2092
+                       + args_size;
2093
+
2094
+       /*
2095
+       if (cfun->machine->fp_needed)
2096
+               frame_pointer_rtx = gen_rtx_REG(Pmode, zip_FP);
2097
+       else
2098
+               frame_pointer_rtx = plus_constant(Pmode, gen_rtx_REG(Pmode, zip_SP),
2099
+                       cfun->machine->sp_fp_offset);
2100
+       */
2101
+}
2102
+
2103
+void
2104
+zip_expand_prologue(void) {
2105
+       rtx     insn;
2106
+
2107
+       const bool      dbg = ((ALL_DEBUG_ON)||(false))&&(!ALL_DEBUG_OFF);
2108
+       zip_compute_frame();
2109
+
2110
+       if (cfun->machine->size_for_adjusting_sp != 0) {
2111
+               insn = emit_insn(gen_subsi3(stack_pointer_rtx,
2112
+                               stack_pointer_rtx,
2113
+                       gen_int_mode(cfun->machine->size_for_adjusting_sp,
2114
+                               SImode)));
2115
+                       // cfun->machine->sp_fp_offset
2116
+
2117
+               RTX_FRAME_RELATED_P(insn) = 1;
2118
+       }
2119
+
2120
+       {
2121
+               int offset = 0, regno;
2122
+               for(regno=0; regno < FIRST_PSEUDO_REGISTER; regno++) {
2123
+                       if (zip_save_reg(regno)) {
2124
+                               insn=emit_insn(gen_movsi_sto(
2125
+                                       gen_rtx_MEM(SImode, plus_constant(
2126
+                                               Pmode, stack_pointer_rtx,
2127
+                                               cfun->machine->sp_fp_offset
2128
+                                               +offset++, true)),
2129
+                                       gen_rtx_REG(SImode, regno)));
2130
+                               RTX_FRAME_RELATED_P(insn) = 1;
2131
+                       }
2132
+               }
2133
+       }
2134
+
2135
+       if (cfun->machine->fp_needed) {
2136
+               if (dbg) zip_debug_rtx(stack_pointer_rtx);
2137
+               if (dbg) zip_debug_rtx(frame_pointer_rtx);
2138
+               insn = emit_insn(gen_movsi_reg_off(frame_pointer_rtx,
2139
+                               stack_pointer_rtx, gen_int_mode(
2140
+                                               cfun->machine->sp_fp_offset,
2141
+                                               SImode)));
2142
+               RTX_FRAME_RELATED_P(insn) = 1;
2143
+       }
2144
+}
2145
+
2146
+bool
2147
+zip_use_return_insn(void)
2148
+{
2149
+       if ((!reload_completed)||(cfun->machine->fp_needed)
2150
+                       ||(get_frame_size()!=0)) {
2151
+               // If R0 ever gets pushed to the stack, then we cannot
2152
+               // use a master return from anywhere.  We need to clean up the
2153
+               // stack first.
2154
+               if ((!crtl->is_leaf)||((df_regs_ever_live_p(0))
2155
+                                               &&(!call_used_regs[0]))) {
2156
+                       return false;
2157
+               }
2158
+       }
2159
+       zip_compute_frame();
2160
+       return (cfun->machine->size_for_adjusting_sp == 0);
2161
+}
2162
+
2163
+/* As per the notes in M68k.c, quote the function epilogue should not depend
2164
+ * upon the current stack pointer.  It should use the frame poitner only,
2165
+ * if there is a frame pointer.  This is mandatory because of alloca; we also
2166
+ * take advantage of it to omit stack adjustments before returning ...
2167
+ *
2168
+ * Let's see if we can use their approach here.
2169
+ *
2170
+ * We can't.  Consider our choices:
2171
+ *     LOD (FP),R0
2172
+ *     LOD 1(FP),R4
2173
+ *     LOD 2(FP),R5
2174
+ *     LOD 3(FP),R6
2175
+ *     LOD 4(FP),FP
2176
+ *     ... Then what is the stack pointer?
2177
+ * or
2178
+ *     LOD (FP),R0
2179
+ *     LOD 1(FP),R4
2180
+ *     LOD 2(FP),R5
2181
+ *     LOD 3(FP),R6
2182
+ *     MOV FP,SP
2183
+ *     LOD 4(SP),FP
2184
+ *     ... Which suffers unnecessary pipeline stalls, and certainly doesn't
2185
+ *     exploit our pipeline memory function
2186
+ * or
2187
+ *     MOV FP,SP
2188
+ *     LOD (SP),R0
2189
+ *     LOD 1(SP),R4
2190
+ *     LOD 2(SP),R5
2191
+ *     LOD 3(SP),R6
2192
+ *     LOD 4(SP),FP
2193
+ * Which will be our choice.  Note that we do use the stack pointer, eventually.
2194
+ *
2195
+ */
2196
+void
2197
+zip_expand_epilogue(void) {
2198
+       int     regno, offset;
2199
+       const bool      dbg = ((ALL_DEBUG_ON)||(false))&&(!ALL_DEBUG_OFF);
2200
+
2201
+       zip_compute_frame();
2202
+
2203
+       if (dbg) fprintf(stderr, "EPILOG::\n");
2204
+       if (cfun->machine->fp_needed) {
2205
+               if (dbg) fprintf(stderr, "EPILOG::Moving frame pointer to stack register\n");
2206
+               emit_insn(gen_movsi_reg(stack_pointer_rtx, frame_pointer_rtx));
2207
+       }
2208
+
2209
+       if (cfun->machine->saved_reg_size != 0) {
2210
+               offset =  (cfun->machine->size_for_adjusting_sp -
2211
+                               cfun->machine->sp_fp_offset
2212
+                       - cfun->machine->saved_reg_size);
2213
+               if (dbg) fprintf(stderr, "EPILOG::Saved_REG_Size = %d\n", cfun->machine->saved_reg_size);
2214
+               for(regno=0; regno < FIRST_PSEUDO_REGISTER; regno++) {
2215
+                       if (zip_save_reg(regno)) {
2216
+                               if (dbg) fprintf(stderr, "EPILOG::RESTORING R%d\n", regno);
2217
+                               emit_insn(gen_movsi_lod(
2218
+                                               gen_rtx_REG(SImode, regno),
2219
+                                       gen_rtx_MEM(SImode, plus_constant( SImode,
2220
+                                               stack_pointer_rtx, offset++, true))));
2221
+                       }
2222
+               }
2223
+       }
2224
+
2225
+       if (cfun->machine->size_for_adjusting_sp != 0) {
2226
+               if (dbg) fprintf(stderr, "EPILOG::ADDSI3(StackPtr, %d)\n",
2227
+                               cfun->machine->size_for_adjusting_sp);
2228
+               emit_insn(gen_addsi3(stack_pointer_rtx, stack_pointer_rtx,
2229
+                       gen_int_mode(
2230
+                               cfun->machine->size_for_adjusting_sp
2231
+                               -cfun->machine->sp_fp_offset, SImode)));
2232
+       }
2233
+       if (dbg) fprintf(stderr, "EPILOG::EMITTING-RETURN\n");
2234
+
2235
+       emit_jump_insn(ret_rtx);
2236
+}
2237
+
2238
+/* Implement RETURN_ADDR_RTX(COUNT, FRAMEADDR).
2239
+ *
2240
+ * We currently only support calculating the return address for the current
2241
+ * frame.
2242
+ */
2243
+
2244
+/*
2245
+rtx
2246
+zip_return_addr_rtx(int count, rtx frame ATTRIBUTE_UNUSED)
2247
+{
2248
+       if (count)
2249
+               return NULL_RTX;
2250
+
2251
+       zip_compute_frame();
2252
+
2253
+       // saved return address for current function is at fp - 1
2254
+       if (cfun->machine->save_ret)
2255
+               return gen_rtx_MEM(Pmode, plus_constant(frame_pointer_rtx,
2256
+                               -UNITS_PER_WORD));
2257
+       return get_hard_reg_initial_val(Pmode, RETURN_ADDRESS_REGNUM);
2258
+}
2259
+*/
2260
+
2261
+/* Implements the macro INITIAL_ELIMINATION_OFFSET,
2262
+ * return the OFFSET.
2263
+ */
2264
+/*
2265
+int
2266
+zip_initial_elimination_offset(int from, int to) {
2267
+       int     ret = 0;
2268
+       zip_compute_frame();
2269
+
2270
+       if (((from) == FRAME_POINTER_REGNUM)&&((to) == STACK_POINTER_REGNUM)) {
2271
+               ret = cfun->machine->sp_fp_offset;
2272
+       } else if (((from)=ARG_POINTER_REGNUM)&&((to)==FRAME_POINTER_REGNUM)) {
2273
+               ret = cfun->machine->local_vars_size;
2274
+       } else {
2275
+               abort();
2276
+       }
2277
+
2278
+       return ret;
2279
+}
2280
+*/
2281
+
2282
+/* Return non-zero if the function argument described by TYPE is to be passed
2283
+ * by reference.
2284
+ */
2285
+/*
2286
+static bool
2287
+zip_pass_by_reference(CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
2288
+               enum machine_mode mode, const_tree type,
2289
+               bool name ATTRIBUTE_UNUSED) {
2290
+       unsigned        HOST_WIDE_INT   size;
2291
+
2292
+       if (type) {
2293
+               if (AGGREGATE_TYPE_P(type)) {
2294
+                       return TRUE;
2295
+               } size = int_size_in_bytes(type);
2296
+       } else
2297
+               size = GET_MODE_SIZE(mode);
2298
+
2299
+       return (size > GET_MODE_SIZE(SImode)); // > 1 word : is this okay?
2300
+       // The idea is to pass everything larger than an int by reference (or
2301
+       // on the stack)
2302
+}
2303
+*/
2304
+
2305
+/*
2306
+ * Code taken from m68k ...
2307
+ */
2308
+static bool
2309
+zip_can_eliminate(int from, int to)
2310
+{
2311
+       // fprintf(stderr, "CAN_ELIMINATE::QUERYING(%d,%d)\n", from, to);
2312
+       if ((from == zip_FP)&&(to == zip_SP))
2313
+               return !cfun->machine->fp_needed;
2314
+       return true;
2315
+}
2316
+
2317
+/*
2318
+static bool
2319
+zip_must_pass_in_stack(enum machine_mode mode, const_tree type)
2320
+{
2321
+       if (mode == BLKmode) {
2322
+               return true;
2323
+       } if (type == NULL) {
2324
+               return false;
2325
+       } return AGGREGATE_TYPE_P(type);
2326
+}
2327
+*/
2328
+
2329
+/*
2330
+static void
2331
+zip_basic_check(void)
2332
+{
2333
+       gcc_assert(mode_base_align[SImode]==4);
2334
+       if ((BITS_PER_UNIT != 32)
2335
+                       ||(GET_MODE_SIZE(SImode)!=1)
2336
+                       ||(GET_MODE_SIZE(DImode)!=1)
2337
+                       ||(HARD_REGNO_NREGS(0,SImode)!=1)) {
2338
+               printf("SIZEOF(SIMode) == %d\n", GET_MODE_SIZE(SImode));
2339
+               printf("BITS_PER_UNIT  == %d\n", BITS_PER_UNIT);
2340
+               gcc_assert(BITS_PER_UNIT==32);
2341
+               gcc_assert(GET_MODE_SIZE(SImode)==1);
2342
+               gcc_assert(HARD_REGNO_NREGS(0,SImode)==1);
2343
+       }
2344
+}
2345
+*/
2346
+
2347
+#define        zip_basic_check()
2348
+
2349
+/* Compute the number of word sized regiters needed to hold a function
2350
+ * argument of mode INT_MODE and tree type TYPE.
2351
+ */
2352
+int
2353
+zip_num_arg_regs(enum machine_mode mode, const_tree type) {
2354
+       int     size;
2355
+
2356
+       zip_basic_check();
2357
+
2358
+       if (targetm.calls.must_pass_in_stack(mode, type))
2359
+               return 0;
2360
+
2361
+       if ((type)&&(mode == BLKmode))
2362
+               size = int_size_in_bytes(type);
2363
+       else
2364
+               size = GET_MODE_SIZE(mode);
2365
+
2366
+       return (size + UNITS_PER_WORD - 1)/UNITS_PER_WORD;
2367
+}
2368
+
2369
+/* pushed in function prologue */
2370
+/*
2371
+static void
2372
+zip_setup_incoming_varargs(CUMULATIVE_ARGS *cum, enum machine_mode mode,
2373
+               tree type, int *pretend_size, int no_rtl) {
2374
+       if (no_rtl)
2375
+               return;
2376
+
2377
+       gcc_assert(mode != BLKmode);
2378
+
2379
+       if (*cum < (ZIP_LAST_ARG_REGNO+1)) {
2380
+               int size = ZIP_FIRST_ARG_REGNO + ZIP_NUM_ARGS_REGS - *cum;
2381
+               rtx     regblock;
2382
+               int     offset = (*cum - ZIP_FIRST_ARG_REGNO) * UNITS_PER_WORD;
2383
+               regblock = gen_rtx_MEM(BLKmode,
2384
+                       plus_constant(arg_pointer_rtx, offset));
2385
+               move_block_from_reg(*cum, regblock, size);
2386
+               *pretend_size = size * UNITS_PER_WORD;
2387
+       }
2388
+
2389
+       if (targetm.calls.strict_argument_naming(cum))
2390
+               *cum = *cum + zip_num_arg_regs(mode, type);
2391
+}
2392
+*/
2393
+
2394
+/*
2395
+static int
2396
+zip_arg_partial_bytes(CUMULATIVE_ARGS *cum, enum machine_mode mode,
2397
+               tree type, bool name ATTRIBUTE_UNUSED) {
2398
+       int     words;
2399
+       unsigned int    regs = zip_num_arg_regs(mode, type);
2400
+
2401
+       if (*cum >= ZIP_LAST_ARG_REGNO + 1)
2402
+               words = 0;
2403
+       else if ((*cum + regs) > ZIP_LAST_ARG_REGNO + 1)
2404
+               words = (*cum + regs) - ZIP_LAST_ARG_REGNO + 1;
2405
+       else
2406
+               words = 0;
2407
+
2408
+       return words * UNITS_PER_WORD;
2409
+}
2410
+*/
2411
+
2412
+static void
2413
+zip_function_arg_advance(cumulative_args_t ca, machine_mode mode,
2414
+               const_tree type, bool named ATTRIBUTE_UNUSED) {
2415
+       CUMULATIVE_ARGS *cum;
2416
+       int     nreg;
2417
+
2418
+       zip_basic_check();
2419
+
2420
+       cum = get_cumulative_args(ca);
2421
+       nreg = zip_num_arg_regs(mode, type);
2422
+       if (((*cum)+nreg) > NUM_ARG_REGS)
2423
+               (*cum) = NUM_ARG_REGS;
2424
+       else
2425
+               (*cum) += nreg;
2426
+}
2427
+
2428
+static rtx
2429
+zip_function_arg(cumulative_args_t ca, machine_mode mode,
2430
+               const_tree type ATTRIBUTE_UNUSED, bool named) {
2431
+       CUMULATIVE_ARGS *cum;
2432
+
2433
+       zip_basic_check();
2434
+
2435
+
2436
+       if (!named)
2437
+               return NULL_RTX;
2438
+       //if (targetm.calls.must_pass_in_stack(mode, type))
2439
+               //return NULL_RTX;
2440
+       cum = get_cumulative_args(ca);
2441
+
2442
+       if ((*cum) >= NUM_ARG_REGS)
2443
+               return NULL_RTX;
2444
+       return
2445
+               gen_rtx_REG(mode, (*cum)+1);
2446
+}
2447
+
2448
+/* NOTICE_UPDATE_CC sends us here
2449
+ */
2450
+void
2451
+zip_update_cc_notice(rtx exp, rtx_insn *insn)
2452
+{
2453
+       const bool      dbg = ((ALL_DEBUG_ON)||(false))&&(!ALL_DEBUG_OFF);
2454
+       enum    attr_ccresult  ccr;
2455
+       enum    attr_conditional  conditionally_executed;
2456
+
2457
+       // The default is that nothing has changed.
2458
+       // cc_status = cc_status_prev;
2459
+       rtx     src, dest;
2460
+
2461
+       if (dbg) fprintf(stderr, "CC-NOTICE ...\n");
2462
+       if (dbg) zip_debug_rtx_pfx("CC :", exp);
2463
+       if (dbg) debug_rtx(exp);
2464
+
2465
+       ccr = get_attr_ccresult(insn);
2466
+       if (ccr == CCRESULT_UNKNOWN) {
2467
+               CC_STATUS_INIT;
2468
+               if (dbg) fprintf(stderr, "\tINIT-CC\n");
2469
+               return;
2470
+       } else if (ccr == CCRESULT_UNCHANGED) {
2471
+               if (dbg) fprintf(stderr, "\tUnchanged CC\n");
2472
+               return;
2473
+       }
2474
+
2475
+       if ((GET_CODE(exp) == PARALLEL)&&(GET_CODE(XVECEXP(exp, 0, 0))==SET)) {
2476
+               // This works up and until we add cc0 parallel instructions
2477
+               // to our instruction set.
2478
+               dest = SET_DEST(XVECEXP(exp, 0, 0));
2479
+               src  = SET_SRC (XVECEXP(exp, 0, 0));
2480
+       } else if (GET_CODE(exp) == SET) {
2481
+               dest = SET_DEST(exp);
2482
+               src  = SET_SRC (exp);
2483
+       } else {
2484
+               // First, do nothing if we haven't touched the condition codes.
2485
+               // Condition codes can only be changed as a result of a set
2486
+               // expression ...?
2487
+               if (dbg) fprintf(stderr, "Non-set expression, doesn\'t touch condition codes\n");
2488
+               return;
2489
+       }
2490
+
2491
+       // Gotta wait on this test, until we know whether or not the
2492
+       // conditionally executed instruction was designed to set the
2493
+       // CC0 register.
2494
+       conditionally_executed = get_attr_conditional(insn);
2495
+       if ((conditionally_executed == CONDITIONAL_YES)&&(dest != cc0_rtx)) {
2496
+               // cc_status is unchanged
2497
+               if (dbg) fprintf(stderr, "\tCC -- unchanged (conditional exec)\n");
2498
+               return;
2499
+       }
2500
+
2501
+       if (ccr == CCRESULT_VALIDZN)
2502
+               cc_status.flags = CC_NO_OVERFLOW;
2503
+       else
2504
+               cc_status.flags = 0;
2505
+       cc_status.value1 = dest;
2506
+       if (dest == cc0_rtx)
2507
+               cc_status.value2 = src;
2508
+       else if((REG_P(dest))&&(!reg_mentioned_p(dest, src)))
2509
+               cc_status.value2 = src;
2510
+       else if((SUBREG_P(dest))&&(!reg_mentioned_p(XEXP(dest,0), src)))
2511
+               cc_status.value2 = src;
2512
+       else
2513
+               cc_status.value2 = 0;
2514
+       if (dbg) fprintf(stderr, "\tCC -- Set flags for\n");
2515
+       if (dbg) zip_debug_rtx_pfx("V1: ", dest);
2516
+       if ((dbg)&&(cc_status.value2)) zip_debug_rtx_pfx("V2: ", src);
2517
+       else if (dbg)   fprintf(stderr, "V2: (No SRC)\n");
2518
+       if ((dbg)&&(REG_P(dest))) fprintf(stderr, "src refers to dest ?? %s\n",
2519
+               refers_to_regno_p(REGNO(dest),REGNO(dest),src,NULL)?"Yes":"No");
2520
+       if ((dbg)&&(REG_P(dest))) fprintf(stderr, "Occurrs %d times\n",
2521
+               count_occurrences(dest,src,0));
2522
+       if ((dbg)&&(REG_P(dest))) fprintf(stderr, "%s mentioned\n",
2523
+               reg_mentioned_p(dest,src)?"Is":"Is not");
2524
+       if ((dbg)&&(REG_P(dest))) fprintf(stderr, "%s referenced\n",
2525
+               reg_referenced_p(dest,src)?"Is":"Is not");
2526
+
2527
+//
2528
+// These results are only used in final.c, where they are used to remove
2529
+// compare instructions if the optimizer is on.  If I produce nothing, no
2530
+// compare instructions will be removed.  If I produce something, a smart
2531
+// decision may be made to remove compare instructions.
2532
+//
2533
+// cc_status will be compared  with subsequent
2534
+//     (set (cc0) (something)) (i.e. compare only) instructions
2535
+//
2536
+//     (set (cc0) (compare (x) (y)))
2537
+//     dst = cc0 -- the destination of the set is ignored, save that it must be
2538
+//             cc0
2539
+//     src1 = (compare (x) (y))
2540
+//     if (src1 == compare)&&(y == (const_int 0))
2541
+//             src2 = (x)
2542
+//     else
2543
+//             src2 = null
2544
+//
2545
+//     Four conditions:
2546
+//     1. if (val1)&&(src1 == val1)
2547
+//             This would be true if I had seen a (set (val1) (src1)) insn
2548
+//             If I have seen a (set (val1) (src1))
2549
+//                     or equivalently a (set (val1) (compare (x) (y)))
2550
+//     or
2551
+//     2. if (val2)&&(src1 == val2)
2552
+//             This would be true if I had seen a (set (val1) (src1)) insn,
2553
+//             and only if val2 was still valid.
2554
+//     or
2555
+//     3. if (src2)&&(value1)&&(src2 == value1)
2556
+//             This would be true if we are comparing against zero, and the
2557
+//             number we are comparing against zero is value 1
2558
+//     or
2559
+//     4. if (src2)&&(value2)&&(src2 == value2)
2560
+//             ... or value2.  This is the common ZipCPU case.
2561
+//
2562
+//             then delete the compare.
2563
+//
2564
+}
2565
+
2566
+
2567
+/* totally buggy - we can't return pointers to nested functions */
2568
+static void
2569
+zip_asm_trampoline_template(FILE *f) {
2570
+       // Whereas at one time I thought I wouldn't need it, now I know I
2571
+       // need this trampoline function, although it is for a completely
2572
+       // different purpose than the one I was familiar with.
2573
+       fprintf(f, "\tldihi 0,r1\n");
2574
+       fprintf(f, "\tldilo 0,r1\n");
2575
+       fprintf(f, "\tjmp r1\n");
2576
+}
2577
+
2578
+/* Worker function for TARGET_TRAMPOLINE_INIT. */
2579
+static void
2580
+zip_trampoline_init(rtx m_tramp ATTRIBUTE_UNUSED,
2581
+       tree fndecl ATTRIBUTE_UNUSED,
2582
+       rtx chain_value ATTRIBUTE_UNUSED) {
2583
+// #warning "This needs to be filled out"
2584
+       abort();
2585
+}
2586
+
2587
+static tree
2588
+def_builtin(const char *name, enum insn_code icode, enum ZIP_BUILTIN_ID_CODE code,
2589
+       tree type)
2590
+{
2591
+       tree t = add_builtin_function(name,type,code,BUILT_IN_MD, NULL, NULL_TREE);
2592
+       zip_basic_check();
2593
+
2594
+       if(t) {
2595
+               zip_builtins[code] = t;
2596
+               zip_builtins_icode[code] = icode;
2597
+       }
2598
+
2599
+       return t;
2600
+
2601
+}
2602
+
2603
+void   zip_init_builtins(void) {
2604
+       zip_basic_check();
2605
+
2606
+  tree void_ftype_void = build_function_type_list(void_type_node, NULL_TREE);
2607
+#ifdef HAVE_zip_rtu
2608
+  def_builtin("zip_rtu", CODE_FOR_zip_rtu, ZIP_BUILTIN_RTU, void_ftype_void);
2609
+#endif
2610
+#ifdef HAVE_zip_halt
2611
+  def_builtin("zip_halt",  CODE_FOR_zip_halt,  ZIP_BUILTIN_HALT, void_ftype_void);
2612
+#endif
2613
+#ifdef HAVE_zip_idle
2614
+  def_builtin("zip_idle", CODE_FOR_zip_idle, ZIP_BUILTIN_IDLE, void_ftype_void);
2615
+#endif
2616
+
2617
+#ifdef HAVE_zip_syscall
2618
+// Support int SYSCALL(callID, int a, int b, int c);
2619
+  def_builtin("zip_syscall", CODE_FOR_zip_syscall, ZIP_BUILTIN_SYSCALL,
2620
+                       build_function_type_list(void_type_node, NULL_TREE));
2621
+#endif
2622
+
2623
+#ifdef HAVE_zip_save_context
2624
+  def_builtin("zip_save_context", CODE_FOR_zip_save_context, ZIP_BUILTIN_SAVE_CONTEXT,
2625
+               build_function_type_list(void_type_node, ptr_type_node, 0));
2626
+#endif
2627
+
2628
+#ifdef HAVE_zip_restore_context
2629
+  def_builtin("zip_restore_context", CODE_FOR_zip_restore_context, ZIP_BUILTIN_RESTORE_CONTEXT,
2630
+       build_function_type_list(void_type_node, ptr_type_node, 0));
2631
+#endif
2632
+
2633
+#ifdef HAVE_zip_bitrev
2634
+  def_builtin("zip_bitrev", CODE_FOR_zip_bitrev, ZIP_BUILTIN_BITREV,
2635
+       build_function_type_list(unsigned_type_node, unsigned_type_node,
2636
+               NULL_TREE));
2637
+#endif
2638
+
2639
+#ifdef HAVE_zip_cc
2640
+  def_builtin("zip_cc", CODE_FOR_zip_cc, ZIP_BUILTIN_CC,
2641
+       build_function_type_list(unsigned_type_node, NULL_TREE));
2642
+#endif
2643
+
2644
+}
2645
+
2646
+static tree
2647
+zip_builtin_decl(unsigned zip_builtin_code, bool initialize_p ATTRIBUTE_UNUSED)
2648
+{
2649
+  if (zip_builtin_code >= ZIP_BUILTIN_MAX)
2650
+    return error_mark_node;
2651
+
2652
+  return zip_builtins[zip_builtin_code];
2653
+}
2654
+
2655
+static rtx
2656
+zip_expand_builtin(tree exp, rtx target,
2657
+               rtx subtarget ATTRIBUTE_UNUSED,
2658
+               machine_mode tmode ATTRIBUTE_UNUSED,
2659
+               int     ignore ATTRIBUTE_UNUSED) {
2660
+
2661
+       tree    fndecl = TREE_OPERAND(CALL_EXPR_FN(exp), 0);
2662
+       bool    nonvoid = (TREE_TYPE(TREE_TYPE(fndecl)) != void_type_node);
2663
+       enum    ZIP_BUILTIN_ID_CODE code=(enum ZIP_BUILTIN_ID_CODE)DECL_FUNCTION_CODE(fndecl);
2664
+       enum    insn_code icode = zip_builtins_icode[code];
2665
+       rtx     pat, op[5];
2666
+       call_expr_arg_iterator  iter;
2667
+       tree    arg;
2668
+
2669
+       if ((code == ZIP_BUILTIN_SAVE_CONTEXT)
2670
+                       ||(code == ZIP_BUILTIN_RESTORE_CONTEXT)) {
2671
+               arg = first_call_expr_arg(exp, &iter);
2672
+               if (arg == error_mark_node)
2673
+                       return NULL_RTX;
2674
+               op[0] = expand_normal(arg);
2675
+               if (GET_CODE(op[0]) != REG)
2676
+                       op[0] = force_reg(Pmode, op[0]);
2677
+               pat = GEN_FCN(icode)(op[0]);
2678
+       } else if (code == ZIP_BUILTIN_BITREV) {
2679
+               arg = first_call_expr_arg(exp, &iter);
2680
+               if (arg == error_mark_node) {
2681
+                       return NULL_RTX;
2682
+               }
2683
+               op[0] = expand_normal(arg);
2684
+               if (!target)
2685
+                       target = gen_reg_rtx(SImode);
2686
+               pat = GEN_FCN(icode)(target, op[0]);
2687
+       } else if (code == ZIP_BUILTIN_CC) {
2688
+               if (!target)
2689
+                       target = gen_reg_rtx(SImode);
2690
+               pat = GEN_FCN(icode)(target);
2691
+       } else // RTU, HALT, IDLE
2692
+               pat = GEN_FCN(icode)();
2693
+       if (!pat)
2694
+               return NULL_RTX;
2695
+       emit_insn(pat);
2696
+       return (nonvoid ? target : const0_rtx);
2697
+}
2698
+
2699
+static bool
2700
+zip_scalar_mode_supported_p(enum machine_mode mode) {
2701
+       zip_basic_check();
2702
+
2703
+       return ((mode)==SImode)||((mode)==DImode); // ||((mode)==SFmode);
2704
+}
2705
+
2706
+static bool
2707
+zip_libgcc_floating_mode_supported_p(enum machine_mode mode) {
2708
+       return ((mode)==SFmode)||((mode)==DFmode);
2709
+}
2710
+
2711
+static int
2712
+zip_address_cost(rtx addr ATTRIBUTE_UNUSED,
2713
+       enum machine_mode mode ATTRIBUTE_UNUSED,
2714
+       addr_space_t as ATTRIBUTE_UNUSED, bool spd ATTRIBUTE_UNUSED) {
2715
+       return 1;
2716
+}
2717
+
2718
+static bool
2719
+zip_mode_dependent_address_p(const_rtx addr ATTRIBUTE_UNUSED,
2720
+       addr_space_t as ATTRIBUTE_UNUSED) {
2721
+       return false;
2722
+}
2723
+
2724
+/*
2725
+static void
2726
+zip_asm_output_anchor(rtx x) {
2727
+       printf("ANCHOR: OP(%d)\n", GET_CODE(x));
2728
+}
2729
+*/
2730
+
2731
+static void
2732
+zip_debug_print(const char *pfx, int lvl, const char *str) {
2733
+       int     i;
2734
+       i = lvl;
2735
+       if ((true)||(lvl == 0))
2736
+               fprintf(stderr, "%s", pfx);
2737
+       else
2738
+               i += strlen(pfx);
2739
+       while(i-->0)
2740
+               fprintf(stderr, "  ");
2741
+       fprintf(stderr, "%s\n", str);
2742
+}
2743
+
2744
+static void
2745
+zip_debug_print_m(const char *pfx, int lvl, const char *str, enum machine_mode m) {
2746
+       int     i;
2747
+
2748
+       i = lvl;
2749
+       if ((true)||(lvl == 0))
2750
+               fprintf(stderr, "%s", pfx);
2751
+       else
2752
+               i = lvl+strlen(pfx);
2753
+       while(i-->0)
2754
+               fprintf(stderr, "  ");
2755
+       switch(m) {
2756
+               case VOIDmode:
2757
+                       fprintf(stderr, "%s:V\n", str);
2758
+                       break;
2759
+               case BLKmode:
2760
+                       fprintf(stderr, "%s:BLK\n", str);
2761
+                       break;
2762
+               case BImode:
2763
+                       fprintf(stderr, "%s:BI\n", str);
2764
+                       break;
2765
+#ifdef HAVE_QImode
2766
+               case QImode:
2767
+                       fprintf(stderr, "%s:QI\n", str);
2768
+                       break;
2769
+#endif
2770
+#ifdef HAVE_HImode
2771
+               case HImode:
2772
+                       fprintf(stderr, "%s:HI\n", str);
2773
+                       break;
2774
+#endif
2775
+               case SImode:
2776
+                       fprintf(stderr, "%s:SI\n", str);
2777
+                       break;
2778
+               case DImode:
2779
+                       fprintf(stderr, "%s:DI\n", str);
2780
+                       break;
2781
+               default:
2782
+                       fprintf(stderr, "%s:?\n", str);
2783
+       }
2784
+}
2785
+
2786
+static void
2787
+zip_debug_rtx_1(const char *pfx, const_rtx x, int lvl) {
2788
+       if (x == NULL_RTX) {
2789
+               zip_debug_print(pfx, lvl, "(NULL-RTX)");
2790
+               return;
2791
+       } else if (GET_CODE(x) > NUM_RTX_CODE) {
2792
+               char    buf[64];
2793
+               sprintf(buf, "(BAD-RTX-CODE %d)", GET_CODE(x));
2794
+               zip_debug_print(pfx, lvl, buf);
2795
+               return;
2796
+       } switch(GET_CODE(x)) { // rtl.def
2797
+       case PARALLEL: zip_debug_print(pfx, lvl, "(PARALLEL");
2798
+               debug_rtx(x); break;
2799
+       case INT_LIST: zip_debug_print(pfx, lvl, "(INT-LIST"); break;
2800
+       case SEQUENCE: zip_debug_print(pfx, lvl, "(SEQUENCE"); break;
2801
+       case ADDRESS: zip_debug_print(pfx, lvl, "(ADDRESS"); break;
2802
+       case DEBUG_INSN: zip_debug_print(pfx, lvl, "(DEBUG-INSN"); break;
2803
+       case INSN:
2804
+               zip_debug_print(pfx, lvl, "(INSN");
2805
+               /*
2806
+               { const rtx_insn *tmp_rtx;
2807
+               for(tmp_rtx = as_a <const rtx_insn *>(x); tmp_rtx != 0; tmp_rtx = NEXT_INSN(tmp_rtx)) {
2808
+                       zip_debug_rtx_1(tmp_rtx, lvl+1);
2809
+               }}
2810
+               */
2811
+               zip_debug_rtx_1(pfx, PATTERN(x), lvl+1);
2812
+               debug_rtx(x);
2813
+               zip_debug_print(pfx, lvl, ")");
2814
+               break;
2815
+       case JUMP_INSN: zip_debug_print(pfx, lvl, "(JUMP-INSN");
2816
+               if (JUMP_LABEL(x)) {
2817
+                       zip_debug_print(pfx, lvl+1, "(w/Label)");
2818
+               } else
2819
+                       zip_debug_print(pfx, lvl+1, "(NO label)");
2820
+               break;
2821
+       case CALL:
2822
+               zip_debug_print(pfx, lvl, "(CALL (Adr) (Args)");
2823
+               zip_debug_rtx_1(pfx, XEXP(x,0), lvl+1);
2824
+               zip_debug_rtx_1(pfx, XEXP(x,1), lvl+1);
2825
+               zip_debug_print(pfx, lvl, ")");
2826
+               break;
2827
+       case CALL_INSN: zip_debug_print(pfx, lvl, "(CALL-INSN");
2828
+               debug_rtx(x);
2829
+               break;
2830
+       case BARRIER: zip_debug_print(pfx, lvl, "(BARRIER)"); break;
2831
+       case RETURN: zip_debug_print(pfx, lvl, "(RETURN)"); break;
2832
+       case NOTE:
2833
+               {       char buf[128];
2834
+                       sprintf(buf, "(NOTE %s)", GET_REG_NOTE_NAME(GET_MODE(x)));
2835
+                       zip_debug_print(pfx, lvl, buf);
2836
+               }break;
2837
+       case COND_EXEC: zip_debug_print(pfx, lvl, "(COND_EXEC)");
2838
+               debug_rtx(x);
2839
+               break;
2840
+       case ASM_INPUT: zip_debug_print(pfx, lvl, "(ASM INPUT)"); break;
2841
+       case ASM_OPERANDS: zip_debug_print(pfx, lvl, "(ASM OPERANDS)"); break;
2842
+       case UNSPEC: zip_debug_print(pfx, lvl, "(UNSPEC)"); break;
2843
+       case UNSPEC_VOLATILE: zip_debug_print(pfx, lvl, "(UNSPEC_VOLATILE)"); break;
2844
+       case CODE_LABEL:
2845
+               {
2846
+                       char    buf[64];
2847
+                       sprintf(buf, "(CODE_LABEL %d)", CODE_LABEL_NUMBER(x));
2848
+                       zip_debug_print_m(pfx, lvl, buf, GET_MODE(x));
2849
+               } break;
2850
+       case SET:
2851
+               zip_debug_print_m(pfx, lvl, "(SET", GET_MODE(x));
2852
+               zip_debug_rtx_1(pfx, XEXP(x,0),lvl+1);
2853
+               zip_debug_rtx_1(pfx, XEXP(x,1),lvl+1);
2854
+               zip_debug_print(pfx, lvl, ")");
2855
+               break;
2856
+       case REG:
2857
+               if (REGNO(x) == zip_PC)
2858
+                       zip_debug_print(pfx, lvl, "(PC)");
2859
+               else if (REGNO(x) == zip_CC)
2860
+                       zip_debug_print(pfx, lvl, "(CC0)");
2861
+               else if (REGNO(x) == zip_SP)
2862
+                       zip_debug_print(pfx, lvl, "(SP)");
2863
+               else if (REGNO(x) == zip_FP)
2864
+                       zip_debug_print(pfx, lvl, "(REG FP)");
2865
+               else if (REGNO(x) == zip_GOT)
2866
+                       zip_debug_print(pfx, lvl, "(REG GBL)");
2867
+               else if (FUNCTION_VALUE_REGNO_P(REGNO(x)))
2868
+                       zip_debug_print(pfx, lvl, "(REG RTN-VL)");
2869
+               else if (REGNO(x) == RETURN_ADDRESS_REGNUM)
2870
+                       zip_debug_print(pfx, lvl, "(REG RTN-AD)");
2871
+               else { char buf[25];
2872
+               sprintf(buf, "(REG %d)", REGNO(x));
2873
+               zip_debug_print_m(pfx, lvl, buf, GET_MODE(x));
2874
+               } break;
2875
+       case IF_THEN_ELSE: // 51
2876
+               zip_debug_print(pfx, lvl, "(IF-THEN-ELSE");
2877
+               zip_debug_rtx_1(pfx, XEXP(x,0),lvl+1);
2878
+               zip_debug_rtx_1(pfx, XEXP(x,1),lvl+1);
2879
+               zip_debug_rtx_1(pfx, XEXP(x,2),lvl+1);
2880
+               zip_debug_print(pfx, lvl, ")");
2881
+               break;
2882
+       case PC:
2883
+               zip_debug_print(pfx, lvl, "(PC)");
2884
+               break;
2885
+       case CC0:
2886
+               zip_debug_print(pfx, lvl, "(CC0)");
2887
+               break;
2888
+       case COMPARE:
2889
+               zip_debug_print(pfx, lvl, "(COMPARE");
2890
+               zip_debug_rtx_1(pfx, XEXP(x,0),lvl+1);
2891
+               zip_debug_rtx_1(pfx, XEXP(x,1),lvl+1);
2892
+               zip_debug_print(pfx, lvl, ")");
2893
+               break;
2894
+       case CONST_INT:
2895
+               { char buf[25];
2896
+               if (GET_MODE(x)==SImode)
2897
+                       sprintf(buf, "(CONST:SI %ld)", INTVAL(x));
2898
+               else if (GET_MODE(x)==VOIDmode)
2899
+                       sprintf(buf, "(CONST:V %ld)", INTVAL(x));
2900
+               else
2901
+                       sprintf(buf, "(CONST:? %ld)", INTVAL(x));
2902
+               zip_debug_print(pfx, lvl, buf);
2903
+               } break;
2904
+       case LABEL_REF:
2905
+               zip_debug_print(pfx, lvl, "(LABEL)");
2906
+               break;
2907
+       case SYMBOL_REF:
2908
+               {
2909
+                       char buf[64];
2910
+                       sprintf(buf, "(SYMBOL: %s)", XSTR(x,0));
2911
+                       // fprintf(file, "%s", XSTR(x,0));
2912
+                       zip_debug_print(pfx, lvl, buf);
2913
+               }
2914
+               break;
2915
+       case MEM:
2916
+               zip_debug_print_m(pfx, lvl, "(MEM", GET_MODE(x));
2917
+               zip_debug_rtx_1(pfx, XEXP(x,0),lvl+1);
2918
+               zip_debug_print(pfx, lvl, ")");
2919
+               break;
2920
+       /*
2921
+       case VALUE:
2922
+               {
2923
+                       char buf[64];
2924
+                       sprintf(buf, "(VALUE: %d)", INTVAL(XEXP,0));
2925
+                       zip_debug_print_m(pfx, lvl, "buf", GET_MODE(x));
2926
+               }
2927
+               break;
2928
+       */
2929
+       case PLUS:
2930
+               zip_debug_print_m(pfx, lvl, "(PLUS", GET_MODE(x));
2931
+               zip_debug_rtx_1(pfx, XEXP(x,0),lvl+1);
2932
+               zip_debug_rtx_1(pfx, XEXP(x,1),lvl+1);
2933
+               zip_debug_print(pfx, lvl, ")");
2934
+               break;
2935
+       case MINUS:
2936
+               zip_debug_print_m(pfx, lvl, "(MINUS", GET_MODE(x));
2937
+               zip_debug_rtx_1(pfx, XEXP(x,0),lvl+1);
2938
+               zip_debug_rtx_1(pfx, XEXP(x,1),lvl+1);
2939
+               zip_debug_print(pfx, lvl, ")");
2940
+               break;
2941
+       case AND:
2942
+               zip_debug_print_m(pfx, lvl, "(AND", GET_MODE(x));
2943
+               zip_debug_rtx_1(pfx, XEXP(x,0),lvl+1);
2944
+               zip_debug_rtx_1(pfx, XEXP(x,1),lvl+1);
2945
+               zip_debug_print(pfx, lvl, ")");
2946
+               break;
2947
+       case IOR:
2948
+               zip_debug_print_m(pfx, lvl, "(OR", GET_MODE(x));
2949
+               zip_debug_rtx_1(pfx, XEXP(x,0),lvl+1);
2950
+               zip_debug_rtx_1(pfx, XEXP(x,1),lvl+1);
2951
+               zip_debug_print(pfx, lvl, ")");
2952
+               break;
2953
+       case XOR:
2954
+               zip_debug_print_m(pfx, lvl, "(XOR", GET_MODE(x));
2955
+               zip_debug_rtx_1(pfx, XEXP(x,0),lvl+1);
2956
+               zip_debug_rtx_1(pfx, XEXP(x,1),lvl+1);
2957
+               zip_debug_print(pfx, lvl, ")");
2958
+               break;
2959
+       case MULT:
2960
+               zip_debug_print_m(pfx, lvl, "(MULT", GET_MODE(x));
2961
+               zip_debug_rtx_1(pfx, XEXP(x,0),lvl+1);
2962
+               zip_debug_rtx_1(pfx, XEXP(x,1),lvl+1);
2963
+               zip_debug_print(pfx, lvl, ")");
2964
+               break;
2965
+       case EQ:        //
2966
+               zip_debug_print_m(pfx, lvl, "(EQ", GET_MODE(x));
2967
+               zip_debug_rtx_1(pfx, XEXP(x,0),lvl+1);
2968
+               zip_debug_rtx_1(pfx, XEXP(x,1),lvl+1);
2969
+               zip_debug_print(pfx, lvl, ")");
2970
+               break;
2971
+       case NE:        //
2972
+               zip_debug_print_m(pfx, lvl, "(NE", GET_MODE(x));
2973
+               zip_debug_rtx_1(pfx, XEXP(x,0),lvl+1);
2974
+               zip_debug_rtx_1(pfx, XEXP(x,1),lvl+1);
2975
+               zip_debug_print(pfx, lvl, ")");
2976
+               break;
2977
+       case GE:        //
2978
+               zip_debug_print_m(pfx, lvl, "(GE", GET_MODE(x));
2979
+               zip_debug_rtx_1(pfx, XEXP(x,0),lvl+1);
2980
+               zip_debug_rtx_1(pfx, XEXP(x,1),lvl+1);
2981
+               zip_debug_print(pfx, lvl, ")");
2982
+               break;
2983
+       case GT:        //
2984
+               zip_debug_print_m(pfx, lvl, "(GT", GET_MODE(x));
2985
+               zip_debug_rtx_1(pfx, XEXP(x,0),lvl+1);
2986
+               zip_debug_rtx_1(pfx, XEXP(x,1),lvl+1);
2987
+               zip_debug_print(pfx, lvl, ")");
2988
+               break;
2989
+       case LE:        //
2990
+               zip_debug_print_m(pfx, lvl, "(LE", GET_MODE(x));
2991
+               zip_debug_rtx_1(pfx, XEXP(x,0),lvl+1);
2992
+               zip_debug_rtx_1(pfx, XEXP(x,1),lvl+1);
2993
+               zip_debug_print(pfx, lvl, ")");
2994
+               break;
2995
+       case LT:        //
2996
+               zip_debug_print_m(pfx, lvl, "(LT", GET_MODE(x));
2997
+               zip_debug_rtx_1(pfx, XEXP(x,0),lvl+1);
2998
+               zip_debug_rtx_1(pfx, XEXP(x,1),lvl+1);
2999
+               zip_debug_print(pfx, lvl, ")");
3000
+               break;
3001
+       case GEU:       //
3002
+               zip_debug_print_m(pfx, lvl, "(GEU", GET_MODE(x));
3003
+               zip_debug_rtx_1(pfx, XEXP(x,0),lvl+1);
3004
+               zip_debug_rtx_1(pfx, XEXP(x,1),lvl+1);
3005
+               zip_debug_print(pfx, lvl, ")");
3006
+               break;
3007
+       case GTU:       //
3008
+               zip_debug_print_m(pfx, lvl, "(GTU", GET_MODE(x));
3009
+               zip_debug_rtx_1(pfx, XEXP(x,0),lvl+1);
3010
+               zip_debug_rtx_1(pfx, XEXP(x,1),lvl+1);
3011
+               zip_debug_print(pfx, lvl, ")");
3012
+               break;
3013
+       case LEU:       //
3014
+               zip_debug_print_m(pfx, lvl, "(LEU", GET_MODE(x));
3015
+               zip_debug_rtx_1(pfx, XEXP(x,0),lvl+1);
3016
+               zip_debug_rtx_1(pfx, XEXP(x,1),lvl+1);
3017
+               zip_debug_print(pfx, lvl, ")");
3018
+               break;
3019
+       case LTU:       //
3020
+               zip_debug_print_m(pfx, lvl, "(LTU", GET_MODE(x));
3021
+               zip_debug_rtx_1(pfx, XEXP(x,0),lvl+1);
3022
+               zip_debug_rtx_1(pfx, XEXP(x,1),lvl+1);
3023
+               zip_debug_print(pfx, lvl, ")");
3024
+               break;
3025
+       case SCRATCH:   //
3026
+               zip_debug_print_m(pfx, lvl, "(SCRATCH)", GET_MODE(x));
3027
+               break;
3028
+       case SUBREG:
3029
+               { char buf[25];
3030
+               sprintf(buf, "(SUBREG %d/%d)", REGNO(XEXP(x,0)),
3031
+                       SUBREG_BYTE(x));
3032
+               zip_debug_print(pfx, lvl, buf);
3033
+               } break;
3034
+       default:
3035
+               { char buf[25];
3036
+               sprintf(buf, "(? = %d) -- calling DEBUG-RTX", GET_CODE(x));
3037
+               zip_debug_print(pfx, lvl, buf);
3038
+               debug_rtx(x);
3039
+               } break;
3040
+       }
3041
+}
3042
+
3043
+void
3044
+zip_debug_rtx_pfx(const char *pfx, const_rtx x) {
3045
+       zip_debug_rtx_1(pfx, x, 0);
3046
+}
3047
+
3048
+void
3049
+zip_debug_rtx(const_rtx x) {
3050
+       zip_debug_rtx_pfx("", x);
3051
+}
3052
+
3053
+void
3054
+zip_debug_insn(rtx_insn *insn ATTRIBUTE_UNUSED) {
3055
+}
3056
+
3057
+void
3058
+zip_debug_bb(basic_block bb) {
3059
+       rtx_insn        *insn;
3060
+
3061
+       fprintf(stderr, "************ BASIC-BLOCK ***************\n");
3062
+       FOR_BB_INSNS(bb, insn)
3063
+       {
3064
+               zip_debug_rtx(insn);
3065
+       }
3066
+}
3067
+
3068
+
3069
+static bool
3070
+zip_legitimate_operand_address(const_rtx x, bool strict)
3071
+{
3072
+       const bool      dbg = ((ALL_DEBUG_ON)||(true))&&(!ALL_DEBUG_OFF);
3073
+
3074
+       if (dbg) fprintf(stderr, "ZIP-LEGITIMATE-OPERAND-ADDRESS\n");
3075
+       if (dbg) zip_debug_rtx_pfx("Test: ", x);
3076
+
3077
+       /*
3078
+        * While this might seem to make sense, it sends GCC into an infinite
3079
+        * loop.
3080
+        *
3081
+       if (GET_CODE(x) == MEM) {
3082
+               return (zip_legitimate_operand_address(XEXP(x,0),strict));
3083
+       }
3084
+       */
3085
+
3086
+       /*
3087
+       if (MEM_P(x)) {
3088
+               if((REG_P(XEXP(x,0)))||(GET_CODE(XEXP(x,0))==PLUS))
3089
+                       return (zip_legitimate_operand_address(XEXP(x,0),strict));
3090
+       } else
3091
+       */
3092
+
3093
+       if (NULL_RTX == x)
3094
+               return false;
3095
+       else if ((GET_MODE(x) != SImode)&&(GET_MODE(x) != VOIDmode))
3096
+               return false;
3097
+       else if (REG_P(x)) {
3098
+               // Only insist the register b a valid register if strict is true
3099
+               if (dbg) fprintf(stderr, "ZIP-LEGITIMATE-OPERAND-ADDRESS -> YES! (Reg)\n");
3100
+               return (!strict)||(REGNO(x) != zip_CC);
3101
+       } else if (GET_CODE(x) == PLUS) {
3102
+               // Is it a valid register?
3103
+               /*
3104
+               if (GET_CODE(XEXP(x,0))==PLUS) {
3105
+                       return (zip_legitimate_operand_address(XEXP(XEXP(x,0),0), strict))
3106
+                               &&(zip_const_address_operand(XEXP(XEXP(x,0),1)));
3107
+               } */
3108
+               if(!REG_P(XEXP(x,0))) {
3109
+                       if (dbg) fprintf(stderr, "ZIP-LEGITIMATE-OPERAND-ADDRESS -> No (No reg in +%s)\n",
3110
+                       (GET_CODE(XEXP(x,1))==REG)?", reg in op[1]":"");
3111
+                       return false;
3112
+               } if ((strict)&&(REGNO(XEXP(x,0)) == zip_CC)) {
3113
+                       if (dbg) fprintf(stderr, "ZIP-LEGITIMATE-OPERAND-ADDRESS -> No (Wrong reg in +, %d)\n", REGNO(XEXP(x,0)));
3114
+                       return false;
3115
+               } if ((GET_CODE(XEXP(x, 1)) == CONST_INT)
3116
+                       &&(INTVAL(XEXP(x, 1)) <= zip_max_anchor_offset)
3117
+                       &&(INTVAL(XEXP(x, 1)) >= zip_min_anchor_offset)) {
3118
+                       if (dbg) fprintf(stderr, "ZIP-LEGITIMATE-OPERAND-ADDRESS -> YES! (reg+int)\n");
3119
+                       return true;
3120
+               } if ((GET_CODE(XEXP(x, 1)) == LABEL_REF)
3121
+                       ||(GET_CODE(XEXP(x, 1)) == SYMBOL_REF)) {
3122
+                       // While we can technically support this, the problem
3123
+                       // is that the symbol address could be anywhere, and we
3124
+                       // have no way of recovering if it's outside of our
3125
+                       // 14 allowable bits.
3126
+                       if (dbg) fprintf(stderr, "ZIP-LEGITIMATE-OPERAND-ADDRESS -> No. (reg+lbl)\n");
3127
+                       return false;
3128
+               } if ((GET_CODE(XEXP(x, 1)) == MINUS)
3129
+                       &&((GET_CODE(XEXP(XEXP(x,1),0)) == LABEL_REF)
3130
+                               ||(GET_CODE(XEXP(XEXP(x,1),0)) == CONST_INT)
3131
+                               ||(GET_CODE(XEXP(XEXP(x,1),0)) == SYMBOL_REF))
3132
+                       &&((GET_CODE(XEXP(XEXP(x,1),1)) == LABEL_REF)
3133
+                               ||(GET_CODE(XEXP(XEXP(x,1),0)) == CONST_INT)
3134
+                               ||(GET_CODE(XEXP(XEXP(x,1),1)) == SYMBOL_REF))
3135
+                       &&((GET_CODE(XEXP(XEXP(x,1),0)))
3136
+                               == (GET_CODE(XEXP(XEXP(x,1),1))))) {
3137
+                       if (dbg) fprintf(stderr, "ZIP-LEGITIMATE-OPERAND-ADDRESS -> YES! (lbl-lbl+reg)\n");
3138
+                       return true;
3139
+               }
3140
+       }
3141
+
3142
+       if (dbg) fprintf(stderr, "ZIP-LEGITIMATE-OPERAND-ADDRESS -> No\n");
3143
+       if (dbg) zip_debug_rtx(x);
3144
+       return false;
3145
+}
3146
+
3147
+static bool
3148
+zip_legitimate_move_operand_p(machine_mode mode ATTRIBUTE_UNUSED, rtx x, bool strict) {
3149
+       const bool      dbg = ((ALL_DEBUG_ON)||(false))&&(!ALL_DEBUG_OFF);
3150
+
3151
+       if (dbg) fprintf(stderr, "ZIP-VALID-MOVE-OPERAND\n");
3152
+       if (dbg) zip_debug_rtx_pfx("VMov?: ", x);
3153
+
3154
+       if (NULL_RTX == x)
3155
+               return false;
3156
+       else if (REG_P(x)) {
3157
+               // Only insist the register b a valid register if strict is true
3158
+               if (dbg) fprintf(stderr, "ZIP-VALID-MOVE-OPERAND -> YES! (Reg)\n");
3159
+               return (!strict)||(REGNO(x) != zip_CC);
3160
+       } else if (GET_CODE(x) == PLUS) {
3161
+               // Is it a valid register?
3162
+               if (GET_CODE(XEXP(x,0))==PLUS) {
3163
+                       return (zip_legitimate_operand_address(XEXP(x,0), strict))
3164
+                               &&(zip_const_address_operand(XEXP(x,0)));
3165
+               } if(GET_CODE(XEXP(x,0)) != REG) {
3166
+                       if (dbg) fprintf(stderr, "ZIP-VALID-MOVE-OPERAND -> No (No reg in +%s)\n",
3167
+                       (GET_CODE(XEXP(x,1))==REG)?", reg in op[1]":"");
3168
+                       return false;
3169
+               } if ((strict)&&(REGNO(XEXP(x,0)) == zip_CC)) {
3170
+                       if (dbg) fprintf(stderr, "ZIP-VALID-MOVE-OPERAND -> No (Wrong reg in +, %d)\n", REGNO(XEXP(x,0)));
3171
+                       return false;
3172
+               } if ((GET_CODE(XEXP(x, 1)) == CONST_INT)
3173
+                       &&(INTVAL(XEXP(x, 1)) <= zip_max_mov_offset)
3174
+                       &&(INTVAL(XEXP(x, 1)) >= zip_min_mov_offset)) {
3175
+                       if (dbg) fprintf(stderr, "ZIP-VALID-MOVE-OPERAND -> YES! (reg+int)\n");
3176
+                       return true;
3177
+               }
3178
+       }
3179
+
3180
+       if (dbg) fprintf(stderr, "ZIP-VALID-MOVE-OPERAND -> No\n");
3181
+       if (dbg) zip_debug_rtx(x);
3182
+       return false;
3183
+}
3184
+
3185
+int
3186
+zip_pd_mov_operand(rtx op)
3187
+{
3188
+       const bool      dbg = ((ALL_DEBUG_ON)||(false))&&(!ALL_DEBUG_OFF);
3189
+
3190
+       if (dbg) fprintf(stderr, "ZIP-VALID-MOV(predicate) for OPERAND\n");
3191
+       return zip_legitimate_move_operand_p(VOIDmode, op, !can_create_pseudo_p());
3192
+}
3193
+
3194
+int
3195
+zip_address_operand(rtx op)
3196
+{
3197
+       const bool      dbg = ((ALL_DEBUG_ON)||(false))&&(!ALL_DEBUG_OFF);
3198
+
3199
+       if (dbg) fprintf(stderr, "ZIP-ADDRESS for OPERAND\n");
3200
+       return zip_legitimate_operand_address(op, !can_create_pseudo_p());
3201
+}
3202
+
3203
+int
3204
+zip_pd_address_operand(rtx op)
3205
+{
3206
+       const bool      dbg = ((ALL_DEBUG_ON)||(false))&&(!ALL_DEBUG_OFF);
3207
+
3208
+       if (dbg) fprintf(stderr, "ZIP-ADDRESS(predicate) for OPERAND\n");
3209
+       return zip_legitimate_operand_address(op, !can_create_pseudo_p());
3210
+}
3211
+
3212
+int
3213
+zip_ct_address_operand(rtx op)
3214
+{
3215
+       const bool      dbg = ((ALL_DEBUG_ON)||(false))&&(!ALL_DEBUG_OFF);
3216
+
3217
+       if (dbg) fprintf(stderr, "ZIP-ADDRESS(constraint) for OPERAND\n");
3218
+       return zip_legitimate_operand_address(op, !can_create_pseudo_p());
3219
+}
3220
+
3221
+int
3222
+zip_const_address_operand(rtx x) {
3223
+       const bool      dbg = ((ALL_DEBUG_ON)||(false))&&(!ALL_DEBUG_OFF);
3224
+
3225
+       if (dbg) fprintf(stderr, "is ZIP-CONST-ADDRESS?\n");
3226
+       if (dbg) zip_debug_rtx(x);
3227
+       if ((GET_MODE(x) != SImode)&&(GET_MODE(x) != VOIDmode))
3228
+               return false;
3229
+       if ((GET_CODE(x) == LABEL_REF)
3230
+                       ||(GET_CODE(x) == CODE_LABEL)
3231
+                       ||(GET_CODE(x) == SYMBOL_REF)) {
3232
+               if (dbg) fprintf(stderr, "is ZIP-CONST-ADDRESS? -> YES!\n");
3233
+               return true;
3234
+       } else if (CONST_INT_P(x)) {
3235
+               if (dbg) fprintf(stderr, "is ZIP-CONST-ADDRESS? -> YES!\n");
3236
+               return true;
3237
+       } else if (GET_CODE(x) == PLUS) {
3238
+               if (dbg) fprintf(stderr, "is ZIP-CONST-ADDRESS(PLUS)\n");
3239
+               return ((zip_const_address_operand(XEXP(x,0)))
3240
+                       &&(CONST_INT_P(XEXP(x,1))));
3241
+       } else if (GET_CODE(x) == MINUS) {
3242
+               if (dbg) fprintf(stderr, "is ZIP-CONST-ADDRESS(MINUS)\n");
3243
+               return ((zip_const_address_operand(XEXP(x,0)))
3244
+                       &&(zip_const_address_operand(XEXP(x,1))));
3245
+       }
3246
+
3247
+       if (dbg) fprintf(stderr, "is ZIP-CONST-ADDRESS? -> No\n");
3248
+       if (dbg) zip_debug_rtx(x);
3249
+       return false;
3250
+}
3251
+
3252
+int
3253
+zip_ct_const_address_operand(rtx x) {
3254
+       const bool      dbg = ((ALL_DEBUG_ON)||(false))&&(!ALL_DEBUG_OFF);
3255
+
3256
+       if (dbg) fprintf(stderr, "ZIP-CONST-ADDRESS(constraint)\n");
3257
+       return zip_const_address_operand(x);
3258
+}
3259
+
3260
+int
3261
+zip_pd_const_address_operand(rtx x) {
3262
+       const bool      dbg = ((ALL_DEBUG_ON)||(false))&&(!ALL_DEBUG_OFF);
3263
+
3264
+       if (dbg) fprintf(stderr, "ZIP-CONST-ADDRESS(predicate)\n");
3265
+       return zip_const_address_operand(x);
3266
+}
3267
+
3268
+
3269
+static bool
3270
+zip_legitimate_address_p(machine_mode mode ATTRIBUTE_UNUSED, rtx x, bool strict)
3271
+{
3272
+       const bool      dbg = ((ALL_DEBUG_ON)||(false))&&(!ALL_DEBUG_OFF);
3273
+
3274
+       if (dbg) fprintf(stderr, "Zip-LEGITIMATE-ADDRESS-P\n");
3275
+       if (dbg) zip_debug_rtx(x);
3276
+
3277
+       // Only insist the register be a valid register if strict is true
3278
+       if (zip_legitimate_operand_address(x, strict))
3279
+               return true;
3280
+       else if (zip_const_address_operand(x))
3281
+               return true;
3282
+
3283
+       return false;
3284
+}
3285
+
3286
+void
3287
+zip_asm_output_def(FILE *stream, const char *name, const char *value)
3288
+{
3289
+       assemble_name(stream, name);
3290
+       fprintf(stream, "\t.equ ");
3291
+       assemble_name(stream, value);
3292
+       fputc('\n', stream);
3293
+}
3294
+
3295
+/*
3296
+bool   zip_load_address_lod(rtx regrx, rtx memrx) {
3297
+       fprintf(stderr, "ZIP-LOAD-ADDRESS-LOD\n");
3298
+       if (!MEM_P(memrx))
3299
+               return false;
3300
+       if (GET_CODE(regrx) != REG)
3301
+               return false;
3302
+       enum    rtx_code ic = GET_CODE(memrx);
3303
+       if ((ic == SYMBOL_REF)
3304
+               ||(ic == CODE_LABEL)
3305
+               ||(ic == LABEL_REF)) {
3306
+               if (can_create_pseudo_p()) {
3307
+                       rtx scratch_reg;
3308
+                       scratch_reg = gen_rtx_SCRATCH(SImode);
3309
+                       emit_insn(gen_movsi_ldi(scratch_reg, XEXP(memrx, 0)));
3310
+                       emit_insn(gen_movsi_lod(regrx, scratch_reg));
3311
+                       return true;
3312
+               } else return false;
3313
+       } else return false;
3314
+}
3315
+
3316
+bool   zip_load_address_sto(rtx memrx, rtx regrx) {
3317
+       fprintf(stderr,  "CHECKING-IN-W/ZIP_LOAD_ADDRESS_STORE\n");
3318
+       if (!MEM_P(memrx))
3319
+               return false;
3320
+       if (GET_CODE(regrx) != REG)
3321
+               return false;
3322
+       enum    rtx_code ic = GET_CODE(memrx);
3323
+       if ((ic == SYMBOL_REF)
3324
+               ||(ic == CODE_LABEL)
3325
+               ||(ic == LABEL_REF)) {
3326
+               if (can_create_pseudo_p()) {
3327
+                       rtx scratch_reg;
3328
+                       scratch_reg = gen_rtx_SCRATCH(SImode);
3329
+                       emit_insn(gen_movsi_ldi(scratch_reg, XEXP(memrx, 0)));
3330
+                       emit_insn(gen_movsi_sto(scratch_reg, regrx));
3331
+                       return true;
3332
+               } else return false;
3333
+       } return false;
3334
+}
3335
+*/
3336
+
3337
+#define        SREG_P(RTX) ((REG_P(RTX))||(SUBREG_P(RTX)))
3338
+
3339
+bool   zip_gen_move_rtl(rtx dst, rtx src) {
3340
+       const bool      dbg = ((ALL_DEBUG_ON)||(true))&&(!ALL_DEBUG_OFF);
3341
+
3342
+       if (dbg) fprintf(stderr, "ZIP-GEN-MOVE\n");
3343
+       if (dbg) zip_debug_rtx_pfx("FROM: ", src);
3344
+       if (dbg) zip_debug_rtx_pfx("TO  : ", dst);
3345
+       if (dbg) fprintf(stderr, "PSEUDOs: %s\n", can_create_pseudo_p()?"true":"false");
3346
+       if ((SREG_P(dst))&&(SREG_P(src))) {
3347
+               // First type of move... register to register
3348
+               if (dbg) fprintf(stderr, "ZIP-GEN-MOVE/REG -- EMIT\n");
3349
+               emit_insn(gen_movsi_reg(dst, src));
3350
+       } else if ((MEM_P(dst))&&(MEM_P(XEXP(dst,0)))) {
3351
+               if (can_create_pseudo_p()) {
3352
+                       rtx     tmp = gen_reg_rtx(Pmode);
3353
+                       zip_gen_move_rtl(tmp, XEXP(dst,0));
3354
+                       zip_gen_move_rtl(gen_rtx_MEM(GET_MODE(src), tmp), src);
3355
+               } else {
3356
+                       fprintf(stderr, "ZIP:Cannot move into mem w/o pseudo\n");
3357
+                       return false;
3358
+               }
3359
+       } else if ((MEM_P(src))&&(MEM_P(XEXP(src,0)))) {
3360
+               if (can_create_pseudo_p()) {
3361
+                       rtx     tmp = gen_reg_rtx(Pmode);
3362
+                       zip_gen_move_rtl(tmp, XEXP(src,0));
3363
+                       zip_gen_move_rtl(dst, gen_rtx_MEM(GET_MODE(src), tmp));
3364
+               } else {
3365
+                       fprintf(stderr, "ZIP: Cannot move from mem(mem(ptr)) w/o pseudo\n");
3366
+                       return false;
3367
+               }
3368
+       } else if ((SREG_P(dst))&&(GET_CODE(src)==PLUS)
3369
+                       &&(REG_P(XEXP(src,0)))
3370
+                       &&(CONST_INT_P(XEXP(src,1)))) {
3371
+               // Second type of move... register plus offset to register
3372
+               if ((INTVAL(XEXP(src, 1)) <= zip_max_mov_offset)
3373
+                       &&(INTVAL(XEXP(src, 1)) >= zip_min_mov_offset)) {
3374
+                       // The offset is within bounds
3375
+                       if (dbg) fprintf(stderr, "ZIP-GEN-MOVE/REG+OFF -- EMIT\n");
3376
+                       emit_insn(gen_movsi_reg_off(dst, XEXP(src,0),XEXP(src,1)));
3377
+               } else if (can_create_pseudo_p()) {
3378
+                       // The offset is out of bounds, get a new register and
3379
+                       // generate an add instruction to split this up.
3380
+                       rtx     tmp = gen_reg_rtx(GET_MODE(XEXP(src,0)));
3381
+
3382
+                       if (dbg) fprintf(stderr, "ZIP-GEN-MOVE/LDI\n");
3383
+                       emit_insn(gen_movsi_ldi(tmp, XEXP(src,1)));
3384
+                       if (dbg) fprintf(stderr, "ZIP-GEN-MOVE/ADD\n");
3385
+                       emit_insn(gen_addsi3(tmp, tmp, XEXP(src,0)));
3386
+                       if (dbg) fprintf(stderr, "ZIP-GEN-MOVE/DST\n");
3387
+                       emit_insn(gen_movsi_reg(dst, tmp));
3388
+               } else {
3389
+                       fprintf(stderr, "ZIP: Cannot move a(r),b w/o pseudo for out of bounds a\n");
3390
+                       return false;
3391
+               }
3392
+       } else if ((MEM_P(dst))&&(MEM_P(src))) {
3393
+               rtx     tmp;
3394
+               if (dbg) fprintf(stderr, "ZIP-GEN-MOVE/MEM/MEM\n");
3395
+               if (can_create_pseudo_p()) {
3396
+                       tmp = gen_reg_rtx(GET_MODE(src));
3397
+                       emit_insn(gen_movsi(tmp, src));
3398
+                       emit_insn(gen_movsi(dst, tmp));
3399
+               } else {
3400
+                       fprintf(stderr, "ZIP: Cannot move mem(A) to mem(B) w/o pseudo\n");
3401
+                       return false;
3402
+               }
3403
+       } else if ((SREG_P(dst))&&(MEM_P(src))) {
3404
+               // Memory load
3405
+               if (dbg) fprintf(stderr, "ZIP-GEN-MOVE/LOD\n");
3406
+               if (zip_legitimate_operand_address(XEXP(src, 0), false)) {
3407
+                       if (dbg) fprintf(stderr, "ZIP-GEN-MOVE/SIMPLE-LOD(ADDR)\n");
3408
+                       if (dbg) zip_debug_rtx_pfx("Smple-Addr: ", src);
3409
+                       if (REG_P(XEXP(src,0)))
3410
+                               mark_reg_pointer(XEXP(src,0),0);
3411
+                       else if ((GET_CODE(XEXP(src,0))==PLUS)
3412
+                                       &&(REG_P(XEXP(XEXP(src,0),0))))
3413
+                               mark_reg_pointer(XEXP(XEXP(src,0),0),0);
3414
+                       emit_insn(gen_movsi_lod(dst, src));
3415
+               } else if (zip_const_address_operand(XEXP(src,0))) {
3416
+                       if (can_create_pseudo_p()) {
3417
+                               rtx     tmp;
3418
+                               if (dbg) fprintf(stderr, "ZIP-GEN-MOVE/LOD(CONST-ADDR)\n");
3419
+                               tmp = gen_reg_rtx(Pmode);
3420
+                               mark_reg_pointer(tmp,0);
3421
+                               emit_insn(gen_movsi_ldi(tmp, XEXP(src,0)));
3422
+                               emit_insn(gen_movsi_lod(dst, gen_rtx_MEM(GET_MODE(src),tmp)));
3423
+                       } else {
3424
+                               if (dbg) fprintf(stderr, "ZIP-GEN-MOVE/LOD(CONST-ADDR,SELF)\n");
3425
+                               emit_insn(gen_movsi_ldi(dst, XEXP(src,0)));
3426
+                               emit_insn(gen_movsi_lod(dst, gen_rtx_MEM(GET_MODE(src),dst)));
3427
+                       }
3428
+               } else {
3429
+                       internal_error("%s", "ZIP/No usable load\n");
3430
+               }
3431
+       } else if ((MEM_P(dst))&&(SREG_P(src))) {
3432
+               // Memory store
3433
+               if (dbg) fprintf(stderr, "ZIP-GEN-MOVE/STO\n");
3434
+               if (zip_legitimate_operand_address(XEXP(dst, 0), false)) {
3435
+                       // If it's a legitimate address already, do nothing mor
3436
+                       if (dbg) fprintf(stderr, "ZIP-GEN-MOVE/STO(Legit Addr)--EMIT\n");
3437
+                       emit_insn(gen_movsi_sto(dst, src));
3438
+               } else if (zip_const_address_operand(XEXP(dst,0))) {
3439
+                       rtx     tmp;
3440
+
3441
+                       if (can_create_pseudo_p()) {
3442
+                               if (dbg) fprintf(stderr, "ZIP-GEN-MOVE/STO(Const Addr,Reg) -- EMIT\n");
3443
+                               // Otherwise we need to load the memory address
3444
+                               // into a register
3445
+                               tmp = gen_reg_rtx(Pmode);
3446
+                               mark_reg_pointer(tmp,0);
3447
+                               emit_insn(gen_movsi_ldi(tmp, XEXP(dst,0)));
3448
+                               //
3449
+                               // Then we can do our load
3450
+                               if (dbg) fprintf(stderr, "ZIP-GEN-MOVE/STO -- emit\n");
3451
+                               emit_insn(gen_movsi_sto(gen_rtx_MEM(GET_MODE(src), tmp), src));
3452
+                       } else {
3453
+                               fprintf(stderr, "Cannot move src -> mem(dst) w/o pseudo\n");
3454
+                               return false;
3455
+                       }
3456
+               } else if (can_create_pseudo_p())
3457
+                       internal_error("%s", "ZIP/No usable store\n");
3458
+               else {
3459
+                       fprintf(stderr, "ZIP/Unanticipated store problem\n");
3460
+                       return false;
3461
+               }
3462
+               if (dbg) fprintf(stderr, "ZIP-GEN-MOVE/STO -- DONE\n");
3463
+       } else if ((MEM_P(dst))&&((CONST_INT_P(src))||(GET_CODE(src)==SYMBOL_REF))) {
3464
+               // Store a constant into memory
3465
+               rtx     tmp;
3466
+
3467
+               if (can_create_pseudo_p()) {
3468
+                       if (dbg) fprintf(stderr, "ZIP-GEN-MOVE/CONST->MEM\n");
3469
+                       // Load the source constant into a register first
3470
+                       tmp = gen_reg_rtx((GET_MODE(src)==VOIDmode)?GET_MODE(dst):GET_MODE(src));
3471
+                       emit_insn(gen_movsi_ldi(tmp,src));
3472
+                       if (dbg) fprintf(stderr, "ZIP-GEN-MOVE/CONST->REG->MEM -- RECURSE\n");
3473
+
3474
+                       // Then do a normal move, recursing to handle memory
3475
+                       // properly
3476
+                       zip_gen_move_rtl(dst, tmp);
3477
+                       if (dbg) fprintf(stderr, "ZIP-GEN-MOVE/CONST->MEM -- DONE\n");
3478
+               } else {
3479
+                       fprintf(stderr, "ZIP/Cannot store constant into mem w/o pseudo\n");
3480
+                       return false;
3481
+               }
3482
+       } else if ((SREG_P(dst))&&(CONST_INT_P(src))) {
3483
+               // Load a constant into a register
3484
+               // The assembler really takes care of all of this, since
3485
+               // the assembler will split the constant if it doesn't fit
3486
+               // into a single instruction.
3487
+               if (dbg) fprintf(stderr, "ZIP-GEN-MOVE/CONST->REG\n");
3488
+               // if ((GET_MODE(dst)==VOIDmode)&&(GET_MODE(src)==VOIDmode))
3489
+                       // PUT_MODE(dst,SImode);
3490
+               emit_insn(gen_movsi_ldi(dst, src));
3491
+       } else if ((REG_P(dst))&&
3492
+                       ((LABEL_P(src))
3493
+                       ||(GET_CODE(src)==SYMBOL_REF)
3494
+                       ||(GET_CODE(src)==LABEL_REF))) {
3495
+               // Load a constant into a register
3496
+               // The assembler really takes care of all of this, since
3497
+               // the assembler will split the constant if it doesn't fit
3498
+               // into a single instruction.
3499
+               if (dbg) fprintf(stderr, "ZIP-GEN-MOVE/LABEL->REG\n");
3500
+               emit_insn(gen_movsi_ldi(dst, src));
3501
+       } else {
3502
+               fprintf(stderr, "ZIP/No usable move\n");
3503
+               zip_debug_rtx_pfx("TO  : ", dst);
3504
+               zip_debug_rtx_pfx("FROM: ", src);
3505
+               debug_rtx(dst);
3506
+               debug_rtx(src);
3507
+               return false;
3508
+       }
3509
+       if (dbg) fprintf(stderr, "ZIP-GEN-MOVE -- DONE\n");
3510
+       return true;
3511
+}
3512
+
3513
+const char *zip_set_zero_or_one(rtx condition, rtx dst) {
3514
+       const bool      dbg = ((ALL_DEBUG_ON)||(true))&&(!ALL_DEBUG_OFF);
3515
+       if (dbg) fprintf(stderr, "ZIP::SET-ZERO-OR-ONE\n");
3516
+       if (dbg) zip_debug_rtx_pfx("CND", condition);
3517
+       if (dbg) zip_debug_rtx_pfx("REG", dst);
3518
+       switch(GET_CODE(condition)) {
3519
+       case EQ:        return "LDI\t0,%0\n\tLDILO.Z\t1,%0";
3520
+       case NE:        return "LDI\t0,%0\n\tLDILO.NZ\t1,%0";
3521
+       case LT:        return "LDI\t0,%0\n\tLDILO.LT\t1,%0";
3522
+       case GT:        return "LDI\t0,%0\n\tLDILO.GT\t1,%0";
3523
+       case LE:        return "LDI\t1,%0\n\tLDILO.GT\t0,%0";
3524
+       case GE:        return "LDI\t0,%0\n\tLDILO.GE\t1,%0";
3525
+       case LTU:       return "LDI\t0,%0\n\tLDILO.C\t1,%0";
3526
+       case GTU:       return "LDI\t1,%0\n\tLDILO.C\t0,%0\n\tLDILO.Z\t0,%0";
3527
+       case LEU:       return "LDI\t0,%0\n\tLDILO.C\t1,%0\n\tLDILO.Z\t1,%0";
3528
+       case GEU:       return "LDI\t1,%0\n\tLDILO.C\t0,%0";
3529
+       default:
3530
+               zip_debug_rtx(condition);
3531
+               internal_error("CSTORE Unsupported condition");
3532
+               return NULL;
3533
+       }
3534
+}
3535
+
3536
+const char *zip_binary_movsicc(rtx_code condition, const char *op, const int opno) {
3537
+       static char     result[64] = "";
3538
+       switch(condition) {
3539
+               //
3540
+               // Result already exists in the iffalse register
3541
+               // Can't change it.  Therefore, on the
3542
+               // condition ... move true register to the
3543
+               // destination
3544
+               //
3545
+               case EQ:        sprintf(result, "%s.Z\t%%%d,%%0", op, opno); break;
3546
+               case NE:        sprintf(result, "%s.NZ\t%%%d,%%0", op, opno); break;
3547
+               case LT:        sprintf(result, "%s.LT\t%%%d,%%0", op, opno); break;
3548
+               case GT:        sprintf(result, "%s.GT\t%%%d,%%0", op, opno); break;
3549
+               // .LE doesn't exist on Zip CPU--turn this into two instructions
3550
+               case LE:        sprintf(result, "%s.LT\t%%%d,%%0\n\t%s.Z\t%%%d,%%0", op, opno, op, opno); break;
3551
+               case GE:        sprintf(result, "%s.GE\t%%%d,%%0", op, opno); break;
3552
+               case LTU:       sprintf(result, "%s.C\t%%%d,%%0", op, opno); break;
3553
+               //
3554
+               // .GTU doesn't exist on the Zip CPU either. We also note that
3555
+               // .C will never be set on an equal condition.  Therefore, we
3556
+               // turn this into a XOR.NZ 2,CC, which will set the .C condition
3557
+               // as long as .Z wasn't true.  We then undo this when we're
3558
+               // done.  This is possible since none of these instructions
3559
+               // (LDI/MOV/Lod conditional, nor Xor conditional) will ever set
3560
+               // the condition codes.
3561
+               //
3562
+               // This is obviously not very optimal.  Avoid this by all means
3563
+               // if you can
3564
+               case GTU:       sprintf(result, "XOR.NZ\t2,CC\n%s.C\t%%%d,%%0\n\tXOR.NZ\t2,CC", op, opno); break;
3565
+               // .LEU doesn't exist on Zip CPU either--turn this into another
3566
+               // two instructions
3567
+               case LEU:       sprintf(result, "%s.C\t%%%d,%%0\n\t%s.Z\t%%%d,%%0", op, opno, op, opno); break;
3568
+               //
3569
+               // .GEU doesn't exist on Zip CPU.  Implementing it her is
3570
+               // painful.  We can change the condition codes to make it so,
3571
+               // but the instruction requires the condition codes not be
3572
+               // changed.  Hence, we must change them back if we do so.
3573
+               //
3574
+               // .C will be set on less than but not equal.  Hence !.C will
3575
+               // be true on greater than or equal.
3576
+               case GEU:       sprintf(result, "XOR\t2,CC\n%s.C\t%%%d,%%0\n\tXOR\t2,CC", op, opno); break;
3577
+               default:
3578
+                       internal_error("MOVSICC(BINARY) Unsupported condition");
3579
+                       return NULL;
3580
+       } return result;
3581
+}
3582
+
3583
+const char *zip_tertiary_movsicc(rtx condition, const char *optrue, const char *opfalse) {
3584
+       static  char    result[64] = "";
3585
+       switch(GET_CODE(condition)) {
3586
+               case EQ:        sprintf(result,"%s\t%%3,%%0\n\t%s.Z\t%%2,%%0", opfalse, optrue); break;
3587
+               case NE:        sprintf(result,"%s\t%%3,%%0\n\t%s.NZ\t%%2,%%0", opfalse, optrue); break;
3588
+               case LT:        sprintf(result,"%s\t%%3,%%0\n\t%s.LT\t%%2,%%0", opfalse, optrue); break;
3589
+               case GT:        sprintf(result,"%s\t%%3,%%0\n\t%s.GT\t%%2,%%0", opfalse, optrue); break;
3590
+               // LE doesn't exist on a Zip CPU.  Accomplish this by
3591
+               // reversing the condition: i.e., load the false value into
3592
+               // the register, and the on condition load the true value.
3593
+               case LE:        sprintf(result,"%s\t%%2,%%0\n\t%s.GT\t%%3,%%0", optrue, opfalse); break;
3594
+               case GE:        sprintf(result,"%s\t%%3,%%0\n\t%s.GE\t%%2,%%0", opfalse, optrue); break;
3595
+               case LTU:       sprintf(result,"%s\t%%3,%%0\n\t%s.C\t%%2,%%0", opfalse, optrue); break;
3596
+               //
3597
+               case GTU:       sprintf(result,"%s\t%%2,%%0\n\t%s.C\t%%3,%%0\n\t%s.Z\t%%3,%%0", optrue, opfalse, opfalse); break;
3598
+               case LEU:       sprintf(result,"%s\t%%3,%%0\n\t%s.C\t%%2,%%0\n\t%s.Z\t%%2,%%0", opfalse, optrue, optrue); break;
3599
+               case GEU:       sprintf(result,"%s\t%%2,%%0\n\t%s.C\t%%3,%%0\n", optrue, opfalse); break;
3600
+               default:
3601
+                       internal_error("MOVSICC Unsupported condition");
3602
+                       return NULL;
3603
+       } return result;
3604
+}
3605
+
3606
+const char *zip_movsicc(rtx dst, rtx condition, rtx iftrue, rtx iffalse) {
3607
+       const bool      dbg = ((ALL_DEBUG_ON)||(true))&&(!ALL_DEBUG_OFF);
3608
+       if (dbg) fprintf(stderr, "ZIP::MOVSICC\n");
3609
+       if (dbg) zip_debug_rtx_pfx("DST", dst);
3610
+       if (dbg) zip_debug_rtx_pfx("CND", condition);
3611
+       if (dbg) zip_debug_rtx_pfx("TRU", iftrue);
3612
+       if (dbg) zip_debug_rtx_pfx("FAL", iffalse);
3613
+       if ((REG_P(iftrue))&&(REGNO(dst)==REGNO(iftrue))) {
3614
+               if (dbg) fprintf(stderr, "ZIP::MOVSICC -- CASE if(X) -> R\n");
3615
+               if (zip_legitimate_move_operand_p(SImode, iffalse, true))
3616
+                       return zip_binary_movsicc(reverse_condition(GET_CODE(condition)), "MOV", 3);
3617
+               else if (zip_const_address_operand(iffalse))
3618
+                       return zip_binary_movsicc(reverse_condition(GET_CODE(condition)), "LDI", 3);
3619
+               else if (zip_const_address_operand(iffalse))
3620
+                       return zip_binary_movsicc(reverse_condition(GET_CODE(condition)), "LDI", 3);
3621
+               else if ((MEM_P(iffalse))&&(zip_legitimate_operand_address(XEXP(iffalse,0), true)))
3622
+                       return zip_binary_movsicc(reverse_condition(GET_CODE(condition)), "LOD", 3);
3623
+               else {
3624
+                       internal_error("MOVSICC Unsupported mode");
3625
+                       return NULL;
3626
+               }
3627
+       } if ((REG_P(iftrue))&&(REGNO(dst)==REGNO(iftrue))) {
3628
+               if (dbg) fprintf(stderr, "ZIP::MOVSICC -- CASE if(!X) -> R\n");
3629
+               if (zip_legitimate_move_operand_p(SImode, iftrue, true))
3630
+                       return zip_binary_movsicc(GET_CODE(condition), "MOV",2);
3631
+               else if (zip_const_address_operand(iffalse))
3632
+                       return zip_binary_movsicc(GET_CODE(condition), "LDI",2);
3633
+               else if (zip_const_address_operand(iffalse))
3634
+                       return zip_binary_movsicc(GET_CODE(condition), "LDI",2);
3635
+               else if ((MEM_P(iffalse))&&(zip_legitimate_operand_address(XEXP(iffalse,0), true)))
3636
+                       return zip_binary_movsicc(GET_CODE(condition), "LOD",2);
3637
+               else {
3638
+                       internal_error("MOVSICC Unsupported mode");
3639
+                       return NULL;
3640
+               }
3641
+       } if ((zip_const_address_operand(iftrue))&&(zip_const_address_operand(iffalse))) {
3642
+               if (dbg) fprintf(stderr, "ZIP::MOVSICC -- IF(X) #1 ELSE #2\n");
3643
+               return zip_tertiary_movsicc(condition, "LDI", "LDI");
3644
+       } if ((zip_const_address_operand(iftrue))&&(zip_legitimate_move_operand_p(SImode, iffalse, true))) {
3645
+               if (dbg) fprintf(stderr, "ZIP::MOVSICC -- IF(X) #1 ELSE A+B\n");
3646
+               return zip_tertiary_movsicc(condition, "LDI", "MOV");
3647
+       } if ((zip_legitimate_move_operand_p(SImode, iftrue, true))&&(zip_const_address_operand(iffalse))) {
3648
+               if (dbg) fprintf(stderr, "ZIP::MOVSICC -- IF(X) A+B ELSE #x\n");
3649
+               return zip_tertiary_movsicc(condition, "MOV", "LDI");
3650
+       } if ((zip_legitimate_move_operand_p(SImode, iftrue, true))
3651
+                       &&(zip_legitimate_move_operand_p(SImode, iffalse, true))) {
3652
+               if (dbg) fprintf(stderr, "ZIP::MOVSICC -- IF(X) A+B ELSE C+D\n");
3653
+               return zip_tertiary_movsicc(condition, "MOV", "MOV");
3654
+       }
3655
+       if ((MEM_P(iftrue))
3656
+               &&(zip_legitimate_operand_address(XEXP(iftrue,0), true))
3657
+               &&(zip_legitimate_move_operand_p(SImode, iffalse, true))) {
3658
+               if (dbg) fprintf(stderr, "ZIP::MOVSICC -- IF(X) A[B] ELSE C+D\n");
3659
+               return zip_tertiary_movsicc(condition, "LOD", "MOV");
3660
+       } if ((zip_legitimate_move_operand_p(SImode, iftrue, true))
3661
+               &&(MEM_P(iffalse))&&(zip_legitimate_operand_address(XEXP(iffalse,0), true))) {
3662
+               if (dbg) fprintf(stderr, "ZIP::MOVSICC -- IF(X) A+B ELSE C[D]\n");
3663
+               return zip_tertiary_movsicc(condition, "MOV", "LOD");
3664
+       } if ((MEM_P(iftrue))&&(zip_legitimate_operand_address(XEXP(iftrue,0), true))
3665
+               &&(MEM_P(iffalse))&&(zip_legitimate_operand_address(XEXP(iffalse,0), true))) {
3666
+               if (dbg) fprintf(stderr, "ZIP::MOVSICC -- IF(X) A[B] ELSE C[D]\n");
3667
+               return zip_tertiary_movsicc(condition, "LOD", "LOD");
3668
+       }
3669
+
3670
+       internal_error("MOVSICC Operands not supported");
3671
+}
3672
+
3673
+const char *zip_addsicc(rtx dst, rtx condition, rtx ifsrc, rtx addv ATTRIBUTE_UNUSED) {
3674
+       // We know upon entry that REG_P(dst) must be true
3675
+       if (!REG_P(dst))
3676
+               internal_error("%s","ADDSICC into something other than register");
3677
+       if ((REG_P(ifsrc))&&(REGNO(dst)==REGNO(ifsrc))) {
3678
+               switch (GET_CODE(condition)) {
3679
+               case EQ: return "ADD.Z\t%3,%0";
3680
+               case NE: return "ADD.NZ\t%3,%0";
3681
+               case LT: return "ADD.LT\t%3,%0";
3682
+               case GT: return "ADD.GT\t%3,%0";
3683
+               case LE: return "ADD.LT\t%3,%0\n\tADD.Z\t%3,%0";
3684
+               case GE: return "ADD.GE\t%3,%0";
3685
+               case LTU: return "ADD.C\t%3,%0";
3686
+               case LEU: return "ADD.C\t%3,%0\n\tADD.Z\t%3,%0";
3687
+               case GEU: return "XOR\t2,CC\n\tADD.C\t%3,%0\n\tXOR\t2,CC";
3688
+               // Can do a GEU comparison, and then undo on the Zero condition
3689
+               case GTU: return "XOR\t2,CC\n\tADD.C\t%3,%0\n\tSUB.Z\t%3,%0\n\tXOR\t2,CC";
3690
+               default:
3691
+                       internal_error("%s", "Zip/No usable addsi expansion");
3692
+                       break;
3693
+               }
3694
+       } else {
3695
+               // MOV A+REG,REG
3696
+               switch (GET_CODE(condition)) {
3697
+               case EQ: return "MOV.Z\t%3+%2,%0";
3698
+               case NE: return "MOV.NZ\t%3+%2,%0";
3699
+               case LT: return "MOV.LT\t%3+%2,%0";
3700
+               case GT: return "MOV.GT\t%3+%2,%0";
3701
+               case LE: return "MOV.LT\t%3+%2,%0\n\tMOV.Z\t%3+%2,%0";
3702
+               case GE: return "MOV.GE\t%3+%2,%0";
3703
+               case LTU: return "MOV.C\t%3+%2,%0";
3704
+               case LEU: return "MOV.C\t%3+%2,%0\n\tMOV.Z\t%3+%2,%0";
3705
+               case GEU: return "XOR\t2,CC\n\tMOV.C\t%3+%2,%0\n\tXOR\t2,CC";
3706
+               // Can do a GEU comparison, and then undo on the Zero condition
3707
+               // EXCEPT: with a move instruction, what's there to undo?  We
3708
+               // just clobbered our register!
3709
+               // case GTU: return "XOR\t2,CC\n\tMOV.C\t%3,%0\n\tSUB.Z\t%3,%0XOR\t2,CC";
3710
+               default:
3711
+                       internal_error("%s", "Zip/No usable addsi(reg,reg) expansion");
3712
+                       break;
3713
+               }
3714
+       }
3715
+
3716
+       return "BREAK";
3717
+}
3718
+
3719
+static void
3720
+zip_canonicalize_comparison(int *code ATTRIBUTE_UNUSED, rtx *op0 ATTRIBUTE_UNUSED, rtx *op1 ATTRIBUTE_UNUSED, bool preserve_op0 ATTRIBUTE_UNUSED)
3721
+{
3722
+/*
3723
+ * While I'd like to keep and have this code, it does absolutely nothing.  The
3724
+ * code apparently only gets called on non-CC0 targets.
3725
+ *
3726
+ *
3727
+       const bool      dbg = true;
3728
+
3729
+       if (dbg) fprintf(stderr, "CANONICALIZE ...%s\n", (preserve_op0)?"(Preserve Op0)":"");
3730
+       if (dbg) zip_debug_rtx_pfx("CODE", gen_rtx_fmt_ee((rtx_code)*code, VOIDmode, cc0_rtx, const0_rtx));
3731
+       if (dbg) zip_debug_rtx_pfx("OP0 ", *op0);
3732
+       if (dbg) zip_debug_rtx_pfx("OP1 ", *op1);
3733
+
3734
+       if ((!preserve_op0)&&((*code == LE)||(*code == GTU)||(*code == GEU))) {
3735
+               rtx tem = *op0;
3736
+               *op0 = *op1;
3737
+               *op1 = tem;
3738
+               *code = (int)swap_condition((enum rtx_code)*code);
3739
+       }
3740
+
3741
+       if ((*code == LE)||(*code == LEU)||(*code==GTU)) {
3742
+               int     offset = (*code == GTU) ? 1 : -1;
3743
+               bool    swap = false;
3744
+               // A < B => A <= B-1
3745
+               if (CONST_INT_P(*op1)) {
3746
+                       *op1 = GEN_INT(INTVAL(*op1)+offset);
3747
+                       swap = true;
3748
+               } else if (REG_P(*op1)) {
3749
+                       *op1 = plus_constant(SImode, *op1, offset, true);
3750
+                       swap = true;
3751
+               } else if ((GET_CODE(*op1)==PLUS)&&(CONST_INT_P(XEXP(*op1,1)))){
3752
+                       *op1 = plus_constant(GET_MODE(*op1),XEXP(*op1,0),
3753
+                                       INTVAL(XEXP(*op1,1))+offset);
3754
+                       swap = true;
3755
+               } if (swap) {
3756
+                       if (*code == LE)
3757
+                               (*code) = LT;
3758
+                       else if (*code == LEU)
3759
+                               (*code) = LTU;
3760
+                       else // (*code) == GTU
3761
+                               (*code) = GEU;
3762
+               }
3763
+       }
3764
+*/
3765
+}
3766
+
3767
+static int     zip_memory_move_cost(machine_mode mode, reg_class_t ATTRIBUTE_UNUSED, bool in) {
3768
+       int     rv = 14;
3769
+       if ((mode == DImode)||(mode == DFmode))
3770
+               rv += 2;
3771
+       return rv;
3772
+}
3773
+
3774
+
3775
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/zip/zip.h gcc-5.3.0-zip/gcc/config/zip/zip.h
3776
--- gcc-5.3.0-original/gcc/config/zip/zip.h     1969-12-31 19:00:00.000000000 -0500
3777
+++ gcc-5.3.0-zip/gcc/config/zip/zip.h  2016-03-05 12:28:06.303411350 -0500
3778
@@ -0,0 +1,3667 @@
3779
+////////////////////////////////////////////////////////////////////////////////
3780
+//
3781
+// Filename:   gcc/config/zip/zip.h
3782
+//
3783
+// Project:    Zip CPU backend for the GNU Compiler Collection
3784
+//
3785
+// Purpose:
3786
+//
3787
+// Creator:    Dan Gisselquist, Ph.D.
3788
+//             Gisselquist Technology, LLC
3789
+//
3790
+////////////////////////////////////////////////////////////////////////////////
3791
+//
3792
+// Copyright (C) 2016, Gisselquist Technology, LLC
3793
+//
3794
+// This program is free software (firmware): you can redistribute it and/or
3795
+// modify it under the terms of  the GNU General Public License as published
3796
+// by the Free Software Foundation, either version 3 of the License, or (at
3797
+// your option) any later version.
3798
+//
3799
+// This program is distributed in the hope that it will be useful, but WITHOUT
3800
+// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
3801
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3802
+// for more details.
3803
+//
3804
+// You should have received a copy of the GNU General Public License along
3805
+// with this program.  (It's in the $(ROOT)/doc directory, run make with no
3806
+// target there if the PDF file isn't present.)  If not, see
3807
+// <http://www.gnu.org/licenses/> for a copy.
3808
+//
3809
+// License:    GPL, v3, as defined and found on www.gnu.org,
3810
+//             http://www.gnu.org/licenses/gpl.html
3811
+//
3812
+//
3813
+////////////////////////////////////////////////////////////////////////////////
3814
+#ifndef        GCC_ZIP_H
3815
+#define        GCC_ZIP_H
3816
+
3817
+
3818
+//
3819
+//
3820
+// Zip CPU configuration registers
3821
+//
3822
+//
3823
+#define        ZIP_USER        0        // Assume we are in supervisor mode
3824
+#define        ZIP_MULTIPLY    1       // Assume we have multiply instructions
3825
+#define        ZIP_DIVIDE      1       // Assume we have divide instructions
3826
+#define        ZIP_FPU         0        // Assume we have no floating point instructions
3827
+#define        ZIP_PIPELINED   1       // Assume our instructions are pipelined
3828
+#define        ZIP_VLIW        1       // Assume we have the VLIW feature
3829
+#define        ZIP_ATOMIC      ((ZIP_PIPELINED)&&(ZIP_VLIW))
3830
+#define        ZIP_PIC         0        // Attempting to produce PIC code, with GOT
3831
+#define        ZIP_HAS_DI      1
3832
+
3833
+// Zip has 16 registers in each user mode.
3834
+//     Register 15 is the program counter (PC)
3835
+//     Register 14 is the condition codes (CC)
3836
+//     Register 13 is the stack pointer   (SP)
3837
+//     Register 12 (may be) the Global Offset Table pointer (GOT)
3838
+//     Register  0 (may be) the return address pointer
3839
+// Registers 16-31 may only be used in supervisor mode.
3840
+#define        is_ZIP_GENERAL_REG(REGNO)       ((REGNO)<13)
3841
+#define        is_ZIP_REG(REGNO)               ((REGNO)<16)
3842
+
3843
+#undef STARTFILE_SPEC
3844
+#define        STARTFILE_SPEC  "_start"
3845
+
3846
+#undef ENDFILE_SPEC
3847
+#define        ENDFILE_SPEC    ""
3848
+
3849
+#undef LIB_SPEC
3850
+#define        LIB_SPEC        "%{!g:-lc} %{g:-lg} -lzip"
3851
+
3852
+#define        zip_PC  15
3853
+#define        zip_CC  14
3854
+#define        zip_SP  13
3855
+#define        zip_FP  12
3856
+#define        zip_GOT 11
3857
+#define        zip_AP  10
3858
+#define        zip_R1  1
3859
+#define        zip_R0  0
3860
+
3861
+#define        ZIP_FIRST_ARG_REGNO     1
3862
+#define        ZIP_LAST_ARG_REGNO      5
3863
+#define        NUM_ARG_REGS            5
3864
+#define        MAX_PARM_REGS           5
3865
+
3866
+/* The overall framework of an assembler file */
3867
+
3868
+#undef ASM_SPEC
3869
+#define        ASM_COMMENT_START       ";"
3870
+#define        ASM_APP_ON              ""
3871
+#define        ASM_APP_OFF             ""
3872
+
3873
+#define        FILE_ASM_OP             "\t.file\n"
3874
+
3875
+/* Output and Generation of Labels */
3876
+#define        GLOBAL_ASM_OP           "\t.global\t"
3877
+
3878
+#undef BITS_PER_UNIT
3879
+#define        BITS_PER_UNIT   (32)
3880
+
3881
+/* Assembler Commands for Alignment */
3882
+#define        ASM_OUTPUT_ALIGN(STREAM,POWER)  \
3883
+               { int pwr = POWER; fprintf(STREAM, "\t.p2align %d\n", (pwr<2)?2:pwr); }
3884
+
3885
+
3886
+/* A C compound statement to output to stdio stream STREAM the assembler syntax
3887
+ * for an instruction operand X. */
3888
+#define        PRINT_OPERAND(STREAM, X, CODE)  zip_print_operand(STREAM, X, CODE)
3889
+#define        PRINT_OPERAND_ADDRESS(STREAM, X) zip_print_operand_address(STREAM, X)
3890
+
3891
+/* Passing arguments in registers */
3892
+#define        FUNCTION_VALUE_REGNO_P(REGNO)   ((REGNO)==zip_R1)
3893
+
3894
+/* Define how to find the value returned by a function.  VALTYPE is the data
3895
+ * type of the value (as a tree).  If the precise function being called is known
3896
+ * FUNC is its FUNCTION_DECL; otherwise, FUNC is 0. */
3897
+#define        FUNCTION_VALUE(VALTYPE, FUNC) gen_rtx_REG(TYPE_MODE(VALTYPE), zip_R1)
3898
+
3899
+/* Define how to find the value returned by a library function assuming the
3900
+ * value has mode MODE.
3901
+ */
3902
+#define        LIBCALL_VALUE(MODE)     gen_rtx_REG(MODE, zip_R1)
3903
+
3904
+
3905
+/* STACK AND CALLING */
3906
+
3907
+
3908
+/* Define this macro as a C expression that is nonzero for registers that are
3909
+ * used by the epilogue or the return pattern.  The stack and frame pointer
3910
+ * registers are already assumed to be used as needed.
3911
+ */
3912
+#define        EPILOGUE_USES(R)        (R == RETURN_ADDRESS_REGNUM)
3913
+
3914
+
3915
+/* Normal alignment required for function parameters on the stack, in bits.  All
3916
+ * stack parameters receive at leaswt this much alignment regardless of data
3917
+ * type. */
3918
+#define        PARM_BOUNDARY   32
3919
+
3920
+/* Alignment of field after 'int : 0' in a structure. */
3921
+#define        EMPTY_FIELD_BOUNDARY    32
3922
+
3923
+/* No data type wants to be aligned rounder than this. */
3924
+#define        BIGGEST_ALIGNMENT       32
3925
+
3926
+/* The best alignment to use in cases where we have a choice. */
3927
+#define        FASTEST_ALIGNMENT       32
3928
+
3929
+/* Every structures size must be a multiple of 32-bits. */
3930
+#define        STRUCTURE_SIZE_BOUNDARY 32
3931
+
3932
+/* PCC_BITFIELD_TYPE_MATTERS -- define this if you wish to imitate the the way
3933
+ * other C compilers handle alignment of bit-fields and the structures that
3934
+ * contain them.
3935
+ *
3936
+ * The behavior is that the type written for a named bit-field (int, short, or
3937
+ * other integer type) imposes an alignment for the entire structure, as if the
3938
+ * structure really did contain an ordinary field of that type.  In addition,
3939
+ * the bit-field is placed within the structure so that it would fit within
3940
+ * such a field, not crossing a boundary for it.
3941
+ *
3942
+ * Thus, no most machines, a named bit-field whose type is written as int would
3943
+ * not cross a four-byte boundary, and would force four-byte alignment for the
3944
+ * whole structure.  (The alignment used may not be four bytes; it is controlled
3945
+ * by other alignment parameters.)
3946
+ *
3947
+ * An unnamed bit-field will not affect the alignment of the containing
3948
+ * structure.
3949
+ *
3950
+ * If thhe macro is defined, its definition should be a C expression, a non
3951
+ * zero value for the expression enables this behavior.
3952
+ * Look at the fundamental type that is used for a bit-field and use that to
3953
+ * impose alignment on the enclosing structure.  struct s{int a:8}; should
3954
+ * have the same alignment as 'int', not 'char'.
3955
+ */
3956
+#undef PCC_BITFIELD_TYPE_MATTERS
3957
+#define        PCC_BITFIELD_TYPE_MATTERS       0
3958
+
3959
+/* MAX_FIXED_MODE_SIZE -- An integer expression for the size in bits of the
3960
+ * largest integer machine mode that should actually be used.  All integer
3961
+ * machine modes of this size and smaller can be used for structures and unions
3962
+ * with the appropriate sizes.  If this macro is undefined,
3963
+ * GET_MODE_BITSIZE(DImode) is assumed.
3964
+ *
3965
+ * ZipCPU -- The default looks good enough for us.
3966
+ */
3967
+
3968
+/* Make strings word-aligned so strcpy from constants will be faster. */
3969
+#define        CONSTANT_ALIGNMENT(EXP, ALIGN)  (((TREE_CODE(EXP)==STRING_CST)  \
3970
+       && ((ALIGN) < FASTEST_ALIGNMENT)) ? FASTEST_ALIGNMENT : (ALIGN))
3971
+
3972
+/* Make arrays of chars word-aligned for the same reasons. */
3973
+#define        DATA_ALIGNMENT(TYPE, ALIGN)     ((TREE_CODE(TYPE) == ARRAY_TYPE) \
3974
+       && (TYPE_MODE(TREE_TYPE(TYPE)) == QImode)               \
3975
+       && ((ALIGN < FASTEST_ALIGNMENT) ? FASTEST_ALIGNMENT : (ALIGN)))
3976
+
3977
+/* Generate Code for Profiling
3978
+ */
3979
+#define        FUNCTION_PROFILER(FILE,LABELNO)         (abort(), 0)
3980
+
3981
+
3982
+/* A C expression which is nonzero if register number NUM is suitable for use
3983
+ * as an index register in operand addresses.
3984
+ */
3985
+#define        REGNO_OK_FOR_INDEX_P(NUM)       0
3986
+
3987
+
3988
+/* A C compound statement with a conditional 'goto LABEL;' executed if X
3989
+ * (an RTX) is a legitimate memory address on the target machine for a memory
3990
+ * operand of mode MODE.
3991
+ */
3992
+/* 17.03 Run-time Target Specification */
3993
+
3994
+/* TARGET_CPU_CPP_BUILTINS() ... This function-like macro expands to a block of
3995
+ * code that defines built-in preprocessor macros and assertions for the target
3996
+ * CPU, using the functions builtin_define, builtin_define_std, and
3997
+ * builtin_assert.  When the front end calls this macro it provides a trailing
3998
+ * semicolon, and since it has finished command line option proccessing your
3999
+ * code can use those results freely.
4000
+ *
4001
+ * ZipCPU --- We should probably capture in this macro what capabilities the
4002
+ * command line parameters we've been given indicate that our CPU has.  That
4003
+ * way, code can be adjusted depending upon the CPU's capabilities.
4004
+ */
4005
+#define        TARGET_CPU_CPP_BUILTINS()                       \
4006
+       { builtin_define("__ZIPCPU__");                 \
4007
+       if (ZIP_FPU) builtin_define("__ZIPFPU__");      \
4008
+       if (ZIP_ATOMIC) builtin_define("__ZIPATOMIC__");        \
4009
+       }
4010
+       // If (zip_param_has_fpu)  builtin_define("__ZIPFPU__");
4011
+       // If (zip_param_has_div)  builtin_define("__ZIPDIV__");
4012
+       // If (zip_param_has_mpy)  builtin_define("__ZIPMPY__");
4013
+       // If (zip_param_has_lock) builtin_define("__ZIPLOCK__");
4014
+       // If (zip_param_supervisor) builtin_define("__ZIPUREGS__");
4015
+       // If (we support int64s) builtin_define("___int64_t_defined");
4016
+
4017
+/* TARGET_OS_CPP_BUILTINS() ... Similarly to TARGET_CPU_CPP_BUILTINS but this
4018
+ * macro is optional and is used for the target operating system instead.
4019
+ */
4020
+
4021
+/* Option macros: (we need to define these eventually ... )
4022
+ *
4023
+ *     TARGET_HANDLE_OPTION
4024
+ *     TARGET_HANDLE_C_OPTION
4025
+ *     TARGET_OBJ_CONSTRUCT_STRING_OBJECT
4026
+ *     TARGET_OBJ_DECLARE_UNRESOLVED_CLASS_REFERENCE
4027
+ *     TARGET_OBJ_DECLARE_CLASS_DEFINITION
4028
+ *     TARGET_STRING_OBJECT_REF_TYPE_P
4029
+ *     TARGET_CHECK_STRING_OBJECT_FORMAT_ARG
4030
+ *     TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE(VOID)
4031
+ *     C_COMMON_OVERRIDE_OTPTIONS
4032
+ *     TARGET_OPTION_OPTIMIZATION_TABLE
4033
+ *     TARGET_OPTION_INIT_STRUCT
4034
+ *     TARGET_OPTION_DEFAULT_PARAMS
4035
+ */
4036
+
4037
+/* SWITCHABLE_TARGET
4038
+ *
4039
+ * Zip CPU doesn't need this, so it defaults to zero.  No need to change it
4040
+ * here.
4041
+ */
4042
+
4043
+/* TARGET_FLOAT_EXCEPTIONS_ROUNDING_SUPPORTED_P(VOID) ... Returns true if the
4044
+ * target supports IEEE 754 floating-point exceptions and rounding modes, false
4045
+ * otherwise.  This is intended to relate to the float and double types, but not
4046
+ * necessarily "long double".  By default, returns true if the adddf3
4047
+ * instruction pattern is available and false otherwise, on the assumption that
4048
+ * hardware floating point supports exceptions and rounding modes but software
4049
+ * floating point does not.
4050
+ *
4051
+ * ZipCPU floating point is barely going to be functional, I doubt it will
4052
+ * support all of these bells and whistles when full functionality is even
4053
+ * achieved.  Therefore, we won't support these modes.  However, we can't just
4054
+ * set this to zero, so let's come back to this.
4055
+ */
4056
+// #warning "Wrong answer encoded to date"
4057
+// #undef      TARGET_FLOAT_EXCEPTIONS_ROUNDING_SUPPORTED_P(X)
4058
+// #define     TARGET_FLOAT_EXCEPTIONS_ROUNDING_SUPPORTED_P(X) 0
4059
+
4060
+/* 17.04 Defining data structures for per-function information */
4061
+
4062
+/* INIT_EXPANDERS ... Macro called to initialize any target specific
4063
+ * information.  This macro is called once per function, before generation of
4064
+ * any RTL has begun.  The intention is to allow the initialization of the
4065
+ * function pointer init_machine_status.
4066
+ */
4067
+// #warning "I may need to define this to handle function return addresses ..."
4068
+
4069
+/* 17.05 Storage Layout */
4070
+
4071
+/* Storage Layout */
4072
+#define        BITS_BIG_ENDIAN         0        // MSB has highest number
4073
+#define        BYTES_BIG_ENDIAN        1       // 1 if MSB is lowest number
4074
+#define        WORDS_BIG_ENDIAN        1       // 1 if MSW is lowest number
4075
+#define        FLOAT_WORDS_BIG_ENDIAN  1
4076
+#define        BITS_PER_WORD           32
4077
+// #define     MAX_BITS_PER_WORD       // defaults to BITS_PER_WORD
4078
+#define        UNITS_PER_WORD          1       // Storage units in a word, pwr of 2:1-8
4079
+#define        MIN_UNITS_PER_WORD      1       // Default is UNITS_PER_WORD
4080
+/* POINTER_SIZE ... Width of a pointer in bits.  You must specify a value no
4081
+ * wider than the width of Pmode.  If it is not equal to the width of Pmode,
4082
+ * you must define POINTERS_EXTEND_UNSIGNED. If you do not specify a value the
4083
+ * default is BITS_PER_WORD.
4084
+ *
4085
+ * ZipCPU --- All of our pointers are 32-bits, the width of our address bus.
4086
+ */
4087
+#define        POINTER_SIZE            32      // Ptr width in bits
4088
+/* POINTERS_EXTEND_UNSIGNED ... A C expression that determines how pointers
4089
+ * should be extended from ptr_mode to either Pmode or word_mode.  It is greater
4090
+ * than zero if pointers should be zero-extended, zero if they should be sign
4091
+ * extended, and negative if some other conversion is needed.  In the last case,
4092
+ * the extension is done by the target's ptr_extend instruction.
4093
+ *
4094
+ * You need not define this macro if the ptr_mode, Pmode, and word_mode are all
4095
+ * the same width.
4096
+ *
4097
+ * ZipCPU --- While we shouldn't need this, QImode and HImode have the same
4098
+ * number of bits as SImode.  Therefore, one might wish to convert between the
4099
+ * two.  Hence, we specify how we would do that here.
4100
+ */
4101
+#define        POINTERS_EXTEND_UNSIGNED        0
4102
+
4103
+/* PROMOTE_MODE(m,unsignedp,type) ... A macro to update m and unsignedp when an
4104
+ * object whose type is type and which has he specified mode and signedness is
4105
+ * to be stored in a register.  This macro is only called when type is a scalar
4106
+ * type.
4107
+ *
4108
+ * On most RISC machines, which only have operations that operate on a full
4109
+ * register, define this macro to set m to word_mode if m is an integer mode
4110
+ * narrower than BITS_PER_WORD.  In most cases, only integer modes should be
4111
+ * widened because wider precision floating-point operations are usually more
4112
+ * expensive than their narrower counterparts.
4113
+ *
4114
+ * For most machines, the macro definition does not change unsigndep.  However,
4115
+ * some machines, have instructions that preferentially handle either signed or
4116
+ * unsigned quantities of certain modes.  For example, on the DEC Alpha, 32-bit
4117
+ * loads from memory and 32-bit add instructions sign-extend the result to
4118
+ * 64-bits. On such machines, set unsignedp according to which kind of extension
4119
+ * is more efficient.
4120
+ *
4121
+ * Do not define this macro if it would never modify m.
4122
+ *
4123
+ * ZipCPU --- We need to always (if possible) promote everything to SImode where
4124
+ * we can handle things.  HImode and QImode just don't make sense on this CPU.
4125
+ */
4126
+#define        PROMOTE_MODE(M,U,T)     if ((GET_MODE_CLASS(M)==MODE_INT)&&(GET_MODE_SIZE(M)<2)) (M)=SImode;
4127
+
4128
+// TARGET_PROMOTE_FUNCTION_MODE
4129
+/* PARM_BOUNDARY ... Normal alignment required for function parameters on the
4130
+ * stack, in bits.  All stack parameters receive at least this much alignment
4131
+ * regardless of data type.  On most machines, this is the same as the size of
4132
+ * an integer.
4133
+ */
4134
+#define        PARM_BOUNDARY   32
4135
+
4136
+/* STACK_BOUNDARY ... Define this macro to the minimum alignment enforced by
4137
+ * hardware for the stack pointer on this machine.  The definition is a C
4138
+ * expression for the desired alignment (measured in bits).  This value is used
4139
+ * as a default if PREFERRED_STACK_BOUNDARY is not defined.  On most machines,
4140
+ * this should be the same as PARM_BOUNDARY.
4141
+ */
4142
+#define        STACK_BOUNDARY  PARM_BOUNDARY
4143
+
4144
+/* PREFERRED_STACK_BOUNDARY ... Define this ... */
4145
+
4146
+/* INCOMING_STACK_BOUNDARY
4147
+ */
4148
+
4149
+/* FUNCTION_BOUNDARY ... Alignment required for a function entry point, in bits.
4150
+ */
4151
+#define        FUNCTION_BOUNDARY       32
4152
+
4153
+/* BIGGEST_ALIGNMENT ... Biggest alignment that any data type can require on
4154
+ * this machine, in bits.  Note that this is not the biggest alignment that is
4155
+ * supported, just the biggest alignment that, when violated, may cause a fault.
4156
+ */
4157
+#define BIGGEST_ALIGNMENT      32
4158
+
4159
+/* MINIMUM_ATOMIC_ALIGNMENT ... If defined, the smallest alignment, that can be
4160
+ * given to an object that can be referenced in one operation, without
4161
+ * disturbing any nearby object.  Normally, this is BITS_PER_UNIT, but may be
4162
+ * larger on machines that don't have byte or halfword store operations.
4163
+ */
4164
+#define        MINIMUM_ATOMIC_ALIGNMENT        BITS_PER_UNIT
4165
+
4166
+/* STRICT_ALIGNMENT ... Set this nonzero if move instructions will actually
4167
+ * fail to work when given unaligned data.  If instructions will merely go
4168
+ * slower in that case, define this macro as 0.
4169
+ */
4170
+#define        STRICT_ALIGNMENT        1
4171
+
4172
+/* MAX_FIXED_MODE_SIZE ... An integer expression for the size in bits of the
4173
+ * largest integer machine mode that should actually be used.  All integer
4174
+ * machine modes of this size or smaller can be used for structures and unions
4175
+ * with the appropriate sizes.  If this macro is undefined,
4176
+ * GET_MODE_BITSIZE(DImode) is assumed.
4177
+ *
4178
+ * ZipCPU ... Get_MOD_BITSIZE(DImode) will be 64, and this is really not the
4179
+ * size on bits of the largest integer machine mode.  However, that's the case
4180
+ * with most DI implementations: A long is two words, spliced together.  We'd
4181
+ * like to support that eventually, but we need to get there.  Hence, let's use
4182
+ * compile time flag (ZIP_HAS_DI) that we can enable when we're ready.
4183
+ */
4184
+#if (ZIP_HAS_DI != 0)
4185
+#define        MAX_FIXED_MODE_SIZE     64
4186
+#else
4187
+#define        MAX_FIXED_MODE_SIZE     32
4188
+#endif
4189
+
4190
+
4191
+/* 17.06 Layout of Source Language Data Types */
4192
+
4193
+#undef CHAR_TYPE_SIZE
4194
+#undef SHORT_TYPE_SIZE
4195
+#undef INT_TYPE_SIZE
4196
+#undef LONG_TYPE_SIZE
4197
+#undef LONG_LONG_TYPE_SIZE
4198
+//
4199
+#define        CHAR_TYPE_SIZE  32
4200
+#define        SHORT_TYPE_SIZE 32
4201
+#define        INT_TYPE_SIZE   32
4202
+#define        LONG_TYPE_SIZE  32
4203
+#define        LONG_LONG_TYPE_SIZE     64
4204
+// BOOL_TYPE_SIZE defaults to CHAR_TYPE_SIZE
4205
+#undef FLOAT_TYPE_SIZE
4206
+#undef DOUBLE_TYPE_SIZE
4207
+#undef LONG_DOUBLE_TYPE_SIZE
4208
+#define        FLOAT_TYPE_SIZE         32
4209
+#define        DOUBLE_TYPE_SIZE        FLOAT_TYPE_SIZE // Zip CPU doesn't support dbls
4210
+#define        LONG_DOUBLE_TYPE_SIZE   64      // This'll need to be done via emulation
4211
+// SHORT_FRAC_TYPE_SIZE
4212
+// LONG_FFRACT_TYPE_SIZE
4213
+// LONG_LONG_FRACT_TIME_SIZE
4214
+#undef SHORT_ACCUM_TYPE_SIZE
4215
+#undef ACCUM_TYPE_SIZE
4216
+#undef LONG_ACCUM_TYPE_SIZE
4217
+#define        SHORT_ACCUM_TYPE_SIZE   SHORT_TYPE_SIZE
4218
+#define        ACCUM_TYPE_SIZE         INT_TYPE_SIZE
4219
+#define        LONG_ACCUM_TYPE_SIZE    LONG_TYPE_SIZE
4220
+
4221
+/* LIBGCC2_GNU_PREFIX ... This macro corresponds to the TARGET_GNU_PREFIX target
4222
+ * hook and should be defined if that hook is overriden to be true.  It causes
4223
+ * function names in libgcc to be changed to use a __gnu_ prefix for their name
4224
+ * rather than the default __.  A port which uses this macro should also arrange
4225
+ * to use t-gnu-prefix in the libgcc config.host.
4226
+ *
4227
+ * ZipCPU -- I see no reason to define and therefore change this behavior.
4228
+ */
4229
+
4230
+/* TARGET_FLT_EVAL_METHOD ... A C expression for the value for FLT_EVAL_METHOD
4231
+ * in float.h,, assuming, if applicable, that the floating-point control word
4232
+ * is in its default state.  If you do not define this macro the value of
4233
+ * FLT_EVAL_METHOD will be zero.
4234
+ *
4235
+ * ZipCPU --- ???
4236
+ */
4237
+
4238
+/* WIDEST_HARDWARE_FP_SIZE ... A C expression for the size in bits of the widest
4239
+ * floating-point format supported by the hardware.  If you define this macro,
4240
+ * you must specify a value less than or equal to the value of LONG_DOUBLE_...
4241
+ * If you do not define this macro, the value of LONG_DOUBLE_TYPE_SIZE is the
4242
+ * default.
4243
+ *
4244
+ * ZipCPU supports 32-bit IEEE floats--IF THE SUPPORT IS COMPILED IN!  This
4245
+ * really needs to be determined, then, based upon a compile time parameter
4246
+ * where the one compiling the code states whether or not the H/W even has
4247
+ * floating point support.
4248
+ *
4249
+ * For now, we'll assume it does--but once we implement GCC parameters, we'll
4250
+ * need to change this.
4251
+ */
4252
+#undef WIDEST_HARDWARE_FP_SIZE
4253
+// #warning "Definition needs to change if no FPU present"
4254
+#define        WIDEST_HARDWARE_FP_SIZE FLOAT_TYPE_SIZE
4255
+
4256
+/* DEFAULT_SIGNED_CHAR ... An expression whose value is 1 or 0, according to
4257
+ * whether the type char should be signed or unsigned by default.  The user
4258
+ * can always override this default with the options -fsigned-char and
4259
+ * -funsigned-char.
4260
+ *
4261
+ * ZipCPU--let's go with the default behavior.
4262
+ */
4263
+#define        DEFAULT_SIGNED_CHAR     1
4264
+
4265
+/* TARGET_DEFAULT_SHORT_ENUMS(VOID) ... This target hook should return true if
4266
+ * the compiler should give an enum type onyl as many bytes as it takes to
4267
+ * represent the range of possible values of that type.  It should return
4268
+ * false if all enum types should be allocated like int.
4269
+ *
4270
+ * The default is to return false.  This is what the ZipCPU needs, so we won't
4271
+ * override it.
4272
+ */
4273
+
4274
+/* SIZE_TYPE ... A C expression for a string describing the name of the data
4275
+ * type to use for size values.  The typedef name size_t is defined using the
4276
+ * contents of the string.
4277
+ *
4278
+ * If you don't define this macro, the default is "long unsigned int".  Since
4279
+ * on the ZipCPU this is a 32-bit number, and all ZipCPU values are 32-bits,
4280
+ * the default seems perfect for us.
4281
+ */
4282
+#define        SIZE_TYPE       "unsigned int"
4283
+
4284
+/* SIZETYPE ... GCC defines internal types () for expressions dealing with size.
4285
+ * This macro is a C expression for a string describing the name of the data
4286
+ * type from which the precision of sizetype is extracted.  The string has the
4287
+ * same restrictions as SIZE_TYPE string.  If you don't define this macro, the
4288
+ * default is SIZE_TYPE --- which seems good enough for us.
4289
+ */
4290
+
4291
+/* PTRDIFF_TYPE ... A C expression for a string describing the name of the data
4292
+ * type to use fo rthe result of subtracting two pointers.  The typedef name
4293
+ * ptrdiff_t is defined using the contents of the string.  See SIZE_TYPE for
4294
+ * more information.
4295
+ *
4296
+ * The default is "long int" which for the ZipCPU is 32-bits---still good enough
4297
+ * for us.
4298
+ */
4299
+#define        PTRDIFF_TYPE    "int"
4300
+
4301
+/* WCHAR_TYPE ... A C expression for a string describing the name of the data
4302
+ * type to use for wide characters.  The typedef name wchar_t is defined using
4303
+ * the contents of  the string.  If you don't define this macro, the default is
4304
+ * 'int'--good enough for ZipCPU.
4305
+ */
4306
+
4307
+/* WCHAR_TYPE_SIZE ... A C expression for the size in bits of the data type for
4308
+ * wide characters.  This is used in cpp, which cannot make use of WCHAR_TYPE.
4309
+ */
4310
+#undef WCHAR_TYPE_SIZE
4311
+#define        WCHAR_TYPE_SIZE 32
4312
+
4313
+/* WINT_TYPE ... A C expression for a string describing the name of the data
4314
+ * type to use for wide characters passed to printf and returned from getwc.
4315
+ * The typedef name wint_t is defined using the contents of the string.  See
4316
+ *
4317
+ * If you don't define this macro, the default is "unsigned int"--also best
4318
+ * for us again.
4319
+ */
4320
+
4321
+/* INTMAX_TYPE ... A C expression for a string describing the name of the
4322
+ * data type that can represent any value of any standard or extended signed
4323
+ * integer type.  The typedef name intmax_t is defined using the contents of
4324
+ * the string.
4325
+ *
4326
+ * If you don't define this macro, the default is the first of "int", "long int"
4327
+ * or "long long int" that has as much precision as "long long int".
4328
+ */
4329
+
4330
+/* UINTMAX_TYPE ... same as INTMAX_TYPE, but for unsigned
4331
+ */
4332
+
4333
+#undef SIG_ATOMIC_TYPE
4334
+#if (ZIP_ATOMIC != 0)
4335
+#define        SIG_ATOMIC_TYPE "int"
4336
+#else
4337
+#define        SIG_ATOMIC_TYPE NULL    // We have no atomic types, but registers
4338
+#endif
4339
+#undef INT8_TYPE
4340
+#define        INT8_TYPE               NULL    // We have no 8-bit integer type
4341
+#undef INT16_TYPE
4342
+#define        INT16_TYPE              NULL
4343
+#undef INT32_TYPE
4344
+#define        INT32_TYPE              "int"
4345
+#undef UINT8_TYPE
4346
+#define        UINT8_TYPE              NULL
4347
+#undef UINT16_TYPE
4348
+#define        UINT16_TYPE             NULL
4349
+#undef UINT32_TYPE
4350
+#define        UINT32_TYPE             "unsigned int"
4351
+#undef INT_LEAST8_TYPE
4352
+#define        INT_LEAST8_TYPE         "int"
4353
+#undef INT_LEAST16_TYPE
4354
+#define        INT_LEAST16_TYPE        "int"
4355
+#undef INT_LEAST32_TYPE
4356
+#define        INT_LEAST32_TYPE        "int"
4357
+#undef UINT_LEAST8_TYPE
4358
+#define        UINT_LEAST8_TYPE        "unsigned int"
4359
+#undef UINT_LEAST16_TYPE
4360
+#define        UINT_LEAST16_TYPE       "unsigned int"
4361
+#undef UINT_LEAST32_TYPE
4362
+#define        UINT_LEAST32_TYPE       "unsigned int"
4363
+#undef INT_FAST8_TYPE
4364
+#define        INT_FAST8_TYPE          "int"
4365
+#undef INT_FAST16_TYPE
4366
+#define        INT_FAST16_TYPE         "int"
4367
+#undef INT_FAST32_TYPE
4368
+#define        INT_FAST32_TYPE         "int"
4369
+#undef UINT_FAST8_TYPE
4370
+#define        UINT_FAST8_TYPE         "unsigned int"
4371
+#undef UINT_FAST16_TYPE
4372
+#define        UINT_FAST16_TYPE        "unsigned int"
4373
+#undef UINT_FAST32_TYPE
4374
+#define        UINT_FAST32_TYPE        "unsigned int"
4375
+#undef INTPTR_TYPE
4376
+#define        INTPTR_TYPE             "unsigned int"
4377
+#undef UINTPTR_TYPE
4378
+#define        UINTPTR_TYPE            "unsigned int"
4379
+
4380
+#undef INT64_TYPE
4381
+#undef UINT64_TYPE
4382
+#undef INT_LEAST64_TYPE
4383
+#undef UINT_LEAST64_TYPE
4384
+#undef INT_FAST64_TYPE
4385
+#undef UINT_FAST64_TYPE
4386
+
4387
+#if (ZIP_HAS_DI != 0)
4388
+#define        INT64_TYPE              "long int"
4389
+#define        UINT64_TYPE             "long unsigned int"
4390
+#define        INT_LEAST64_TYPE        "long int"
4391
+#define        UINT_LEAST64_TYPE       "long unsigned int"
4392
+#define        INT_FAST64_TYPE         "long int"
4393
+#define        UINT_FAST64_TYPE        "long unsigned int"
4394
+#else
4395
+#define        INT64_TYPE              NULL
4396
+#define        UINT64_TYPE             NULL
4397
+#define        INT_LEAST64_TYPE        NULL
4398
+#define        UINT_LEAST64_TYPE       NULL
4399
+#define        INT_FAST64_TYPE         NULL
4400
+#define        UINT_FAST64_TYPE        NULL
4401
+#endif
4402
+
4403
+#define        TARGET_PTRMEMFUNC_VBI_LOCATION  ptrmemfunc_vbit_in_pfn
4404
+
4405
+
4406
+/* 17.07 Register Usage / Register definitions */
4407
+
4408
+/* FIRST_PSEUDO_REGISTER ... Number of hardware registers known to the compiler.
4409
+ * They receive numbers 0 through FIRST_PSEUDO_REGISTER-1; thus the first
4410
+ * pseudo register's numbrer really is assigned the number
4411
+ * FIRST_PSEUDO_REGISTER.
4412
+ *
4413
+ * ZipCPU---There are 16 registers in the ZipCPU, numbered 0-15 with the CC
4414
+ * and PC register being numbered 14 and 15 respectively.  Therefore, the
4415
+ * compiler can take register number 16 and above and do whatever it wants
4416
+ * with it.
4417
+ */
4418
+#ifdef DEFINE_USER_REGS
4419
+#define        FIRST_PSEUDO_REGISTER   32
4420
+#else
4421
+#define        FIRST_PSEUDO_REGISTER   16
4422
+#endif
4423
+
4424
+/* FIXED_REGISTERS ... An initializer that says which registers are used for
4425
+ * fixed purposes all throughout the compiled code and are therefore not
4426
+ * available for general allocation.  These would include the stack pointer, the
4427
+ * frame pointer (except on machines where that can be used as a general
4428
+ * register when no frame pointer is needed), the program counter on machines
4429
+ * where that is considered one of the addressable registers, and any other
4430
+ * numbered register with a standard use.
4431
+ *
4432
+ * This information is expressed as a sequence of numbers, separated by commas,
4433
+ * and surrounded by braces.  The nth number is 1 if register n is fixed, 0
4434
+ * otherwise.
4435
+ *
4436
+ * For the Zip CPU, we have three fixed registers that are not available for
4437
+ * general allocation:
4438
+ *
4439
+ *     SP      The stack pointer
4440
+ *     CC      The condition codes and CPU state register
4441
+ *     PC      The program counter
4442
+ *
4443
+ * Other registers, such as FP (the frame pointer) or GBL (the global offset
4444
+ * table pointer) are registers that we hope will not be so fixed.
4445
+ */
4446
+#define        FIXED_REGISTERS         { 0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1 }
4447
+
4448
+/* CALL_USED_REGISTERS ... like FIXED_REGISTERS but has 1 for each register
4449
+ * that is clobbered (in general) by function calls as well as for fixed
4450
+ * registers.  This macro therefore identifies the registers that are not
4451
+ * available for general allocation of values that must live across function
4452
+ * calls.
4453
+ *
4454
+ * If a register has 0 in CALL_USED_REGISTERS, the compiler automatically saves
4455
+ * it on function entry and restores it on function exit, if the register is
4456
+ * used within the function.
4457
+ *
4458
+ * On the Zip CPU, we must save R0 (the return address), and (let's pick) any
4459
+ * register above R5.
4460
+ */
4461
+#define        CALL_USED_REGISTERS     { 0,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1 }
4462
+
4463
+/* CALL_REALLY_USED_REGISTERS ...  optional macro that, if not defined, defaults
4464
+ * to the value of CALL_USED_REGISTERS.
4465
+ */
4466
+
4467
+/* HARD_REGNO_CALL_PART_CLOBBERED(REGNO,MODE) ... A C expression that is nonzero
4468
+ * if it is not permissible to store a value of mode MODE in hard register REGNO
4469
+ * across a call without some part of it being clobbbered.  For most machines,
4470
+ * this macro need not be defined.  It is only required for machines that do
4471
+ * not preserve the eentire contents of a register across a call.
4472
+ *
4473
+ * In the Zip CPU, we clobber R0 with our return address during a call, so let's
4474
+ * make sure this gets included here.
4475
+ */
4476
+#define        HARD_REGNO_CALL_PART_CLOBBERED(REGNO,MODE)      (REGNO==0)
4477
+
4478
+/* TARGET_CONDITIONAL_REGISTER_USAGE(VOID) ... This hook may conditionally
4479
+ * modify five variables fixed_regs, call_used_regs, global_regs, reg_names, and
4480
+ * reg_class_contents, to take into account any dependence of these register
4481
+ * sets on target flags.  The first three of these are of type char[]
4482
+ * (interpreted as Boolean vectors).  global_regs is a const char *[] and
4483
+ * reg_class_contents is a HARD_REG_SET.  Before the macro is called,
4484
+ * fixed_regs, call_used_regs, reg_class_contents, and reg_names have been
4485
+ * initialized from FIXED_REGISTERS, CALL_USED_REGISTERS, REG_CLASS_CONTENTS,
4486
+ * and REGISTER_NAMES, respectively.  global_regs has been cleared, and any
4487
+ * -ffixed-reg, -fcall-used-reg, and -fcall-saved-reg command options have been
4488
+ * applied.
4489
+ *
4490
+ * ZipCPU -- I may need to return and define this depending upon how FP and
4491
+ * GBL register allocation go.  But for now, we'll leave this at its default
4492
+ * value.
4493
+ */
4494
+// #warning "Revisit me after FP and GBL allocation"
4495
+
4496
+/* INCOMING_REGNO(out) ... Define this macro if the target machine has register
4497
+ * windows. ...
4498
+ *
4499
+ * Zip CPU has no register windows.
4500
+ */
4501
+
4502
+/* OUTGOING_REGNO ... same thing.
4503
+ */
4504
+
4505
+/* LOCAL_REGNO ... same thing.
4506
+ */
4507
+
4508
+/* PC_REGNUM ... If the program counter has a register number, define this as
4509
+ * that register number.  Otherwise do not define it.
4510
+ */
4511
+#define        PC_REGNUM       zip_PC
4512
+
4513
+
4514
+/* REG_ALLOC_ORDER ... If defined, an initializer for a vector of integers,
4515
+ * containing the number of hard registers in the order in which GCC should
4516
+ * prefer to use them (from most preferred to least.
4517
+ *
4518
+ * If this macro is not definedd, registers are used lowest numbered first (all
4519
+ * else being equal).
4520
+ *
4521
+ * Since the default is the ZipCPU desired case, we won't define this here.
4522
+ */
4523
+
4524
+/* ADJUST_REG_ALLOC_ORDER ... on most machines it is not necessary to define
4525
+ * this macro, so we won't either.
4526
+ */
4527
+
4528
+/* HONOR_REG_ALLOC_ORDER ...
4529
+ */
4530
+
4531
+/* HONOR_REG_ALLOC_ORDER ... on most machines it is not necessary to define
4532
+ * this macro, so we won't either.
4533
+ */
4534
+
4535
+/* HARD_REGNO_NREGS(REGNO, MODE) ... A C expression for the number of
4536
+ * consecutive hard registers, starting at register number REGNO, required to
4537
+ * hold a value of mode MODE.
4538
+ *
4539
+ * On a machine where all registers are exactly one word, a suitable definition
4540
+ * is given of ((GET_MODE_SIZE(MODE)+UNITS_PER_WORD-1)/UNITS_PER_WORD.
4541
+ *
4542
+ * On ZipCPU, we might do
4543
+ *     ((((MODE)==DImode)||((MODE)==DFmode))?2:1)
4544
+ * but I think the default (above) code should work as well.  Hence, let's stick
4545
+ * with the default, lest someone try to create larger modes (TImode, OImode,
4546
+ * XImode) and expect us to follow them properly some how.
4547
+ *
4548
+ * Okay, now in hind sight, we know that the default doesn't work for our
4549
+ * architecture, since GET_MODE_SIZE(SImode)=4, not 1.  Thus, let's rearrange
4550
+ * this expression to work in bits rather than in bytes and we'll know more
4551
+ * of what we are doing.
4552
+ */
4553
+#undef HARD_REGNO_NREGS
4554
+#define        HARD_REGNO_NREGS(REGNO, MODE)   ((GET_MODE_SIZE(MODE)+UNITS_PER_WORD-1)\
4555
+               / (UNITS_PER_WORD))
4556
+
4557
+/* HARD_REGNO_NREGS_HAS_PADDING(REGNO,MODE) ... A C expression that is nonzero
4558
+ * if a value of mode MODE, stored in memory, ends with padding that causes it
4559
+ * to take up more space than in registers starting at register number REGNO
4560
+ * (as determined by multiplying GCC's notion of the size of the register when
4561
+ * containing this mode by the number of registers returned by HARD_REGNO_NREGS)
4562
+ * By default this is zero.
4563
+ *
4564
+ * Zip CPU --- The default looks good enough to me.
4565
+ */
4566
+
4567
+/* HARD_REGNO_NREGS_WITH_PADDING(REGNO, MODE)
4568
+ *
4569
+ * ZipCPU ---
4570
+ */
4571
+
4572
+/* REGMODE_NATURAL_SIZE(MODE) -- Define this macro if the natural size of
4573
+ * registers that hold values of mode mode is not the word size.  It is a C
4574
+ * expression that should give the natural size in bytes for the specified mode.
4575
+ * It is used by the register allocator to try to optimize its results.
4576
+ *
4577
+ * ZipCPU ---
4578
+ */
4579
+// #define     REGMODE_NATURAL_SIZE(MODE)      (((MODE)==DImode)?2:1)
4580
+
4581
+/* HARD_REGNO_MODE_OK ... A C expression that is nonzero if it is permissible
4582
+ * to store a value of mode MODE in a hard regsiter number REGNO (or in several
4583
+ * registers starting with that one).  For a machine where all registers are
4584
+ * equivalent, a suitable definition is '1'.  You need not include code to check
4585
+ * for the numbers of fixed registers, because the allocation mechanism
4586
+ * considered them to be always occupied.
4587
+ *
4588
+ * ZipCPU --- As long as you are already avoiding the fixed registers, the
4589
+ * suitable default definition mentioned above should be sufficient.
4590
+ */
4591
+#undef HARD_REGNO_MODE_OK
4592
+#define        HARD_REGNO_MODE_OK(R,M) 1
4593
+
4594
+/* HARD_REGNO_RENAME_OK(FROM,TO) ... A C expression that is nonzero if it is
4595
+ * okay to rename a hard register FROM to another hard register TO.  One common
4596
+ * use of this macro is to prevernt renaming of a register to another register
4597
+ * that is not saved by a prologue in an interrupt handler.  The default is
4598
+ * always nonzero.
4599
+ *
4600
+ * ZipCPU --- The default looks good enough to us.
4601
+ */
4602
+#undef HARD_REGNO_RENAME_OK
4603
+#define        HARD_REGNO_RENAME_OK(FROM,TO)   ((is_ZIP_GENERAL_REG(FROM))&&(is_ZIP_GENERAL_REG(TO)))
4604
+
4605
+
4606
+/* MODES_TIABLE_P(M1, M2) ... A C expression that is nonzero if a value of mode
4607
+ * M1 is accessible in mode M2 without copying.
4608
+ *
4609
+ * ZipCPU --- well, that's true for us (although we support scant few modes) ...
4610
+ * so lets' set to one.
4611
+ */
4612
+#define        MODES_TIEABLE_P(M1,M2)  1
4613
+
4614
+/* TARGET_HARD_REGNO_SCRATCH_OK(REGNO)
4615
+ * This target hook should return true if it is OK to use a hard register
4616
+ * REGNO has a scratch register in peephole2.  One common use of this macro is
4617
+ * to prevent using of a register that is not saved by a prologue in an
4618
+ * interrupt handler.  The default version of this hook always returns true.
4619
+ *
4620
+ * ZipCPU --- the default works for us as well.  If you are in an interrupt
4621
+ * context, you have an entirely new set of registers (the supervisor set), so
4622
+ * this is a non-issue.
4623
+ */
4624
+
4625
+/* AVOID_CCMODE_COPIES ... define this macro if the compiler should avoid
4626
+ * copies to/from CCmode register(s).  You should only define this macro if
4627
+ * support for copying to/from CCmode is incomplete.
4628
+ *
4629
+ * ZipCPU --- CCmode register copies work like any other, so we'll keep with the
4630
+ * default definition.
4631
+ */
4632
+
4633
+/* STACK_REGS ... Define this if the machine has any stack-like registers.
4634
+ *
4635
+ * Zip CPU has no stack-like registers, as their definition is different from
4636
+ * the ZipCPU stack pointer register.
4637
+ */
4638
+
4639
+#define        ZIP_REG_BYTE_SIZE       1
4640
+
4641
+/* 17.08 Register Classes */
4642
+
4643
+/* enum reg_class ... An enumerate type that must be defined with all the
4644
+ * register class names as enumerated values.  NO_REGS must be first.  ALL_REGS
4645
+ * must be the last register class, followed by one more enumerated value,
4646
+ * LIM_REG_CLASSES, which is not a register class but rather tells how many
4647
+ * classes there are.
4648
+ *
4649
+ * ZipCPU --- We'll defined register 0-13 as general registers, 14-15 in
4650
+ * all_regs, and go from there.
4651
+ */
4652
+enum   reg_class {
4653
+       NO_REGS, GENERAL_REGS,
4654
+#ifdef DEFINE_USER_REGS
4655
+       USER_REGS,
4656
+#endif
4657
+       ALL_REGS, LIM_REG_CLASSES
4658
+};
4659
+
4660
+/* N_REG_CLASSES ... the number of distinct register classes, defined as follows
4661
+ */
4662
+#define        N_REG_CLASSES   (int)LIM_REG_CLASSES
4663
+
4664
+/* REG_CLASS_NAMES ... An initializer containing the names of the register
4665
+ * classes as C string constants.  These names are used in writing some of the
4666
+ * debugging dumps.
4667
+ */
4668
+#define        REG_CLASS_NAMES { "NO_REGS", "GENERAL_REGS", "ALL_REGS" }
4669
+
4670
+/* REG_CLASS_CONTENTS ... An initializer containing the contents of the register
4671
+ * classes, as integerss which are bit masks.  The nth integer specifies the
4672
+ * contents of class n.  That way the integer mask is interpreted as that
4673
+ * register r is in the class if (mask&(1<<r)) is 1.
4674
+ *
4675
+ * When the machine has more than 32 registers ... that's not us.
4676
+ *
4677
+ * ZipCPU --- This is straight forward, three register classes, etc.
4678
+ */
4679
+#define        REG_CLASS_CONTENTS { { 0x00000}, {0x03fff}, {0x0ffff} }
4680
+
4681
+#ifdef DEFINE_USER_REGS
4682
+#define        REG_CLASS_NAMES { "NO_REGS", "GENERAL_REGS", "USER_REGS", "ALL_REGS" }
4683
+#define        REG_CLASS_CONTENTS { { 0x00000},{0x03fff},{0x0ffff0000},{0x0ffffffff} }
4684
+#define        FIXED_REGISTERS         { 0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 }
4685
+#define        CALL_USED_REGISTERS     { 0,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 }
4686
+#endif
4687
+
4688
+/* REGNO_REG_CLASS ... A C expression whose value is a register class
4689
+ * containing hard register REGNO.  In general there is more than one such
4690
+ * class;  Choose a class which is minimal, meaning that no smaller class also
4691
+ * contains the register.
4692
+ */
4693
+#undef REGNO_REG_CLASS
4694
+#define        REGNO_REG_CLASS(R)      (is_ZIP_REG(R)?((R<=13)?GENERAL_REGS:ALL_REGS):NO_REGS)
4695
+
4696
+/* BASE_REG_CLASS ... A macro whose definition is the name of the class to which
4697
+ * a valid base register must belong.  A base register is one used in an address
4698
+ * which is the register value plus a displacement.
4699
+ */
4700
+#undef BASE_REG_CLASS
4701
+#define        BASE_REG_CLASS  GENERAL_REGS
4702
+
4703
+/* MODE_BASE_CLASS(MODE) ... This is a variation of the BASE_REG_CLASS macro
4704
+ * which allows the selection of a bse register in a mode dependent manner.  If
4705
+ * mode is VOIDmode then it should return the same value as BASE_REG_CLASS.
4706
+ */
4707
+#undef MODE_BASE_CLASS
4708
+#define        MODE_BASE_CLASS(MODE)   GENERAL_REGS
4709
+
4710
+/* MODE_BASE_REG_REG_CLASS(MODE) ... A C expression whose value is the register
4711
+ * class to which a valid base register must belong in order to be used in a
4712
+ * base plus index register address.  You should define this macro if base plus
4713
+ * index addresses have different requirements than other base register uses.
4714
+ *
4715
+ * Zip CPU does not support the base plus index addressing mode, thus ...
4716
+ */
4717
+#undef MODE_BASE_REG_REG_CLASS
4718
+#define        MODE_BASE_REG_REG_CLASS(MODE)   NO_REGS
4719
+
4720
+/* INDEX_REG_CLASS ... A macro whose definition is the name of the class to
4721
+ * which a valid index register must belong.  An index register is one used in
4722
+ * an address where its value is either multiplied by a scale factor or added
4723
+ * to another register (as well as added to a displacement).
4724
+ *
4725
+ * ZipCPU -- Has no index registers.
4726
+ */
4727
+#undef INDEX_REG_CLASS
4728
+#define        INDEX_REG_CLASS NO_REGS
4729
+
4730
+/* REGNO_OK_FOR_BASE_P(NUM) ... A C expression which is nonzero if register
4731
+ * number num is suitable for use as a base register in operand addresses.
4732
+ */
4733
+#undef REGNO_OK_FOR_BASE_P
4734
+#ifdef DEFINE_USER_REGS
4735
+# define REGNO_OK_FOR_BASE_P(NUM)      ((NUM != zip_CC)&&(NUM < 16))
4736
+#else
4737
+# define REGNO_OK_FOR_BASE_P(NUM)      (NUM != zip_CC)
4738
+#endif
4739
+
4740
+/* REGNO_MODE_OK_FOR_BASE_P ... A C expressison that is just like
4741
+ * REGNO_OK_FOR_BASE_P, except that that expression may examine the mode of the
4742
+ * memory refgerence in MODE.  You should define this macro if the mode of the
4743
+ * memory reference affects whether a register may be used as a base register.
4744
+ *
4745
+ * ZipCPU --- the mode doesn't affect anything, so we don't define this.
4746
+ */
4747
+
4748
+/* REGNO_MODE_OK_FOR_REG_BASE_P(NUM, MODE) ... base plus index operand
4749
+ * addresses, accessing memory in mode mode.
4750
+ *
4751
+ * Use of this macro is deprecated.
4752
+ */
4753
+
4754
+/* REGNO_MODE_CODE_OK_FRO_BASE_P(N,M,AS,OC,IC) ... A C expression which is
4755
+ * nonzero if a register number N is suitable for use as a base register in
4756
+ * operand addresses, accessing memory in mode M in address space AS.  This is
4757
+ * similar to REGNO_MODE_OK_FOR_BASE_P, except that the expression may examine
4758
+ * the context in which the register appears in the memory reference.
4759
+ *
4760
+ * ZipCPU---We aren't specific in how we use our registers.
4761
+ */
4762
+#define        REGNO_MODE_CODE_OK_FOR_BASE_P(N,M,AS,OC,IC) REGNO_OK_FOR_BASE_P(N)
4763
+
4764
+/* REGNO_OK_FOR_INDEX_P(REGNO) ... A C expression which is nonzero if register
4765
+ * num is suitable for use as an index register in opernad addressess.  It may
4766
+ * be either a suitable hard register or a pseudo register that has been
4767
+ * allocated usch as a hard register.
4768
+ *
4769
+ * ZipCPU has no index registers, therefore we declare this to be zero.
4770
+ */
4771
+#undef REGNO_OK_FOR_INDEX_P
4772
+#define        REGNO_OK_FOR_INDEX_P(REGNO)     0
4773
+
4774
+/* TARGET_PREFERRED_RENAME_CLASS(RCLASS) ... A target hook that places
4775
+ * additional preference on the register class to use when it is necessary to
4776
+ * rename a register in class RCLASS to another class, or perhaps NO_REGS, if no
4777
+ * preferred register class is found or hook preferred_rename_class is not
4778
+ * implemented.  SOmething returning a more restrictive class makes better code.
4779
+ * For example, on ARM, thumb-2 instructions using LO_REGS may be smaller than
4780
+ * instructions using GENERIC_REGS.  By returning LO_REGS from
4781
+ * preferred_rename_class, code size can be reduced.
4782
+ */
4783
+// #undef TARGET_PREFERRED_RENAME_CLASS
4784
+// #define     TARGET_PREFERRED_RENAME_CLASS(RCLASS)   RCLASS
4785
+
4786
+/* TARGET_PREFERRED_RELOAD_CLASS(X,RC) ... A target hook that places additional
4787
+ * restri tions on the register class to use when it is necessary to copy value
4788
+ * X into a register in class RC.  The value is a register class; rehaps RC, or
4789
+ * perhaps a smaller class.
4790
+ *
4791
+ * The default fversion of this hook always returns value of RC argument, which
4792
+ * sounds quite appropriate for the ZipCPU.
4793
+ */
4794
+
4795
+/* PREFERRED_RELOAD_CLASS(X,CLASS) ... A C expression that places additional
4796
+ * restrictions on the register class to use when it is necessary to copy
4797
+ * value X into a register in class CLASS.  On many machines, the following
4798
+ * definition is safe: PREFERRED_RELOAD_CLASS(X,CLASS) (CLASS)
4799
+ * Sometimes returning a more restrictive class makes better code.  For example,
4800
+ * on the 68k, when x is an integer constant that is in range for a moveq
4801
+ * instruction, the value of this macro is always DATA_REGS as long as CLASS
4802
+ * includes the data registers.  Requiring a Ddata register guarantees that a
4803
+ * 'moveq' will be used.
4804
+ *
4805
+ * ZipCPU --- you can't load certain values into all members of ALL_REGS.  For
4806
+ * example, loading (sleep and !gie) into the CC register could halt the CPU.
4807
+ * Hence, we only allow loads into the GENERAL_REG class.
4808
+ */
4809
+#define        PREFERRED_RELOAD_CLASS(X, CLASS)        GENERAL_REGS
4810
+
4811
+/* TARGET_PREFERRED_OUTPUT_RELOAD_CLASS(RTX,RCLASS) ... Like TARGET_PREFERRED_..
4812
+ * RELOAD_CLASS, but for output instead of input reloads.
4813
+ *
4814
+ * ZipCPU --- there's gotta be a valid default behaviour for this.
4815
+ */
4816
+
4817
+/* LIMIT_RELOAD_CLASS(MODE, CL) ...
4818
+ *
4819
+ * Don't define this macro unless the target machine has limitations which
4820
+ * require the macro to do something nontrivial.  ZipCPU doesn't, so we won't.
4821
+ */
4822
+
4823
+/* TARGET_SECONDARY_RELOAD
4824
+ * SECONDARY_ ...
4825
+ * Don't think we need these ...
4826
+ */
4827
+
4828
+/* CLASS_MAX_NREGS(CLASS,MODE) ... A C expression for the maximum number of
4829
+ * consecutive registers of class CLASS needed to hold a value of mode MODE.
4830
+ *
4831
+ * This is closely related to the macro HARD_REGNO_NREGS.  In fact, the value
4832
+ * of the macro CLASS_MAX_REGS(CL,M) should be the maximum value of
4833
+ * HARD_REGNO_NREGS(REGNO,MODE) for all REGNO values in the class CLASS.
4834
+ *
4835
+ * This macro helps control the handling of multiple word values in the reload
4836
+ * pass.
4837
+ *
4838
+ * ZipCPU --- We'll just use HARDNO_REGNO_NREGS, since CLASS is independent for
4839
+ * us.  We'll also choose register R0, since ... well, since it simply doesn't
4840
+ * matter.  (HARD_REGNO_NREGS ignores this anyway)
4841
+ */
4842
+#define        CLASS_MAX_NREGS(CLASS, MODE)    HARD_REGNO_NREGS(0,MODE)
4843
+
4844
+/* CANNOT_CHANGE_MODE_CLASS
4845
+ * ???
4846
+ */
4847
+
4848
+/* TARGET_IRA_CHANGE_PSEUDO_ALLOCNO_CLASS
4849
+ */
4850
+
4851
+/* TARRGET_LRA_P
4852
+ * Default looks good.
4853
+ */
4854
+
4855
+/* TARGET_REGISTER_PRIORITY(INT) ... A target hook which returns the register
4856
+ * priority number to which the register HARD_REGNO belongs to.  THe bigger the
4857
+ * number
4858
+ *
4859
+ * The default version of this target hook returns always zero---good enough for
4860
+ * the ZipCPU.
4861
+ */
4862
+
4863
+/* TARGET_REGISTER_USAGE_LEVELING_P(VOID) ... A target hook which returns true
4864
+ * if we need register usage leveling.  That means if a few hard registers are
4865
+ * equally good for the assignment, we choose the least used hard register.  The
4866
+ * register usage leveling may be profitable for some targets.  Don't use usage
4867
+ * leveling for targets with conditional execution or targets with big register
4868
+ * files as it hurts if-conversion and cross-jumping optimizations.  The default
4869
+ * version of this target hook returns always false.
4870
+ *
4871
+ * ZipCPU --- Default is the right answer.
4872
+ */
4873
+
4874
+/* TARGET_DIFFERENT_ADDR_DISPLACEMENT_P ...
4875
+ * Default looks good.
4876
+ */
4877
+
4878
+/* TARGET_CANNOT_SUBSTITUTE_MEM_EQUIV_P ...
4879
+ * Default looks good.
4880
+ */
4881
+
4882
+/* TARGET_LEGITIMIZE_ADDRESS_DISPLACEMENT ....
4883
+ */
4884
+
4885
+/* TARGET_SPILL_CLASS
4886
+ *
4887
+ * ZipCPU --- If we were running in supervisor mode only, this might be the
4888
+ * user set of registers.  However, we're not building for that mode (now),
4889
+ * so we'll leave this at the default of NO_REGS.
4890
+ */
4891
+
4892
+/* TARGET_CSTORE_MODE(ICODE) ... Defines the machine mode to use for the
4893
+ * boolean result of conditional store patterns.  The OCIDE argument is the
4894
+ * instruction code for the cstore being performed.  Not defining this hook is
4895
+ * the same as accepting the mode encoded into operand 0 of the cstore expander
4896
+ * patterns.
4897
+ *
4898
+ * ??? ZipCPU --- I don't follow this documentation.  We'll leave this at the
4899
+ * default therefore.
4900
+ */
4901
+
4902
+/* 17.09 Stack Layout and Calling Conventions */
4903
+
4904
+
4905
+/* STACK_GROWS_DOWNWARD ... Define this macro if pushing a word onto the stack
4906
+ * moves the stack pointer to a smaller address, and false otherwise.
4907
+ *
4908
+ * ZipCPU ... well, our stack does grow downward, but it doesn't do so auto-
4909
+ * magically.  We have to move the stack pointer ourselves.  However, since this
4910
+ * is our convention, we'll define it as such.
4911
+ */
4912
+#undef STACK_GROWS_DOWNWARD
4913
+#define        STACK_GROWS_DOWNWARD    1
4914
+
4915
+/* STACK_PUSH_CODE ... This macro defines the operation used when something is
4916
+ * pushed on the stack.  In RTL, a push operation will be
4917
+ * (set (mem( STACK_PUSH_CODE(reg sp))) ...) The choiecs are PRE_DEC, POST_DEC,
4918
+ * PRE_INC, and POST_INC.  Which of these is correct depends on the stack
4919
+ * direction and on whether the stack pointer points to the last item on the
4920
+ * stack or whether it points to the space for the next item on the stack.
4921
+ * The default is PRE_DECC when STACK_GROWS_DOWNWARD is true, which is almost
4922
+ * always right, and PRE_INC otherwise, which is often wrong.
4923
+ *
4924
+ * ZipCPU --- None of these is right, so let's leave this at the default and
4925
+ * see how badly we get mangled.  In particular, ZipCPU doesn't have any of the
4926
+ * PRE_DEC, POST_DEC, PRE_INC, or POST_INC addressing modes used here.
4927
+ */
4928
+
4929
+/* FRAME_GROWS_DOWNWARD ... Define this macro to nonzero if the addresses of
4930
+ * local variable slots are at negative offsets from the frame pointer.
4931
+ *
4932
+ * ZipCPU --- If the frame pointer is defined as the stack pointer upon the
4933
+ * start of function execution, and that stack pointer grows downward, than
4934
+ * this should be the case as well.
4935
+ */
4936
+#undef FRAME_GROWS_DOWNWARD
4937
+#define        FRAME_GROWS_DOWNWARD    1
4938
+// #define     FRAME_GROWS_DOWNWARD    0        // This was ECO32's value
4939
+
4940
+
4941
+/* ARGS_GROW_DOWNWARD ... Define this macro if successive arguments to a
4942
+ * function occupy decreasing addresses on the stack.
4943
+ *
4944
+ * ZipCPU -- we can leave this up to the compiler's preferred implementation,
4945
+ * it is of no consequence to the hardware.
4946
+ */
4947
+
4948
+/* STARTING_FRAME_OFFSET ... Offset from the frame pointer to the first local
4949
+ * variable slot to be allocated.  If FRAME_GROWS_DOWNWARD, find the next slot's
4950
+ * offset by subtracting the firstt slot's length from STARTING_FRAME_OFFSET.
4951
+ * Otherwise it is found by adding the length of the first slot to the value
4952
+ * START_FRAME_OFFSET.
4953
+ *
4954
+ * ZipCPU --- I'm not certain on this, let's come back after we look at how
4955
+ * the code is getting generated.  However, the ECO32 code I am copying from
4956
+ * suggests that 0 is the right value, so we'll use that here.
4957
+ */
4958
+// #warning "Re-evaluate me"
4959
+#define        STARTING_FRAME_OFFSET   0
4960
+
4961
+/* STACK_ALIGNMENT_NEEDED ... Define to zero to disable final alignment of the
4962
+ * stack during reload.  The nonzero default for this macro is suitable for most
4963
+ * ports.
4964
+ *
4965
+ * ZipCPU --- we'll leave this at the default, although if any alignment code
4966
+ * shows up on the stack we may need to adjust it.
4967
+ */
4968
+
4969
+/* STACK_POINTER_OFFSET ... Offset from the SP register to the first location at
4970
+ * which outgoing arguments are placed.  If not specified, the default value
4971
+ * of zero is used.  This is the proper value for most machines.
4972
+ */
4973
+#define        STACK_POINTER_OFFSET    0
4974
+
4975
+/* FIRST_PARM_OFFSET ... Offset from the argument pointer register to the first
4976
+ * argument's address.  On some machines it may depend on the data type of the
4977
+ * function.
4978
+ */
4979
+#define        FIRST_PARM_OFFSET(F)    0
4980
+
4981
+/* STACK_DYNAMIC_OFFSET(F) ... Offset from the stack pointer register to an item
4982
+ * dynamically allocated on the stack, e.g., by alloca.  The default value for
4983
+ * this macro is STACK_POINTER_OFFSET plus the length of the outgoing arguments.
4984
+ * The default is correct for most machines, ...
4985
+ *
4986
+ * ZipCPU --- so we'll use it for the ZipCPU.
4987
+ */
4988
+
4989
+/* INITIAL_FRAME_ADDRESS_RTX ... A C expression whose value is RTL representing
4990
+ * the address of the initial stack frame.  This address is passed to
4991
+ * RETURN_ADDR_RTX and DYNAMIC_CHAIN_ADDRESS.  If you don't define this macro,
4992
+ * a reasonable default value will be used.  Define this macro in order to make
4993
+ * frame pointer elimination work in the presence of __builtin_frame_address(C)
4994
+ * and __builtin_return_address(C) for (C) not equal to zero.
4995
+ *
4996
+ * ZipCPU --- Let's try the reasonable default and see what happens.
4997
+ */
4998
+
4999
+/* SETUP_FRAME_ADDRESSES ... A C expression that produces the machine-specific
5000
+ * code to setup the stack so that arbitrary frames can be accessed.  For
5001
+ * example, on the SPARC, we must flush all of the register windows to the stack
5002
+ * before we can access arbitrary stack frames.  You will seldom need to define
5003
+ * this macro.  The default is to do nothing.
5004
+ *
5005
+ * ZipCPU --- which is what we shall do here.
5006
+ */
5007
+
5008
+/* TARGET_BUILTIN_SETJMP_FRAME_VALUE(VOID) ... This target hook should return
5009
+ * an RTX that is used to store the address of the current frame into the
5010
+ * builtin setjmp buffer.  The default value, virtual_stack_vars_rtx, is correct
5011
+ * for most machines.  One reason you may need to define this target hook is if
5012
+ * hard_frame_pointer_rtx is the appropriate value on your machine.
5013
+ *
5014
+ * ZipCPU --- leave this undefined, since the default value should be correct
5015
+ * for "most" machines.
5016
+ */
5017
+
5018
+/* FRAME_ADDR_RTX ... most machines do not need to define it.
5019
+ */
5020
+
5021
+/* RETURN_ADDR_RTX(COUNT,FRAMEADDR) ... A C expression whose value is RTL
5022
+ * representing the value of the return address for the frame COUNT steps up
5023
+ * from the current frame, after the prologue.  FRAMEADDR is the frame pointer
5024
+ * of the COUNT frame, or the frame pointer of the COUNT-1 frame if
5025
+ * RETURN_ADDR_IN_PREVIOUS_FRAME is nonzero.  The value of the expression must
5026
+ * always be the correct address when COUNT is nonzero, but may be NULL_RTX if
5027
+ * there is no way to determine the return address of other frames.
5028
+ *
5029
+ * ZipCPU --- I have no idea how we'd do this, so let's just return NULL_RTX.
5030
+ */
5031
+#undef RETURN_ADDR_RTX
5032
+#define        RETURN_ADDR_RTX(COUNT,FRAMEADDR)        NULL_RTX
5033
+
5034
+/* RETURN_ADDR_IN_PREVIOUS_FRAME ... Define this macro to nonzero value if the
5035
+ * return address of a particular stack frame is accessed from the frame pointer
5036
+ * of the previous stack frame.  The zero default for this macro is suitable
5037
+ * for most ports.
5038
+ *
5039
+ * ZipCPU---Default works here as well.
5040
+ */
5041
+
5042
+/* INCOMING_RETURN_ADDR_RTX ... A C expression whose value is RTL representing
5043
+ * the location of the incoming return address at the beginning of any function,
5044
+ * before the prologue.  This RTL is either a REG, indicating that the return
5045
+ * value is saved in 'REG', or a MEM representing the location in the stack.
5046
+ * If this RTL is a REG, you should define DWARF_RETURN_COLUMN to
5047
+ * DWARF_FRAME_REGNUM(REGNO).
5048
+ *
5049
+ * ZipCPU --- While our incoming return address could theoretically be in any
5050
+ * register, our machine description file is going to place it into register
5051
+ * R0, so that's what we return here.
5052
+ */
5053
+#undef INCOMING_RETURN_ADDR_RTX
5054
+#define        INCOMING_RETURN_ADDR_RTX        gen_rtx_REG(SImode, zip_R0)
5055
+
5056
+
5057
+/* DWARF_ALT_FRAME_RETURN_COLUMN
5058
+ */
5059
+
5060
+/* DWARF_ZERO_REG ... A C exrpession whose value is an integer giving a DWARF2
5061
+ * register number that is considered to always have the value zero.  This
5062
+ * should only be defined if the target has an architected zero register (ZipCPU
5063
+ * does not), and someone decided it was a good idea to use that register number
5064
+ * to terminate the stack backtrace.  New ports should avoid this (so the
5065
+ * ZipCPU port will avoid it as well).
5066
+ *
5067
+ */
5068
+
5069
+/* TARGET_DWARF_HANDLE_FRAME_UNSPEC
5070
+ */
5071
+
5072
+/* INCOMING_FRAME_SP_OFFSET
5073
+ */
5074
+#define        INCOMING_FRAME_SP_OFFSET        0
5075
+
5076
+/* ARG_POINTER_CFA_OFFSET
5077
+ */
5078
+
5079
+/* FRAME_POINTER_CFA_OFFSET
5080
+ */
5081
+
5082
+/* CFA_FRAME_BASE_OFFSET
5083
+ */
5084
+
5085
+/* 17.09.02 Exception handling support */
5086
+
5087
+/* EH_RETURN_DATA_REGNO(N) ... A C expression whose value is the Nth register
5088
+ * number used for data by exception handlers, or INVALID_REGNUM if fewer than
5089
+ * N registers are usable.  The exception handling library routines communicate
5090
+ * with the exception handlers via a set of agreed upon registers.  Ideally
5091
+ * these registers should be call clobbered; it is possible to use call-saved
5092
+ * registers, but may negatively impact code size.  The target must support at
5093
+ * least 2 data registers, but should define 4 if their are enough free
5094
+ * registers.
5095
+ *
5096
+ * You must define this macro if you want to support call frame exception
5097
+ * handling like that provided by DWARF 2.
5098
+ */
5099
+#define        EH_RETURN_DATA_REGNO(N) (((N<ZIP_FIRST_ARG_REGNO)||(N>ZIP_LAST_ARG_REGNO))?(N-1):INVALID_REGNUM)
5100
+
5101
+/* EH_RETURN_STACKADJ_RTX ... A C expression whose value is RTL representing
5102
+ * a location in which to store a stack adjustment to be applied before function
5103
+ * return.  This is used to unwind the stack to an exception handler's call
5104
+ * frame.  It will be assigned zero on code paths that return normally.
5105
+ *
5106
+ * Do not define this macro if the stack pointer is saved and restored by the
5107
+ * regular prolog and epilog code in the call frame itself (which it is for the
5108
+ * ZipCPU); in this case, the exception handling library routines will update
5109
+ * the stack location to be restored in place.  Otherwise, you must define this
5110
+ * macro if you want to support call frame exception handling like that provided
5111
+ * by DWARF 2.
5112
+ *
5113
+ */
5114
+
5115
+/* EH_RETURN_HANDLER_RTX ... A C expression whose value is RTL representing a
5116
+ * location in which to store the address of an exception handler to which we
5117
+ * should return.  It will not be assigned on code paths that return normally.
5118
+ *
5119
+ * Typcally this is the location in the call frame at which the normal return
5120
+ * address is stored.  For targets that return by popping an address of the
5121
+ * stack, this might be a memory address just below the target callf rame
5122
+ * rather than inside the current call frame.  If defined,
5123
+ * EH_RETURN_STACKADJ_RTX will have already been assigned, so it may be used
5124
+ * to calculate the location of the target call frame.
5125
+ *
5126
+ * If you want to support call frame exception handling, you must define either
5127
+ * this macro or the eh_return instruction pattern.
5128
+ */
5129
+// #warning "I don't know what to do here."
5130
+
5131
+/*
5132
+ *
5133
+ *
5134
+ *
5135
+ *   REST OF SECTION SKIPPED ...
5136
+ *
5137
+ *
5138
+ *
5139
+ */
5140
+
5141
+/* 17.09.03 Specifying how stack checking is done */
5142
+
5143
+/* STACK_CHECK_BUILTIN ... a non-zero value if stack checking is done by the
5144
+ * configuration files in a machine-dependent manner.  You should define this
5145
+ * macro if stack checking is required by the ABI of your machine or if you
5146
+ * would like to do stack checking in some more efficient way than the generic
5147
+ * appraoch.  The default value of this macro is zero.
5148
+ *
5149
+ * ZipCPU --- The default makes sense for us.
5150
+ */
5151
+// #define STACK_CHECK_BUILTIN 0
5152
+
5153
+/* STACK_CHECK_STATIC_BUILTIN ... A nonzero value if static stack checking is
5154
+ * done by the configuration files in a machine-dependent manner.  You should
5155
+ * define this macro if you would like to do static stack checking in some more
5156
+ * efficient way than the generic approach.  The default value of this macro
5157
+ * is zero.
5158
+ *
5159
+ * ZipCPU --- The default makes sense for us.
5160
+ */
5161
+
5162
+/* STACK_CHECK_PROBE_INTERVAL_EXP ...  An integer specifying the interval at
5163
+ * which GCC must generate stack probe instructions, defined as 2 raised to this
5164
+ * interval.  You will normally define this macro so that the interval is no
5165
+ * larger than the size of the "guard pages" at the end of a stack area.  The
5166
+ * default value of 12 (4096-byte interval) is suitable for most systems.
5167
+ *
5168
+ * ZipCPU --- Default.
5169
+ */
5170
+
5171
+/* STACK_CHECK_MOVING_SP ... An integer which is non-zero if GCC should move
5172
+ * the stack pointer page by page when doing probes.  This can be necessary
5173
+ * on systems where the stack pointer contains the bottom address of the memory
5174
+ * area accessible to the executing thread at any point in time.  In this
5175
+ * situation, an alternate signal stack is required in order to be able to
5176
+ * recover from a stack overflow.  The default value of this macro is zero.
5177
+ *
5178
+ * ZipCPU -- Default.
5179
+ */
5180
+
5181
+/* STACK_CHECK_PROTECT
5182
+ */
5183
+/* STACK_CHECK_MAX_FRAME_SIZE
5184
+ * ... you should normally not change the default value of this macro.
5185
+ */
5186
+/* STACK_CHECK_FIXED_FRAME_SIZE
5187
+ * ... you ... will normally use the default of four words.
5188
+ */
5189
+
5190
+/* STACK_CHECK_MAX_VAR_SIZE
5191
+ * ... you will normally not need to override that default.
5192
+ */
5193
+
5194
+/* 17.09.04 Registers that Address the Stack Frame*/
5195
+
5196
+/* STACK_POINTER_REGNUM ... The register number of the stack pointer register,
5197
+ * which must also be a fixed register according to FIXED_REGISTERS.  On most
5198
+ * machines, the hardware determines which register this is.
5199
+ */
5200
+#undef STACK_POINTER_REGNUM
5201
+#define        STACK_POINTER_REGNUM    zip_SP
5202
+
5203
+/* FRAME_POINTER_REGNUM ... The register number of the frame pointer register,
5204
+ * which is used to access certain automatic variables in the stack frame.  On
5205
+ * some machines, the hardware determines which register this is.  On other
5206
+ * machines you can choose any register you wish for this purpose.
5207
+ *
5208
+ * ZipCPU --- While I'd like to dump this pointer, since I don't really see
5209
+ * a need for it, alloca() requires it.  Therefore let's assine a register to
5210
+ * this purpose and watch what the compiler does with it.
5211
+ */
5212
+#define        FRAME_POINTER_REGNUM    zip_FP
5213
+
5214
+/* HARD_FRAME_POINTER_REGNUM ... On some machines the offset between the frame
5215
+ * pointer and starting offset of the automatic variables is not known until
5216
+ * after register allocation has been done (for example, because the saved
5217
+ * registers are between these two locations).  On those machines, define
5218
+ * FRAME_POINTER_REGNUM the number of a special, fixed register to be used
5219
+ * internally until the offset is known, and define HARD_FRAME_POINTER_REGNUM
5220
+ * to be the actual hard register number used for the frame pointer.
5221
+ *
5222
+ * Do not define this macro if it would be the same as FRAME_POINTER_REGNUM
5223
+ *
5224
+ * ZipCPU --- we do not define this macro.
5225
+ */
5226
+//#define HARD_FRAME_POINTER_REGNUM    zip_FP
5227
+
5228
+/* ARG_POINTER_REGNUM ... The register number of the arg pointer register, which
5229
+ * is used to access the function's argument list.  On some machines, this is
5230
+ * the same as the frame pointer register.  On some machines, the hardware
5231
+ * determines which register this is.  On other machines, you can choose any
5232
+ * register you wish for this purpose.  If this is not the same register as the
5233
+ * frame pointer register, then you must mark it as a fixed register according
5234
+ * to FIXED_REGISTERs, or arrange to be able to eliminate it.
5235
+ *
5236
+ * ZipCPU --- We really don't want to lose another register to something
5237
+ * pointless, so let's set this to be the frame pointer register.  Especially
5238
+ * given the ZipCPU's ease of accessing things via offsets of registers, this
5239
+ * should work for a rather large stack frame.
5240
+ */
5241
+#define ARG_POINTER_REGNUM     zip_FP
5242
+
5243
+/* HARD_FRAME_POINTER_IS_FRAME_POINTER ... define this to be a preprocessor
5244
+ * constant that is nonzero if hard_frame_pointer_rtx and frame_pointer_rtx
5245
+ * should be the same.  The default definition is sufficient for us.
5246
+ */
5247
+
5248
+/* HARD_FRAME_POINTER_IS_ARG_POINTER ...
5249
+ * ZipCPU doesn't need this macro
5250
+ */
5251
+
5252
+/* RETURN_ADDRESS_POINTER_REGNUM ... The register number of the return address
5253
+ * pointer register, which is used to access the current function's return
5254
+ * address from the stack.  On some machines, the return address is not at a
5255
+ * fixed offset from the frame pointer or stack pointer or argument pointer.
5256
+ * This register can be defined to point to the return address on the stack, and
5257
+ * then to be converted by ELIMINABLE_REGS into either the frame pointer or the
5258
+ * stack pointer.
5259
+ *
5260
+ * Do not define this macro unless there is no other way to get the return
5261
+ * address from the stack.
5262
+ *
5263
+ * ZipCPU---we need this.
5264
+ */
5265
+#define        RETURN_ADDRESS_REGNUM   zip_R0
5266
+
5267
+
5268
+/* STATIC_CHAIN_REGNUM ... Register numbers used for passing a function's
5269
+ * static chain pointer.  If register windows are used, the register number as
5270
+ * seen by the called function is STATIC_CHAIN_INCOMING_REGNUM, while the
5271
+ * register number as seen by the calling function is STATIC_CHAIN_REGNUM.  If
5272
+ * these register are the same, STATIC_CHAIN_INCOMING_REGNUM need not be
5273
+ * defined.
5274
+ *
5275
+ * ZipCPU doesn't have register windows, so we don't need to define this.
5276
+ */
5277
+// #warning "I have no reason to believe this will even work"
5278
+#define        STATIC_CHAIN_REGNUM     zip_GOT
5279
+
5280
+/* TARGET_STATIC_CHAIN ... This hook replaces the use of STATIC_CHAIN_REGNUM et
5281
+ * al for targets that may use different static chain locations for different
5282
+ * nested functions.  This may be required if the target has function attributes
5283
+ * that affect the calling conventions of the function and those calling
5284
+ * conventions use different static chain locations.
5285
+ *
5286
+ * ZipCPU --- don't need this.
5287
+ */
5288
+// #define     STATIC_CHAIN_REGNUM     zip_R11
5289
+
5290
+
5291
+/* DWARF_FRAME_REGISTERS ... This macro specifies  the maximum number of hard
5292
+ * registers that can be saved in a call frame.  This is used to size data
5293
+ * structures used in DWARF2 exception handling.
5294
+ *
5295
+ * Prior to GCC 3.0, this macro was needed in order to establish a stable
5296
+ * exception handling ABI in the face of adding new hard registers for ISA
5297
+ * extensions.  In GCC 3.0 and later, the EH ABI is insulated from changes in
5298
+ * the number of hard registers.  Nevertheless, this macro can still be used to
5299
+ * reduce the runtime memory requirements of the exception handling routines,
5300
+ * which can be substantial if the ISA contains a lot of registers that are not
5301
+ * call-saved.
5302
+ *
5303
+ * If this macro is not defined, it defaults to FIRST_PSEUDO_REGISTER.
5304
+ *
5305
+ * ZipCPU --- The default is not sufficient.  The CC and PC registers need to
5306
+ * be saved and examined as well in any debug/exception context.  Hence, we
5307
+ * define this to be all of our registers.
5308
+ */
5309
+#undef DWARF_FRAME_REGISTERS
5310
+#define        DWARF_FRAME_REGISTERS   16
5311
+
5312
+/* PRE_GCC3_DWARF_FRAME_REGISTERS ... This macro is similar to DWARF_FRAME_REG..
5313
+ * but is provided for backward compatibility in pre GCC 3.0 compiled code.
5314
+ *
5315
+ * If not defined, it defaults to DWARF_FRAME_REGISTERS---which is perfect for
5316
+ * the ZipCPU.
5317
+ */
5318
+
5319
+/* DWARF_REG_TO_UNWIND_COLUMN(REGNO) ... Define this macro if the target's
5320
+ * representation for dwarf registers is different than the internal
5321
+ * representation for unwind column.  Given a dwarf register, this macro should
5322
+ * return the unwind column number to use instead.
5323
+ *
5324
+ * ... ???
5325
+ */
5326
+
5327
+/* DWARF_FRAME_REGNUM(REGNO) ... Define this macro is the target's
5328
+ * representation for dwarf registers used in .eh_frame or .debug_frame is
5329
+ * different from that used in other debug info sections.  Given a GCC hard
5330
+ * register number, this macro should return the .eh_frame register number.
5331
+ * The default is DBX_REGISTER_NUMBER(REGNO).
5332
+ *
5333
+ * ZipCPU --- provided we define DBX_REGISTER_NUMBER(REGNO) well, this default
5334
+ * should still work for us.
5335
+ */
5336
+
5337
+/* DWARF2_FRAME_REG_OUT(REGNO, FOR_EH) ... Define this macro to map register
5338
+ * numbers held in the call frame info that GCC has collected using
5339
+ * DWARF_FRAME_REGNO to those that should be output in .debug_frame (for_eh is
5340
+ * zero) and .eh_frame (for_eh is non-zero). The default is to return REGNO.
5341
+ *
5342
+ * ZipCPU --- Default is good enough.
5343
+ */
5344
+
5345
+/* REG_VALUE_IN_UNWIND_CONTEXT ... Define this macro if the target stores
5346
+ * register values as _Unwind_Word type in unwind context.  It should be defined
5347
+ * if target register size is larger than the size of void *.  The default
5348
+ * is to store register values as void *type.
5349
+ *
5350
+ * ZipCPU --- Default is what we need.
5351
+ */
5352
+
5353
+/* ASSUME_EXTENDED_UNWIND_CONTEXT ... Define this macro to be 1 if the target
5354
+ * always uses extended unwind context with version, args_size, and by_value
5355
+ * fields.  If it is undefined, it will always be defined to 1 when REG_VALUE_IN_UNWIND_CONTEXT is defined and 0 otherwise.
5356
+ *
5357
+ */
5358
+
5359
+
5360
+/* 17.09.05 Eliminating Frame Pointer and Arg Pointer */
5361
+
5362
+/* TARGET_FRAME_POINTER_REQUIRED(VOID) ... This target hook should return true
5363
+ * if a function must have and use a frame pointer.  This target hook is
5364
+ * called in the reload pass.  If its return value is true, the function will
5365
+ * have a frame pointer.
5366
+ *
5367
+ * This target hook can in principle examine the current function and decide
5368
+ * according to the facts, but on most machines the constant false or the
5369
+ * constant true suffices.  Use false when the machine allows code to be
5370
+ * generated with no frame pointer, and doing so saves some time or space.
5371
+ * Use true when there is no possible advantage to avoiding a frame pointer.
5372
+ *
5373
+ * ZipCPU---if we add in a frame pointer, we become register starved.  Hence,
5374
+ * we'll treat this as a constant false--which is also the default value.
5375
+ */
5376
+#define        target_frame_pointer_required   zip_frame_pointer_required
5377
+
5378
+/* INITIAL_FRAME_POINTER_OFFSET ... A C statement to store in the variable
5379
+ * depth-var the difference between the frame pointer and the stack pointer
5380
+ * values immediately after the function prologue.  The value would be computed
5381
+ * from information such as the result of get_frame_size() and the tables of
5382
+ * registers regs_ever_live and call_used_regs.
5383
+ *
5384
+ * If ELIMINABLE_REGS is defined, this macro will not be used and need not be
5385
+ * defined.  Otherwise, it must be defined even if TARGET_FRAME_POINTER_REQD
5386
+ * always returns true; in that case you may set depth-var to anything.
5387
+ *
5388
+ * ZipCPU --- we intend to set ELIMINABLE_REGS, so this is not necessary.
5389
+ */
5390
+// #define     INITIAL_FRAME_POINTER_OFFSET(DEPTH)     (DEPTH) = 0
5391
+
5392
+
5393
+/* ELIMINABLE_REGS ... If defined, this macro specifies a table of register
5394
+ * pairs used to eliminate unneeded registers that point into the stack frame.
5395
+ * If it is not defined, the only elimination attempted by the compiler is to
5396
+ * replace references to the frame pointer with references to the stack pointer.
5397
+ *
5398
+ * On some machines, the position of the argument pointer is not known until
5399
+ * the compilation is completed.  In such a case, a separate hard register
5400
+ * must be used for the argument pointer.  This register can be eliminated by
5401
+ * replacing it with either the frame pointer or the argument pointer,
5402
+ * depending on whether or not the frame pointer has been eliminated.
5403
+ *
5404
+ * ZipCPU we'll take their suggestion and define this as:
5405
+ */
5406
+#undef ELIMINABLE_REGS
5407
+#define        ELIMINABLE_REGS \
5408
+       {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM },  \
5409
+        { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM },  \
5410
+        { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
5411
+
5412
+/* bool TARGET_CAN_ELIMINATE(FROM,TO) ... This target function should return
5413
+ * true if the compiler is allowed to try to replace register number FROM with
5414
+ * register number TO.  This target hook need only be defined if ELIMINABLE_REGS
5415
+ * is defined, and will usually return true since most of the cases preventing
5416
+ * register elimination are things that the compiler  already knows about.
5417
+ *
5418
+ * ZipCPU ... does the compiler  know about my decision as to whether or not
5419
+ * the frame pointer was needed?  The m68k code suggests it does not ...
5420
+ */
5421
+#define TARGET_CAN_ELIMINATE   zip_can_eliminate
5422
+
5423
+/* INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) ... This macro is similar to
5424
+ * INITIAL_FRAME_POINTER_OFFSET.  It specifies the initial difference between
5425
+ * the specified pair of registers.  This macro must be defined if
5426
+ * ELIMINABLE_REGS is defined.
5427
+ *
5428
+ * ZipCPU---Is there a default we can use?
5429
+ */
5430
+#define        INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET)    (OFFSET)=0
5431
+/*
5432
+#define        INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET)            \
5433
+       do { (OFFSET) = zip_initial_elimination_offset((FROM), (TO)); } \
5434
+       while(0)                                        \
5435
+*/
5436
+
5437
+/* 17.09.06 Passing function arguments on the stack */
5438
+
5439
+/* TARGET_PROMOTE_PROTOTYPES ... Returns true if an argument declared in a
5440
+ * prototype as an integral type smaller than int should actually be
5441
+ * passed as an int.  In addition to avoiding errors in certain cases of
5442
+ * mismatch, it also makes for better code on certain machines.  The default is
5443
+ * to not promote prototypes.
5444
+ *
5445
+ * Since everything is an int on the ZipCPU, let's promote anything smaller
5446
+ * (which should still be an int) up to an int anyway.
5447
+ */
5448
+#undef TARGET_PROMOTE_PROTOTYPES
5449
+#define        TARGET_PROMOTE_PROTOTYPES       hook_bool_const_tree_true
5450
+
5451
+/* PUSH_ARGS ... A C expression.  If nonzero, push instructions will be used to
5452
+ * pass outgoing arguments.  If the target machine does not have a push
5453
+ * instruction, set it to zero.  That directs GCC to use an alternate strategy:
5454
+ * to allocate the entire argument block and then store the arguments into it.
5455
+ * When PUSH_ARGS is nonzero, PUSH_ROUNDING must be defined too.
5456
+ *
5457
+ * ZipCPU does not have a push instruction, so we set this to zero.
5458
+ */
5459
+#undef PUSH_ARGS
5460
+#define        PUSH_ARGS       0
5461
+
5462
+/* PUSH_ARGS_REVERSED ... A C expression.  If nonzero, function arguments will
5463
+ * be evaluated last to first, rather than first to last.  If this macro is
5464
+ * not defined, it defaults to PUSH_ARGS on targets where the stack and args
5465
+ * grow in opposite directions, and zero otherwise.
5466
+ *
5467
+ * ZipCPU---Let's evaluate our arguments first to last.
5468
+ */
5469
+#define        PUSH_ARGS_REVERSED      1
5470
+
5471
+/* PUSH_ROUNDING(NPUSHED) ... A C expression that is the number of bytes
5472
+ * actually pushed onto the stack when an instruction attempts to push
5473
+ * (NPUSHED) bytes.
5474
+ *
5475
+ * ZipCPU---We cannot push bytes.  Let's leave this undefined and see what
5476
+ * happens.
5477
+ */
5478
+// #warning "No appropriate definition seemed right."
5479
+
5480
+/* ACCUMULATE_OUTGOING_ARGS ... A C expression.  If non-zero, the maximum amount
5481
+ * of space required for outgoing arguments will be computed and placed into
5482
+ * crtl->outgoing_args_size.  No space will be pushed onto the stack for each call; instead the function prologue should increase the stack frame size by this
5483
+ * amount.
5484
+ *
5485
+ * ZipCPU---This is *cool* and so necessary---it saves an extra two instructions
5486
+ * each time we try to call a function/routine.  Yes, we want and *need* this
5487
+ * for good performance.  I mean, think of it, free performance increase?  Who
5488
+ * could argue with that?
5489
+ */
5490
+#undef ACCUMULATE_OUTGOING_ARGS
5491
+#define        ACCUMULATE_OUTGOING_ARGS        1
5492
+
5493
+
5494
+/* REG_PARM_STACK_SPACCE(FN) ... Define this macro if functions should assume
5495
+ * that stack space has been allocated for arguments even when their values
5496
+ * are passed in registers.  The value of this macro is the size, in bytes, of
5497
+ * the area reserved for arguments passed in registers for the function
5498
+ * represented by FN, which can be zero if GCC is calling a library function.
5499
+ * The argument FN can be the FUNCTION_DECL, or the type itself of the function.
5500
+ *
5501
+ * This space can be allocated by the caller, or be part of the machine
5502
+ * dependent stack frame: OUTGOING_REG_PARM_STACK_SPACE says which.
5503
+ *
5504
+ * ZipCPU --- Why allocate space you won't use?  Let's leave this undefined
5505
+ * therefore.
5506
+ */
5507
+// #undef      REG_PARM_STACK_SPACE
5508
+
5509
+
5510
+
5511
+/* INCOMING_REG_PARM_STACK_SPACE(FN) ... Like REG_PARM_STACK_SPACE, but for
5512
+ * incoming register arguments.  Define this macro if space guaranteed when
5513
+ * compiling a function body is different to space required when making a call,
5514
+ * a situation that can arise with K&R style function definitions.
5515
+ *
5516
+ */
5517
+
5518
+/* OUTGOING_REG_PARM_STACK_SPACE(FN) ... Define this to a nonzero value if it
5519
+ * is the responsibility of the caller to allocate the area reserved for
5520
+ * arguments passed in registers when calling a function of FN.  FN may be NULL
5521
+ * if the function called is a library function.
5522
+ *
5523
+ * ZipCPU---Why allocate space you don't need?
5524
+ */
5525
+#define        OUTGOING_REG_PARM_STACK_SPACE(FNTYPE)   0
5526
+
5527
+
5528
+/* STACK_PARMS_IN_REG_PARM_AREA ... Define this macro if REG_PARM_STACK_SPACE
5529
+ * is defined, buyt the stack parameters don't skip the area specified by it.
5530
+ *
5531
+ * ZipCPU---We didn't define REG_PARM_STACK_SPACE, so we won't define this.
5532
+ */
5533
+
5534
+/* TARGET_RETURN_POPS_ARGS(DECL,FNTYPE,SZ) ... This target hook returns the
5535
+ * number of bytes of its own arguments that a function pops on returning, or 0
5536
+ * if the function pops no arguments and the caller must therefore pop them all
5537
+ * after the function returns.
5538
+ *
5539
+ * ZipCPU --- If we define this, we'll lose our gain from
5540
+ * ACCUMULATE_OUTOING_ARGS.  Thus, we leave this undefined.
5541
+ */
5542
+
5543
+/* CALL_POPS_ARGS(CUM) ... A C expression that should indicate the number of
5544
+ * bytes a call sequence pops off of the stack.  It is added to the value of
5545
+ * RETURN_POPS_ARGS when compiling a function call.  CUM is the variable in
5546
+ * which all arguments to the function have been accumulated.
5547
+ *
5548
+ * ZipCPU---The call sequence, by itself, doesn't touch the stack.  Therefore
5549
+ * this is zero.
5550
+ */
5551
+#undef CALL_POPS_ARGS
5552
+#define        CALL_POPS_ARGS(CUM)     0
5553
+
5554
+
5555
+/* 17.09.07 Passing arguments in registers */
5556
+
5557
+/* TARGET_FUNCTION_ARG ... Return an RTX indicating whether a function argument
5558
+ * is passed in a register, and if so, which register.
5559
+ */
5560
+/*
5561
+ * This has been poisoned ... so let's not define it anymore and look for
5562
+ * a better way to do this ...
5563
+ *
5564
+ * #define     FUNCTION_ARG(CUM, MODE, TYPE, NAMED) (((NAMED) == 0) ? NULL_RTX
5565
+ *     : targetm.calls.must_pass_in_stack(MODE, TYPE)  ? NULL_RTX
5566
+ *     : (CUM) > ZIP_LAST_ARG_REGNO                    ? NULL_RTX
5567
+ *     : gen_rtx_REG(MODE, CUM))
5568
+ */
5569
+#define        TARGET_FUNCTION_ARG     zip_function_arg
5570
+
5571
+
5572
+/* TARGET_MUST_PASS_IN_STACK ...
5573
+ */
5574
+// #undef      TARGET_MUST_PASS_IN_STACK
5575
+// #define     TARGET_MUST_PASS_IN_STACK       zip_must_pass_in_stack
5576
+
5577
+/* TARGET_FUNCTION_INCOMING_ARG ... Define this hook if the target machine
5578
+ * has register windows, ... which ZipCPU does not have.
5579
+ */
5580
+
5581
+/* TARGET_USE_PSEUDO_PIC_REG(void) ... This hook should return 1 in case
5582
+ * pseudo register should be created for pic_offset_table_rtx during function
5583
+ * expand.
5584
+ *
5585
+ * This should be defined by global parameters, isn't it?
5586
+ */
5587
+
5588
+/* TARGET_INIT_PIC_REG(v) ... Perform a target dependent initialization of
5589
+ * pic_offset_table_rtx.  This hook is called at the start of register
5590
+ * allocation.
5591
+ *
5592
+ * ZipCPU---Let's revisit this.
5593
+ */
5594
+// #warning "Come back and relook at relocations"
5595
+
5596
+/* TARGET_ARG_PARTIAL_BYTES ... This target hook returns the number of bytes
5597
+ * at the beginning of an argument that must be put in registers.  The value
5598
+ * must be zero for arguments that are passed entirely in registers or that
5599
+ * are entirely pushed on the stack.
5600
+ */
5601
+// #undef      TARGET_ARG_PARTIAL_BYTES
5602
+// #define     TARGET_ARG_PARTIAL_BYTES        zip_arg_partial_bytes
5603
+
5604
+/* TARGET_PASS_BY_REFERENCE(CUM,MOD,TREE,NAMED) ... This target hook should
5605
+ * return true if an argument at the position indicated by CUM should be passed
5606
+ * by reference.  This predicate is queried after target independent reasons
5607
+ * for being pssed by reference, such as TREE_ADDRESSABLE(TREE).
5608
+ *
5609
+ */
5610
+// #undef      TARGET_PASS_BY_REFERENCE
5611
+// #define     TARGET_PASS_BY_REFERENCE        zip_pass_by_reference
5612
+
5613
+/* CUMULATIVE ARGS ...  A C type for declaring a variable that is used as the
5614
+ * first argument of 'FUNCTION_ARG' and other related values.
5615
+ *
5616
+ * ZipCPU---We're in trouble if an 'int' won't work, so let's just use that.
5617
+ */
5618
+#define        CUMULATIVE_ARGS int
5619
+
5620
+/*
5621
+ * OVERRIDE_ABI_FORMAT
5622
+ */
5623
+
5624
+/* INIT_CUMULATIVE_ARGS ... A C statement (sans semicolon) for initializing the
5625
+ * variable CUM for the state at the beginning of the argument list.
5626
+ *
5627
+ *
5628
+ * ZipCPU---The first argument is passed in register ZIP_FIRST_ARG_REGNO, or
5629
+ * R1 (unless it has been redefined above ...)
5630
+ */
5631
+#define        INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,FNDECL,N_NAMED_ARGS) (CUM = 0)
5632
+
5633
+/* INIT_CUMULATIVE_LIBCALL_ARGS
5634
+ * INIT_CUMULATIVE_INCOMING_ARGS
5635
+ *
5636
+ * These default to the last INIT_CUM_ARGS value above.
5637
+ */
5638
+
5639
+/* TARGET_FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) .. This hook updates
5640
+ * the summarizer variable pointed to by CUM to advance past an argument in
5641
+ * the argument list.  The values MODE, TYPE, and NAMED describe that
5642
+ * argument.  Once this is done, the variable CUM is suitable for analyzing the
5643
+ * following argument with TARGET_FUNCTION_ARG, etc.  This hook need not do
5644
+ * anything if the argument in question was passed on the stack.  The compiler
5645
+ * knows how to track the amount of stack space used for arguments without
5646
+ * any special help.
5647
+ *
5648
+ * ZipCPU---Here we simply copy from ECO32.
5649
+ */
5650
+#define        TARGET_FUNCTION_ARG_ADVANCE     zip_function_arg_advance
5651
+
5652
+/*
5653
+ * TARGET_ARG_OFFSET --- not necessary
5654
+ * FUNCTION_ARG_PADDING        --- not necessary, since we shouldn't be padding
5655
+ * PAD_VARARGS_DOWN    --- not necessary, since we shouldn't be padding
5656
+ * BLOCK_REG_PADDING
5657
+ * TARGET_FUNCTION_ARG_BOUNDARY
5658
+ * TARGET_FUNCTION_ARG_ROUND_BOUNDARY
5659
+ */
5660
+
5661
+/* FUNCTION_ARG_REGNO_P(REGNO) ... A C expression that is nonzero if REGNO is
5662
+ * the number of a hard register in which function arguments are sometimes
5663
+ * passed.  This does not include implicit arguments such as the static chain
5664
+ * and the structure-value address.  On many machines, no registers can be used
5665
+ * for this purpose since all function arguments are pushed on the stack.
5666
+ */
5667
+#define        FUNCTION_ARG_REGNO_P(r) ((r >= ZIP_FIRST_ARG_REGNO)&&(r<=ZIP_LAST_ARG_REGNO))
5668
+
5669
+/* TARGET_SPLIT_COMPLEX_ARG(TYPE) ... This hook should return true if parameter
5670
+ * of type TYPE are passed as two scalar parameters.  By default, GCC will
5671
+ * attempt to pack complex arguments into the target's word size.  Some ABI's
5672
+ * require complex arguments to be split and treated as their individual
5673
+ * components.
5674
+ *
5675
+ * The default value of this hook is NULL, which is treated as always false,
5676
+ * and which should be good enough for ZipCPU--which can go either way.
5677
+ */
5678
+
5679
+/* TARGET_BUILD_BUILTIN_VA_LIST ... This hook returns a type node for va_list
5680
+ * for the target.  The default version of the hook returns void*.
5681
+ *
5682
+ */
5683
+
5684
+/* TARGET_ENUM_VA_LIST_P
5685
+ */
5686
+
5687
+/* TARGET_FN_ABI_VA_LIST ... This hook returns the va_list type of the calling
5688
+ * convention specified by FN.  The default version of this returns va_list_type_node.
5689
+ */
5690
+
5691
+/* TARGET_FN_ABI_VA_LIST
5692
+ */
5693
+
5694
+/* TARGET_CANONICAL_VA_LIST_TYPE
5695
+ */
5696
+
5697
+/* TARGET_GIMPLIFY_VA_ARG_EXPR
5698
+ */
5699
+
5700
+/* TARGET_VALID_POINTER_MODE(MODE) ... Define this to return nonzero if the
5701
+ * port can handle pointers with machine mode MODE.  The default version of this
5702
+ * hook returns true for both ptr_mode and Pmode.
5703
+ *
5704
+ * ZipCPU---if Pmode is properly defined (above, and I think it is), then the
5705
+ * default behavior is quite appropriate.
5706
+ */
5707
+
5708
+/* TARGET_REF_MAY_ALIAS_ERRNO(REFP) ... Define this to return nonzero if the
5709
+ * memory reference REF may alias with the system C library errno location.
5710
+ * The default version of this hook assumes the system C library errno location
5711
+ * is either a declaration of type int or accessed by dereferencing a pointer
5712
+ * to int.
5713
+ *
5714
+ * ZipCPU --- Default sounds good to me.
5715
+ */
5716
+
5717
+
5718
+/* TARGET_SCALAR_MODE_SUPPORTED_P(MODE) ... Define this to return nonzero if
5719
+ * the port is prepared to handl instructions involving scalar mode MODE.  For
5720
+ * a scalar mode to be considered supported, all the basic arithmetic and
5721
+ * comparisons must work.
5722
+ *
5723
+ * The default version of this hook returns true for any mode required to
5724
+ * handle the basic C types (as defined by the port).  Included here are the
5725
+ * double-word arithmetic supported by the code in optabs.c.
5726
+ */
5727
+#undef TARGET_SCALAR_MODE_SUPPORTED_P
5728
+#define        TARGET_SCALAR_MODE_SUPPORTED_P  zip_scalar_mode_supported_p
5729
+
5730
+/* TARGET_VECTOR_MODE_SUPPORTED_P(MODE) ... Define this to return nonzero if the
5731
+ * port is prepared to handle instructions involving vector mode MODE.  At the
5732
+ * very least, it must have move patterns for this mode.
5733
+ *
5734
+ * ZipCPU---does not support any vector modes.
5735
+ */
5736
+#undef TARGET_VECTOR_MODE_SUPPORTED_P
5737
+#define        TARGET_VECTOR_MODE_SUPPORTED_P  hook_bool_mode_false
5738
+
5739
+/* TARGET_ARRAY_MODE_SUPPORTED_P(MODE, NELEMS) ... Return true if GCC should
5740
+ * try to use a scalar mode to store an array of NELEMS elements, given that
5741
+ * each element has mode MODE.  Returning true here overrides the usual MAX_FIXED_MODE limit and allows GCC to use any defined integer mode.
5742
+ *
5743
+ * ZipCPU---Sounds good.
5744
+ */
5745
+// #undef      TARGET_ARRAY_MODE_SUPPORTED_P
5746
+// #define     TARGET_ARRAY_MODE_SUPPORTED_P   zip_array_mode_supported_p
5747
+
5748
+/* TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P(MODE) ... Define this to return
5749
+ * nonzero if libgcc provides support for the floating-point mode MODE, which is
5750
+ * known to pass TARGET_SCALAR_MODE_SUPPORTED_P.  The default version of this
5751
+ * hook returns true for all of SFmode, DFmode, XFmode, and TFmode, if such
5752
+ * modes exist.
5753
+ *
5754
+ * ZipCPU---We only support SFmode and DFmode, but for now only in emulation
5755
+ * (if we can).  Let's allow both of those and see how far we get.
5756
+ */
5757
+#undef TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P
5758
+#define        TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P zip_libgcc_floating_mode_supported_p
5759
+
5760
+/* TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P(MODE) ... Define this to return
5761
+ * nonzero for machine modes for which the port has small register classes.  If
5762
+ * target hook returns nonzero for a given MODE, the compiler will try to
5763
+ * minimize the lifetime of registers in MODE.  The hook may be called with
5764
+ * VOIDmode as an argument.  In this case, the hook is expected to return
5765
+ * nonzero if it returns nonzero for any mode.
5766
+ *
5767
+ * The default version of this hook returns false for any mode.
5768
+ *
5769
+ * ZipCPU---Default sounds good.
5770
+ */
5771
+
5772
+/* 17.09.08 How scalar function values are returned */
5773
+
5774
+/* TARGET_FUNCTION_VALUE
5775
+ */
5776
+
5777
+/* LIBCALL_VALUE
5778
+ */
5779
+
5780
+
5781
+/* 17.09.09 How large values are returned */
5782
+
5783
+/* TARGET_RETURN_IN_MEMORY(TYP,FNTYP) ... This target hook should return a
5784
+ * nonzero value to say to return the function value in memory, just as large
5785
+ * structures are always returned.  Here type will be the data type of the value
5786
+ * and FNTYP will be the type of the function doing the returning, or NULL
5787
+ * for libcalls.
5788
+ *
5789
+ */
5790
+#undef TARGET_RETURN_IN_MEMORY
5791
+#define        TARGET_RETURN_IN_MEMORY zip_return_in_memory
5792
+
5793
+/* DEFAULT_PCC_STRUCT_RETURN
5794
+ * TARGET_STRUCT_VALUE_RTX
5795
+ * PCC_STATIC_STRUCT_RETURN
5796
+ * TARGET_GET_RAW_RESULT_MODE
5797
+ * TARGET_GET_RAW_ARG_MODE
5798
+ */
5799
+
5800
+
5801
+/* 17.09.10 Caller-Saves Register Allocation */
5802
+/* 17.09.11 Function Entry and Exit */
5803
+/* 17.09.12 Generating code for profiling */
5804
+/* 17.09.13 Permitting tail calls*/
5805
+/* 17.09.14 Stack smashing protection */
5806
+/* 17.09.15 Miscellaneous register hooks */
5807
+
5808
+/* TARGET_CALL_FUSAGE_CONTAINS_NON_CALLEE_CLOBBERS
5809
+ * ZipCPU --- default is good enough for us.
5810
+ */
5811
+
5812
+/* 17.10 Implementing VARARGS MACROS */
5813
+
5814
+/* ...
5815
+ */
5816
+
5817
+/* void TARGET_SETUP_INCOMING_VARARGS(A,M,T,I,S) ... This target hook offers an
5818
+ * alternative to using __builtin_saveregs and defining the hook TARGET_EXPAND..
5819
+ * _BUILTIN_SAVEREGS.  Use it to store the anonymous register arguments into the
5820
+ * stack so that all the arguments appear to have been passed consecutively
5821
+ * on the stack.  Once this is done, you can use the standard implementation
5822
+ * of varargs that works for machines that pass all their arguments on the
5823
+ * stack.
5824
+ */
5825
+// #undef      TARGET_SETUP_INCOMING_VARARGS
5826
+// #define     TARGET_SETUP_INCOMING_VARARGS   zip_setup_incoming_varargs
5827
+
5828
+/* ...
5829
+ */
5830
+
5831
+/* 17.11 Trampolines for Nested Functions */
5832
+
5833
+/* TARGET_ASM_TRAMPOLINE_TEMPLATE ... This hook is called by
5834
+ * assemble_trampoline_template to output, on the stream f, assembler code for
5835
+ * a block of data that contains the constant parts of a trampoline.  This code
5836
+ * should not include a label--the label is taken care of automatically.
5837
+ *
5838
+ * ZipCPU -- looks like we need to do this.
5839
+ */
5840
+#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
5841
+#define        TARGET_ASM_TRAMPOLINE_TEMPLATE  zip_asm_trampoline_template
5842
+
5843
+/* TRAMPOLINE_SECTION ... Return the section into which the trampoline template
5844
+ * is to be placed.  The default value is readonly_data_section.
5845
+ *
5846
+ * ZipCPU--default should be good enough.
5847
+ */
5848
+
5849
+/* TRAMPOLINE_SIZE ... A C expression for the size (in bytes) of the trampoline
5850
+ * as an integer.
5851
+ *
5852
+ * ZipCPU--it's three instructions, or 96 bits.  However, 32-bits is our minimal
5853
+ * addressible unit, so what size do we offer here?  We'll stick with the number
5854
+ * of bytes, but we may need to change this later.
5855
+ *
5856
+ */
5857
+// #warning "May need to redefine trampoline_size in words, not bytes"
5858
+#undef TRAMPOLINE_SIZE
5859
+#define        TRAMPOLINE_SIZE 3
5860
+
5861
+/* TRAMPOLINE_ALIGNMENT ... alignment required for trampolines, in bits.
5862
+ *
5863
+ * Well that's well known in ZipCPU --- 32-bits.
5864
+ */
5865
+#undef TRAMPOLINE_ALIGNMENT
5866
+#define        TRAMPOLINE_ALIGNMENT    32
5867
+
5868
+/* void TARGET_TRAMPOLINE_INIT(RTX,TREE,RTX CH) ... This hook is called to
5869
+ * initialize a trampoline.  m_tramp is an RTX for the memory block for the
5870
+ * trampoline; TREE is the FUNCTION_DECL for the nested fucntion;  CH is an
5871
+ * rtx for the static chain value that should be passed to the function when
5872
+ * it is called.
5873
+ *
5874
+ * ZipCPU ... Can we get by without this?
5875
+ */
5876
+#undef TARGET_TRAMPOLINE_INIT
5877
+#define        TARGET_TRAMPOLINE_INIT  zip_trampoline_init
5878
+
5879
+/* TARGET_TRAMPOLINE_ADJUST_ADDRESS(RTX) ... This hook should perform any
5880
+ * machine-specific adjustment in the address of the trampoline.  Its argument
5881
+ * contains the address of the memory block that was passed to
5882
+ * TARGET_TRAMPOLINE_INIT.  In case the address to be used for a function call
5883
+ * should be different from the address at which the template was stored, the
5884
+ * different address should be returned; otherwise addr should be returned
5885
+ * unchanged.  If the hook is not defined, RTX (addr) will be used for function
5886
+ * calls.
5887
+ *
5888
+ * ZipCPU--works for us!
5889
+ */
5890
+
5891
+/* CLEAR_INSN_CACHE(BEG,END) ... If defined, expands to a C expression clearing
5892
+ * the instruction cache in the specified interval.  The definition of this
5893
+ * macro would typically be a series of asm statements.   Both BEG and END are
5894
+ * pointer expressions.
5895
+ *
5896
+ * ZipCPU --- Ouch!  We have no way to do this (yet)!
5897
+ */
5898
+
5899
+/* TRANSFER_FROM_TRAMPOLINE ... Define this macro is trampolines need a special
5900
+ * subroutine to do their work.  THe macro should expand to a series of asm
5901
+ * statements which will be compiled with GCC.  They go in a library function
5902
+ * named __transfer_from_trampoline.
5903
+ *
5904
+ * We may need to rethink trampolines on ZipCPU.
5905
+ */
5906
+
5907
+
5908
+/* 17.12 Implicit Calls to Library Routines */
5909
+
5910
+/* DECLARE_LIBRARY_RENAMES
5911
+ *
5912
+ * ZipCPU: Don't need it.
5913
+ */
5914
+
5915
+/* TARGET_INIT_LIBFUNCS(VOID) ... This hook should declare additional library
5916
+ * routines or rename existing ones, using the functions set_optab_libfunc and
5917
+ * init_one_libfunc defined in optabs.c.  init_optabs calls this macro after
5918
+ * initializing all the normal library routines.
5919
+ *
5920
+ * Most ports don't need to define this hook, so we won't either.
5921
+ */
5922
+
5923
+/* TARGET_LIBFUNC_GNU_PREFIX ... If false (the default), internal library
5924
+ * routines start with two underscores.  If set to true, these routines start
5925
+ * with __gnu_ instead.
5926
+ *
5927
+ * ZipCPU: No change necessary.
5928
+ */
5929
+
5930
+/* FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE,COMPARISON) ... This macro should return
5931
+ * true if the library routine that implements the floating point comparison
5932
+ * operator comparison in mode mode will return a boolean and false if it will
5933
+ * return a tristate.
5934
+ *
5935
+ * Most ports don't need to define this macro, so Zip CPU won't either.
5936
+ */
5937
+
5938
+/* TARGET_HAS_NO_HW_DIVIDE ... This macro should be defined if the target has no
5939
+ * hardware divide instructions.  If this macro is defined, GCC will use an
5940
+ * algorithm which makes use of simple logical and arithmetic operations for
5941
+ * 64-bit division.  If the macro is not defined, GCC will use an algorithm
5942
+ * which makes use of a 64-bit by 32-bit divide primitive.
5943
+ *
5944
+ * Zip CPU, though, doesn't have the 64-bit by 32-bit divide primitive, thus
5945
+ * we have no HW DIVIDE (for now).
5946
+ */
5947
+#define        TARGET_HAS_NO_HW_DIVIDE
5948
+
5949
+/* TARGET_EDOM ... The value of EDOM on the target machine, as a C integer
5950
+ * expression.  If you don't define this macro, GCC does not attempt to deposit
5951
+ * the value of EDOM into errno directly.  Look in /usr/include/errno.h to find
5952
+ * the value of EDOM on your system.
5953
+ *
5954
+ * EDOM is the error created when a math argument is out of the domain of the
5955
+ * function.
5956
+ *
5957
+ * ZipCPU: Don't need it---I don't think.
5958
+ */
5959
+
5960
+/* GEN_ERRNO_RTX ... Define this macro as a C exrpession to create an rtl
5961
+ * expression that refers to the global "variable" errno.  (On certain
5962
+ * systems, errno may not actually be a variable.)  If you don't define this
5963
+ * macro, a reasonable default is used.
5964
+ *
5965
+ * ZipCPU --- if a reasonable default is used, we'll use that--especially since
5966
+ * I doubt we'll be using errno for a while.
5967
+ */
5968
+
5969
+/* NEXT_OBJC_RUNTIME ... Set this macro to 1 to use the "NeXT" Objective-C
5970
+ * message sending conventions by default.  This calling convention involves
5971
+ * passing the object, the selector and the method arguments all at once to the
5972
+ * method-lookup library function.  This is the usual setting when targetting
5973
+ * Darwin/Mac OS X systems, which have the NeXT runtime installed.
5974
+ *
5975
+ * If the macro is set to 0, ...
5976
+ *
5977
+ * Doesn't look relevant (yet) for the Zip CPU--especially since we don't have
5978
+ * an O/S yet.
5979
+ */
5980
+
5981
+
5982
+
5983
+/* 17.13 Addressing Modes */
5984
+
5985
+/* C expressions that are nonzero if the machine supports pre-increment,
5986
+ * pre-decrement, post-increment, or post-decrement addressing respectively.
5987
+ */
5988
+#define        HAVE_PRE_INCREMENT      (0)
5989
+#define        HAVE_PRE_DECREMENT      (0)
5990
+#define        HAVE_POST_INCREMENT     (0)
5991
+#define        HAVE_POST_DECREMENT     (0)
5992
+
5993
+/* C expression that is nonzero if the machine supports pre- or post- address
5994
+ * side-effect generation involving constants other than the size of the memory
5995
+ * operand.
5996
+ */
5997
+#define        HAVE_PRE_MODIFY_DISP    (0)
5998
+#define        HAVE_POST_MODIFY_DISP   (0)
5999
+
6000
+/* C expression that is non-zero if the machine supports pre- or post-address
6001
+ * side-effect generation involving a register displacement.
6002
+ */
6003
+#define        HAVE_PRE_MODIFY_REG     (0)
6004
+#define        HAVE_POST_MODIFY_REG    (0)
6005
+
6006
+/* CONSTANT_ADDRESS_P(X) ... A C expression that is 1 if the RTX X is a constant
6007
+ * which is a valid address.  On most machines the default definition ... is
6008
+ * acceptable, but a few machines are more restrictive as to which constant
6009
+ * addresses are supported.
6010
+ *
6011
+ * Zip CPU is designed for offset addresses, not constant addresses.  Although
6012
+ * the CPU will support 18-bit signed constant addresses, the assembler and
6013
+ * general programming model do not.  Further, without knowing where the final
6014
+ * address will be located, this is an unusable model.  Therefore we will
6015
+ * define this as not supported.
6016
+ *
6017
+ * In hindsight, this isn't true--labels and symbols are valid addresses, and
6018
+ * they are also constant addresses.  Hence, we leave this at its default.
6019
+ */
6020
+// #undef      CONSTANT_ADDRESS_P
6021
+// #define     CONSTANT_ADDRESS_P(X)   (0)
6022
+
6023
+/* CONSTANT_P(X) ... CONSTANT_P, which is defined by target-independent code, accepts integer values expressions whose values are not explicitly known, such as symbol_ref, label_ref, and high expressions and const arithmetic expressions, in addition to const_int and const_double expressions.
6024
+ *
6025
+ * Huh???
6026
+ */
6027
+// #define CONSTANT_P(X) ???
6028
+
6029
+/* A number, the maximum number of registers that can appear in a valid memory
6030
+ * address.
6031
+ */
6032
+#define        MAX_REGS_PER_ADDRESS    1
6033
+
6034
+/* TARGET_LEGITIMATE_ADDRESS_P(MODE,RTX,STRICT) ... A function that returns
6035
+ * whether RTX is a legitimate memory address on the target machine for a
6036
+ * memory operation of mode MODE.
6037
+ */
6038
+#undef TARGET_LEGITIMATE_ADDRESS_P
6039
+#define TARGET_LEGITIMATE_ADDRESS_P    zip_legitimate_address_p
6040
+
6041
+/* ECO32 suggested we do something like ... */
6042
+#ifdef IGNORE_THIS_FOR_NOW
6043
+#define        TARGET_LEGITIMATE_ADDRESS_P(MODE,X,STRICT)                      \
6044
+       do {                                                    \
6045
+               if (GET_CODE(X) == PLUS) {                      \
6046
+                       rtx     op1, op2;                       \
6047
+                       op1 = XEXP(X, 0); op2 = XEXP(X, 1);     \
6048
+                       if ((GET_CODE(op1) == REG)              \
6049
+                               &&(CONSTANT_ADDRESS_P(op2))     \
6050
+                               &&(REGNO_OK_FOR_BASE_P(REGNO(op1))))    \
6051
+                               goto LABEL;                     \
6052
+               } if ((REG_P(X))&&(REGNO_OK_FOR_BASE_P(REGNO(X)))) \
6053
+                       goto LABEL;                             \
6054
+               if ((GET_CODE(X) == SYMBOL_REF)                 \
6055
+                       ||(GET_CODE(X) == LABEL_REF)            \
6056
+                       ||(GET_CODE(X) == CONST))               \
6057
+                       goto LABEL;                             \
6058
+       } while(0)
6059
+#endif
6060
+
6061
+
6062
+/* TARGET_MEM_CONSTRAINT ... A single character to be used instead of the
6063
+ * default 'm' character for general memory addresses.  This defines the
6064
+ * constraint letter which matches the memory addresses accepted by
6065
+ * TARGET_LEGITIMATE_ADDRESS_P.  Define this macro if you want to support new
6066
+ * address format in your back end without changing the semantics of the 'm'
6067
+ * constraint.  This is necessary in order to preserve functionality of inline
6068
+ * assembly constructs using the 'm' constraint.
6069
+ *
6070
+ * ZipCPU--doesn't look like we need to define this at all.
6071
+ */
6072
+
6073
+/* FIND_BASE_TERM(X) ... A C expression to determine the base term of address
6074
+ * X or to provide a simplified version of X from which alias.c can easily find
6075
+ * the base term.  This macro is used in only two places: find_base_value and
6076
+ * find_base_term in alias.c.
6077
+ *
6078
+ * It is always safe for this macro  to not be defined.  It exists so that
6079
+ * alias analysis can understand machine-dependent addresses.
6080
+ *
6081
+ * ZipCPU: We'll skip this then.
6082
+ */
6083
+
6084
+/* TARGET_LEGITIMIZE_ADDRESS(RTX,OLD,MODE) ... This hook is given an invalid
6085
+ * memory address RTX for an operand of mode MODE and should try to return a
6086
+ * valid memory address.  RTX will always be the result of a call to
6087
+ * break_out_memory_refs, and OLD will be the operand that was given to that
6088
+ * function to produce RTX.
6089
+ *
6090
+ * ZipCPU -- this may be worth coming back to.
6091
+ */
6092
+// #undef      TARGET_LEGITIMIZE_ADDRESS
6093
+// #define     TARGET_LEGITIMIZE_ADDRESS       zip_legitimize_address
6094
+
6095
+/* LEGITIMIZE_RELOAD_ADDRESS(X,MODE,OP,TYPE,IND,WIN) ... A C compound statement
6096
+ * that attempts to replace X, which is an address that needs reloading, with
6097
+ * a valid memory address for an operand of mode MODE.  WIN will be a C
6098
+ * statement label elsewhere in the code.  It is not necessary to define this
6099
+ * macro, but it might be useful for performance reasons.
6100
+ *
6101
+ * ZipCPU: This is worth coming back to, according to the notes page, but it
6102
+ * may also be a difficult macro to use.  Look at other implementations before
6103
+ * we dive into this.
6104
+ */
6105
+// #undef LEGITIMIZE_RELOAD_ADDRESS
6106
+// #define LEGITIMIZE_RELOAD_ADDRESS
6107
+
6108
+/* TARGET_MODE_DEPENDENT_ADDRESS_P(ADDR,SPACE) ... This hook returns true
6109
+ * if memory address addr in address space addrspace can have different meanings
6110
+ * depending on the machine mode of the memory reference it is used for or if
6111
+ * the address is valid for some modes but not others.
6112
+ */
6113
+#undef TARGET_MODE_DEPENDENT_ADDRESS_P
6114
+#define        TARGET_MODE_DEPENDENT_ADDRESS_P         zip_mode_dependent_address_p
6115
+
6116
+/* TARGET_LEGITIMATE_CONSTANT_P
6117
+ */
6118
+
6119
+/* TARGET_DELIGITIMIZE_ADDRESS(RTX)
6120
+ */
6121
+
6122
+/* TARGET_CONST_NOT_OK_FOR_DEBUG_P(RTX) ... This hook should return true if RTX
6123
+ * should not be emitted into debug sections.
6124
+ */
6125
+
6126
+/* TARGET_CANNOT_FORCE_CONST_MEM(MODE,RTX) ... This hook should return true if
6127
+ * RTX is a form that cannot (or should not) be spilled to the constant pool.
6128
+ * MODE is the mode of X.  The default version returns false.
6129
+ */
6130
+
6131
+/* TARGET_USE_BLOCKS_FOR_CONSTANT_P(MODE,RTX) ... This hook should return true
6132
+ * if pool entries for constant RTX can be placed in an object_block structure.
6133
+ * MODE is the mode of X.  The default version returns false for all constants.
6134
+ *
6135
+ *????
6136
+ */
6137
+// #warning "Huh?"
6138
+
6139
+/* TARGET_USE_BLOCKS_FOR_DECL_P(DECL) ... This hook should return true if pool
6140
+ * entries for DECL should be placed in an object_block structure.  The default
6141
+ * version returns true for all DECL's.
6142
+ *
6143
+ * Sounds good.
6144
+ */
6145
+
6146
+/* TARGET_BUILTIN_RECIPROCAL(TREE) ... This hook should return the DECL of a
6147
+ * function that implements the reciprocal of the machine specific builtin
6148
+ * function fndecl, or NULL_TREE if such a function is not available.
6149
+ */
6150
+
6151
+/* TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD(VOID) ... This hook should return the
6152
+ * DECL of a function f that given an address addr as an argument returns a mask
6153
+ * m that can be used to extrract from two vectors the relevant data that
6154
+ * resides in addr in case addr is not properly aligned.
6155
+ *
6156
+ * Zip CPU does not support vectorization.
6157
+ */
6158
+
6159
+/* Other vector, SIMD, and GOACC macros skipped as Zip CPU doesn't support
6160
+ * such data accesses and manipulation.
6161
+ */
6162
+
6163
+/* 17.14 Anchored Addresses */
6164
+
6165
+/* TARGET_MIN_ANCHOR_OFFSET ... The minimum offset that should be applied to
6166
+ * a section anchor.  On most targets, it should be the smallest offset that
6167
+ * can be applied to a base register while still giving a legitimate address for
6168
+ * every mode.  The default value is 0.
6169
+ *
6170
+ * On the Zip CPU, this is the minimum operand B offset to a LOD or STO
6171
+ * operation, which would be a signed 14 bit number.
6172
+ */
6173
+#undef TARGET_MIN_ANCHOR_OFFSET
6174
+#define TARGET_MIN_ANCHOR_OFFSET       zip_min_anchor_offset
6175
+
6176
+/* TARGET_MAX_ANCHOR_OFFSET ... Like TARGET_MIN_ANCHOR_OFFSET, but the maximum
6177
+ * (inclusive) offset that should be applied to section anchors.  The default
6178
+ * value is 0.
6179
+ */
6180
+#undef TARGET_MAX_ANCHOR_OFFSET
6181
+#define TARGET_MAX_ANCHOR_OFFSET       zip_max_anchor_offset
6182
+
6183
+/* TARGET_ASM_OUTPUT_ANCHOR(RTX) ... Write the assembly code to define section
6184
+ * anchor RTX, which is a SYMBOL_REF for which 'SYMBOL_REF_ANCHOR_P(RTL) is
6185
+ * true.  The hook is called with the assembly output position set to the
6186
+ * beginning of SYMBOL_REF_BLOCK(X).
6187
+ *
6188
+ * If ASM_OUTPUT_DEF is available, the hook's default definition uses it to
6189
+ * define the symbol as '. + SYMBOL_REF_BLOCK_OFFSET(RTL)'.  If ASM_OUTPUT_DEF
6190
+ * is not available, the hook's default definition is NULL, which disables the
6191
+ * use of section anchors altogether.
6192
+ *
6193
+ * Section anchors will be very valuable in Zip CPU assembly, therefore we
6194
+ * must define this hook.
6195
+ */
6196
+// #undef      TARGET_ASM_OUTPUT_ANCHOR
6197
+// #define     TARGET_ASM_OUTPUT_ANCHOR        zip_asm_output_anchor
6198
+
6199
+/* TARGET_USE_ANCHORS_FOR_SYMBOL_P(RTX) ... Return true if GCC should attempt
6200
+ * to use anchors to access SYMBOL_REF X.  You can assume SYMBOL_REF_HAS_BLOCK_INFO_P(X) and !SYMBOL_REF_ANCHOR_P(X).
6201
+ *
6202
+ * The default version is correct for most targets, but you might need to intercept this hook to handle things like target specific attributes or target-specific sections.
6203
+ *
6204
+ * Not knowing anything more, we'll leave the default as is for the Zip CPU.
6205
+ */
6206
+// #undef TARGET_USE_ANCHORS_FOR_SYMBOL_P
6207
+// #define TARGET_USE_ANCHORS_FOR_SYMBOL_P     zip_use_anchors_for_symbol_p
6208
+
6209
+/* 17.15 Condition Code Status */
6210
+
6211
+/* 17.15.1 Representation of condition codes using (cc0) --- that's us */
6212
+
6213
+/* CC_STATUS_MDEP ... C code for a data type which is used for declaring
6214
+ * the mdep component of cc_status.  It defaults to int.
6215
+ *
6216
+ * ZipCPU---Int is good for us.
6217
+ */
6218
+
6219
+/* CC_STATUS_MDEP_INIT ... A C expression to initialize the mdep field to
6220
+ * "empty".  The default definition does nothing, since most machines don't
6221
+ * use the field anyway.  If you want to use the field, you should probably
6222
+ * define  this macro to initialize it.
6223
+ */
6224
+
6225
+/* NOTICE_UPDATE_CC(EXP, INSN) ... A C compound statement to set the components
6226
+ * of cc_status appropriately for an insn insn whose body is exp.  It is this
6227
+ * macro's responsibility to recognize insns that set the condition code as
6228
+ * a byproduct of other activity as well as those that explicitly set (cc0).
6229
+ *
6230
+ * ZipCPU --- We need this, as not all expressions set (cc0).
6231
+ *
6232
+ */
6233
+#define        NOTICE_UPDATE_CC(EXP, INSN)     zip_update_cc_notice(EXP, INSN)
6234
+
6235
+
6236
+/* 17.15.2 Representation of condition codes using registers */
6237
+/* ... which the ZipCPU doesn't have.  The ZipCPU has a CC0 register, and hence
6238
+ * this section isn't supposed to apply.
6239
+ */
6240
+
6241
+/* SELECT_CC_MODE(op, x, y)
6242
+ */
6243
+
6244
+/* TARGET_CANONICALIZE_COMPARISON(int,rtx *, rtx *, bool) ... On some machines
6245
+ * (such as the ZipCPU) not all possible comparisons are defined, but you can
6246
+ * convert an invalid comparison into a valid one.  For example, the Alpha
6247
+ * does not have a GT comparison, but you can use an LT comparison instead and
6248
+ * swap the order of the operands.
6249
+ *
6250
+ * On such machines, implement this hook to do any required conversions:  code
6251
+ * is the initial comparison code and op0 and op1 are the left and right
6252
+ * operands of the comparison, respectively.  If op0_preserve_value is true the
6253
+ * implementation is not allowed to change the value of op0 since the value
6254
+ * might be used in RTXs which aren't comparisons.  E.g. the implementation is
6255
+ * not allowed to swap operands in that case.
6256
+ *
6257
+ * GCC will not assume that the comparison resulting from this macro is valid
6258
+ * but will see if the resulting insn matches a pattern in the 'md' file.
6259
+ *
6260
+ * You need not implement this hook if it would never change the comparison
6261
+ * code or operands.
6262
+ *
6263
+ * In the case of the ZipCPU, the ZipCPU only keeps track of 8 possible
6264
+ * comparisons, and bastardizing other comparisons into those 8 is extremely
6265
+ * painful.  Therefore, we *need* this capability to make certain we can use
6266
+ * our comparisons successfully.
6267
+ *
6268
+ * The only problem is ... this hook appears to only be called on non-CC0
6269
+ * machines.  Hence, defining it hasn't done anything for us.
6270
+ */
6271
+// #define     TARGET_CANONICALIZE_COMPARISON  zip_canonicalize_comparison
6272
+
6273
+/* 17.16 Relative costs of operations */
6274
+
6275
+
6276
+// #define     REGISTER_MOVE_COST(MODE,FROM,TO)        ((MODE==DImode)||(MODE==DFmode))?4:2
6277
+// #define     TARGET_REGISTER_MOVE_COST
6278
+// #define     MEMORY_MOVE_COST(MODE, CLASS, IN)       ((MODE==DImode)||(MODE==DFmode))?8:7
6279
+/* TARGET_REGISTER_MOVE_COST(M,FRM,TO) ... This target hook should return the
6280
+ * cost of moving data of mode M from a register in class FRM to one in class
6281
+ * TO.  The classes are expressed using the enumeration values such as
6282
+ * GENERAL_REGS.  A value of 2 is the default; other values are interpreted
6283
+ * relative to that.
6284
+ *
6285
+ * It is not required that the cost always equal 2 when FROM is the same as TO;
6286
+ * on some machines it is expensive to move between registers if they are not
6287
+ * general registers.
6288
+ *
6289
+ * If reload sees ...
6290
+ *
6291
+ * ZipCPU ... We can leave this at its default value of 2.
6292
+ */
6293
+
6294
+/* TARGET_MEMORY_MOVE_COST(MOD,CL,IN) ... This target hook should return the
6295
+ * cost of moving data of mode MOD between a register of class CL and memory.
6296
+ * IN is false if the value is to be written to memory, true if it is to be
6297
+ * read in.  This cost is relative to those in TARGET_REGISTER_MOVE_COST.
6298
+ * If moving between registers and memory is more expensive that between two
6299
+ * registers, you should add this target hook to express the relative cost.
6300
+ *
6301
+ * If you do not add this target hook, GCC uses a default cost of 4 plus the
6302
+ * cost of copying via a secondary reload register, if one is needed.  If your
6303
+ * machine requires a secondary reload register to copy between memory and a
6304
+ * register of CL but the reload mechanism is more complex than copying via
6305
+ * an intermediate, use this target hook to reflect the actual cost of the
6306
+ * move.
6307
+ *
6308
+ * ZipCPU --- Memory moves are more expensive than twice the cost of register
6309
+ * moves, so let's make certain this is defined.
6310
+ */
6311
+#define        TARGET_MEMORY_MOVE_COST zip_memory_move_cost
6312
+
6313
+// #warning "This needs to be double checked, and annotated"
6314
+#define        BRANCH_COST(SPEED,PREDICTABLE)          ((SPEED)?2:5)
6315
+
6316
+/* Define this macro as a C expression which is nonzero if accessing less than
6317
+ * a word of memory (i.e. a 'char' or a 'short') is no faster than accessing
6318
+ * a word of memory.
6319
+ */
6320
+#define        SLOW_BYTE_ACCESS        1
6321
+
6322
+/* MOVE_RATIO(SPD) ... The threshold of number of scalar memory-to-memory move
6323
+ * instructions, below which a sequence of instructions should be generated
6324
+ * instead of a string move instruction or a library call.  Increasing the
6325
+ * value will always make code faster, but eventually incurs high cost in
6326
+ * increased code size.
6327
+ */
6328
+#define        MOVE_RATIO(SPD) 5
6329
+
6330
+/* TARGET_USE_BY_PIECES_INFRASTRUCTURE_P(SZ,ALGN,OP,SPD) ...
6331
+ */
6332
+// #undef      TARGET_USE_BY_PIECES_INFRASTRUCTURE_P(S,A,OP,SPD)
6333
+// #define     TARGET_USE_BY_PIECES_INFRASTRUCTURE_P(S,A,OP,SPD)// needs hook
6334
+
6335
+/* CLEAR_RATIO(SPD) ... The threshold number of scalar move instructions, below
6336
+ * which a sequence of instructions should be generated to clear memory instead
6337
+ * of a string clear instruction or a library call.  Increasing the value will
6338
+ * always make the code faster, but eventually incurs high cost in increased
6339
+ * code size.
6340
+ */
6341
+#define        CLEAR_RATIO(SPD)        MOVE_RATIO(SPD)
6342
+
6343
+/* NO_FUNCTION_CSE ... Define this macro to be true if it is as good or better
6344
+ * to call a constant function address than to call an address kept in a
6345
+ * register.
6346
+ *
6347
+ * On the Zip CPU, constant function addresses--especially relative ones,
6348
+ * can be optimized into a single cycle delay.  Register jumps will always
6349
+ * stall the whole (5-stage) pipeline.
6350
+ */
6351
+#define        NO_FUNCTION_CSE
6352
+
6353
+/* TARGET_ADDRESS_COST ... This hook computes the cost of an addressing mode
6354
+ * that contains address.  If not defined, the cost is computed from the
6355
+ * address expression and the TARGET_RTX_COST hook.
6356
+ */
6357
+// We should define this for ZIP ... we're just not there yet
6358
+// int TARGET_ADDRESS_COST(rtx address, machine_mode mode, addr_space_t as, bool speed)
6359
+/* TARGET_ADDRESS_COST(ADDR,MODE,AS, SPD) ... This hook computes the cost of an
6360
+ * addressing mode that contains ADDR.  If not defined, the cost is computed
6361
+ * from the ADDR expression and the TARGET_RTX_COST hook.  In cases where more
6362
+ * than one form of an address is known, the form with the lowest cost will be
6363
+ * used.  If multiple forms have the same, lowest, cost, the one that is the
6364
+ * most complex will be used.
6365
+ *
6366
+ * ZipCPU really has only one address cost, the only type of address it
6367
+ * supports.  Sure, index addressing would cost us more, but we don't support
6368
+ * that so ... I think we're okay defining this as a constant.  Indeed, the
6369
+ * docs state that, "On RISC amchines, all instructions normally have the same
6370
+ * length and execution time.  Hence all addresses will have equal costs."
6371
+ */
6372
+#undef TARGET_ADDRESS_COST
6373
+#define        TARGET_ADDRESS_COST     zip_address_cost
6374
+
6375
+
6376
+/* TARGET_NO_SPECULATION_IN_DELAY_SLOTS_P ... This predicate controls the use
6377
+ * of the eager delay slot filler to disallow speculatively executed
6378
+ * instructions being placed in delay slots.  Targets such as certain MIPS
6379
+ * architectures posess both branches with and without delay slots.  As the
6380
+ * eager delay slot filler can decrease performance, disabling it is beneficial
6381
+ * when ordinary branches are available.  Use of delay slot branches filled
6382
+ * using basic filler is often still desirable as the delay slot can hide a
6383
+ * pipeline bubble.
6384
+ */
6385
+// How should Zip CPU define this--we have no delay slots.
6386
+
6387
+
6388
+/* 17.17 Instruction Scheduler */
6389
+
6390
+#define        TARGET_SCHED_ISSUE_RATE zip_sched_issue_rate
6391
+
6392
+/* 17.18 Dividing the Output into Sections */
6393
+
6394
+/* Switch to the text or data segment. */
6395
+#define        TEXT_SECTION_ASM_OP     "\t.text"
6396
+#define        DATA_SECTION_ASM_OP     "\t.data"
6397
+
6398
+// #undef      TARGET_LIBGCC_SDATA_SECTION
6399
+// #define     TARGET_LIBGCC_SDATA_SECTION     ".sdata"
6400
+
6401
+
6402
+/* 17.19 Position Independent Code */
6403
+
6404
+#define        PIC_OFFSET_TABLE_REGNUM                 zip_GOT
6405
+#define        PIC_OFFSET_TABLE_REG_CALL_CLOBBERED     0
6406
+// #define LEGITIMATE_PIC_OPERAND_P(X) should evaluate to X(GOT) only
6407
+
6408
+/* 17.20 Defining the Output Assembler Language */
6409
+
6410
+/* 17.20.4 Output and Generation of Labels */
6411
+
6412
+/* ASM_OUTPUT_LABEL
6413
+ * ... A default definition of this macro is provided which is correct for
6414
+ * most systems.
6415
+ */
6416
+
6417
+/* ASM_OUTPUT_FUNCTION_LABEL
6418
+ * ... if not defined, then the function name is defined in the usual manner
6419
+ * as a label.
6420
+ */
6421
+
6422
+/* ASM_OUTPUT_INTERNAL_LABEL ... Identical to ASM_OUTPUT_LABEL, except that name
6423
+ * is known to refer to a compiler-generated label.  The default definition
6424
+ * uses assemble_name_raw, which is like assemble_name except that it is more
6425
+ * efficient.
6426
+ */
6427
+
6428
+/* SIZE_ASM_OP ... A C string containing the appropriate assembler directive
6429
+ * to specify the size of a symbol, without any arguments.  ON systems that
6430
+ * use ELF, the dfault is "\t.size\t"; on other systems, the default is not to
6431
+ * define this macro.
6432
+ *
6433
+ * Define this amcro only if it is correct to use the default definitions of
6434
+ * ASM_OUTPUT_SIZE_DERECTIVE and ASM_OUTPUT_MEASURED_SIZE for your system.
6435
+ * If you need your own custom definitions of those macros, or if you do not
6436
+ * need explicit symbol sizes at all, do not define this macro.
6437
+ */
6438
+
6439
+/* ASM_OUTPUT_SIZE_DIRECTIVE
6440
+ * ASM_OUTPUT_MEASURED_SIZE
6441
+ */
6442
+
6443
+/* NO_DOLLAR_IN_LABEL ... Define this macro if the assembler does not accept
6444
+ * the character '$' in label names.  By default constructors and destructors
6445
+ * in G++ have "$" in the identifiers.  If this label is defined, '.' is
6446
+ * used instead.
6447
+ */
6448
+
6449
+/* NO_DOT_IN_LABEL ... Define this macro if the assembler does not accept the
6450
+ * character '.' in label names.  By default constructors and destructors in
6451
+ * G++ have names that use '.'.  If this macro is defined, these names are
6452
+ * rewritten to avoid '.'.
6453
+ */
6454
+
6455
+/* TYPE_ASM_OP ... A C string containing the appropriate assembler directive to
6456
+ * specify the type of a symbol, without any arguments.  On systems that use
6457
+ * ELF the default in config/elfos.h is "\t.type\t"; on other systems, the default is not to define this macro.
6458
+ *
6459
+ * Define this macro only if it is correct to use the default definition of
6460
+ * ASM_OUTPUT_TYPE_DIRECTIVE forr your system.  If you need your own custom
6461
+ * definition of this macr, or if you do not need explicit symbol types at all,
6462
+ * do not define this macro.
6463
+ */
6464
+
6465
+/* TYPE OPERAND_FMD ... A
6466
+ */
6467
+
6468
+/* ASM_OUTPUT_TYPE_DIRECTIVE
6469
+ */
6470
+
6471
+/* ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) ...
6472
+ * if this macro is not defined, then the function name is defined in the usual
6473
+ * manner as a label (by means of ASM_OUTPUT_FUNCTION_LABEL).
6474
+ */
6475
+
6476
+/* ASM_DECLARE_FUNCTION_SIZE
6477
+ * ASM_DECLARE_COLD_FUNCTION_NAME
6478
+ * ASM_DECLARE_COLD_FUNCTION_SIZE
6479
+ * ASM_DECLARE_OBJECT_NAME
6480
+ * TARGET_ASM_DECLARE_CONSTANT_NAME
6481
+ */
6482
+/* ASM_DECLARE_REGISTER_GLOBAL(STREAM, DECL, REGNO, NAME) ... A C statement
6483
+ * (sans semicolon) to output to the stdio stream STREAM any text necessary for
6484
+ * claiming a register REGNO for a global variable DECL with name NAME.
6485
+ *
6486
+ * If you don't defin this macro, that is equivalent to dfining it to do
6487
+ * nothing.
6488
+ */
6489
+
6490
+/* ASM_FINISH_DECLARE_OBJECT
6491
+ * TARGET_ASM_GLOBALIZE_LABEL
6492
+ * TARGET_ASM_GLOBALIZE_DECL_NAME
6493
+ * TARGET_ASM_ASSEMBLE_UNDEFINED_DECL
6494
+ * ASM_WEAKEN_LABEL
6495
+ * ASM_WEAKEN_DECL
6496
+ * ASM_OUTPUT_WEAKREF
6497
+ * SUPPORTS_WEAK
6498
+ * TARGET_SUPPORTS_WEAK
6499
+ * MAKE_DECL_ONE_ONLY
6500
+ * SUPPORTS_ONE_ONLY
6501
+ * TARGTE_ASM_ASSEMBLE_VISIBILITY
6502
+ * TARGET_WEAK_NOT_IN_ARCHIVE_TOC
6503
+ * ASM_OUTPUT_EXTERNAL
6504
+ * TARGET_ASM_EXTERNAL_LIBCALL
6505
+ * TARGET_ASM_MARK_DECLPRESERVED
6506
+ * ASM_OUTPUT_LABELREF
6507
+ * TARGET_MANGLE_ASSEMBLER_NAME
6508
+ * ASM_OUTPUT_SYMBOL_REF
6509
+ * ASM_OUTPUT_LABEL_REF
6510
+ * TARGET_ASM_INTERNAL_LABEL
6511
+ * ASM_OUTPUT_DEBUG_LABEL
6512
+ * ASM_GENERATE_INTERNAL_LABEL
6513
+ * ASM_FORMAT_PRIVATE_NAME
6514
+ */
6515
+
6516
+/* ASM_OUTPUT_DEF ... A C statement to output to the stdio stream STREAM
6517
+ * assembler code which defines (equates) the symbol NAME to have the value
6518
+ * VALUE.
6519
+ *
6520
+ * ZipCPU---So many other things that we need depend upon this, that we need
6521
+ * to implement a non-default version.
6522
+ */
6523
+#define        ASM_OUTPUT_DEF  zip_asm_output_def
6524
+
6525
+/* ASM_OUTPUT_DEF_FROM_DECLS
6526
+ * TARGET_DEFERRED_OUTPUT_DEFS
6527
+ * ASM_OUTPUT_WEAK_ALIAS
6528
+ * OBJ_GEN_METHOD_LABEL
6529
+ */
6530
+
6531
+
6532
+/* 17.20.7 Output of Assembler Instructions */
6533
+
6534
+#define        REGISTER_NAMES { "R0","R1","R2","R3","R4","R5","R6","R7","R8","R9", \
6535
+       "R10","R11","R12","SP","CC","PC" }
6536
+
6537
+/* REGISTER_PREFIX     (Undefined by default)
6538
+ * LOCAL_LABEL_PREFIX  (Undefined by default)
6539
+ * USER_LABEL_PREFIX   defaults to "*"
6540
+ * IMMEDIATE_PREFIX    (Undefined by default)
6541
+ *
6542
+ * If defined, C string expressions to be used for the '%R', '%L', '%U', and
6543
+ * '%I' options of asm_fprintf (see 'final.c').  These are useful when a single
6544
+ * 'md' file must support multiple assembler formats.  In that case, the various
6545
+ * 'tm.h' files can define these macros differently.
6546
+ */
6547
+// #define     USER_LABEL_PREFIX       "*"
6548
+
6549
+/* Defining memory operand address formats is in this section. */
6550
+
6551
+/* 17.20.10 Assembler Commands for Alignment */
6552
+
6553
+/* JUMP_ALIGN(label) ... The alignment (log base 2) to put in front of label,
6554
+ * which is a common destination of jumps and has no fallthru incoming
6555
+ * edge.  This macro need not be defined if you don't want any special alignment
6556
+ * to be done at such a time.  Most machine descriptions do not currently define
6557
+ * this macro.
6558
+ *
6559
+ * ZipCPU---The assembler should automatically deal with label alignment, so
6560
+ * let's not do anything about it here.
6561
+ */
6562
+
6563
+/* TARGET_ASM_JUMP_ALIGN_MAX_SKIP
6564
+ */
6565
+
6566
+/* LABEL_ALIGN_AFTER_BARRIER
6567
+ * TARGET_ASM_LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP
6568
+ */
6569
+
6570
+/* LOOP_ALIGN(label)
6571
+ * TARGET_ASM_LOOP_ALIGN_MAX_SKIP
6572
+ * LABEL_ALIGN
6573
+ * TARGET_ASM_LABEL_ALIGN_MAX_SKIP
6574
+ */
6575
+
6576
+/* ASM_OUTPUT_SKIP(STREAM, NBYTES) A C statement to output to the stdio
6577
+ * stream an assembler instruction to advance the location counter by nbytes
6578
+ * bytes.
6579
+ */
6580
+
6581
+/* TARGET_ASM_LABEL_ALIGN */
6582
+/* Assembler Commands for Alignment */
6583
+#define        ASM_OUTPUT_ALIGN(STREAM,POWER)  \
6584
+               { int pwr = POWER; fprintf(STREAM, "\t.p2align %d\n", (pwr<2)?2:pwr); }
6585
+
6586
+
6587
+
6588
+/* 17.21 Controlling Debugging Information Format */
6589
+/* 17.22 Cross Compilation and Floating Point */
6590
+/* 17.23 Mode switching instructions */
6591
+/* 17.24 Defining target-specific uses of __attribute__ */
6592
+#undef TARGET_OPTION_OVERRIDE
6593
+#define        TARGET_OPTION_OVERRIDE  zip_override_options
6594
+
6595
+/* 17.25 Emulating TLS */
6596
+/* 17.26 Defining coprocessor specifics for MIPS targets*/
6597
+
6598
+ // ZipCPU isn't MIPS.
6599
+
6600
+/* 17.27 Parameters for Precompiled Header Validity Checking */
6601
+/* 17.28 C++ ABI parameters */
6602
+/* 17.29 Adding support for named address spaces */
6603
+/* 17.30 Miscellaneous Parameters */
6604
+
6605
+/* HAS_LONG_COND_BRANCH ... Define this boolean macro to indicate whether or
6606
+ * not your architecture has conditional branches that can span all of memory.
6607
+ * It is used in conjunction with an optimization that partitions hot and
6608
+ * cold basic blocks into separate sections of the executable.  If this macro
6609
+ * is set to false, gcc will convert any conditional branches that attempt to
6610
+ * cross between sections into unconditional branches or indirect jumps.
6611
+ *
6612
+ * ZipCPU --- The assembler renders long unconditional branch code without
6613
+ * problems, so we can pretend that such long branches exist.
6614
+ */
6615
+#define        HAS_LONG_COND_BRANCH true
6616
+
6617
+/* HAS_LONG_UNCOND_BRANCH ... Define this boolean macro to indicate whether
6618
+ * or not your architecture has unconditional branches that can span all of
6619
+ * memory.  (ZipCPU does ... via the LOD (PC),PC instruction.)  It is used in
6620
+ * conjunction with an optimization that partitions hot and cold basic blocks
6621
+ * into separate sections of the executable.  If this macro is set to false,
6622
+ * gcc will convert any unconditional branches that attempt to cross between
6623
+ * sections into indirect jumps.
6624
+ *
6625
+ * ZipCPU has the LOD (PC),PC instruction which can be used to implement a long
6626
+ * jump.
6627
+ */
6628
+#define        HAS_LONG_UNCOND_BRANCH  true
6629
+
6630
+/* CASE_VECTOR_MODE ... An alias for a machine mode name.  This is the machine
6631
+ * mode that eleemnts of a jump-table should have.
6632
+ *
6633
+ */
6634
+#define        CASE_VECTOR_MODE        SImode
6635
+
6636
+/* CASE_VECTOR_SHORTEN_MODE(MIN,MAX,BODY) ... Optional: return the preferred
6637
+ * mode for an addr_diff_vec when the minimum and maximum offset are known.
6638
+ * If you define this, it enables extra code in branch shortening to deal with
6639
+ * addr_diff_vec.  To make this work, you also have to define INSN_ALIGN and
6640
+ * make the alignment for addr_diff_vec explicit.  The body argument is provided so that the offset_unsigned and scale flags can be updated.
6641
+ *
6642
+ * ZipCPU---No advantage here.
6643
+ */
6644
+
6645
+/* CASE_VECTOR_PC_RELATIVE ... Define this exrpession to indicate when
6646
+ * jump-tables should contain relative addresses.  You need not define this
6647
+ * macro if jump-tables never contain relative addresses, or jump-tables
6648
+ * should contain relative addresses only when -fPIC or -FPIC is in effect.
6649
+ *
6650
+ * ZipCPU---No advantage in PC-Relative jump tables--except in PIC relative
6651
+ * code.
6652
+ */
6653
+
6654
+/* TARGET_CASE_VALUES_THRESHOLD(VOID) ... This function returns the smallest
6655
+ * number of different values for which it is best to use a jump-table instead
6656
+ * of a tree of conditional branches.  The default is four for machines with a
6657
+ * casesi instruction and five otherwise.  This is best for most machines.
6658
+ *
6659
+ * ZipCPU---Leave at the default.
6660
+ */
6661
+
6662
+/* WORD_REGISTER_OPERATIONS ... Define this macro to 1 if operations between
6663
+ * registers with integral mode smaller than a word are always performed on the
6664
+ * entire register.  Most RISC machines have this property and most CISC
6665
+ * machines do not.
6666
+ *
6667
+ * ZipCPU---We have the property, 'cause we're fairly risk.
6668
+ */
6669
+#undef WORD_REGISTER_OPERATIONS
6670
+#define        WORD_REGISTER_OPERATIONS        1
6671
+
6672
+/* LOAD_EXTEND_OP(MEMODE) ... Define this macro to be a C expression indicating
6673
+ * when insns that read memory in MEMMODE, an integral mode narrower than a
6674
+ * word, set the bits outside of MEMMODE to be either the sign extension or
6675
+ * zero-extension of the data read.  Return SIGN_EXTEND for values of MEMMODE
6676
+ * for which the insn sign-extends, ZERO_EXTEND for which it zero-extends, and
6677
+ * UNKNOWN for other modes.
6678
+ *
6679
+ * Do not define this macro if it would always return UNKNOWN.
6680
+ *
6681
+ * ZipCPU---This should be irrelevant, so we leave it undefined.
6682
+ */
6683
+#undef LOAD_EXTEND_OP
6684
+#define        LOAD_EXTEND_OP(MEM)     SIGN_EXTEND
6685
+
6686
+/* SHORT_IMMEDIATES_SIGN_EXTEND ... Define this macro to 1 if loading short immediate values into registers sign extends.
6687
+ *
6688
+ * ZipCPU---All immediates are sign extended, so yes.
6689
+ */
6690
+#undef SHORT_IMMEDIATES_SIGN_EXTEND
6691
+#define        SHORT_IMMEDIATES_SIGN_EXTEND    1
6692
+
6693
+/* TARGET_MIN_DIVISIONS_FOR_RECIP_MUL
6694
+ */
6695
+
6696
+/* MOVE_MAX ... The maximum number of bytes that a single instruction can move
6697
+ * quickly between memory and registers or between two memory locations.
6698
+ *
6699
+ * ZipCPU --- Although we can move 32-bits at a time, and most people would call
6700
+ * this 4-bytes, the compiler defines a byte as the minimum addressable unit.
6701
+ * Therefore, this is defined to be one.
6702
+ */
6703
+#define        MOVE_MAX        1
6704
+
6705
+/* MAX_MOVE_MAX ... The maximum number of bytes that a single instruction can
6706
+ * move quickly between memory and registers or between two memory ...
6707
+ *
6708
+ * ZipCPU --- this sounds just the same as MOVE_MAX, which is the default
6709
+ * definition of this.
6710
+ */
6711
+
6712
+/* SHIFT_COUNT_TRUNCATED ... A C expression that is nonzero if on this machine
6713
+ * the number of bits actually used for the count of a shift operation is equal
6714
+ * to the number of bits needed to represent the size of the object being
6715
+ * shifted.
6716
+ *
6717
+ * You need not define this macro if it would have the value of zero.
6718
+ *
6719
+ * ZipCPU---A shift of 33 (or more) in either direction will wipe out the
6720
+ * value in the register, therefore this value should be zero, the default.
6721
+ */
6722
+
6723
+/* TARGET_SHIFT_TRUNCATION_MASK(MODE) ... This function describes how the
6724
+ * standard shift patterns for MODE deal with shifts by negative amounts or by
6725
+ * more than the width of the mode.
6726
+ *
6727
+ * ZipCPU---The default is zero, since we didn't define SHIFT_COUNT_TRUNCATED.
6728
+ * This is the case for the ZipCPU as well.
6729
+ */
6730
+
6731
+/* TRULY_NOOP_TRUNCATION(OUTPREC,INPREC) ... A C expression which is nonzero
6732
+ * if on this machine it is safe to "convert" an integer of INPREC bits to one
6733
+ * of OUTPREC bits (where OUTPREC is smaller than INPREC) by merely operating on
6734
+ * it as if it had OUTPREC bist.  On many machines, this expression can be 1.
6735
+ *
6736
+ * ZiPCPU ... If both values are 32-bit, what conversion takes place?  If one is
6737
+ * 64-bit and the other 32-bit ... I suppose it would then be safe.
6738
+ */
6739
+#undef TRULY_NOOP_TRUNCATION
6740
+#define TRULY_NOOP_TRUNCATION(O,I)     1
6741
+
6742
+/* TARGET_MODE_REP_EXTENDED(MODE,REPMODE) ... The representation of an integral
6743
+ * mode can be such that the values are always extended to a wider integral
6744
+ * mode.  Return SIGN_EXTEND if values of MODE are represented in sign-extended
6745
+ * form to REPMODE.  Return UNKNOWN otherwise.  (Currently none of the targets
6746
+ * use zero-extended.
6747
+ *
6748
+ */
6749
+// #undef      TARGET_MODE_REP_EXTENDED
6750
+// #define     TARGET_MODE_REP_EXTENDED(R,M)   SIGN_EXTEND
6751
+
6752
+/* STORE_FLAG_VALUE ... A C expression describing the value returned by a
6753
+ * comparison operator with an integral mode and stored by a store-flag
6754
+ * instruction (cstoremode4) when the condition is true.  This description
6755
+ * must apply to all the cstoremode4 patterns and all the comparison operators
6756
+ * whose results have MODE_INT mode.
6757
+ *
6758
+ * ZipCPU---Doesn't really have a STORE_FLAG_VALUE instruction ...
6759
+ */
6760
+
6761
+/* FLOAT_STORE_FLAG_VALUE
6762
+ *
6763
+ * ZipCPU
6764
+ */
6765
+
6766
+/* VECTOR_STORE_FLAG_VALUE ... define this macro on machines that have vector
6767
+ * comparison operations that return a vector result ...
6768
+ *
6769
+ * ZipCPU---Doesn't support vector operations.
6770
+ */
6771
+
6772
+/* CLZ_DEFINED_VALUE_AT_ZERO(MODE, VAL)
6773
+ * CTZ_DEFINED_VALUE_AT_ZERO(MODE, VAL)
6774
+ *
6775
+ * A C expression that indicates whetther the architecture defines a value for
6776
+ * clz or ctz with a zero operand.  A result of 0 indicates the value is
6777
+ * undefined.  If the value is defined for only the RTL expression, the macro should evaluate to 1.  If the value also applies to the corresponding optab
6778
+ * entry, then the macro should evaluate to 2.  In cases where the value is
6779
+ * defined, value should be set to this value.
6780
+ * If this macro is not defined, the value of clz or ctz at zero is assumed to
6781
+ * be undefined.
6782
+ *
6783
+ * ZipCPU---Has neither clz nor ctz instructions, so we don't need this.
6784
+ */
6785
+
6786
+/* Pmode ... An alias for the machine mode for pointers.  On most machines,
6787
+ * define this to be the integer mode corresponding to the width of a
6788
+ * hardware pointer.  SImode on 32-bits machines, or DImode on 64-bit machines.
6789
+ * On some machines you must define this to be one of the partial
6790
+ * integer modes, such as PSImode.
6791
+ */
6792
+#undef Pmode
6793
+#define        Pmode   SImode
6794
+
6795
+/* FUNCTION_MODE ... An alais for the machine mode used for memory references to
6796
+ * function being called, in call RTL expressions.  On most CISC machines, where
6797
+ * an instruction can begin at any byte address, this should be QImode.  On most
6798
+ * RISC machines, where all instructions have fixed size and alignment, this
6799
+ * should be a mode with the same size and alignment as the machine instruction
6800
+ * words--typically SImode or HImode.
6801
+ *
6802
+ * ZipCPU---Definitely SImode, as with Pmode.  (All words are 32-bits, including
6803
+ * addresses on the ZipCPU.
6804
+ */
6805
+#undef FUNCTION_MODE
6806
+#define        FUNCTION_MODE   SImode
6807
+
6808
+/* STDC_0_IN_SYSTEM_HEADERS
6809
+ */
6810
+
6811
+/* TARGET_C_PREINCLUDE(V) ... Define this hook to return the name of  a header
6812
+ * file to be included at the start of all compilations, as if it had been
6813
+ * included with #include <file>.  If this hook returns NULL, or is not defined,
6814
+ * or if the header is not found, or if the user specifies -ffreestanding or
6815
+ * -nostdinc, no header is included.
6816
+ *
6817
+ * ZipCPU --- We don't have a standard library defined yet, so we'll leave this
6818
+ * as NULL.
6819
+ */
6820
+#undef TARGET_C_PREINCLUDE
6821
+#define        TARGET_C_PREINCLUDE     NULL
6822
+
6823
+/* TARGET_CXX_IMPLICIT_EXTERN_C(CONST CHAR *) ... Define this hook to add target
6824
+ * specific C++ implicit extern C functions.  If this function returns true
6825
+ * for the name of a file-scope function, that function implicitly gets extern
6826
+ * "C" linkage rather than whatever linkage the declaration would normally have.
6827
+ * An example of such function is WinMain on Win32 targets.
6828
+ *
6829
+ * ZipCPU---Not ready to deal with this yet.
6830
+ */
6831
+
6832
+/* NO_IMPLICIT_EXTERN_C ... Define this macro if the system header files
6833
+ * support C++ as well as C.  This macro inhibits the usual method of using
6834
+ * system header files in C++, which is to pretend that the file's contents
6835
+ * are enclosed in 'extern "C" {...}'.
6836
+ *
6837
+ *
6838
+ * ZipCPU --- Don't have either C or C++ headers, so let's skip this for now.
6839
+ * Eventually, though, I think ZipCPU and C++ would go very well together.
6840
+ */
6841
+
6842
+/* REGISTER_TARGET_PRAGMAS ... Define this macro if you want to implement any
6843
+ * target specific pragmas.
6844
+ *
6845
+ * ZipCPU --- let's not.
6846
+ */
6847
+
6848
+/* HANDLE_PRAGMA_PACK_WITH_EXPANSION ... Define this macro if macros should be
6849
+ * expanded in the arguments of #pragma pack().
6850
+ *
6851
+ * ZipCPU ... why?
6852
+ */
6853
+
6854
+/* TARGET_DEFAULT_PACK_STRUCT ... If your target requires a struct packing
6855
+ * default other than 0 (meaning the machine default), define this macro to
6856
+ * the necessary value (in bytes).  This must be a value that would also be
6857
+ * valid to use with #pragma pack() (that is a small power of two.
6858
+ */
6859
+
6860
+/* DOLLARS_IN_IDENTIFIERS
6861
+ * ZipCPU --- Default (not changing C)
6862
+ */
6863
+
6864
+/* INSN_SETS_ARE_DELAYED(INSN) ... Define this macro as a C expression that
6865
+ * is nonzero if it is safe for the delay slot schedule to place instructions
6866
+ * in the delay slot of INSN, even if they appear to use a resource set or
6867
+ * clobbered in INSN.  INSN is always a ...
6868
+ *
6869
+ * ZipCPU --- You need not define this macro if it would always return zero.
6870
+ */
6871
+
6872
+/* INSN_REFERENCES_ARE_DELAYED(INSN) ... Define this macro as a C expression
6873
+ * that is nonzero if it is safe for the delay slot schedule to place
6874
+ * instructions in the delay slot of INSN, even if they appear to set or clobber
6875
+ * a resource referenced in INSN.  INSN is always a jump_insn or an insn.  On
6876
+ * machines where some insn or jump_insn is really a function call and ...
6877
+ *
6878
+ * ZipCPU --- You need not define this macro if it would always return zero.
6879
+ */
6880
+
6881
+/* MULTIPLE_SYMBOL_SPACES ... Define this macro as a C expression that is
6882
+ * nonzero if, in some cases, global symbols from one translation unit may not
6883
+ * be bound to undefined symbols in another translation unit without user
6884
+ * intervention.  For instance, under Microsoft Windows symbols must be
6885
+ * explicitly imported from shared libraries (DLLs).
6886
+ *
6887
+ * ZipCPU---You need not define this macro if it would always evaluate to zero,
6888
+ * so we won't.
6889
+ */
6890
+
6891
+/* TARGET_MD_ASM_ADJUST
6892
+ */
6893
+/* MATH_LIBRARY ... Define this macro as a C constant ... you only need to
6894
+ * define this macro if the default of "m" is wrong.
6895
+ *
6896
+ * ZipCPU --- as we don't have a math library yet, building one such that "m"
6897
+ * works doesn't sound like a problem.  Let's not define this.
6898
+ */
6899
+
6900
+/* LIBRARY_PATH_ENV ... Define this as a C string constant for the environment
6901
+ * variable that specifies where the linker should look for libraries.
6902
+ *
6903
+ * Just in case we want to add libraries for ZipCPU, let's place them in
6904
+ * /usr/local/zip/lib, so as not to confuse them with our local systems
6905
+ * libraries.
6906
+ */
6907
+#define        LIBRARY_PATH_ENV        "/usr/local/zip/lib"
6908
+
6909
+/* TARGET_POSIX_IO ... Define this macro if the target supports the following
6910
+ * POSIX file fucntions: access, mkdir, and file locking with fcntl/F_SETLKW.
6911
+ *
6912
+ * ZipCPU does not.
6913
+ */
6914
+
6915
+/* MAX_CONDITIONAL_EXECUTE ... A C expression for the maximum number of
6916
+ * instructions to execute via conditional execution instructions instead of a
6917
+ * branch.  A value of BRANCH_COST+1 is the default if the machine does not use
6918
+ * cc0 and 1 if it does use cc0.
6919
+ *
6920
+ * ZipCPU---This sounds good enough for the ZipCPU as well--as long as we have
6921
+ * BRANCH_COST defined.  However, BRANCH_COST is defined as conditionally to
6922
+ * something else, so let's keep looking into this.
6923
+ */
6924
+
6925
+/* IFCVT_MODIFY_TESTS(CEINFO,TRUE,FALSE) ... Used if the target needs to
6926
+ * perform machine-dependent modifications on hte conditionals used for turning
6927
+ * basic blocks into conditionally executed code.  CEINFO points to a data
6928
+ * structure, struct ce_if_block, which contains information about the currently
6929
+ * processed blocks.  TRUE and FALSE are the tests that are used for
6930
+ * converting the then-block and the else-block, respectively.  Set either TRUE
6931
+ * or FALSE to a null pointer if the tests cannot be converted.
6932
+ *
6933
+ * ZipCPU --- I need to set this to properly take advantage of our conditional
6934
+ * execution and conditional testing capabilities.
6935
+ */
6936
+// #warning "Need to come back to this."
6937
+
6938
+/* IFCVT_MODIFY_MULTIPLE_TESTS(CEINFO, BB, TRUE, FALSE) ... Like
6939
+ * IFCVT_MODIFY_TESTS, but used when converting more complicated if-statements
6940
+ * into conditions combined by and and or operations.  BB contains the basic
6941
+ * block that contains the test that is currently being processed and about to
6942
+ * be turned into a condition.
6943
+ *
6944
+ *
6945
+ * ZipCPU --- I need to set this to properly take advantage of our conditional
6946
+ * execution and conditional testing capabilities.
6947
+ */
6948
+// #warning "Need to come back to this."
6949
+
6950
+
6951
+/* IFCVT_MODIFY_INSN(CEINFO, PATTERN, INSN) ... A C expression to modify the
6952
+ * PATTERN of an INSN that is to be converted to conditional execution format.
6953
+ * CEINFO points to a data structure, struct ce_if_block, which contains
6954
+ * information about the currently processed blocks.
6955
+ *
6956
+ *
6957
+ * ZipCPU --- I need to set this to properly take advantage of our conditional
6958
+ * execution and conditional testing capabilities.
6959
+ */
6960
+// #warning "Need to come back to this."
6961
+
6962
+
6963
+/* IFCVT_MODIFY_FINAL(CEINFO) ... A C expression to perform any final
6964
+ * machine dependent modifications in converting code to conditional
6965
+ * execution.  The involved basic blocks can be found in struct ce_if_block
6966
+ * structure pointed to be CEINFO.
6967
+ *
6968
+ *
6969
+ * ZipCPU --- I need to set this to properly take advantage of our conditional
6970
+ * execution and conditional testing capabilities.
6971
+ */
6972
+// #warning "Need to come back to this."
6973
+
6974
+
6975
+/* IFCVT_MODIFY_CANCEL(CEINFO) ... A C expression to cancel any machine
6976
+ * dependent modifications in converting code to conditional execution.  The
6977
+ * involved basic blocks can be found in the struct ce_if_block structure that
6978
+ * is pointed to by CEINFO.
6979
+ *
6980
+ *
6981
+ * ZipCPU --- I need to set this to properly take advantage of our conditional
6982
+ * execution and conditional testing capabilities.
6983
+ */
6984
+// #warning "Need to come back to this."
6985
+
6986
+
6987
+/* IFCVT_MACHDEP_INIT(CEINFO) ... A C expression to initialize any machine
6988
+ * specific data for if-conversion of the if-block in the CEINFO block structure
6989
+ * that is pointed by CEINFO.
6990
+ *
6991
+ *
6992
+ * ZipCPU --- I need to set this to properly take advantage of our conditional
6993
+ * execution and conditional testing capabilities.
6994
+ */
6995
+// #warning "Need to come back to this."
6996
+
6997
+
6998
+/* TARGET_MACHINE_DEPENDENT_REORG(VOID) ... If non-null, this hook performs a
6999
+ * target specific pass over the instruction stream.  The compiler will run it
7000
+ * at all optimization levels, just before the point at which it normally does
7001
+ * delayed branch scheduling.
7002
+ *
7003
+ * You need not implement the hook if it has nothing to do.
7004
+ *
7005
+ * ZipCPU---This may be part of a later upgrade, but shouldn't be needed to
7006
+ * just get us started.
7007
+ */
7008
+
7009
+
7010
+/* TARGET_INIT_BUILTINS(VOID) ... Define this hook if you ahve any machine
7011
+ * specific builtin functions that need to be defined.  It should be a function
7012
+ * that performs the necessary setup.  Machine specific builtin functions can be
7013
+ * useful to expand special machine instructions that would otherwise not
7014
+ * normally be generated because they have no equivalent in the source language.
7015
+ *
7016
+ * To create a built in function, call the function lang_hooks.builtin_function
7017
+ * which is defined by the language front end.  You can use any type nodes
7018
+ * set up by build_common_tree_nodes; only language front ends that use those
7019
+ * two functions will call "TARGET_INIT_BUILTINS".
7020
+ *
7021
+ * ZipCPU---We need to come back to this.  We should have several built-ins
7022
+ * defined: rtu(), wait(), halt(), save_context(cstackregno), and
7023
+ * restore_context(cstackregno).
7024
+ *
7025
+ */
7026
+#undef TARGET_INIT_BUILTINS
7027
+#define        TARGET_INIT_BUILTINS    zip_init_builtins
7028
+
7029
+/* TARGET_BUILTIN_DECL(CODE,INITP) ... Define this hook if you have any
7030
+ * machine specific builtin functions that need to be defined.  It should be a
7031
+ * function that returns the builtin function declaration for the builtin
7032
+ * function code code.  If there is no such builtin and it cannot be initialized
7033
+ * at this time if INITP is true the function should return NULL_TREE.  If
7034
+ * CODE is out of range the fucntion should return error-mark_node.
7035
+ *
7036
+ * ZipCPU ... needs to be done, don't know how to do it yet.
7037
+ */
7038
+#undef TARGET_BUILTIN_DECL
7039
+#define        TARGET_BUILTIN_DECL     zip_builtin_decl
7040
+
7041
+
7042
+/* TARGET_EXPAND_BUILTIN(TREE,TGT,SUB,MODE,IGNORE) ... Expand a call to a
7043
+ * machine specific built-in function that was set up by TARGET_INIT_BUILTINS.
7044
+ * TREE is the expression for the function call; the result should go to
7045
+ * TGT if that is convenient, and have mode MODE if that is convenient.  SUB
7046
+ * may be used as the target for computing one of EXP's operands.  IGNORE is
7047
+ * non-zero if the value is to be ignored.  This function should return the
7048
+ * result of the call to the built-in function.
7049
+ *
7050
+ * ZipCPU ... needs to do it, just to get our special intrinsic functions
7051
+ */
7052
+#define        TARGET_EXPAND_BUILTIN   zip_expand_builtin
7053
+
7054
+
7055
+/* TARGET_BUILTIN_CHKP_FUNCTION(FCODE) ... Allows the target to redefine
7056
+ * builtin functions used by Pointer Bounds Checker for code instrumentation.
7057
+ *
7058
+ * ZipCPU --- not interested.
7059
+ */
7060
+/* TARGET_CHKP_BOUND_TYPE
7061
+ * TARGET_CHKP_MAKE_BOUNDS_CONSTANT
7062
+ * TARGET_CHKP_INITIALIZE_BOUNDS
7063
+ *
7064
+ * ZipCPU --- Same as last one.
7065
+ */
7066
+
7067
+
7068
+/* TARGET_RESOLVE_OVERLOADED_BUILTIN(LOC, FN, ARGS) ... Select a replacement
7069
+ * for a machine specific built-in function that was set up by
7070
+ * TARGET_INIT_BUILTINS.
7071
+ *
7072
+ * ZipCPU --- If I go to the trouble to create a builtin, why would I want
7073
+ * to then overload it?
7074
+ */
7075
+
7076
+/* TARGET_FOLD_BUILTIN(FN,NARGS,ARGP,IGNORE) ... Fold a call to a machine
7077
+ * specific built-in function that was set up by 'TARGET_INIT_BUILTINS'  FN
7078
+ * is the declaration of the built-in function.  NARGS is the number of
7079
+ * arguments passed to the function; the arguments themselves are pointed to by
7080
+ * ARGP.  The result is another tree, valid for both GIMPLE and GENERIC,
7081
+ * containing as simplified expression for the call's result.  If IGNORE is
7082
+ * true the value will be ignored.
7083
+ *
7084
+ * ZipCPU --- You know, this and the previous couple sound like something
7085
+ * whereby I might be able replace bit-reversal code with my bit reverse
7086
+ * instruction.  That would be very useful, but not necessary to get me
7087
+ * started.
7088
+ */
7089
+
7090
+/* TARGET_GIMPLE_FOLD_BUILTIN
7091
+ * TARGET_COMPARE_VERSION_PRIORITY
7092
+ * TARGET_GET_FUNCTION_VERSIONS_DISPATCHER
7093
+ * TARGET_GENERATE_VERSION_DISPATCHER_BODY
7094
+ * TARGET_CAN_USE_DOLOOP_P
7095
+ * TARGET_INVALID_WITHIN_DOOLOOP
7096
+ * TARGET_LEGITIMATE_COMBINED_INSN
7097
+ * TARGET_CAN_FOLLOW_JUMP
7098
+ * TARGET_COMMUTATIVE_P
7099
+ */
7100
+
7101
+/* TARGET_ALLOCATE_INITIAL_VALUE(REGNO)  ... When the initial value of a hard
7102
+ * register has been copied in a pseudo register, it is often not necessary
7103
+ * ...
7104
+ */
7105
+/* TARGET_UNSPEC_MAY_TRAP_P(RTX,FLAGS)  ... This target hook returns nonzero in
7106
+ * RTX, un unspec or unspec_volatile operation, might cause a trap.  Targets
7107
+ * can use this hook to enhance precision of analysis for unspec and
7108
+ * unspec_volatile operations.  You may call may_trap_p_1 to analyze inner
7109
+ * elements of RTX in which case flags should be passed along.
7110
+ */
7111
+
7112
+/* TARGET_SET_CURRENT_FUNCTION(TREE)  The compiler invokes this hook whenever
7113
+ * it changes its current function context (CFUN).  You can define this
7114
+ * function if the back end needs to perform any initialization or reset
7115
+ * actions on a per-function basis.  For example, it may be used to implement
7116
+ * function attributes that affect register usage or code generation patterns.
7117
+ */
7118
+
7119
+/* TARGET_OBJECT_SUFFIX ... Define this macro to be a C string representing the
7120
+ * suffix for object files on your target machine.  If you do not define this
7121
+ * macro, GCC will use ".o" as the suffix for object files.
7122
+ */
7123
+#define        TARGET_OBJECT_SUFFIX    ".o"
7124
+
7125
+/* TARGET_EXECUTABLE_SUFFIX
7126
+ */
7127
+#define        TARGET_EXECUTABLE_SUFFIX        ""
7128
+
7129
+/* COLLECT_EXPORT_LIST ... If defined, collect2 will scan the individual object
7130
+ * files specified on its command line and create an export list for the linker.
7131
+ * Define this macro for systems like AIX, where the linker discards object
7132
+ * files that are not referenced from main and uses export lists.
7133
+ *
7134
+ * ZipCPU --- shoudln't need this.
7135
+ */
7136
+
7137
+/* MODIFY_JNI_METHOD_CALL(MDECL)  ... Define this macro to a C expression
7138
+ * representing a variant of the method call mdecl, if Java Native Interface
7139
+ * (JNI) methods must be invoked differently from other methods on your
7140
+ * target.  For example, on 32-bit MSWindows, JNI methods must be invoked
7141
+ * using the stdcall calling convention and this macro is then ...
7142
+ *
7143
+ * ZipCPU----Don't need this.  (yet)
7144
+ */
7145
+
7146
+
7147
+/* TARGET_CANNOT_MODIFY_JUMPS_P ... This target hook returns true past the
7148
+ * point in which a new jump instructions could be created.  On machines that
7149
+ * require a register for every jump such as the SHmedia ISA of SH5, this point
7150
+ * would typically be reload, so thiss target hook should be defined to a
7151
+ * function such as:
7152
+ *
7153
+ * ZipCPU --- I don't get what this is for.
7154
+ */
7155
+
7156
+/* TARGET_BRANCH_TARGET_REGISTER_CLASS ... This target hook returns a register
7157
+ * class for which branch target register optimizations should be applied.  All
7158
+ * registers in this class should be usable interchangably.  After reload,
7159
+ * registers in this class will be re-allocated and loads will be hoisted out of
7160
+ * loops and be subjected to inter-block scheduling.
7161
+ *
7162
+ * ZipCPU---GENERAL_REGS, but this should be a default already ...
7163
+ */
7164
+
7165
+
7166
+/* TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED ...  Branch target register
7167
+ * optimization will by default exclude callee-saved registers that are not
7168
+ * already live during the current function.  If this target hook returns true,
7169
+ * they will be included.  The target code must then make sure that all target
7170
+ * registers in the class returned by TARGET_BRANCH_REGISTER_CLASS that might
7171
+ * be saved are saaved.
7172
+ *
7173
+ * ZipCPU---
7174
+ */
7175
+
7176
+
7177
+/* TARGET_HAVE_CONDITIONAL_EXECUTION(VOID) ... This target hook returns true
7178
+ * if the target supports conditional execution.  This target hook is required
7179
+ * only when the target has several different modes and they have different
7180
+ * conditional execution capability, such as ARM.
7181
+ *
7182
+ * ZipCPU---Yes!  All instructions may be conditionally executed (except the
7183
+ * long version load immediate ...)
7184
+ */
7185
+#define        TARGET_HAVE_CONDITIONAL_EXECUTION       hook_bool_void_true
7186
+
7187
+/* TARGET_GEN_CCMP_FIRST(PREP,GEN,CODE,OP0,OP1) .. This function prepares to
7188
+ * emit a comparison instruction for the first compare in a sequence of
7189
+ * conditional comparisons.  It returns an appropriate comparison with CC for
7190
+ * passing to gen_ccmp_next or cbranch_optab.  The instructions to prepare the
7191
+ * compare are saved in prep_seq and the compare instructions are saved in
7192
+ * gen_seq.  They will be emitted when all the compares in the conditional
7193
+ * comparison are generated without error.  CODE is the rtx_code of the compare
7194
+ * for op0 and op1.
7195
+ *
7196
+ *
7197
+ * ZipCPU---???
7198
+ */
7199
+
7200
+/* TARGET_GEN_CCMP_NEXT(PREP,GEN,PREV,CMP,OP0,OP1,BITCODE) ... This function
7201
+ * prepares to emit a conditional comparison within a sequence of conditional
7202
+ * comparisons.  It returns an appropriate comparison with CC for passing to
7203
+ * gen_ccmp_next or cbranch_optab.  The insn to prepare the compare are saved
7204
+ * in prep_seq and the compare instructions are saved in gen_seq.  They will be
7205
+ * emitted when all the compares in the conditional comparison are generated
7206
+ * without error.  The pPREV expression is the result of a prior call to either
7207
+ * gen_ccmp_first or gen_ccmp_next.  It may return NULL if the combination of
7208
+ * PREV and this comparison is not supported, otherwise the result must be the
7209
+ * appropriate for passing to gen_ccmp_next or cbranch_optab.  CODE is the RTX
7210
+ * code of the compare for op0 and op1.  BITCODE is AND or IOR, which is the op
7211
+ * on the compares.
7212
+ *
7213
+ *
7214
+ * ZipCPU --- ???
7215
+ */
7216
+
7217
+/* TARGET_LOOP_UNROLL_ADJUST(NUNROLL, LOOP) ... This target hook returns a new
7218
+ * value for the number of times loop should be unrolled.  The parameter NUNROLL
7219
+ * is the number of times the loop is to be unrolled.  The parameter loop is a
7220
+ * pointer to the loop, which is going to be checked for unrolling.  The target
7221
+ * hook is required only when the target has special constraints like maximum number of memory accesses.
7222
+ *
7223
+ *
7224
+ * ZipCPU -- ???
7225
+ */
7226
+
7227
+
7228
+/* POWI_MAX_MULTS ... If defined, this macro is interpreted as a signed integer
7229
+ * C expression that specifies the maximum number of floating point
7230
+ * multiplications that should be emitted when expanding exponentiation by an
7231
+ * integer constant inline.  When this value is defined, exponentiation
7232
+ * requiring more than this number of multiplications is implemented by calling
7233
+ * the system library's pow, powf, or powl routines.  The default value
7234
+ places no upper bound on the multiplication count.
7235
+ *
7236
+ * ZipCPU---As we have no system library pow() routine (yet) ... we're not
7237
+ * ready for this macro.
7238
+ */
7239
+
7240
+
7241
+/* TARGET_EXTRA_INCLUDES(SYSROOT, PFX, STDINC) ... This target hook should
7242
+ * register any extra include files for the target.  The parameter stdinc
7243
+ * indicates if normal include files are present.  The parameter SYSROOT is the
7244
+ * system root directory.  The parameter PFX is the prefix for the GCC
7245
+ * directoiry.
7246
+ *
7247
+ *
7248
+ * ZipCPU---None yet.
7249
+ */
7250
+
7251
+/* TARGET_EXTRA_PRE_INCLUDES(SYSROOT, PFX, STDINC) ... This target hook should
7252
+ * register any extrra include files for the target before any standard headers.
7253
+ * The parameter stdinc indicates if normal include files are present.
7254
+ *
7255
+ * ZipCPU --- None.
7256
+ */
7257
+
7258
+/* TARGET_OPTF(PATH) ... This target hook should register special include paths
7259
+ * for the target.  The parameter path is the integer to register.  On Darwin
7260
+ * systems, this is used for Framework includes, which have semantics that are
7261
+ * different from -I.
7262
+ *
7263
+ *
7264
+ * ZipCPU --- None.
7265
+ */
7266
+
7267
+/* TARGET_USE_LOCAL_THUNK_ALIAS_P(FN) ... This target macro returns if it is
7268
+ * safe to use a local alias for a virtual function FN when constructing
7269
+ * thunks, false otherwise.  By default, the macro returns true for all
7270
+ * functions, if a target supports aliases (i.e. defines ASM_OUTPUT_DEF),
7271
+ * false otherwise.
7272
+ *
7273
+ *
7274
+ * ZipCPU --- ???
7275
+ */
7276
+// #warning "ASM_OUTPUT_DEF's definition has not been considered"
7277
+
7278
+
7279
+/* TARGET_FORMAT_TYPES ... If defined, this macro is the name of a global
7280
+ * variable containing target-specific format checking information for the
7281
+ * -Wformat option.  The default is to have no target-specific format checks.
7282
+ *
7283
+ * ZipCPU --- Default
7284
+ */
7285
+
7286
+/* TARGET_N_FORMAT_TYPES
7287
+ *
7288
+ * ZipCPU --- Default
7289
+ */
7290
+
7291
+/* TARGET_OVERRIDES_FORMAT_ATTRIBUTES ... If defined, this macro is the name of
7292
+ * a global variable containing target-specific format overrides for the
7293
+ * -Wformat option.  The default is to have no target specific format overrides.
7294
+ *
7295
+ * ZipCPU --- Default
7296
+ */
7297
+
7298
+/* TARGET_OVERRIDEES_FORMAT_ATTRIBUTES
7299
+ * TARGET_OVERRIDEES_FORMAT_ATTRIBUTES_COUNT
7300
+ *
7301
+ * If defined, the (first) macro is the name of a global variable containing
7302
+ * target-specific format overrides for the -Wformat option.
7303
+ */
7304
+/* TARGET_OVERRIDES_FORMAT_INIT ... If defined, this macro specifies the
7305
+ * optional initialization routine for target specific customizations of the
7306
+* system printf and scanf formatter settings.
7307
+ */
7308
+
7309
+/* TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN(TLIST,FN,VAL) ... If defined, this
7310
+ * macro returns the diagnostic message when it is illegal to pass an argument
7311
+ * VAL to function FN with prototype TLIST.
7312
+ *
7313
+ * ZipCPU---Default.
7314
+ */
7315
+
7316
+/* TARGET_INVALID_CONVERSION
7317
+ * TARGET_INVALID_UNARY_OP
7318
+ * TARGET_INVALID_BINARY_OP
7319
+ * TARGET_INVALID_PARAMETER_TYPE
7320
+ * TARGET_INVALID_RETURN_TYPE
7321
+ * TARGET_PROMOTED_TYPE
7322
+ * TARGET_CONVERT_TO_TYPE
7323
+ * TARGET_USE_JCR_SECTION_TYPE
7324
+ * OBJC_JBLEN
7325
+ * LIBGCC2_UNWIND_ATTRIBUTE
7326
+ * TARGET_UPDATE_STACK_BOUNDARY
7327
+ * TARGET_GET_DRAP_RTX
7328
+ * TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS
7329
+ */
7330
+/* TARGET_CONST_ANCHOR ... On some architectures it can take multiple
7331
+ * instructions to synthesize a constant. If there is another constant already
7332
+ * in a register that is close enough in value then it is preferable that the
7333
+ * new constant is computed from the register using immediate addition or
7334
+ * subtraction.  We accomplish this through CSE.  Besides the value of the
7335
+ * constant we also add a lower and an upper constant anchor to the available
7336
+ * expressions.  These are then queried when encountering new constants.  The
7337
+ * anchors are computed by rounding the constant up and down to a multiple of
7338
+ * the value of TARGET_CONST_ANCHOR.  TARGET_CONST_ANCHOR should be the maximum
7339
+ * positive value accepted by immediate-add plus one.  We currently assume that
7340
+ * the value of TARGET_CONST_ANCHOR is a poewr of 2.  For example, on MIPS,
7341
+ * where add-immediate takes a 16-bit signed value, TARGET_CONST_ANCHOR is set
7342
+ * to 0x8000.  The default value is zero, which disables this optimization.
7343
+ *
7344
+ * ZipCPU---One of the great strengths of the ZipCPU ISA is its ability to
7345
+ * access registers plus immediates.  To use this, we *need* this capability.
7346
+ * So, we define it here. (to 0x20000, or 2^17 because we can handle 18-bits of
7347
+ * signed immediate offsets)
7348
+ *
7349
+ * On ZipCPU---2^17
7350
+ */
7351
+#define        TARGET_CONST_ANCHOR     zip_const_anchor
7352
+
7353
+/* TARGET_ASAN_SHADOW_OFFSET ... Return the offset bitwise ored into shifted
7354
+ * address to get corresponding Address Sanitizer shadow memory address.  NULL
7355
+ * if address Sanitizer is not supported by the target.
7356
+ */
7357
+#define        TARGET_ASAN_SHADOW_OFFSET       NULL
7358
+
7359
+/* TARGET_MEMMODEL_CHECK
7360
+ */
7361
+/* TARGET_ATOMIC_TEST_AND_SET_TRUEVAL ... This value should be set if the result
7362
+ * written by atomic test and set is not exactly 1, i.e. the bool true.
7363
+ */
7364
+/* TARGET_HAS_IFUNC_P ... It returns true if the target supports GNU indirect
7365
+ * functions.  The support includes the assembler, linker, and dynamic linker.
7366
+ * The default value of this hook is based on target's libc.
7367
+ */
7368
+#define        TARGET_HAS_IFUNC_P      hook_bool_void_true
7369
+
7370
+/* TARGET_ATOMIC_ALIGN_FOR_MODE(MODE) ... If defined, this function returns
7371
+ * an appropriate alignment in bits for an atomic object of machine mode
7372
+ * MODE.  If 0 is returned then the default alignment for the specified mode
7373
+ * is used.
7374
+ *
7375
+ * ZipCPU---Both default and 2 would be valid.  We'll stick to the default.
7376
+ */
7377
+
7378
+/* TARGET_ATOMIC_ASSIGN_EXPAND_FENV --- ISO C11 requires atomic compound
7379
+ * assignments that may raise floating-point exceptions to raise exceptions
7380
+ * corresponding to the arithmetic operation whose result was successfully
7381
+ * stored in a compare-and-exchange sequence.  This requires code equivalent to
7382
+ * calls to feholdexcept, feclearexcept and feupdateenv to be generated at
7383
+ * appropriate points in the compare-and-exchange sequence.  This hook should
7384
+ * set *hold to an expression equivalent
7385
+ *
7386
+ * ZipCPU --- ???
7387
+ */
7388
+
7389
+/* TARGET_RECORD_OFFLOAD_SYMBOL ... Used when offloaded functions are seen in
7390
+ * the compilation unit and no named sections are available.  It is called once
7391
+ * for each symbol that must be recorded in the offload function and variable
7392
+ * table.
7393
+ *
7394
+ * ZipCPU --- Offloaded functions?
7395
+ */
7396
+
7397
+/* TARGET_OFFLOAD_OPTIONS
7398
+ *
7399
+ * ZipCPU---none defined
7400
+ */
7401
+
7402
+/* TARGET_SUPPORTS_WIDE_INT ... On older ports, large integers are stored
7403
+ * in CONST_DOUBLE rtl objects.  Newer ports define TARGET_SUPPORTS_WIDE_INT
7404
+ * to be nonzero to indicate that large integers are stored in CONST_WIDE_INT
7405
+ * rtl objects.  The CONST_WIDE_INT allows very large integer constants to be
7406
+ * represented.  CONST_DOUBLE is limited to twice the size of the hosts
7407
+ * HOST_WIDE_INT representation.
7408
+ *
7409
+ * ZipCPU---We don't need these yet, so this isn't yet relevant.  (These ints
7410
+ * are wider than DImode ...)
7411
+ */
7412
+#define        TARGET_SUPPORTS_WIDE_INT        0
7413
+
7414
+
7415
+/* Now, for the prototype functions ...*/
7416
+// These have been moved to zip-protos.h
7417
+
7418
+// extern void zip_init_builtins(void);
7419
+// extern void zip_asm_output_anchor(rtx x);
7420
+// extern bool zip_legitimate_address_p(enum machine_mode mode, rtx x, bool string);
7421
+// extern void zip_asm_trampoline_template(FILE *);
7422
+// extern void zip_initial_elimination_offset(int from, int to);
7423
+// extern void zip_print_operand(FILE *stream, rtx *x, int code);
7424
+// extern void zip_print_operand_address(FILE *stream, rtx *x);
7425
+// extern void zip_asm_output_def(FILE *s, const char *n, const char *v);
7426
+// extern void zip_update_cc_notice(rtx exp, rtx_insn *insn);
7427
+// extern      int zip_address_operand(rtx op);
7428
+// extern      int zip_const_address_operand(rtx op);
7429
+// extern void zip_expand_prologue(void);
7430
+// extern void zip_expand_epilogue(void);
7431
+// extern bool zip_gen_move_rtl(rtx, rtx);
7432
+// extern bool zip_load_address_lod(rtx, rtx);
7433
+// extern bool zip_load_address_sto(rtx, rtx);
7434
+// extern void zip_print_operand(FILE *fp, rtx x, int code);
7435
+// extern void zip_print_operand_address(FILE *fp, rtx x);
7436
+// extern bool zip_use_return_insn(void);
7437
+
7438
+#define        QImode  SImode
7439
+#define        HImode  SImode
7440
+
7441
+#include "insn-modes.h"
7442
+#include "zip-protos.h"
7443
+
7444
+#endif /* GCC_ZIP_H */
7445
+
7446
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/zip/zip.md gcc-5.3.0-zip/gcc/config/zip/zip.md
7447
--- gcc-5.3.0-original/gcc/config/zip/zip.md    1969-12-31 19:00:00.000000000 -0500
7448
+++ gcc-5.3.0-zip/gcc/config/zip/zip.md 2016-03-05 20:46:16.437972832 -0500
7449
@@ -0,0 +1,1696 @@
7450
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7451
+;;
7452
+;; Filename:   zip.md
7453
+;;
7454
+;; Project:    Zip CPU -- a small, lightweight, RISC CPU soft core
7455
+;;
7456
+;; Purpose:    This is the machine description of the Zip CPU as needed by the
7457
+;;             GNU compiler collection (GCC).
7458
+;;
7459
+;;
7460
+;; Creator:    Dan Gisselquist, Ph.D.
7461
+;;             Gisselquist Technology, LLC
7462
+;;
7463
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7464
+;;
7465
+;; Copyright (C) 2015, Gisselquist Technology, LLC
7466
+;;
7467
+;; This program is free software (firmware): you can redistribute it and/or
7468
+;; modify it under the terms of  the GNU General Public License as published
7469
+;; by the Free Software Foundation, either version 3 of the License, or (at
7470
+;; your option) any later version.
7471
+;;
7472
+;; This program is distributed in the hope that it will be useful, but WITHOUT
7473
+;; ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
7474
+;; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7475
+;; for more details.
7476
+;;
7477
+;; License:    GPL, v3, as defined and found on www.gnu.org,
7478
+;;             http://www.gnu.org/licenses/gpl.html
7479
+;;
7480
+;;
7481
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7482
+;;
7483
+;;
7484
+;; - Immediate integer operand constraints
7485
+;;     'I'     -2^22 ... 2^22-1, or -4194304 .. 4194303        (LDI insn)
7486
+;;     'M'     -2^12 ... 2^12-1, or -4096 ... 4095             (MOV offset)
7487
+;;     'N'     -2^14 ... 2^14-1, or -16384 ... 16383           (OpB offset)
7488
+;;     'O'     -2^17 ... 2^17-1, or -131072 ... 131071         (OpB Immediate)
7489
+;;     'R'     0...31                                          (Shift value)
7490
+;; - Memory constraints
7491
+;;     'Q'     Op-B capable references to memory
7492
+;;     'S'     References to constant memory
7493
+;; - Address constraints
7494
+;;     'P'     Op-B capable references to memory
7495
+;;     'T'     Constant memory addresses
7496
+(define_constraint "M"
7497
+  "An 13-bit signed immediate such as a MOV instruction can handle"
7498
+  (and (match_code "const_int")
7499
+       (match_test "(ival < 0x1000) && (ival >= -0x1000)")))
7500
+(define_constraint "N"
7501
+  "An 14-bit signed immediate offset such as an Op-B register offset"
7502
+  (and (match_code "const_int")
7503
+       (match_test "(ival < 0x2000) && (ival >= -0x2000)")))
7504
+(define_constraint "O"
7505
+  "An 18-bit signed immediate such as an Op-B Immediate can handle"
7506
+  (and (match_code "const_int")
7507
+       (match_test "(ival < 0x20000) && (ival >= -0x20000)")))
7508
+(define_constraint "R"
7509
+  "Bits that a value may be shifted"
7510
+  (and (match_code "const_int")
7511
+       (match_test "(ival < 32) && (ival >= 0)")))
7512
+;;
7513
+;
7514
+;
7515
+; Our builtin functions, by identifier
7516
+;
7517
+(define_constants
7518
+       [(UNSPEC_RTU            1)
7519
+       (UNSPEC_HALT            2)
7520
+       (UNSPEC_IDLE            3)
7521
+       (UNSPEC_SYSCALL         4)
7522
+       (UNSPEC_SAVE_CONTEXT    5)
7523
+       (UNSPEC_RESTORE_CONTEXT 6)
7524
+       (UNSPEC_BITREV          7)
7525
+       (UNSPEC_GETCC           8)
7526
+       (UNSPEC_LDILO           9)
7527
+       ])
7528
+;
7529
+;
7530
+; Registers by name
7531
+(define_constants
7532
+  [(RTN_REG            0)      ; Return address register
7533
+   (RTNV_REG           1)      ; Subroutine return value register
7534
+   (AP_REG             10)     ; Hopefully never used
7535
+   (GBL_REG            11)     ; Hopefully never used, but just in case ...
7536
+   (FP_REG             12)
7537
+   (SP_REG             13)
7538
+   (CC_REG             14)
7539
+   (PC_REG             15)
7540
+  ])
7541
+;
7542
+;
7543
+;
7544
+
7545
+;; Predicates
7546
+(define_predicate "zip_const_address_operand_p"
7547
+       (match_code "symbol_ref,const,label_ref,code_label")
7548
+{
7549
+       return zip_const_address_operand(op);
7550
+})
7551
+
7552
+(define_predicate "zip_address_operand_p"
7553
+       (match_code "reg,plus")
7554
+{
7555
+       return zip_pd_address_operand(op);
7556
+})
7557
+
7558
+(define_predicate "zip_mov_operand_p"
7559
+       (match_code "reg,plus")
7560
+{
7561
+       return zip_pd_mov_operand(op);
7562
+})
7563
+
7564
+(define_predicate "zip_memory_operand_p"
7565
+       (match_code "mem")
7566
+{
7567
+       return zip_pd_address_operand(XEXP(op,0));
7568
+})
7569
+
7570
+;; Constraints
7571
+;
7572
+(define_memory_constraint "S"
7573
+       "Any memory referenced by a constant address, possibly unknown at compile time"
7574
+       (and (match_code "mem")
7575
+               (match_test "zip_ct_const_address_operand(XEXP(op,0))")))
7576
+(define_memory_constraint "Q"
7577
+       "Any memory addressed suitably for a load or store instruction"
7578
+       (and (match_code "mem")
7579
+               (match_test "zip_ct_address_operand(XEXP(op,0))")))
7580
+(define_address_constraint "U"
7581
+       "An address suitable for a load or store instruction"
7582
+       (and (match_code "reg,plus")
7583
+               (match_test "zip_ct_address_operand(op)")))
7584
+(define_address_constraint "T"
7585
+       "Any constant address, to include those made by symbols unknown at compile time"
7586
+       (and (match_code "label_ref,code_label,symbol_ref,const")
7587
+               (match_test "zip_ct_const_address_operand(op)")))
7588
+;
7589
+;
7590
+;; Attributes
7591
+;
7592
+(define_attr "predicable"  "no,yes" (const_string "yes"))
7593
+(define_attr "conditional" "no,yes" (const_string "no"))
7594
+(define_attr "ccresult" "set,unknown,unchanged,validzn" (const_string "set"))
7595
+;
7596
+; Mode attributes
7597
+; (define_mode_iterator ZI [QI HI SI])
7598
+; (define_mode_attr zipa [(QI "") (HI "") (SI "")])
7599
+(define_mode_iterator ZI [SI])
7600
+(define_mode_attr zipa [(SI "")])
7601
+;
7602
+;
7603
+;
7604
+;; Instructions
7605
+;
7606
+; (define_insn
7607
+;      optional name
7608
+;      RTL template -- a vector of incomplete RTL expressions describing the
7609
+;              semantics of the instruction.  It is incomplete because it may
7610
+;              contain match_operand, match_operator, and match_dup expressions
7611
+;      The condition --- contains a C expression, may be an empty string
7612
+;      output template or output statement--fragment of C code returning a str
7613
+;      Attributes --
7614
+;      )
7615
+;
7616
+; (match_operand:m n predicate constraint)
7617
+;      Placeholder for operand #n of the instruction
7618
+;      Predicate       string that is the name of a fucntion w/ 2 arguments:
7619
+;                              (expression, machine mode)
7620
+;              we can build functions:
7621
+;                      "isregister"    to describe a register
7622
+;                      "isimmediate"   to describe an immediate
7623
+;                      "offsetreg"     to describe a register plus offset
7624
+;                      "anyregister"   to describe *ANY* register (uRx or Rx)
7625
+;              But ... functions "address_operand", "immediate_operand",
7626
+;                      "register_operand", "indirect_operand"
7627
+;              "comparison_operatot" and "ordered_comparison_operator"
7628
+;              are also available--be aware, they include more comparisons
7629
+;              than Zip CPU can do.
7630
+;
7631
+;
7632
+;
7633
+;
7634
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7635
+;;
7636
+;; Move instructions: both
7637
+;      (arbitrary) from variables to variables, but this gets
7638
+;              expanded into:
7639
+;      from registers to registers
7640
+;      from immediates to registers
7641
+;;
7642
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7643
+;
7644
+;
7645
+;
7646
+(define_expand "mov<mode>"
7647
+       [(set (match_operand:ZI 0 "nonimmediate_operand" "") ; =r,Q,r,r")
7648
+               (match_operand:ZI 1 "general_operand" ""))] ; r,r,Q,i"))]
7649
+       ""
7650
+       {/* Everything except mem=const or mem=mem can be done easily */
7651
+       if (zip_gen_move_rtl(operands[0], operands[1]))
7652
+               DONE;
7653
+       else internal_error("%s", "Zip/No usable movsi expansion\n");
7654
+       }
7655
+       [(set_attr "ccresult" "unchanged")])
7656
+(define_insn "mov<mode>_reg"   ; Register to register move
7657
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7658
+               (match_operand:ZI 1 "register_operand" "r"))]
7659
+       ""
7660
+       "MOV    %1,%0"
7661
+       [(set_attr "ccresult" "unchanged")])
7662
+(define_insn "mov<mode>_reg_off"       ; Register to register move
7663
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7664
+               (plus:ZI (match_operand:ZI 1 "register_operand" "r")
7665
+                       (match_operand:ZI 2 "const_int_operand" "M")))]
7666
+       ""
7667
+       "MOV    %2(%1),%0"
7668
+       [(set_attr "ccresult" "unchanged")])
7669
+(define_insn "mov<mode>_lod"   ; Load from memory
7670
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7671
+               (match_operand:ZI 1 "zip_memory_operand_p" "Q"))]
7672
+       ""
7673
+       "LOD    %1,%0"
7674
+       [(set_attr "ccresult" "unchanged")])
7675
+(define_insn "mov<mode>_sto"   ; Store into memory
7676
+       [(set (match_operand:ZI 0 "zip_memory_operand_p" "=Q")
7677
+               (match_operand:ZI 1 "register_operand" "r"))]
7678
+       ""
7679
+       "STO    %1,%0"
7680
+       [(set_attr "ccresult" "unchanged")])
7681
+(define_insn "mov<mode>_ldi"   ; Load immediate
7682
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7683
+               (match_operand:ZI 1 "immediate_operand" "ipU"))]
7684
+       ""
7685
+       "LDI    %1,%0"
7686
+       [(set_attr "ccresult" "unchanged")])
7687
+;
7688
+;
7689
+;
7690
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7691
+;;
7692
+;; Load and store multiple values
7693
+;;
7694
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7695
+;
7696
+; So far, from the code I've seen from GCC's output,
7697
+; these instructions do not appear to be necessary.
7698
+;
7699
+;(define_insn "load_multiple"
7700
+;      for(a=0; a<%2; a++)
7701
+;              LOD a(%1),%0+a
7702
+;(define_insn "store_multiple"
7703
+;      for(a=0; a<%2; a++)
7704
+;              STO %0+a,a(%1)
7705
+; pushsi -- Do not define, compiler will work around it nicely w/o our help
7706
+;
7707
+;
7708
+;
7709
+;
7710
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7711
+;;
7712
+;; General arithmetic instructions
7713
+;;
7714
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7715
+;
7716
+;
7717
+;
7718
+;
7719
+(define_insn "add<mode>3" ; Fastest/best instruction always goes first
7720
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7721
+               (plus:ZI (match_operand:ZI 1 "general_operand" "0")
7722
+                       (match_operand:ZI 2 "general_operand" "rO")))
7723
+       ]
7724
+       ""
7725
+       "ADD    %2,%0"
7726
+       [(set_attr "ccresult" "set")])
7727
+(define_insn "add<mode>3_off" ; Fastest/best instruction always goes first
7728
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7729
+               (plus:ZI (match_operand:ZI 1 "general_operand" "0")
7730
+                       (plus:ZI (match_operand:ZI 2 "general_operand" "r")
7731
+                               (match_operand:ZI 3 "const_int_operand" "N"))))
7732
+       ]
7733
+       ""
7734
+       "ADD    %3+%2,%0"
7735
+       [(set_attr "ccresult" "set")])
7736
+;
7737
+;
7738
+;
7739
+(define_insn "sub<mode>3"
7740
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7741
+               (minus:ZI (match_operand:ZI 1 "general_operand" "0")
7742
+                       (match_operand:ZI 2 "general_operand" "rO")))
7743
+       ]
7744
+       ""
7745
+       "SUB    %2,%0"
7746
+       [(set_attr "ccresult" "set")])
7747
+(define_insn "sub<mode>3_off"
7748
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7749
+               (minus:ZI (match_operand:ZI 1 "general_operand" "0")
7750
+                       (plus:ZI (match_operand:ZI 2 "general_operand" "%r")
7751
+                               (match_operand:ZI 3 "const_int_operand" "N"))))
7752
+       ]
7753
+       ""
7754
+       "SUB    %3+%2,%0"
7755
+       [(set_attr "ccresult" "set")])
7756
+(define_insn "mul<mode>3"
7757
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7758
+               (mult:ZI (match_operand:ZI 1 "register_operand" "%r")
7759
+                       (match_operand:ZI 2 "register_operand" "r")))
7760
+       (clobber (match_scratch:ZI 3 "=r"))]
7761
+       ; "(R0 != R1)&&(R0 != R2)&&(R0!=R3)&&(R1!=R2)&&(R1=R3)&&(R2!=R3)"
7762
+       ""
7763
+       "MOV    %1,%0
7764
+       MPYS    %2,%0
7765
+       MOV     %1,%3
7766
+       ROL     16,%3
7767
+       MPYS    %2,%3
7768
+       ROL     16,%3
7769
+       AND     0x0ffff,%3
7770
+       ADD     %3,%0
7771
+       MOV     %2,%3
7772
+       ROL     16,%3
7773
+       MPYS    %1,%3
7774
+       ROL     16,%3
7775
+       AND     0x0ffff,%3
7776
+       ADD     %3,%0"
7777
+       [(set_attr "ccresult" "unknown")])
7778
+
7779
+(define_insn "div<mode>3"
7780
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7781
+               (div:ZI (match_operand:ZI 1 "general_operand" "0")
7782
+                       (match_operand:ZI 2 "general_operand" "rO")))]
7783
+       ""
7784
+       "DIVS   %2,%0"
7785
+       [(set_attr "ccresult" "set")])
7786
+(define_insn "div<mode>3_off"
7787
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7788
+               (div:ZI (match_operand:ZI 1 "general_operand" "0")
7789
+                       (plus:ZI (match_operand:ZI 2 "general_operand" "r")
7790
+                               (match_operand:ZI 3 "const_int_operand" "N"))))]
7791
+       ""
7792
+       "DIVS   %3+%2,%0"
7793
+       [(set_attr "ccresult" "set")])
7794
+(define_insn "udiv<mode>3"
7795
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7796
+               (udiv:ZI (match_operand:ZI 1 "general_operand" "0")
7797
+                       (match_operand:ZI 2 "general_operand" "rO")))]
7798
+       ""
7799
+       "DIVU   %2,%0"
7800
+       [(set_attr "ccresult" "set")])
7801
+(define_insn "udiv<mode>3_off"
7802
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7803
+               (udiv:ZI (match_operand:ZI 1 "general_operand" "0")
7804
+                       (plus:ZI (match_operand:ZI 2 "general_operand" "r")
7805
+                               (match_operand:ZI 3 "const_int_operand" "N"))))]
7806
+       ""
7807
+       "DIVU   %3+%2,%0"
7808
+       [(set_attr "ccresult" "set")])
7809
+;;
7810
+;; modsi3
7811
+;; umodsi3
7812
+;;
7813
+(define_insn "umin<mode>3"
7814
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7815
+               (umin:ZI (match_operand:ZI 1 "register_operand" "%0")
7816
+                       (match_operand:ZI 2 "register_operand" "r")))
7817
+       ]
7818
+       ""
7819
+       "CMP    %0,%2
7820
+       MOV.C   %2,%0"
7821
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
7822
+(define_insn "umax<mode>3"
7823
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7824
+               (umax:ZI (match_operand:ZI 1 "register_operand" "%0")
7825
+                       (match_operand:ZI 2 "register_operand" "r")))
7826
+       ]
7827
+       ""
7828
+       "CMP    %2,%0
7829
+       MOV.C   %2,%0"
7830
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
7831
+(define_insn "smin<mode>3"
7832
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7833
+               (smin:ZI (match_operand:ZI 1 "register_operand" "%0")
7834
+                       (match_operand:ZI 2 "register_operand" "r")))
7835
+       ]
7836
+       ""
7837
+       "CMP    %2,%0
7838
+       MOV.GT  %2,%0"
7839
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
7840
+(define_insn "smax<mode>3"
7841
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7842
+               (smax:ZI (match_operand:ZI 1 "register_operand" "%0")
7843
+                       (match_operand:ZI 2 "register_operand" "r")))
7844
+       ]
7845
+       ""
7846
+       "CMP    %0,%2
7847
+       MOV.LT  %2,%0"
7848
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
7849
+(define_insn "and<mode>3"
7850
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7851
+               (and:ZI (match_operand:ZI 1 "register_operand" "%0")
7852
+                       (match_operand:ZI 2 "general_operand" "rO")))
7853
+       ]
7854
+       ""
7855
+       "AND    %2,%0"
7856
+       [(set_attr "ccresult" "set")])
7857
+(define_insn "and<mode>3_off"
7858
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7859
+               (and:ZI (match_operand:ZI 1 "register_operand" "0")
7860
+                       (plus:ZI (match_operand:ZI 2 "register_operand" "r")
7861
+                               (match_operand:ZI 3 "const_int_operand" "N"))))
7862
+       ]
7863
+       ""
7864
+       "AND    %3+%2,%0"
7865
+       [(set_attr "ccresult" "set")])
7866
+(define_insn "ior<mode>3"
7867
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7868
+               (ior:ZI (match_operand:ZI 1 "register_operand" "%0")
7869
+                       (match_operand:ZI 2 "general_operand" "rO")))
7870
+       ]
7871
+       ""
7872
+       "OR     %2,%0"
7873
+       [(set_attr "ccresult" "set")])
7874
+(define_insn "ior<mode>3_off"
7875
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7876
+               (ior:ZI (match_operand:ZI 1 "register_operand" "0")
7877
+                       (plus:ZI (match_operand:ZI 2 "register_operand" "r")
7878
+                               (match_operand:ZI 3 "general_operand" "N"))))
7879
+       ]
7880
+       ""
7881
+       "OR     %3+%2,%0"
7882
+       [(set_attr "ccresult" "set")])
7883
+(define_insn "xor<mode>3"
7884
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7885
+               (xor:ZI (match_operand:ZI 1 "register_operand" "%0")
7886
+                       (match_operand:ZI 2 "general_operand" "rO")))
7887
+       ]
7888
+       ""
7889
+       "XOR    %2,%0"
7890
+       [(set_attr "ccresult" "set")])
7891
+(define_insn "xor<mode>3_off"
7892
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7893
+               (xor:ZI (match_operand:ZI 1 "register_operand" "0")
7894
+                       (plus:ZI (match_operand:ZI 2 "register_operand" "r")
7895
+                               (match_operand:ZI 3 "general_operand" "N"))))
7896
+       ]
7897
+       ""
7898
+       "XOR    %3+%2,%0"
7899
+       [(set_attr "ccresult" "set")])
7900
+;(define_insn "addv<mode>4"
7901
+       ;[(set (match_operand:ZI 0 "register_operand" "=r")
7902
+               ;(plus:ZI (match_operand:ZI 1 "register_operand" "%r")
7903
+                       ;(match_operand:ZI 2 "general_operand" "rO")))
7904
+       ;(set (pc) (if_then_else (eq (cc0) (const_int 0))
7905
+                       ;(label_ref (match_operand 3))
7906
+                       ;(pc)))]
7907
+       ;""
7908
+       ;"MOV   %1,%0
7909
+       ;ADD    %2,%0
7910
+       ;BV     %3"
7911
+       ;[(set_attr "predicable" "no") (set_attr "ccresult" "set")])
7912
+;;(define_insn "subvsi4"
7913
+;;     MOV     %1,%0
7914
+;;     SUB     %2,%0
7915
+;;     BV      %3
7916
+;;(mulvsi4)
7917
+;;(define_insn "uaddvsi4"
7918
+;;     ADD     %2,%0
7919
+;;     BC      %3
7920
+;;(define_insn "usubvsi4"
7921
+;;     MOV     %1,%0
7922
+;;     SUB     %2,%0
7923
+;;     BC      %3
7924
+;;
7925
+;; (define_insn "umulvsi4"
7926
+;;     ... ???)
7927
+;;
7928
+(define_insn "ashr<mode>3"
7929
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7930
+               (ashiftrt:ZI (match_operand:ZI 1 "register_operand" "0")
7931
+                       (match_operand:ZI 2 "general_operand" "rR")))]
7932
+       ""
7933
+       "ASR    %2,%0"
7934
+       [(set_attr "ccresult" "set")])
7935
+(define_insn "lshr<mode>3"
7936
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7937
+               (lshiftrt:ZI (match_operand:ZI 1 "register_operand" "0")
7938
+                       (match_operand:ZI 2 "register_operand" "rR")))]
7939
+       ""
7940
+       "LSR    %2,%0"
7941
+       [(set_attr "ccresult" "set")])
7942
+(define_insn "rotl<mode>3"
7943
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7944
+               (rotate:ZI (match_operand:ZI 1 "register_operand" "0")
7945
+                       (match_operand:ZI 2 "general_operand" "rR")))]
7946
+       ""
7947
+       "ROL    %2,%0"
7948
+       [(set_attr "ccresult" "set")])
7949
+;
7950
+(define_insn "neg<mode>2"
7951
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7952
+               (neg:ZI (match_operand:ZI 1 "register_operand" "r")))
7953
+       ]
7954
+       ""
7955
+       "NEG    %1,%0"
7956
+       [(set_attr "ccresult" "validzn")])
7957
+(define_insn "abs<mode>2"
7958
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7959
+               (abs:ZI (match_operand:ZI 1 "register_operand" "0")))
7960
+       ]
7961
+       ""
7962
+       "TEST   %0
7963
+       NEG.LT  %0"
7964
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
7965
+(define_insn "popcount<mode>2"
7966
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7967
+               (popcount:ZI (match_operand:ZI 1 "register_operand" "r")))
7968
+       ]
7969
+       ""
7970
+       "POPC   %1,%0"
7971
+       [(set_attr "ccresult" "set")])
7972
+(define_expand "parity<mode>2"
7973
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7974
+               (popcount:ZI (match_operand:ZI 1 "register_operand" "r")))
7975
+       (set (match_dup:ZI 0) (and:ZI (match_dup:ZI 0) (const_int -2)))
7976
+       ])
7977
+(define_insn "one_cmpl<mode>2"
7978
+       [(set (match_operand:ZI 0 "register_operand" "=r")
7979
+               (not:ZI (match_operand:ZI 1 "register_operand" "0")))
7980
+       ]
7981
+       ""
7982
+       "XOR    -1,%0"
7983
+       [(set_attr "ccresult" "set")])
7984
+;
7985
+;
7986
+;
7987
+;
7988
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7989
+;;
7990
+;; General arithmetic instructions -- double words
7991
+;;
7992
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7993
+;
7994
+;
7995
+;
7996
+(define_insn "adddi3" ; Fastest/best instruction always goes first
7997
+       [(set (match_operand:DI 0 "register_operand" "=r")
7998
+               (plus:DI (match_operand:DI 1 "general_operand" "0")
7999
+                       (match_operand:DI 2 "register_operand" "r")))
8000
+       ]
8001
+       ""
8002
+       "ADD    %L2,%L0\n\tADD.C\t1,%H0\n\tADD\t%H2,%H0"
8003
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8004
+;
8005
+(define_insn "subdi3"
8006
+       [(set (match_operand:DI 0 "register_operand" "=r")
8007
+               (minus:DI (match_operand:DI 1 "general_operand" "0")
8008
+                       (match_operand:DI 2 "register_operand" "r")))
8009
+       ]
8010
+       ""
8011
+       "SUB    %L2,%L0\n\tSUB.C\t1,%H0\n\tSUB\t%H2,%H0"
8012
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8013
+;
8014
+(define_insn "anddi3"
8015
+       [(set (match_operand:DI 0 "register_operand" "=r")
8016
+               (and:DI (match_operand:DI 1 "register_operand" "%0")
8017
+                       (match_operand:DI 2 "register_operand" "r")))
8018
+       ]
8019
+       ""
8020
+       "AND    %L2,%L0\n\tAND\t%H2,%H0"
8021
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8022
+;
8023
+(define_insn "iordi3"
8024
+       [(set (match_operand:DI 0 "register_operand" "=r")
8025
+               (ior:DI (match_operand:DI 1 "register_operand" "%0")
8026
+                       (match_operand:DI 2 "register_operand" "r")))
8027
+       ]
8028
+       ""
8029
+       "OR     %2,%0\n\tOR\t%H2,%H0"
8030
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8031
+;
8032
+(define_insn "xordi3"
8033
+       [(set (match_operand:DI 0 "register_operand" "=r")
8034
+               (xor:DI (match_operand:DI 1 "register_operand" "%0")
8035
+                       (match_operand:DI 2 "register_operand" "r")))
8036
+       ]
8037
+       ""
8038
+       "XOR    %2,%0\n\tXOR\t%H2,%H0"
8039
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8040
+;
8041
+(define_insn "negdi2"
8042
+       [(set (match_operand:DI 0 "register_operand" "=r")
8043
+               (neg:DI (match_operand:DI 1 "register_operand" "0")))]
8044
+       ""
8045
+       "XOR    -1,%L0\n\tXOR\t-1,%H0\n\tADD\t1,%L0\n\tADD.C\t1,%H0"
8046
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8047
+;
8048
+(define_insn "absdi2"
8049
+       [(set (match_operand:ZI 0 "register_operand" "=r")
8050
+               (abs:ZI (match_operand:ZI 1 "register_operand" "0")))
8051
+       (clobber (match_scratch:SI 2 "=r"))]
8052
+       ""
8053
+       "CLR    %2
8054
+       TEST    %H0             ; Problem, we can't tell conditions
8055
+       LDILO.LT        1,%2
8056
+       XOR.LT  -1,%L0
8057
+       XOR.LT  -1,%H0
8058
+       ADD     %2,%L0
8059
+       ADD.C   %1,%HI"
8060
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8061
+(define_insn "one_cmpldi2"
8062
+       [(set (match_operand:DI 0 "register_operand" "=r")
8063
+               (not:DI (match_operand:DI 1 "register_operand" "0")))
8064
+       ]
8065
+       ""
8066
+       "XOR    -1,%L0\n\tXOR\t-1,%H0"
8067
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8068
+(define_insn "umindi3"
8069
+       [(set (match_operand:DI 0 "register_operand" "=r")
8070
+               (umin:DI (match_operand:DI 1 "register_operand" "%0")
8071
+                       (match_operand:DI 2 "register_operand" "r")))
8072
+       ]
8073
+       ""
8074
+       "CMP    %H0,%H2
8075
+       CMP.Z   %L0,%L2
8076
+       MOV.C   %H2,%H0
8077
+       MOV.C   %L2,%L0"
8078
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8079
+(define_insn "umaxdi3"
8080
+       [(set (match_operand:DI 0 "register_operand" "=r")
8081
+               (umax:DI (match_operand:DI 1 "register_operand" "%0")
8082
+                       (match_operand:DI 2 "register_operand" "r")))
8083
+       ]
8084
+       ""
8085
+       "CMP    %H2,%H0
8086
+       CMP.Z   %L2,%L0
8087
+       MOV.C   %H2,%H0
8088
+       MOV.C   %L2,%L0"
8089
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8090
+(define_insn "popcountdi2"
8091
+       [(set (match_operand:SI 0 "register_operand" "=r")
8092
+               (popcount (match_operand:DI 1 "register_operand" "r")))
8093
+       (clobber (match_scratch:SI 2 "=r"))
8094
+       ]
8095
+       ""
8096
+       "POPC   %L1,%0
8097
+       POPC    %H1,%2
8098
+       ADD     %2,%0"
8099
+       [(set_attr "predicable" "no") (set_attr "ccresult" "set")])
8100
+(define_expand "paritydi2"
8101
+       [(set (match_operand:SI 0 "register_operand" "=r")
8102
+               (popcount (match_operand:DI 1 "register_operand" "r")))
8103
+       (set (match_dup 0) (and:SI (match_dup 0) (const_int -2)))
8104
+       ])
8105
+;
8106
+; Still missing DI instructions for smin:DI, smax:DI, movdicc, adddicc,
8107
+;      mult:di, div:di, divu:di
8108
+;
8109
+;
8110
+;
8111
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8112
+;;
8113
+;; Conditional arithmetic instructions
8114
+;;
8115
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8116
+;
8117
+;
8118
+;
8119
+;
8120
+(define_expand "cstore<mode>4" ; Store 0 or 1 in %0 based on cmp between %2&%3
8121
+       [(set (cc0) (compare (match_operand:ZI 2 "register_operand" "r")
8122
+               (match_operand:ZI 3 "nonmemory_operand" "rO")))
8123
+       (set (match_operand:ZI 0 "register_operand" "=r") (if_then_else:ZI
8124
+                       (match_operator 1 "ordered_comparison_operator"
8125
+                                       [(cc0) (const_int 0)])
8126
+                       (const_int 1) (const_int 0)))]
8127
+       ""
8128
+       )
8129
+(define_insn "cstoredi4" ; Store 0 or 1 in %0 based on cmp between %2&%3
8130
+       [(set (match_operand:SI 0 "register_operand" "=r")
8131
+               (if_then_else:SI (match_operator 1 "ordered_comparison_operator"
8132
+                       [(compare (match_operand:DI 2 "register_operand" "r")
8133
+                               (match_operand:DI 3 "register_operand" "r"))])
8134
+                       (const_int 1) (const_int 0)))]
8135
+       ""
8136
+       {
8137
+               switch(GET_CODE(operands[1])) {
8138
+               case EQ:        return "CLR\t%0\n\tCMP\t%H3,%H2\n\tCMP.Z\t%L3,%L2\n\tLDILO.Z\t1,%0\n";
8139
+               case NE:        return "CLR\t%0\n\tCMP\t%H3,%H2\n\tCMP.NZ\t%L3,%L2\n\tLDILO.NZ\t1,%0\n";
8140
+               case LTU:       return "CLR\t%0\n\tCMP\t%H3,%H2\n\tCMP.Z\t%L3,%L2\n\tLDILO.C\t1,%0\n";
8141
+               case LEU:       return "CLR\t%0\n\tCMP\t%H3,%H2\n\tCMP.Z\t%L3,%L2\n\tLDILO.C\t1,%0\n\tLDILO.Z\t1,%0\n";
8142
+               case GTU:       return "CLR\t%0\n\tCMP\t%H2,%H3\n\tCMP.Z\t%L2,%L3\n\tLDILO.C\t1,%0\n";
8143
+               case GEU:       return "CLR\t%0\n\tCMP\t%H2,%H3\n\tCMP.Z\t%L2,%L3\n\tLDILO.C\t1,%0\n\tLDILO.Z\t1,%0\n";
8144
+               default:
8145
+                       gcc_unreachable();
8146
+               }
8147
+       }
8148
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8149
+;
8150
+;
8151
+;
8152
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8153
+;;
8154
+;; Comparison instructions, both compare and test
8155
+;;
8156
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8157
+;
8158
+;
8159
+;
8160
+;; This will only work so well, since the direction of the compare is
8161
+;; important in unsigned compares.
8162
+;;
8163
+(define_insn "cmp<mode>"
8164
+       [(set (cc0) (compare (match_operand:ZI 0 "register_operand" "r")
8165
+               (match_operand:ZI 1 "nonmemory_operand" "rO")))]
8166
+       ""
8167
+       "CMP\t%1,%0"
8168
+       [(set_attr "ccresult" "set")])
8169
+(define_insn "cmp<mode>_off"
8170
+       [(set (cc0) (compare (match_operand:ZI 0 "register_operand" "r")
8171
+               (plus:ZI (match_operand:ZI 1 "register_operand" "r")
8172
+                       (match_operand:ZI 2 "const_int_operand" "N"))))]
8173
+       ""
8174
+       "CMP\t%2+%1,%0"
8175
+       [(set_attr "ccresult" "set")])
8176
+(define_insn "test<mode>"
8177
+       [(set (cc0) (compare (and:ZI (match_operand:ZI 0 "register_operand" "r")
8178
+                               (match_operand:ZI 1 "nonmemory_operand" "rO"))
8179
+                       (const_int 0)))]
8180
+       ""
8181
+       "TEST   %1,%0"
8182
+       [(set_attr "ccresult" "set")])
8183
+(define_insn "test<mode>_off"
8184
+       [(set (cc0) (compare (and:ZI (match_operand:ZI 0 "register_operand" "r")
8185
+                               (plus:ZI
8186
+                                 (match_operand:ZI 1 "register_operand" "r")
8187
+                                 (match_operand:ZI 2 "const_int_operand" "N")))
8188
+                       (const_int 0)))]
8189
+       ""
8190
+       "TEST   %2+%1,%0"
8191
+       [(set_attr "ccresult" "set")])
8192
+(define_insn "nop"
8193
+       [(const_int 0)]
8194
+       ""
8195
+       "NOOP"
8196
+       [(set_attr "ccresult" "unchanged")])
8197
+;
8198
+;
8199
+;
8200
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8201
+;;
8202
+;; Conditional execution predicates
8203
+;;
8204
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8205
+;
8206
+; Sadly, these aren't complete like they should be.  Although these are all of
8207
+; the conditional execution prefixes that the Zip CPU supports, GCC looks for
8208
+; other conditions then these.  That is, (cond_exec ...) is not as well
8209
+; recognized as (if_then_else ...).  So we have to duplicate things to support
8210
+; both methods.
8211
+;
8212
+(define_cond_exec
8213
+       [(ne (cc0) (const_int 0))]
8214
+       ""
8215
+       "(NZ)"
8216
+       [(set_attr "conditional" "yes")])
8217
+(define_cond_exec
8218
+       [(lt (cc0) (const_int 0))]
8219
+       ""
8220
+       "(LT)"
8221
+       [(set_attr "conditional" "yes")])
8222
+(define_cond_exec
8223
+       [(eq (cc0) (const_int 0))]
8224
+       ""
8225
+       "(Z)"
8226
+       [(set_attr "conditional" "yes")])
8227
+(define_cond_exec
8228
+       [(gt (cc0) (const_int 0))]
8229
+       ""
8230
+       "(GT)"
8231
+       [(set_attr "conditional" "yes")])
8232
+(define_cond_exec
8233
+       [(ge (cc0) (const_int 0))]
8234
+       ""
8235
+       "(GE)"
8236
+       [(set_attr "conditional" "yes")])
8237
+(define_cond_exec
8238
+       [(ltu (cc0) (const_int 0))]
8239
+       ""
8240
+       "(C)"
8241
+       [(set_attr "conditional" "yes")])
8242
+;
8243
+;
8244
+;
8245
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8246
+;;
8247
+;; Conditional move instructions, since these won't accept conditional
8248
+;;     execution RTL
8249
+;;
8250
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8251
+;
8252
+; // Look for #define HAVE_conditional_move to understand how these might be
8253
+; // used.
8254
+;
8255
+(define_insn "set_zero_or_one<mode>"
8256
+       [(set (match_operand:ZI 0 "register_operand" "=r") (if_then_else:ZI
8257
+                       (match_operator 1 "ordered_comparison_operator"
8258
+                                       [(cc0) (const_int 0)])
8259
+                       (const_int 1) (const_int 0)))]
8260
+       ""
8261
+       { return (zip_set_zero_or_one(operands[1], operands[0]));
8262
+       }
8263
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unchanged")])
8264
+(define_insn "mov<mode>cc"
8265
+       [(set (match_operand:ZI 0 "register_operand" "=r")
8266
+               (if_then_else:ZI (match_operator 1 "ordered_comparison_operator"
8267
+                       [(cc0) (const_int 0)])
8268
+                       (match_operand:ZI 2 "general_operand" "rio")
8269
+                       (match_operand:ZI 3 "nonmemory_operand" "rio")))]
8270
+       ""
8271
+       {
8272
+       return zip_movsicc(operands[0], operands[1], operands[2], operands[3]);
8273
+       }
8274
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unchanged")])
8275
+(define_insn "add<mode>cc"
8276
+       [(set (match_operand:ZI 0 "register_operand" "=r,r")
8277
+               (if_then_else:ZI (match_operator 1 "ordered_comparison_operator"
8278
+                       [(cc0) (const_int 0)])
8279
+                       (plus:ZI (match_operand:ZI 2 "register_operand" "0,r")
8280
+                               (match_operand:ZI 3 "nonmemory_operand" "rO,M"))
8281
+                       (match_dup 0)))]
8282
+       ""
8283
+       {
8284
+       return zip_addsicc(operands[0], operands[1], operands[2], operands[3]);
8285
+       }
8286
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unchanged")])
8287
+;
8288
+;
8289
+;(define_expand "mov<mode>cc"
8290
+;      [(set (match_operand:ZI 0 "general_operand" "=rm,rm,r,r,r"
8291
+;              (if_then_else:ZI (match_operator 1 "ordered_comparison_operator"
8292
+;                      [(cc0) (const_int 0)])
8293
+;                      (match_operand:ZI 2 "general_operand" "0,r,0,m,rm")
8294
+;                      (match_operand:ZI 3 "general_operand" "r,0,m,0,rm"))))]
8295
+;      )
8296
+;
8297
+;
8298
+;
8299
+; While an interesting approach, the following suffers from problems when the
8300
+; move amount is constant.  At anything less than four, moves should not require
8301
+; the movmemSI instruction.  At anything greater, if constant, the initial tests
8302
+; are not required and should result in a hardcoded result.  Practically,
8303
+; though, this should really be a define_expand instruction, calling on the
8304
+; RTX's of all the respective subinstructions found below.
8305
+;
8306
+;(define_insn "movmemSI"
8307
+;      [(parallel [(set (mem:BLK (match_operand 0 "register_operand" "+r"));Dst
8308
+;                      (mem:BLK (match_operand 1 "register_operand" "+r")));Src
8309
+;              (use (match_operand:SI 2 "register_operand" "+r"))]); Length
8310
+;              (match_operand 3 "" "")                 ;Alignment
8311
+;              (clobber (match_scratch:SI 4 "=r"))
8312
+;              (clobber (match_scratch:SI 5 "=r"))
8313
+;              (clobber (match_scratch:SI 6 "=r"))
8314
+;              (clobber (match_scratch:SI 7 "=r"))]
8315
+;      ""
8316
+;      "TEST\t1,%2
8317
+;      LOD.NZ\t%1,%4
8318
+;      STO.NZ\t%4,%0
8319
+;      ADD.NZ\t1,%0
8320
+;      ADD.NZ\t1,%1
8321
+;      TEST\t2,%2
8322
+;      LOD.NZ\t%1,%4
8323
+;      LOD.NZ\t1(%1),%5
8324
+;      STO.NZ\t%4,(%0)
8325
+;      STO.NZ\t%4,1(%0)
8326
+;      ADD.NZ\t2,%0
8327
+;      ADD.NZ\t2,%1
8328
+;      AND\t-4,%2
8329
+;      BZ\t.Lskp%=\n.Ltop%=:
8330
+;      LOD\t(%1),%4
8331
+;      LOD\t1(%1),%5
8332
+;      LOD\t2(%1,%6
8333
+;      LOD\t3(%1),%7
8334
+;      STO\t%4,(%1)
8335
+;      STO\t%5,1(%1)
8336
+;      STO\t%6,2(%1)
8337
+;      STO\t%7,3(%1)
8338
+;      SUB\t4,%2
8339
+;      BZ\t%.Lskp%=
8340
+;      BRA\t.Ltop%=\n.Lskp%=:"
8341
+;      [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8342
+;(define_insn "setmemsi"
8343
+;      [(parallel
8344
+;              [(set (mem:BLK
8345
+;                      (match_operand 0 "register_operand" "+r")); Destination
8346
+;                      (match_operand:SI 2 "register_operand" "r")) ; Source
8347
+;              (use (match_operand:SI 1 "register_operand" "+r"))])  ; Length
8348
+;              (match_operand 3 "" "")]
8349
+;      ""
8350
+;      "TEST\t1,%1
8351
+;      STO.NZ\t%2,(%0)
8352
+;      ADD.NZ\t1,%0
8353
+;      TEST\t2,%1
8354
+;      STO.NZ\t%2,(%0)
8355
+;      STO.NZ\t%2,1(%0)
8356
+;      ADD.NZ\t2,%0
8357
+;      AND\t-4,%1
8358
+;      BZ\t.Lskp%=\n.Ltop%=:\n
8359
+;      STO\t%2,(%0)
8360
+;      STO\t%2,1(%0)
8361
+;      STO\t%2,2(%0)
8362
+;      STO\t%2,3(%0)
8363
+;      SUB\t%4,%0
8364
+;      BZ\t.Lskp%=
8365
+;      BRA\t.Ltop%=\n.Lskp%=:"
8366
+;      [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8367
+;;
8368
+;
8369
+;
8370
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8371
+;;
8372
+;; Control flow instructions
8373
+;;
8374
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8375
+;
8376
+;
8377
+;
8378
+(define_expand "jump"
8379
+       [(set (pc)
8380
+               (label_ref (match_operand 0 "" "")))]); // Was general-op, "mro"
8381
+(define_insn "jump_const"      ; Must be modeless, VOIDmode, not SI or any othr
8382
+       [(set (pc)      ; Otherwise it won't accept jumps to labels
8383
+               (match_operand:SI 0 "zip_const_address_operand_p" ""))]
8384
+       ""
8385
+       "BRA    %0"
8386
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unchanged")])
8387
+(define_insn "jump_label"      ; Must be modeless, VOIDmode, not SI or any othr
8388
+       [(set (pc)      ; Otherwise it won't accept jumps to labels
8389
+               (label_ref (match_operand 0 "" "")))]
8390
+       ""
8391
+       "BRA    %0"
8392
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unchanged")])
8393
+;
8394
+; This is really the same thing as an indirect jump ... the big difference
8395
+; is that the zip_address_operand_p checks for an "N" type condition, not an
8396
+; "M" type condition ... a bug, but one that works for now.  (The assembler
8397
+; should be able to catch and except on it ...)
8398
+;
8399
+; #warning "This predicate is appropriate for non-moves, but not for JMPs"
8400
+(define_insn "jump_variable"
8401
+       [(set (pc)
8402
+               (match_operand:SI 0 "zip_address_operand_p" ""))]
8403
+       ""
8404
+       "JMP    %0"
8405
+       [(set_attr "ccresult" "unchanged")])
8406
+;
8407
+; Indirect jumps ... both to registers, and registers plus offsets
8408
+;
8409
+(define_insn "indirect_jump"
8410
+       [(set (pc)
8411
+               (match_operand:SI 0 "register_operand" "r"))]
8412
+       ""
8413
+       "JMP    %0"
8414
+       [(set_attr "ccresult" "unchanged")])
8415
+(define_insn "indirect_jump_mem"
8416
+       [(set (pc) (match_operand:SI 0 "zip_memory_operand_p" "o"))]
8417
+       ""
8418
+       "LOD    %0,PC"
8419
+       [(set_attr "ccresult" "unchanged")])
8420
+(define_insn "indirect_jump_off"
8421
+       [(set (pc)
8422
+               (plus:SI (match_operand:SI 0 "register_operand" "r")
8423
+                       (match_operand:SI 1 "const_int_operand" "M")))]
8424
+       ""
8425
+       "JMP    %1(%0)"
8426
+       [(set_attr "ccresult" "unchanged")])
8427
+;;
8428
+; cbranchsi4
8429
+;;     Op 0 = the comparison operator (le,lt,eq,ne,gt,ge,and usgn ltu,geu,etc.)
8430
+;;     Op 1&2 the operands of the compare instruction
8431
+;;     Op 3 is the jump label
8432
+;;
8433
+;;
8434
+;; #warning Need to adjust this so that the "LT" code doesnt get generated ...
8435
+;;
8436
+(define_expand "cbranch<mode>4"
8437
+       [(set (cc0) (compare (match_operand:ZI 1 "register_operand" "r")
8438
+               (match_operand:ZI 2 "nonmemory_operand" "rO")))
8439
+       (set (pc) (if_then_else (match_operator 0 "ordered_comparison_operator"
8440
+                       [(cc0) (const_int 0)])
8441
+                       (label_ref (match_operand 3 "" ""))
8442
+                       (pc)))]
8443
+       ""
8444
+       {
8445
+               // extern void zip_debug_rtx(const_rtx);
8446
+               //; Two branches give us no end of difficulty when implementing.
8447
+               //; Let's check for these two branch codes, and swap the
8448
+               //; comparison to simplify them.
8449
+               // fprintf(stderr, "CBRANCH\n");
8450
+               // zip_debug_rtx(operands[0]);
8451
+               // zip_debug_rtx(operands[1]);
8452
+               // zip_debug_rtx(operands[2]);
8453
+               // zip_debug_rtx(operands[3]);
8454
+               if ((GET_CODE(operands[0])==GTU)&&(REG_P(operands[2]))) {
8455
+                       // fprintf(stderr, "CBRANCH:(GTU,?,REG,?)\n");
8456
+                       emit_insn(gen_rtx_SET(VOIDmode, cc0_rtx,
8457
+                               gen_rtx_COMPARE(VOIDmode, operands[2], operands[1])));
8458
+                       emit_jump_insn(gen_cbranch_jmp_ltu(operands[3]));
8459
+                       DONE;
8460
+               } else if((GET_CODE(operands[0])==GEU)&&(REG_P(operands[2]))) {
8461
+                       fprintf(stderr, "CBRANCH:(GEU,?,REG,?)\n");
8462
+                       emit_insn(gen_rtx_SET(VOIDmode, cc0_rtx,
8463
+                               gen_rtx_COMPARE(VOIDmode, operands[2], operands[1])));
8464
+                       emit_jump_insn(gen_cbranch_jmp_leu(operands[3]));
8465
+                       DONE;
8466
+               } // ; Otherwise ... just handle the branch normally
8467
+
8468
+               //; Except ... we can do better for some instructions, such as
8469
+               //; LE.  While we could exchange CMP Rx,Ry into -1(Rx),Ry, it
8470
+               //; would be difficult to explain to users why MIN_INT didn't
8471
+               //; compare properly.  Hence we only adjust constant integers.
8472
+               //;
8473
+               if ((GET_CODE(operands[0])==LE)
8474
+                               &&(CONST_INT_P(operands[2]))
8475
+                               &&(INTVAL(operands[2])>(1<<17)-2)) {
8476
+                       // fprintf(stderr, "CBRANCH:(LE,?,#,?)\n");
8477
+                       emit_insn(gen_rtx_SET(VOIDmode, cc0_rtx,
8478
+                               gen_rtx_COMPARE(VOIDmode, operands[1],
8479
+                                       GEN_INT(INTVAL(operands[2])+1))));
8480
+                       emit_insn(gen_cbranch_jmp_lt(operands[3]));
8481
+                       DONE;
8482
+               } else if ((GET_CODE(operands[0])==LEU)
8483
+                               &&(CONST_INT_P(operands[2]))
8484
+                               &&(INTVAL(operands[2])<(1<<17)-2)) {
8485
+                       // fprintf(stderr, "CBRANCH:(LEU,?,#,?)\n");
8486
+                       emit_insn(gen_rtx_SET(VOIDmode, cc0_rtx,
8487
+                               gen_rtx_COMPARE(VOIDmode, operands[1],
8488
+                                       GEN_INT(INTVAL(operands[2])+1))));
8489
+                       emit_insn(gen_cbranch_jmp_ltu(operands[3]));
8490
+                       DONE;
8491
+               }
8492
+       })
8493
+(define_insn "cbranch_jmp_eq"
8494
+       [(set (pc) (if_then_else (eq (cc0) (const_int 0))
8495
+                (label_ref (match_operand 0 "" ""))
8496
+                (pc)))]
8497
+       ""
8498
+       "BZ\t%0"
8499
+       [(set_attr "predicable" "no")
8500
+               (set_attr "conditional" "yes")
8501
+               (set_attr "ccresult" "unchanged")])
8502
+(define_insn "cbranch_jmp_neq"
8503
+       [(set (pc) (if_then_else (ne (cc0) (const_int 0))
8504
+                (label_ref (match_operand 0 "" ""))
8505
+                (pc)))]
8506
+       ""
8507
+       "BNZ\t%0"
8508
+       [(set_attr "predicable" "no")
8509
+               (set_attr "conditional" "yes")
8510
+               (set_attr "ccresult" "unchanged")])
8511
+(define_insn "cbranch_jmp_lt"
8512
+       [(set (pc) (if_then_else (lt (cc0) (const_int 0))
8513
+                (label_ref (match_operand 0 "" ""))
8514
+                (pc)))]
8515
+       ""
8516
+       "BLT\t%0"
8517
+       [(set_attr "predicable" "no")
8518
+               (set_attr "conditional" "yes")
8519
+               (set_attr "ccresult" "unchanged")])
8520
+(define_insn "cbranch_jmp_le"
8521
+       [(set (pc) (if_then_else (le (cc0) (const_int 0))
8522
+                (label_ref (match_operand 0 "" ""))
8523
+                (pc)))]
8524
+       ""
8525
+       "BLT\t%0
8526
+       BZ\t%0"
8527
+       [(set_attr "predicable" "no")
8528
+               (set_attr "conditional" "yes")
8529
+               (set_attr "ccresult" "unchanged")])
8530
+(define_insn "cbranch_jmp_gt"
8531
+       [(set (pc) (if_then_else (gt (cc0) (const_int 0))
8532
+                (label_ref (match_operand 0 "" ""))
8533
+                (pc)))]
8534
+       ""
8535
+       "BGT\t%0"
8536
+       [(set_attr "predicable" "no")
8537
+               (set_attr "conditional" "yes")
8538
+               (set_attr "ccresult" "unchanged")])
8539
+(define_insn "cbranch_jmp_ge"
8540
+       [(set (pc) (if_then_else (ge (cc0) (const_int 0))
8541
+                (label_ref (match_operand 0 "" ""))
8542
+                (pc)))]
8543
+       ""
8544
+       "BGE\t%0"
8545
+       [(set_attr "predicable" "no")
8546
+               (set_attr "conditional" "yes")
8547
+               (set_attr "ccresult" "unchanged")])
8548
+(define_insn "cbranch_jmp_ltu"
8549
+       [(set (pc) (if_then_else (ltu (cc0) (const_int 0))
8550
+                (label_ref (match_operand 0 "" ""))
8551
+                (pc)))]
8552
+       ""
8553
+       "BC\t%0"
8554
+       [(set_attr "predicable" "no")
8555
+               (set_attr "conditional" "yes")
8556
+               (set_attr "ccresult" "unchanged")])
8557
+(define_insn "cbranch_jmp_gtu"
8558
+       [(set (pc) (if_then_else (gtu (cc0) (const_int 0))
8559
+                (label_ref (match_operand 0 "" ""))
8560
+                (pc)))]
8561
+       ""      ; Flip the condition, and then we can jump
8562
+       "XOR\t2,CC
8563
+       BC\t%0"
8564
+       [(set_attr "predicable" "no")
8565
+               (set_attr "conditional" "yes")
8566
+               (set_attr "ccresult" "unknown")])
8567
+(define_insn "cbranch_jmp_leu"
8568
+       [(set (pc) (if_then_else (leu (cc0) (const_int 0))
8569
+                (label_ref (match_operand 0 "" ""))
8570
+                (pc)))]
8571
+       ""      ; Need to check for both LTU (i.e. C) and Z
8572
+       "BC\t%0
8573
+       BZ\t%0"
8574
+       [(set_attr "predicable" "no")
8575
+               (set_attr "conditional" "yes")
8576
+               (set_attr "ccresult" "unchanged")])
8577
+(define_insn "cbranch_jmp_geu"
8578
+       [(set (pc) (if_then_else (geu (cc0) (const_int 0))
8579
+                (label_ref (match_operand 0 "" ""))
8580
+                (pc)))]
8581
+       ""      ; Flip the comparison, then check for GEU (once flipped)a
8582
+               ; Z is naturally checked for, as C would've never been set on Z
8583
+               ; so by flipping it, it is tantamount to saying Z or GTU.
8584
+       "BZ\t%0
8585
+       XOR\t2,CC
8586
+       BC\t%0"
8587
+       [(set_attr "predicable" "no")
8588
+               (set_attr "conditional" "yes")
8589
+               (set_attr "ccresult" "unknown")])
8590
+(define_insn "cbranchdi4"
8591
+       [(set (pc) (if_then_else
8592
+               (match_operator 0 "ordered_comparison_operator"
8593
+                       [(match_operand:DI 1 "register_operand" "r")
8594
+                               (match_operand:DI 2 "nonmemory_operand" "rO")])
8595
+                       (label_ref (match_operand 3 "" ""))
8596
+                       (pc)))
8597
+       (clobber (cc0))]
8598
+       ""
8599
+       {
8600
+               switch(GET_CODE(operands[0])) {
8601
+               case EQ:
8602
+                       return "CMP\t%H2,%H1\n\tCMP.Z\t%L2,%L1\n\tBZ\t%3";
8603
+               case NE:
8604
+                       return "CMP\t%H2,%H1\n\tCMP.NZ\t%L2,%L1\n\tBNZ\t%3";
8605
+               case LE:
8606
+                       return "CMP\t%H2,%H1\n\tBLT\t%3\n\tCMP.Z\t%L2,%L1\n\tBC\t%3\n\tBZ\t%3";
8607
+               case GT:
8608
+                       return "CMP\t%H1,%H2\n\tBLT\t%3\n\tBNZ\t.Ldi%=\n\tCMP\t%L1,%L2\n\tBC\t%3\n.Ldi%=:";
8609
+               case LT:
8610
+                       return "CMP\t%H2,%H1\n\tBLT\t%3\n\tBNZ\t.Ldi%=\n\tCMP\t%L2,%L1\n\tBC\t%3\n.Ldi%=:";
8611
+               case GE:
8612
+                       return "CMP\t%H1,%H2\n\tBLT\t%3\n\tBNZ\t.Ldi%=\n\tCMP\t%L1,%L2\n\tBC\t%3\nBZ\t%3\n.Ldi%=:";
8613
+               case LTU:
8614
+                       return "CMP\t%H2,%H1\n\tCMP.Z\t%L2,%L1\n\tBC\t%3\n";
8615
+               case LEU:
8616
+                       return "CMP\t%H2,%H1\n\tCMP.Z\t%L2,%L1\n\tBC\t%3\n\tBZ\t%3";
8617
+               case GTU:
8618
+                       return "CMP\t%H1,%H2\n\tCMP.Z\t%L1,%L2\n\tBC\t%3\n";
8619
+               case GEU:
8620
+                       return "CMP\t%H1,%H2\n\tCMP.Z\t%L1,%L2\n\tBC\t%3\nBZ\t%3";
8621
+               default:
8622
+                       gcc_unreachable();
8623
+               }
8624
+       }
8625
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8626
+;
8627
+;
8628
+;
8629
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8630
+;;
8631
+;; Subroutine call
8632
+;;
8633
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8634
+;
8635
+;
8636
+; There are two types of calls: "call" and "call_value".
8637
+;
8638
+; Each of these types of calls are then expanded into one of:
8639
+;
8640
+;      _const          - A call to a constant address, such as a symbol
8641
+;                      reference or a fixed location
8642
+;
8643
+;      _label          - This should be the same as _const, except that for
8644
+;                      some reason the RTL and matching rules are separate.
8645
+;                      Hence we have a separate rule for this.
8646
+;
8647
+;      _mem            - The memory address we wish to jump to is stored in
8648
+;                      memory somewhere, and we have only a pointer.  In this
8649
+;                      case, we load that pointer straight to the PC and go.
8650
+;
8651
+;      _var            - The address to jump to is given as an offset to a
8652
+;                      register, such as X+R3.  This is an indirect jump.
8653
+;                      Although we support it, it does require different RTL
8654
+;                      code.
8655
+;
8656
+(define_expand "call"
8657
+       [(call (match_operand 0 "" "")
8658
+               (match_operand 1 "" ""))]
8659
+       ""
8660
+       {
8661
+               if (MEM_P(operands[0])) {
8662
+                       // This should always be the case
8663
+                       rtx addr = XEXP(operands[0],0);
8664
+                       if (zip_const_address_operand_p(addr, SImode)) {
8665
+                               // fprintf(stderr, "Generating gen_void_call_const()\n");
8666
+                               emit_call_insn(gen_void_call_const(addr,
8667
+                                               operands[1]));
8668
+                       } else if ((MEM_P(addr))&&(zip_address_operand(
8669
+                                                       XEXP(addr,0)))) {
8670
+                               emit_call_insn(gen_void_call_mem(XEXP(addr,0),
8671
+                                                                operands[1]));
8672
+                       } else {
8673
+                               emit_call_insn(gen_void_call_var(addr,
8674
+                                                                operands[1]));
8675
+                       }
8676
+                       DONE;
8677
+               }
8678
+       })
8679
+;
8680
+;
8681
+;
8682
+; How do we want to do this better?
8683
+;      Replace the RTL w/
8684
+;              return_label= gen_label_rtx();
8685
+;              emit_movsi(gen_rtx_REG(zip_R0),plus_constant(
8686
+;                      gen_rtx_REG(zip_PC),return_label));
8687
+;              emit_jump(label_rtx(
8688
+;
8689
+;              emit_label(return_label);
8690
+;
8691
+; The problem is: we can't!  GCC distinguishes between jumps and calls when
8692
+; optimizing, and it doesn't see the need to keep the label around.  Thus, the
8693
+; label gets removed and the call gets lost.  Hence we do it this way (below).
8694
+; I'll probably bastardize a means of getting a new codelabel that GCC doesn't
8695
+; recognize as such, but for now we'll use .Lcall# as our label.
8696
+;
8697
+(define_insn "void_call_const"
8698
+       [(parallel [(call (mem:SI (match_operand:SI 0 "zip_const_address_operand_p" ""))
8699
+                       (match_operand 1 "" ""))
8700
+               (clobber (reg:SI RTN_REG))])]
8701
+       ""
8702
+       "MOV    .Lcall%=(PC),R0\;BRA\t%0\n.Lcall%=:"
8703
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8704
+;(define_insn "void_call_label"
8705
+;      [(parallel [(call (mem:SI (label_ref (match_operand 0 "" "")))
8706
+;                      (match_operand 1 "" ""))
8707
+;              (clobber (reg:SI RTN_REG))])]
8708
+;      ""
8709
+;      "MOV    .Lcall%=(PC),R0\;BRA\t%0\n.Lcall%=:"
8710
+;      [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8711
+(define_insn "void_call_mem"
8712
+       [(parallel [(call (mem:SI (mem:SI (match_operand:SI 0 "zip_address_operand_p" "")))
8713
+                       (match_operand 1 "" ""))
8714
+               (clobber (reg:SI RTN_REG))])]
8715
+       ""
8716
+       "MOV    .Lcall%=(PC),R0\;LOD\t%0,PC\n.Lcall%=:"
8717
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8718
+;
8719
+; #warning "This predicate is appropriate for non-moves, but not for JMPs"
8720
+(define_insn "void_call_var"
8721
+       [(parallel [(call (mem:SI (match_operand:SI 0 "zip_address_operand_p" ""))
8722
+                       (match_operand 1 "" ""))
8723
+               (clobber (reg:SI RTN_REG))])]
8724
+       ""
8725
+       "MOV    .Lcall%=(PC),R0\;JMP\t%0\n.Lcall%=:"
8726
+       ; emit_move_insn(??)
8727
+       ;       emit_jump(where);
8728
+       ;       emit_label(return_address);
8729
+       ;
8730
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8731
+(define_expand "call_value"
8732
+       [(set (reg:SI RTNV_REG)
8733
+               (call (match_operand:SI 1 "" "")
8734
+                       (match_operand 2 "" "")))
8735
+       (set (match_operand:SI 0 "register_operand" "=r") (reg:SI RTNV_REG))]
8736
+       ""
8737
+       {
8738
+               // extern void zip_debug_rtx(const_rtx);
8739
+               // fprintf(stderr, "ZIP.MD::CALL-VALUE()\n");
8740
+               // zip_debug_rtx(operands[1]);
8741
+               if (MEM_P(operands[1])) {
8742
+                       // fprintf(stderr, "ZIP.MD::CALL-VALUE() MEM_P\n");
8743
+                       // zip_debug_rtx(operands[1]);
8744
+                       // This should always be the case
8745
+                       rtx addr = XEXP(operands[1],0);
8746
+                       if (zip_const_address_operand_p(addr, SImode)) {
8747
+                               // fprintf(stderr, "Generating gen_reg_call_const()\n");
8748
+                               emit_call_insn(gen_reg_call_const(addr, operands[2]));
8749
+                       } else if ((MEM_P(addr))&&(zip_address_operand(XEXP(addr,0)))) {
8750
+                               // fprintf(stderr, "ZIP.MD::CALL-VALUE() INDIRECT\n");
8751
+                               emit_call_insn(gen_reg_call_mem(XEXP(addr,0), operands[2]));
8752
+                       } else {
8753
+                               // fprintf(stderr, "ZIP.MD::CALL-VALUE() INDIRECT\n");
8754
+                               emit_call_insn(gen_reg_call_var(addr, operands[2]));
8755
+                       }
8756
+                       DONE;
8757
+               }
8758
+       })
8759
+(define_insn "reg_call_const"
8760
+       [(parallel [(set (reg:SI RTNV_REG)
8761
+               (call (mem:SI (match_operand:SI 0 "zip_const_address_operand_p" ""))
8762
+                       (match_operand 1 "" "")))
8763
+               (clobber (reg:SI RTN_REG))])]
8764
+       ""
8765
+       "MOV    .Lcall%=(PC),R0\;BRA\t%0\n.Lcall%=:"
8766
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8767
+;(define_insn "reg_call_label"
8768
+;      [(parallel [(set (reg:SI RTNV_REG)
8769
+;              (call (mem:SI (match_operand 0 "" ""))
8770
+;                      (match_operand 1 "" "")))
8771
+;              (clobber (reg:SI RTN_REG))])]
8772
+;      ""
8773
+;      "MOV    .Lcall%=(PC),R0\;BRA\t%0\n.Lcall%=:"
8774
+;      [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8775
+(define_insn "reg_call_mem"
8776
+       [(set (reg:SI RTNV_REG)
8777
+               (call (mem:SI (mem:SI (match_operand:SI 0 "zip_address_operand_p" "")))
8778
+                       (match_operand 1 "" "")))
8779
+               (clobber (reg:SI RTN_REG))]
8780
+       ""
8781
+       "MOV    .Lcall%=(PC),R0\;LOD\t%0,PC\n.Lcall%=:" ; emit_label(return_lbl);
8782
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8783
+; #warning "This predicate is appropriate for non-moves, but not for JMPs"
8784
+(define_insn "reg_call_var"
8785
+       [(parallel [(set (reg:SI RTNV_REG)
8786
+               (call (mem:SI (match_operand:SI 0 "zip_address_operand_p" ""))
8787
+                       (match_operand 1 "" "")))
8788
+               (clobber (reg:SI RTN_REG))])]
8789
+       ""
8790
+       "MOV    .Lcall%=(PC),R0\;JMP\t%0\n.Lcall%=:"
8791
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8792
+;
8793
+;
8794
+;
8795
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8796
+;;
8797
+;; Frame manipulation RTX
8798
+;;
8799
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8800
+;
8801
+;
8802
+;
8803
+(define_expand "prologue"
8804
+       [(const_int 0)]
8805
+       ""
8806
+       "{ zip_expand_prologue(); DONE; }")
8807
+(define_expand "epilogue"
8808
+       [(return)]
8809
+       ""
8810
+       "{ zip_expand_epilogue(); DONE; }")
8811
+(define_expand "return" ; In order to use the function predicate, this *must*
8812
+       [(return)]      ; be a define_expand
8813
+       "zip_use_return_insn()")
8814
+       ; "JMP  R0"
8815
+       ; [(set_attr "ccresult" "unchanged")])
8816
+(define_insn "*return" ; A "*" -- means it cannot be called from C
8817
+       [(return)]
8818
+       ""
8819
+       "JMP    R0"
8820
+       [(set_attr "ccresult" "unchanged")])
8821
+(define_insn "simple_return"   ; A "*" -- means it cannot be called from C
8822
+       [(simple_return)]
8823
+       ""
8824
+       "JMP    R0"
8825
+       [(set_attr "ccresult" "unchanged")])
8826
+;
8827
+;
8828
+;
8829
+;;;;;;;;;;;;;;;;;;;;;;;;;;
8830
+;;
8831
+;; Zip Builtin Functions
8832
+;;
8833
+;;;;;;;;;;;;;;;;;;;;;;;;;;
8834
+;
8835
+;
8836
+;
8837
+(define_insn "zip_rtu"
8838
+       [(unspec_volatile [(reg:SI CC_REG)] UNSPEC_RTU)
8839
+       (clobber (cc0))]
8840
+       "(!ZIP_USER)"
8841
+       "RTU"
8842
+       [(set_attr "ccresult" "unknown")])
8843
+(define_insn "zip_halt" ; Needs to be unspec_volatile, or optimizer will opt out
8844
+       [(unspec_volatile [(reg:SI CC_REG)] UNSPEC_HALT)
8845
+       (clobber (cc0))]
8846
+       "(!ZIP_USER)"
8847
+       "HALT"
8848
+       [(set_attr "ccresult" "unknown")])
8849
+(define_insn "zip_idle"
8850
+       [(unspec_volatile [(reg:SI CC_REG)] UNSPEC_IDLE)
8851
+       (clobber (cc0))]
8852
+       ""
8853
+       "WAIT"
8854
+       [(set_attr "ccresult" "unknown")])
8855
+(define_insn "zip_syscall"
8856
+       [(unspec_volatile [(reg:SI CC_REG)] UNSPEC_SYSCALL)]
8857
+       ""
8858
+       "CLR\tCC"
8859
+       [(set_attr "ccresult" "unknown")])
8860
+;
8861
+;
8862
+; Operator "save_context"
8863
+;
8864
+;      operand 0 missing output reload ... ?
8865
+;
8866
+(define_insn "zip_save_context"
8867
+       [(parallel [
8868
+               (unspec_volatile
8869
+                       [ (match_operand:SI 0 "register_operand" "r") ]
8870
+                       UNSPEC_SAVE_CONTEXT)
8871
+               (clobber (match_scratch:SI 1 "=r"))
8872
+               (clobber (match_scratch:SI 2 "=r"))
8873
+               (clobber (match_scratch:SI 3 "=r"))
8874
+               (clobber (match_scratch:SI 4 "=r"))
8875
+               (use (match_dup 0))])]
8876
+       "(!ZIP_USER)"
8877
+       "MOV\tuR0,%1
8878
+       MOV\tuR1,%2
8879
+       MOV\tuR2,%3
8880
+       MOV\tuR3,%4
8881
+       STO\t%1,%0
8882
+       STO\t%2,1(%0)
8883
+       STO\t%3,2(%0)
8884
+       STO\t%4,3(%0)
8885
+       MOV\tuR4,%1
8886
+       MOV\tuR5,%2
8887
+       MOV\tuR6,%3
8888
+       MOV\tuR7,%4
8889
+       STO\t%1,4(%0)
8890
+       STO\t%2,5(%0)
8891
+       STO\t%3,6(%0)
8892
+       STO\t%4,7(%0)
8893
+       MOV\tuR8,%1
8894
+       MOV\tuR9,%2
8895
+       MOV\tuR10,%3
8896
+       MOV\tuR11,%4
8897
+       STO\t%1,8(%0)
8898
+       STO\t%2,9(%0)
8899
+       STO\t%3,10(%0)
8900
+       STO\t%4,11(%0)
8901
+       MOV\tuR12,%1
8902
+       MOV\tuSP,%2
8903
+       MOV\tuCC,%3
8904
+       MOV\tuPC,%4
8905
+       STO\t%1,12(%0)
8906
+       STO\t%2,13(%0)
8907
+       STO\t%3,14(%0)
8908
+       STO\t%4,15(%0)"
8909
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8910
+(define_insn "zip_restore_context"
8911
+       [(unspec_volatile [
8912
+               (match_operand:SI 0 "register_operand" "r")] UNSPEC_RESTORE_CONTEXT)
8913
+               ; (match_scratch:SI 1 "r")
8914
+               ; (match_scratch:SI 2 "r")
8915
+               ; (match_scratch:SI 3 "r")
8916
+               ; (match_scratch:SI 4 "r")] 6)
8917
+       (clobber (match_scratch:SI 1 "=r"))
8918
+       (clobber (match_scratch:SI 2 "=r"))
8919
+       (clobber (match_scratch:SI 3 "=r"))
8920
+       (clobber (match_scratch:SI 4 "=r"))
8921
+       (use (match_dup 0))]
8922
+       "(!ZIP_USER)"
8923
+       "LOD\t0(%0),%1
8924
+       LOD\t1(%0),%2
8925
+       LOD\t2(%0),%3
8926
+       LOD\t3(%0),%4
8927
+       MOV\t%1,uR0
8928
+       MOV\t%2,uR1
8929
+       MOV\t%3,uR2
8930
+       MOV\t%4,uR3
8931
+       LOD\t4(%0),%1
8932
+       LOD\t5(%0),%2
8933
+       LOD\t6(%0),%3
8934
+       LOD\t7(%0),%4
8935
+       MOV\t%1,uR4
8936
+       MOV\t%2,uR5
8937
+       MOV\t%3,uR6
8938
+       MOV\t%4,uR7
8939
+       LOD\t8(%0),%1
8940
+       LOD\t9(%0),%2
8941
+       LOD\t10(%0),%3
8942
+       LOD\t11(%0),%4
8943
+       MOV\t%1,uR8
8944
+       MOV\t%2,uR9
8945
+       MOV\t%3,uR10
8946
+       MOV\t%4,uR11
8947
+       LOD\t12(%0),%1
8948
+       LOD\t13(%0),%2
8949
+       LOD\t14(%0),%3
8950
+       LOD\t15(%0),%4
8951
+       MOV\t%1,uR12
8952
+       MOV\t%2,uSP
8953
+       MOV\t%3,uCC
8954
+       MOV\t%4,uPC"
8955
+       [(set_attr "predicable" "no") (set_attr "ccresult" "unknown")])
8956
+(define_insn "zip_bitrev"
8957
+       [(set (match_operand:SI 0 "register_operand" "=r")
8958
+               (unspec:SI [(match_operand:SI 1 "register_operand" "r")] UNSPEC_BITREV))
8959
+       ]
8960
+       ""
8961
+       "BREV\t%1,%0"
8962
+       [(set_attr "ccresult" "set")])
8963
+(define_insn "zip_cc"
8964
+       [(set (match_operand:SI 0 "register_operand" "=r")
8965
+               (unspec:SI [(reg:SI CC_REG)] UNSPEC_GETCC))]
8966
+       ""
8967
+       "MOV\tCC,%0"
8968
+       [(set_attr "ccresult" "unchanged")])
8969
+(define_insn "ldilo"
8970
+       [(set (match_operand:SI 0 "register_operand" "=r")
8971
+               (unspec:SI [(match_operand:SI 1 "immediate_operand" "")] UNSPEC_LDILO))]
8972
+       ""
8973
+       "LDILO  %1,%0"
8974
+       [(set_attr "predicable" "yes") (set_attr "ccresult" "unchanged")])
8975
+
8976
+;
8977
+;
8978
+;
8979
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8980
+;;
8981
+;; Floating point Op-codes
8982
+;;
8983
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8984
+;
8985
+;
8986
+;
8987
+(define_insn "addsf3"
8988
+       [(set (match_operand:SF 0 "register_operand" "=r")
8989
+               (plus:SF (match_operand:SF 1 "register_operand" "0")
8990
+                       (match_operand:SF 2 "register_operand" "r")))]
8991
+       "(ZIP_FPU)"
8992
+       "FPADD  %2,%0"
8993
+       [(set_attr "ccresult" "unknown")])
8994
+(define_insn "subsf3"
8995
+       [(set (match_operand:SF 0 "register_operand" "=r")
8996
+               (minus:SF (match_operand:SF 1 "register_operand" "0")
8997
+                       (match_operand:SF 2 "register_operand" "r")))]
8998
+       "(ZIP_FPU)"
8999
+       "FPSUB  %2,%0"
9000
+       [(set_attr "ccresult" "unknown")])
9001
+(define_insn "mulsf3"
9002
+       [(set (match_operand:SF 0 "register_operand" "=r")
9003
+               (mult:SF (match_operand:SF 1 "register_operand" "0")
9004
+                       (match_operand:SF 2 "register_operand" "r")))]
9005
+       "(ZIP_FPU)"
9006
+       "FPMUL  %2,%0"
9007
+       [(set_attr "ccresult" "unknown")])
9008
+(define_insn "divsf3"
9009
+       [(set (match_operand:SF 0 "register_operand" "=r")
9010
+               (div:SF (match_operand:SF 1 "register_operand" "0")
9011
+                       (match_operand:SF 2 "register_operand" "r")))]
9012
+       "(ZIP_FPU)"
9013
+       "FPDIV  %2,%0"
9014
+       [(set_attr "ccresult" "unknown")])
9015
+
9016
+;
9017
+;
9018
+;
9019
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9020
+;;
9021
+;; Trap Instruction
9022
+;;
9023
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9024
+;
9025
+;
9026
+; The ZipCPU doesn't really have a "trap" instruction per se.  The goal is that
9027
+; *nothing* should ever trap, and so we should never get here.  However, the
9028
+; compiler seems to want a trap instruction for some reason.  (It keeps us
9029
+; from calling the abort() function, if we don't define these ...)  So let's
9030
+; just grab onto the break instruction and declare it to be a trap instruction
9031
+; for our purposes.  Alternatively, we might've used a syscall, but ... this
9032
+; will work for both user and system instructions.
9033
+;
9034
+(define_insn "trap"
9035
+       [(trap_if (const_int 1) (const_int 0))]
9036
+       ""
9037
+       "BREAK"
9038
+       [(set_attr "predicable" "yes") (set_attr "ccresult" "unchanged")])
9039
+;
9040
+(define_expand "ctrap<mode>4"
9041
+       [(set (cc0) (compare (match_operand:ZI 1 "register_operand" "r")
9042
+               (match_operand:ZI 2 "nonmemory_operand" "rO")))
9043
+       (trap_if (match_operator 0 "ordered_comparison_operator"
9044
+                       [(cc0) (const_int 0)])
9045
+                       (match_operand 3 "const_int_operand" "O"))]
9046
+       ""
9047
+       )
9048
+(define_insn "trapif"
9049
+       [(trap_if (match_operator 0 "ordered_comparison_operator"
9050
+                       [(cc0) (const_int 0)])
9051
+                       (match_operand 1 "const_int_operand" "O"))]
9052
+       ""
9053
+       "BREAK\t%1"
9054
+       [(set_attr "predicable" "no")])
9055
+;
9056
+;
9057
+;
9058
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9059
+;;
9060
+;; Unimplemented (or not yet implemented) RTL Codes
9061
+;;
9062
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9063
+;
9064
+;
9065
+;
9066
+; The book says that add<mode>3 is used if addptr<mode>3 is undefined.
9067
+; Hence we leave this as unimplemented.
9068
+;
9069
+;(define_insn "addptrsi3"
9070
+;      [(set (match_operand:SI 0 "register_operand" "=r")
9071
+;              (plus:SI (match_operand:SI 1 "register_operand" "r")
9072
+;                      (match_operand:SI 2 "general_operand" "M")))]
9073
+;      ; Addptr is not allowed to clobber condition codes, thus we *must*
9074
+;      ; use the mov (A+B),C form of the add.
9075
+;      ""
9076
+;      "MOV    %2(%1),%0"
9077
+;      [(set_attr "ccresult" "unchanged")])
9078
+;
9079
+; (define_insn "casesi"
9080
+;      "LDI    %4,R0
9081
+;      SUB     %2,%1
9082
+;      BLT     %5
9083
+;      CMP     %3,%1
9084
+;      BGT     %5
9085
+;      ADD     %1,R0
9086
+;      LOD     (R0),pc"
9087
+;      "")
9088
+; (define_insn "decrement_and_branch_until_zero"
9089
+       ; [(parallel [
9090
+               ; (set (match_operand:SI 0 "regiser_operand" "r")
9091
+                       ; (minus:SI (match_dup 0) (const_int 1)))
9092
+               ; (set (pc) (if_then_else
9093
+                               ; (ge (minus:SI (match_dup 0) (const_int 1)))
9094
+                               ; (label_ref (match_operand 1 "" ""))
9095
+                               ; (pc)))])]
9096
+       ; ""
9097
+; ;    SUB     1,%0
9098
+; ;    BNZ     %1
9099
+; ;     .vice the faster (optimize for speed)
9100
+       ; "SUB  1,%0
9101
+       ; BZ    %=
9102
+       ; BRA   %1
9103
+       ; %=:"
9104
+       ; [(set_attr "predicable" "no") (set_attr "ccresult" "set")])
9105
+; doloop_end - do not define--would require cost of an unopt register to use
9106
+; allocate_stack       - do not define ...
9107
+; nonlocal_goto - do not define
9108
+;(define_insn "ctrapmm4"
9109
+;      CMP     %1,%2
9110
+;      MOV.%0  %3,R0
9111
+;      LDILO.%0 0,(CC)
9112
+;
9113
+;(define_insn "sync_compare_and_swapsi"
9114
+;      [(set ...
9115
+;              )]
9116
+;      "(ZIP_ATMOC)"
9117
+;      LOCK            (alu)           // Hmmm ... need to modify if I will
9118
+;      LOD     %1,%0   OP-VALID        // operate on the value before the store
9119
+;      CMP     %0,%2   DCD-valid
9120
+;      STO.Z   %2,%1   PF-valid
9121
+;
9122
+;(define_insn "sync_lock_test_and_setsi"
9123
+;      LOCK
9124
+;      LOD     %1,%0
9125
+;      STO     %0,%1
9126
+;
9127
+;(define_insn "sync_lock_releasesi"
9128
+;      STO     %1,%0
9129
+;
9130
+;
9131
+;(define_insn "negvsi3"
9132
+;      "MOV    %1,%0
9133
+;      XOR     -1,%0
9134
+;      ADD     1,%0
9135
+;      BV      %2"
9136
+;      "")
9137
+
9138
+;
9139
+; STILL MISSING:
9140
+;      SYSCALL(ID)
9141
+;              MOV %ID,R0
9142
+;              CLR     CC
9143
+;      cmove   ... the conditional move, created from a
9144
+;      (set (match_op 0 "" "r") (if_then_else (condition) (a) (reg X))))
9145
+;      pattern
9146
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/zip/zip-modes.def gcc-5.3.0-zip/gcc/config/zip/zip-modes.def
9147
--- gcc-5.3.0-original/gcc/config/zip/zip-modes.def     1969-12-31 19:00:00.000000000 -0500
9148
+++ gcc-5.3.0-zip/gcc/config/zip/zip-modes.def  2016-03-04 17:13:26.438204784 -0500
9149
@@ -0,0 +1,21 @@
9150
+/*
9151
+ * Commends in C-long comment form
9152
+ * class
9153
+ *     Mode = "SI"
9154
+ *     PRECISION, BYTESIZE, COUNT ??
9155
+ *     FORMAT
9156
+ *     EXPR
9157
+ */
9158
+// INT_MODE(QI, 1);
9159
+// INT_MODE(HI, 1);
9160
+// INT_MODE(SI, 1);
9161
+// INT_MODE(DI, 2);
9162
+
9163
+// FLOAT_MODE(SF, 1, ieee_single_format);
9164
+// FLOAT_MODE(DF, 2, ieee_single_format);
9165
+
9166
+// We cannot override machmodes.def from here.  Thus, even though our QI,
9167
+// HI, and SI modes are all 1-byte, we cant set them that way here.  The
9168
+// change needed to be made in machmodes.def.  Hence, here is a target
9169
+// configuration change--in machmodes.def--that properly belonged in the
9170
+// config directory.
9171
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/zip/zip-protos.h gcc-5.3.0-zip/gcc/config/zip/zip-protos.h
9172
--- gcc-5.3.0-original/gcc/config/zip/zip-protos.h      1969-12-31 19:00:00.000000000 -0500
9173
+++ gcc-5.3.0-zip/gcc/config/zip/zip-protos.h   2016-03-02 10:35:53.661426308 -0500
9174
@@ -0,0 +1,69 @@
9175
+////////////////////////////////////////////////////////////////////////////////
9176
+//
9177
+// Filename:   zip-protos.h
9178
+//
9179
+// Project:    Zip CPU backend for the GNU Compiler Collection
9180
+//
9181
+// Purpose:
9182
+//
9183
+// Creator:    Dan Gisselquist, Ph.D.
9184
+//             Gisselquist Technology, LLC
9185
+//
9186
+////////////////////////////////////////////////////////////////////////////////
9187
+//
9188
+// Copyright (C) 2016, Gisselquist Technology, LLC
9189
+//
9190
+// This program is free software (firmware): you can redistribute it and/or
9191
+// modify it under the terms of  the GNU General Public License as published
9192
+// by the Free Software Foundation, either version 3 of the License, or (at
9193
+// your option) any later version.
9194
+//
9195
+// This program is distributed in the hope that it will be useful, but WITHOUT
9196
+// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
9197
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9198
+// for more details.
9199
+//
9200
+// You should have received a copy of the GNU General Public License along
9201
+// with this program.  (It's in the $(ROOT)/doc directory, run make with no
9202
+// target there if the PDF file isn't present.)  If not, see
9203
+// <http://www.gnu.org/licenses/> for a copy.
9204
+//
9205
+// License:    GPL, v3, as defined and found on www.gnu.org,
9206
+//             http://www.gnu.org/licenses/gpl.html
9207
+//
9208
+//
9209
+////////////////////////////////////////////////////////////////////////////////
9210
+#ifndef        ZIP_PROTOS_H
9211
+#define        ZIP_PROTOS_H
9212
+
9213
+extern void    zip_expand_prologue(void);
9214
+extern void    zip_expand_epilogue(void);
9215
+extern int     zip_initial_elimination_offset(int, int);
9216
+extern void    zip_print_operand(FILE *, rtx, int);
9217
+extern void    zip_print_operand_address(FILE *, rtx);
9218
+extern enum    reg_class       zip_reg_class(int);
9219
+extern rtx     zip_return_addr_rtx(int, rtx);
9220
+extern int     zip_num_arg_regs(enum machine_mode, tree);
9221
+
9222
+extern void    zip_asm_output_def(FILE *s, const char *n, const char *v);
9223
+extern void    zip_update_cc_notice(rtx exp, rtx_insn *insn);
9224
+extern int     zip_address_operand(rtx op);
9225
+extern int     zip_const_address_operand(rtx op);
9226
+extern bool    zip_gen_move_rtl(rtx, rtx);
9227
+// extern      bool    zip_load_address_lod(rtx, rtx);
9228
+// extern      bool    zip_load_address_sto(rtx, rtx);
9229
+extern bool    zip_use_return_insn(void);
9230
+extern const char *zip_set_zero_or_one(rtx, rtx);
9231
+extern const char *zip_movsicc(rtx, rtx, rtx, rtx);
9232
+
9233
+extern int     zip_ct_address_operand(rtx op);
9234
+extern int     zip_pd_address_operand(rtx op);
9235
+extern int     zip_pd_mov_operand(rtx op);
9236
+extern int     zip_ct_const_address_operand(rtx op);
9237
+extern int     zip_pd_const_address_operand(rtx op);
9238
+extern const char *zip_movsicc(rtx, rtx, rtx, rtx);
9239
+extern const char *zip_addsicc(rtx, rtx, rtx, rtx);
9240
+// extern      void    zip_canonicalize_comparison(int *, rtx *, rtx *, bool);
9241
+
9242
+#endif
9243
+
9244
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config.gcc gcc-5.3.0-zip/gcc/config.gcc
9245
--- gcc-5.3.0-original/gcc/config.gcc   2015-09-10 10:17:53.000000000 -0400
9246
+++ gcc-5.3.0-zip/gcc/config.gcc        2016-02-14 00:53:37.389411987 -0500
9247
@@ -479,6 +479,10 @@
9248
 tilepro*-*-*)
9249
        cpu_type=tilepro
9250
        ;;
9251
+zip*)
9252
+       cpu_type=zip
9253
+       tmake_file=zip/t-zip
9254
+       ;;
9255
 esac
9256
 
9257
 tm_file=${cpu_type}/${cpu_type}.h
9258
@@ -2972,6 +2976,15 @@
9259
        c_target_objs="m32c-pragma.o"
9260
        cxx_target_objs="m32c-pragma.o"
9261
        ;;
9262
+zip-*-netbsd*)
9263
+       tm_file="${tm_file} elfos.h netbsd.h netbsd-elf.h zip/netbsd.h"
9264
+       tmake_file="${tmake_file} zip/t-zip"
9265
+       ;;
9266
+zip*)
9267
+       target_has_targetm_common=yes
9268
+       tm_file="elfos.h newlib-stdint.h ${tm_file}"
9269
+       tmake_file="${tmake_file} zip/t-zip"
9270
+       ;;
9271
 *)
9272
        echo "*** Configuration ${target} not supported" 1>&2
9273
        exit 1
9274
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/cse.c gcc-5.3.0-zip/gcc/cse.c
9275
--- gcc-5.3.0-original/gcc/cse.c        2015-02-03 15:41:38.000000000 -0500
9276
+++ gcc-5.3.0-zip/gcc/cse.c     2016-03-05 20:34:50.226907590 -0500
9277
@@ -634,6 +634,14 @@
9278
 
9279
 /* Nonzero if X has the form (PLUS frame-pointer integer).  */
9280
 
9281
+#ifdef DO_ZIP_DEBUGS
9282
+#include <stdio.h>
9283
+extern void zip_debug_rtx(const_rtx);
9284
+#define        ZIP_DEBUG_LINE(STR,RTX) do { fprintf(stderr, "%s\n", STR); zip_debug_rtx(RTX); } while(0)
9285
+#else
9286
+#define        ZIP_DEBUG_LINE(STR,RTX)
9287
+#endif
9288
+
9289
 static bool
9290
 fixed_base_plus_p (rtx x)
9291
 {
9292
@@ -2843,6 +2851,7 @@
9293
   enum rtx_code code;
9294
   const char *fmt;
9295
 
9296
+       ZIP_DEBUG_LINE("CANON-REG", insn);
9297
   if (x == 0)
9298
     return x;
9299
 
9300
@@ -2898,6 +2907,7 @@
9301
          validate_canon_reg (&XVECEXP (x, i, j), insn);
9302
     }
9303
 
9304
+       ZIP_DEBUG_LINE("CANON-REG-RTN", x);
9305
   return x;
9306
 }
9307
 
9308
@@ -3144,14 +3154,16 @@
9309
   if (x == 0)
9310
     return x;
9311
 
9312
+       ZIP_DEBUG_LINE("FOLD-RTX", x);
9313
   /* Try to perform some initial simplifications on X.  */
9314
   code = GET_CODE (x);
9315
   switch (code)
9316
     {
9317
     case MEM:
9318
     case SUBREG:
9319
-      if ((new_rtx = equiv_constant (x)) != NULL_RTX)
9320
-        return new_rtx;
9321
+      if ((new_rtx = equiv_constant (x)) != NULL_RTX) {
9322
+       ZIP_DEBUG_LINE("FOLD-RTX-NEW", new_rtx);
9323
+        return new_rtx; }
9324
       return x;
9325
 
9326
     case CONST:
9327
@@ -3208,6 +3220,8 @@
9328
        rtx folded_arg = XEXP (x, i), const_arg;
9329
        machine_mode mode_arg = GET_MODE (folded_arg);
9330
 
9331
+       ZIP_DEBUG_LINE("FOLD-RTX-ARG = ", folded_arg);
9332
+
9333
        switch (GET_CODE (folded_arg))
9334
          {
9335
          case MEM:
9336
@@ -3317,6 +3331,7 @@
9337
        }
9338
 
9339
       apply_change_group ();
9340
+       ZIP_DEBUG_LINE("FOLD-RTX-CANONICALIZED = ", insn);
9341
     }
9342
 
9343
   /* If X is an arithmetic operation, see if we can simplify it.  */
9344
@@ -4203,6 +4218,7 @@
9345
 {
9346
   rtx dest = SET_DEST (set);
9347
   rtx src = SET_SRC (set);
9348
+       ZIP_DEBUG_LINE("TRY-BACK-SUBSTITUTE-REG", insn);
9349
 
9350
   if (REG_P (dest)
9351
       && REG_P (src) && ! HARD_REGISTER_P (src)
9352
@@ -4258,6 +4274,7 @@
9353
            }
9354
        }
9355
     }
9356
+       ZIP_DEBUG_LINE("TRY-BACK-SUBSTITUTE-REG, done", insn);
9357
 }
9358
 
9359
 /* Record all the SETs in this instruction into SETS_PTR,
9360
@@ -4351,6 +4368,7 @@
9361
   rtx tem;
9362
   rtx x = PATTERN (insn);
9363
   int i;
9364
+       ZIP_DEBUG_LINE("CANONICALIZE-INSN", insn);
9365
 
9366
   if (CALL_P (insn))
9367
     {
9368
@@ -4364,6 +4382,7 @@
9369
       canon_reg (SET_SRC (x), insn);
9370
       apply_change_group ();
9371
       fold_rtx (SET_SRC (x), insn);
9372
+       ZIP_DEBUG_LINE("CANONICALIZE-INSN, was set:", insn);
9373
     }
9374
   else if (GET_CODE (x) == CLOBBER)
9375
     {
9376
@@ -4400,6 +4419,7 @@
9377
     canon_reg (PATTERN (insn), insn);
9378
   else if (GET_CODE (x) == PARALLEL)
9379
     {
9380
+       ZIP_DEBUG_LINE("CANONICALIZE-INSN/parallel", insn);
9381
       for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
9382
        {
9383
          rtx y = XVECEXP (x, 0, i);
9384
@@ -4491,6 +4511,7 @@
9385
 
9386
      The result of apply_change_group can be ignored; see canon_reg.  */
9387
 
9388
+       ZIP_DEBUG_LINE("CANONICALIZE-INSN/done", insn);
9389
   apply_change_group ();
9390
 }
9391
 
9392
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/defaults.h gcc-5.3.0-zip/gcc/defaults.h
9393
--- gcc-5.3.0-original/gcc/defaults.h   2015-03-03 10:04:02.000000000 -0500
9394
+++ gcc-5.3.0-zip/gcc/defaults.h        2016-02-06 16:57:53.939410173 -0500
9395
@@ -480,6 +480,8 @@
9396
 #define LOG2_BITS_PER_UNIT 3
9397
 #elif BITS_PER_UNIT == 16
9398
 #define LOG2_BITS_PER_UNIT 4
9399
+#elif BITS_PER_UNIT == 32
9400
+#define LOG2_BITS_PER_UNIT 5
9401
 #else
9402
 #error Unknown BITS_PER_UNIT
9403
 #endif
9404
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/doc/gcc.log gcc-5.3.0-zip/gcc/doc/gcc.log
9405
--- gcc-5.3.0-original/gcc/doc/gcc.log  1969-12-31 19:00:00.000000000 -0500
9406
+++ gcc-5.3.0-zip/gcc/doc/gcc.log       2016-01-30 15:18:43.262724969 -0500
9407
@@ -0,0 +1,214 @@
9408
+This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) (format=pdfetex 2014.5.7)  30 JAN 2016 15:17
9409
+entering extended mode
9410
+ restricted \write18 enabled.
9411
+ file:line:error style messages enabled.
9412
+ %&-line parsing enabled.
9413
+**\catcode126=12 \def\normaltilde{~}\catcode126=13 \let~\normaltilde  \input ./
9414
+gcc.texi
9415
+(./gcc.texi (/usr/share/texmf/tex/texinfo/texinfo.tex
9416
+Loading texinfo [version 2013-09-11.11]:
9417
+\bindingoffset=\dimen16
9418
+\normaloffset=\dimen17
9419
+\pagewidth=\dimen18
9420
+\pageheight=\dimen19
9421
+\outerhsize=\dimen20
9422
+\outervsize=\dimen21
9423
+\cornerlong=\dimen22
9424
+\cornerthick=\dimen23
9425
+\topandbottommargin=\dimen24
9426
+\headlinebox=\box16
9427
+\footlinebox=\box17
9428
+\margin=\insert252
9429
+\EMsimple=\toks13
9430
+\groupbox=\box18
9431
+\groupinvalidhelp=\toks14
9432
+\mil=\dimen25
9433
+\exdentamount=\skip18
9434
+\inmarginspacing=\skip19
9435
+\centerpenalty=\count27
9436
+ pdf,
9437
+\tempnum=\count28
9438
+\lnkcount=\count29
9439
+\filename=\toks15
9440
+\filenamelength=\count30
9441
+\pgn=\count31
9442
+\toksA=\toks16
9443
+\toksB=\toks17
9444
+\toksC=\toks18
9445
+\toksD=\toks19
9446
+\boxA=\box19
9447
+\countA=\count32
9448
+\nopdfimagehelp=\toks20
9449
+ fonts,
9450
+\sffam=\fam8
9451
+\textleading=\dimen26
9452
+ markup,
9453
+\fontdepth=\count33
9454
+ glyphs,
9455
+\errorbox=\box20
9456
+
9457
+page headings,
9458
+\titlepagetopglue=\skip20
9459
+\titlepagebottomglue=\skip21
9460
+\evenheadline=\toks21
9461
+\oddheadline=\toks22
9462
+\evenfootline=\toks23
9463
+\oddfootline=\toks24
9464
+ tables,
9465
+\tableindent=\dimen27
9466
+\itemindent=\dimen28
9467
+\itemmargin=\dimen29
9468
+\itemmax=\dimen30
9469
+\itemno=\count34
9470
+\multitableparskip=\skip22
9471
+\multitableparindent=\skip23
9472
+\multitablecolspace=\dimen31
9473
+\multitablelinespace=\skip24
9474
+\colcount=\count35
9475
+\everytab=\toks25
9476
+ conditionals,
9477
+\doignorecount=\count36
9478
+ indexing,
9479
+\whatsitskip=\skip25
9480
+\whatsitpenalty=\count37
9481
+\secondaryindent=\skip26
9482
+\partialpage=\box21
9483
+\doublecolumnhsize=\dimen32
9484
+ sectioning,
9485
+\unnumberedno=\count38
9486
+\chapno=\count39
9487
+\secno=\count40
9488
+\subsecno=\count41
9489
+\subsubsecno=\count42
9490
+\appendixno=\count43
9491
+\absseclevel=\count44
9492
+\secbase=\count45
9493
+\chapheadingskip=\skip27
9494
+\secheadingskip=\skip28
9495
+\subsecheadingskip=\skip29
9496
+ toc,
9497
+\tocfile=\write0
9498
+\contentsrightmargin=\skip30
9499
+\savepageno=\count46
9500
+\lastnegativepageno=\count47
9501
+\tocindent=\dimen33
9502
+ environments,
9503
+\lispnarrowing=\skip31
9504
+\envskipamount=\skip32
9505
+\circthick=\dimen34
9506
+\cartouter=\dimen35
9507
+\cartinner=\dimen36
9508
+\normbskip=\skip33
9509
+\normpskip=\skip34
9510
+\normlskip=\skip35
9511
+\lskip=\skip36
9512
+\rskip=\skip37
9513
+\nonfillparindent=\dimen37
9514
+\tabw=\dimen38
9515
+\verbbox=\box22
9516
+
9517
+defuns,
9518
+\defbodyindent=\skip38
9519
+\defargsindent=\skip39
9520
+\deflastargmargin=\skip40
9521
+\defunpenalty=\count48
9522
+\parencount=\count49
9523
+\brackcount=\count50
9524
+ macros,
9525
+\paramno=\count51
9526
+\macname=\toks26
9527
+ cross references,
9528
+\auxfile=\write1
9529
+\savesfregister=\count52
9530
+\toprefbox=\box23
9531
+\printedrefnamebox=\box24
9532
+\infofilenamebox=\box25
9533
+\printedmanualbox=\box26
9534
+ insertions,
9535
+\footnoteno=\count53
9536
+\SAVEfootins=\box27
9537
+\SAVEmargin=\box28
9538
+
9539
+(/usr/share/texlive/texmf-dist/tex/generic/epsf/epsf.tex
9540
+This is `epsf.tex' v2.7.4 <14 February 2011>
9541
+\epsffilein=\read1
9542
+\epsfframemargin=\dimen39
9543
+\epsfframethickness=\dimen40
9544
+\epsfrsize=\dimen41
9545
+\epsftmp=\dimen42
9546
+\epsftsize=\dimen43
9547
+\epsfxsize=\dimen44
9548
+\epsfysize=\dimen45
9549
+\pspoints=\dimen46
9550
+)
9551
+\noepsfhelp=\toks27
9552
+ localization,
9553
+\nolanghelp=\toks28
9554
+\countUTFx=\count54
9555
+\countUTFy=\count55
9556
+\countUTFz=\count56
9557
+ formatting,
9558
+\defaultparindent=\dimen47
9559
+ and turning on texinfo input format.)
9560
+\openout1 = `gcc.aux'.
9561
+
9562
+@cpindfile=@write2
9563
+@fnindfile=@write3
9564
+@vrindfile=@write4
9565
+@tpindfile=@write5
9566
+@kyindfile=@write6
9567
+@pgindfile=@write7
9568
+texinfo.tex: doing @include of gcc-common.texi
9569
+
9570
+
9571
+./gcc.texi:25: I can't find file `gcc-common.texi'.
9572
+@temp ->@input gcc-common.texi
9573
+
9574
+@includezzz ...and @input #1 }@expandafter }@temp
9575
+                                                  @popthisfilestack
9576
+l.25 @include gcc-common.texi
9577
+
9578
+(Press Enter to retry, or Control-D to exit)
9579
+Please type another input file name: include/gcc-common.texi
9580
+(./include/gcc-common.texi
9581
+texinfo.tex: doing @include of gcc-vers.texi
9582
+
9583
+
9584
+./include/gcc-common.texi:11: I can't find file `gcc-vers.texi'.
9585
+@temp ->@input gcc-vers.texi
9586
+
9587
+@includezzz ...and @input #1 }@expandafter }@temp
9588
+                                                  @popthisfilestack
9589
+l.11 @include gcc-vers.texi
9590
+
9591
+(Press Enter to retry, or Control-D to exit)
9592
+Please type another input file name: include/gcc-vers.texi
9593
+./include/gcc-common.texi:11: I can't find file `include/gcc-vers.texi'.
9594
+@temp ->@input gcc-vers.texi
9595
+
9596
+@includezzz ...and @input #1 }@expandafter }@temp
9597
+                                                  @popthisfilestack
9598
+l.11 @include gcc-vers.texi
9599
+
9600
+(Press Enter to retry, or Control-D to exit)
9601
+Please type another input file name:
9602
+./include/gcc-common.texi:11: I can't find file `include/gcc-vers.texi'.
9603
+@temp ->@input gcc-vers.texi
9604
+
9605
+@includezzz ...and @input #1 }@expandafter }@temp
9606
+                                                  @popthisfilestack
9607
+l.11 @include gcc-vers.texi
9608
+
9609
+(Press Enter to retry, or Control-D to exit)
9610
+Please type another input file name:
9611
+./include/gcc-common.texi:11: Emergency stop.
9612
+@temp ->@input gcc-vers.texi
9613
+
9614
+@includezzz ...and @input #1 }@expandafter }@temp
9615
+                                                  @popthisfilestack
9616
+l.11 @include gcc-vers.texi
9617
+
9618
+End of file on the terminal!
9619
+
9620
+./include/gcc-common.texi:11:  ==> Fatal error occurred, no output PDF file pro
9621
+duced!
9622
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/expr.c gcc-5.3.0-zip/gcc/expr.c
9623
--- gcc-5.3.0-original/gcc/expr.c       2015-04-07 10:34:06.000000000 -0400
9624
+++ gcc-5.3.0-zip/gcc/expr.c    2016-03-05 10:47:57.804889921 -0500
9625
@@ -7999,6 +7999,8 @@
9626
    the back of the caller.
9627
    The normal operating mode is to pass FALSE for this parameter.  */
9628
 
9629
+#include "print-tree.h"
9630
+
9631
 rtx
9632
 expand_expr_real (tree exp, rtx target, machine_mode tmode,
9633
                  enum expand_modifier modifier, rtx *alt_rtl,
9634
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/genmodes.c gcc-5.3.0-zip/gcc/genmodes.c
9635
--- gcc-5.3.0-original/gcc/genmodes.c   2015-01-05 07:33:28.000000000 -0500
9636
+++ gcc-5.3.0-zip/gcc/genmodes.c        2016-03-04 21:27:49.669147699 -0500
9637
@@ -330,7 +330,8 @@
9638
         the size of a CC mode is four units.  */
9639
       validate_mode (m, UNSET, UNSET, UNSET, UNSET, UNSET);
9640
 
9641
-      m->bytesize = 4;
9642
+       /* For the ZipCPU, however, it is only one unit */
9643
+      m->bytesize = 1;
9644
       m->ncomponents = 1;
9645
       m->component = 0;
9646
       break;
9647
@@ -766,11 +767,12 @@
9648
 
9649
   /* So put the default value unless the target needs a non standard
9650
      value. */
9651
-#ifdef BITS_PER_UNIT
9652
-  bits_per_unit = BITS_PER_UNIT;
9653
-#else
9654
-  bits_per_unit = 8;
9655
-#endif
9656
+// #ifdef BITS_PER_UNIT
9657
+  // bits_per_unit = BITS_PER_UNIT;
9658
+// #else
9659
+  bits_per_unit = 32;
9660
+#warning "Is there a more automated way to set bits per unit?"
9661
+// #endif
9662
 
9663
 #ifdef MAX_BITSIZE_MODE_ANY_INT
9664
   max_bitsize_mode_any_int = MAX_BITSIZE_MODE_ANY_INT;
9665
@@ -1083,7 +1085,7 @@
9666
       first = modes[c];
9667
       last = 0;
9668
       for (m = first; m; last = m, m = m->next)
9669
-       ;
9670
+       if ((m->next)&&(m->next->bytesize == m->bytesize)) first = m;
9671
 
9672
       /* Don't use BImode for MIN_MODE_INT, since otherwise the middle
9673
         end will try to use it for bitfields in structures and the
9674
@@ -1268,7 +1270,7 @@
9675
            continue;
9676
          if (m->precision != (unsigned int) -1)
9677
            {
9678
-             if (m2->precision != 2 * m->precision)
9679
+             if (m2->precision < 2 * m->precision)
9680
                continue;
9681
            }
9682
          else
9683
@@ -1323,7 +1325,6 @@
9684
       tagged_printf ("MODE_MASK (%u)", m->precision, m->name);
9685
     else
9686
       tagged_printf ("MODE_MASK (%u*BITS_PER_UNIT)", m->bytesize, m->name);
9687
-
9688
   puts ("#undef MODE_MASK");
9689
   print_closer ();
9690
 }
9691
@@ -1351,12 +1352,23 @@
9692
   int c;
9693
   struct mode_data *m;
9694
 
9695
+  puts(
9696
+"\n\n/* This is a rather strange conundrum.  Alignment is used by the host in\n"
9697
+" * the assembly file, whereas the size is used by the target.  Thus, for\n"
9698
+" * now, to align to a single target word means to align to 4 8-bit bytes in\n"
9699
+" * assembly.  If you get it wrong, the assembler will try to help.  Thus,\n"
9700
+" * aligning to anything less than 4 (1 target word) will cause an alignment\n"
9701
+" * of the target word in size.  However, this tries to do a little something\n"
9702
+" * teach our compiler what we are doing.\n"
9703
+" */\n");
9704
   print_maybe_const_decl ("%sunsigned char",
9705
                          "mode_base_align", "NUM_MACHINE_MODES",
9706
                          alignment);
9707
 
9708
   for_all_modes (c, m)
9709
-    tagged_printf ("%u", m->alignment, m->name);
9710
+    tagged_printf ("%u", 4*m->bytesize,
9711
+               // m->alignment,
9712
+               m->name);
9713
 
9714
   print_closer ();
9715
 }
9716
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/machmode.def gcc-5.3.0-zip/gcc/machmode.def
9717
--- gcc-5.3.0-original/gcc/machmode.def 2015-01-05 07:33:28.000000000 -0500
9718
+++ gcc-5.3.0-zip/gcc/machmode.def      2016-03-04 22:47:59.406632941 -0500
9719
@@ -184,11 +184,11 @@
9720
    larger types, then corresponding modes must be added here.  The
9721
    name OI is reserved for a 256-bit type (needed by some back ends).
9722
     */
9723
-INT_MODE (QI, 1);
9724
-INT_MODE (HI, 2);
9725
-INT_MODE (SI, 4);
9726
-INT_MODE (DI, 8);
9727
-INT_MODE (TI, 16);
9728
+// INT_MODE (QI, 1);
9729
+// INT_MODE (HI, 1);
9730
+INT_MODE (SI, 1);
9731
+INT_MODE (DI, 2);
9732
+INT_MODE (TI, 4);
9733
 
9734
 /* No partial integer modes are defined by default.  */
9735
 
9736
@@ -206,8 +206,8 @@
9737
    These are the IEEE mappings.  They can be overridden with
9738
    RESET_FLOAT_FORMAT or at runtime (in TARGET_OPTION_OVERRIDE).  */
9739
 
9740
-FLOAT_MODE (SF, 4, ieee_single_format);
9741
-FLOAT_MODE (DF, 8, ieee_double_format);
9742
+FLOAT_MODE (SF, 1, ieee_single_format);
9743
+FLOAT_MODE (DF, 2, ieee_double_format);
9744
 
9745
 /* Basic CC modes.
9746
    FIXME define this only for targets that need it.  */
9747
@@ -215,16 +215,16 @@
9748
 
9749
 /* Fixed-point modes.  */
9750
 FRACT_MODE (QQ, 1, 7); /* s.7 */
9751
-FRACT_MODE (HQ, 2, 15); /* s.15 */
9752
-FRACT_MODE (SQ, 4, 31); /* s.31 */
9753
-FRACT_MODE (DQ, 8, 63); /* s.63 */
9754
-FRACT_MODE (TQ, 16, 127); /* s.127 */
9755
+FRACT_MODE (HQ, 1, 15); /* s.15 */
9756
+FRACT_MODE (SQ, 1, 31); /* s.31 */
9757
+FRACT_MODE (DQ, 2, 63); /* s.63 */
9758
+FRACT_MODE (TQ, 4, 127); /* s.127 */
9759
 
9760
 UFRACT_MODE (UQQ, 1, 8); /* .8 */
9761
-UFRACT_MODE (UHQ, 2, 16); /* .16 */
9762
-UFRACT_MODE (USQ, 4, 32); /* .32 */
9763
-UFRACT_MODE (UDQ, 8, 64); /* .64 */
9764
-UFRACT_MODE (UTQ, 16, 128); /* .128 */
9765
+UFRACT_MODE (UHQ, 1, 16); /* .16 */
9766
+UFRACT_MODE (USQ, 1, 32); /* .32 */
9767
+UFRACT_MODE (UDQ, 2, 64); /* .64 */
9768
+UFRACT_MODE (UTQ, 4, 128); /* .128 */
9769
 
9770
 ACCUM_MODE (HA, 2, 8, 7); /* s8.7 */
9771
 ACCUM_MODE (SA, 4, 16, 15); /* s16.15 */
9772
@@ -246,9 +246,9 @@
9773
 COMPLEX_MODES (FLOAT);
9774
 
9775
 /* Decimal floating point modes.  */
9776
-DECIMAL_FLOAT_MODE (SD, 4, decimal_single_format);
9777
-DECIMAL_FLOAT_MODE (DD, 8, decimal_double_format);
9778
-DECIMAL_FLOAT_MODE (TD, 16, decimal_quad_format);
9779
+DECIMAL_FLOAT_MODE (SD, 1, decimal_single_format);
9780
+DECIMAL_FLOAT_MODE (DD, 2, decimal_double_format);
9781
+DECIMAL_FLOAT_MODE (TD, 4, decimal_quad_format);
9782
 
9783
 /* The symbol Pmode stands for one of the above machine modes (usually SImode).
9784
    The tm.h file specifies which one.  It is not a distinct mode.  */
9785
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/machmode.h gcc-5.3.0-zip/gcc/machmode.h
9786
--- gcc-5.3.0-original/gcc/machmode.h   2015-01-05 07:33:28.000000000 -0500
9787
+++ gcc-5.3.0-zip/gcc/machmode.h        2016-02-06 17:21:49.592924065 -0500
9788
@@ -180,13 +180,7 @@
9789
 /* Get the size in bytes and bits of an object of mode MODE.  */
9790
 
9791
 extern CONST_MODE_SIZE unsigned char mode_size[NUM_MACHINE_MODES];
9792
-#if GCC_VERSION >= 4001
9793
-#define GET_MODE_SIZE(MODE) \
9794
-  ((unsigned short) (__builtin_constant_p (MODE) \
9795
-                    ? mode_size_inline (MODE) : mode_size[MODE]))
9796
-#else
9797
 #define GET_MODE_SIZE(MODE)    ((unsigned short) mode_size[MODE])
9798
-#endif
9799
 #define GET_MODE_BITSIZE(MODE) \
9800
   ((unsigned short) (GET_MODE_SIZE (MODE) * BITS_PER_UNIT))
9801
 
9802
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/objc/objc-encoding.c gcc-5.3.0-zip/gcc/objc/objc-encoding.c
9803
--- gcc-5.3.0-original/gcc/objc/objc-encoding.c 2015-01-09 15:18:42.000000000 -0500
9804
+++ gcc-5.3.0-zip/gcc/objc/objc-encoding.c      2016-03-04 22:53:40.431902505 -0500
9805
@@ -765,10 +765,14 @@
9806
        {
9807
          switch (TYPE_MODE (type))
9808
            {
9809
+#ifdef HAVE_QImode
9810
            case QImode:
9811
              charType = 'C'; break;
9812
+#endif
9813
+#ifdef HAVE_HImode
9814
            case HImode:
9815
              charType = 'S'; break;
9816
+#endif
9817
            case SImode:
9818
              {
9819
                if (type == long_unsigned_type_node)
9820
@@ -788,10 +792,14 @@
9821
        {
9822
          switch (TYPE_MODE (type))
9823
            {
9824
+#ifdef HAVE_QImode
9825
            case QImode:
9826
              charType = 'c'; break;
9827
+#endif
9828
+#ifdef HAVE_HImode
9829
            case HImode:
9830
              charType = 's'; break;
9831
+#endif
9832
            case SImode:
9833
              {
9834
                if (type == long_integer_type_node)
9835
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/postreload.c gcc-5.3.0-zip/gcc/postreload.c
9836
--- gcc-5.3.0-original/gcc/postreload.c 2015-07-17 09:50:38.000000000 -0400
9837
+++ gcc-5.3.0-zip/gcc/postreload.c      2016-03-05 20:42:53.707428238 -0500
9838
@@ -71,6 +71,13 @@
9839
 #include "df.h"
9840
 #include "dbgcnt.h"
9841
 
9842
+#ifdef DO_ZIP_DEBUGS
9843
+extern void zip_debug_rtx(const_rtx);
9844
+#define        ZIP_DEBUG_LINE(STR,RTX) do { fprintf(stderr, "%s:%d/%s\n", __FILE__,__LINE__,STR); zip_debug_rtx(RTX); } while(0)
9845
+#else
9846
+#define        ZIP_DEBUG_LINE(STR,RTX)
9847
+#endif
9848
+
9849
 static int reload_cse_noop_set_p (rtx);
9850
 static bool reload_cse_simplify (rtx_insn *, rtx);
9851
 static void reload_cse_regs_1 (void);
9852
@@ -120,6 +127,8 @@
9853
   basic_block insn_bb = BLOCK_FOR_INSN (insn);
9854
   unsigned insn_bb_succs = EDGE_COUNT (insn_bb->succs);
9855
 
9856
+       ZIP_DEBUG_LINE("RELOAD-CSE-SIMPLIFY:",insn);
9857
+
9858
   if (GET_CODE (body) == SET)
9859
     {
9860
       int count = 0;
9861
@@ -147,6 +156,7 @@
9862
        apply_change_group ();
9863
       else
9864
        reload_cse_simplify_operands (insn, testreg);
9865
+       ZIP_DEBUG_LINE("End of reload_cse_simplify_operands", insn);
9866
     }
9867
   else if (GET_CODE (body) == PARALLEL)
9868
     {
9869
@@ -205,6 +215,7 @@
9870
        apply_change_group ();
9871
       else
9872
        reload_cse_simplify_operands (insn, testreg);
9873
+       ZIP_DEBUG_LINE("End of reload_cse_simplify_operands", insn);
9874
     }
9875
 
9876
 done:
9877
@@ -246,6 +257,7 @@
9878
          cfg_changed |= reload_cse_simplify (insn, testreg);
9879
 
9880
        cselib_process_insn (insn);
9881
+       ZIP_DEBUG_LINE("End-CSE-REGS-1:",insn);
9882
       }
9883
 
9884
   /* Clean up.  */
9885
@@ -276,6 +288,8 @@
9886
 #endif
9887
   bool speed = optimize_bb_for_speed_p (BLOCK_FOR_INSN (insn));
9888
 
9889
+
9890
+       ZIP_DEBUG_LINE("RELOAD:Attempting to simplify set",set);
9891
   dreg = true_regnum (SET_DEST (set));
9892
   if (dreg < 0)
9893
     return 0;
9894
@@ -427,6 +441,7 @@
9895
   /* Array of alternatives, sorted in order of decreasing desirability.  */
9896
   int *alternative_order;
9897
 
9898
+       ZIP_DEBUG_LINE("Simplify-Operands", insn);
9899
   extract_constrain_insn (insn);
9900
 
9901
   if (recog_data.n_alternatives == 0 || recog_data.n_operands == 0)
9902
@@ -519,6 +534,7 @@
9903
          SET_HARD_REG_BIT (equiv_regs[i], REGNO (l->loc));
9904
     }
9905
 
9906
+       ZIP_DEBUG_LINE("Simplify-Operands - A", insn);
9907
   alternative_mask preferred = get_preferred_alternatives (insn);
9908
   for (i = 0; i < recog_data.n_operands; i++)
9909
     {
9910
@@ -617,6 +633,7 @@
9911
            }
9912
        }
9913
     }
9914
+       ZIP_DEBUG_LINE("Simplify-Operands - B", insn);
9915
 
9916
   /* Record all alternatives which are better or equal to the currently
9917
      matching one in the alternative_order array.  */
9918
@@ -666,6 +683,7 @@
9919
       validate_change (insn, recog_data.operand_loc[i],
9920
                       gen_rtx_REG (mode, op_alt_regno[i][j]), 1);
9921
     }
9922
+       ZIP_DEBUG_LINE("Simplify-Operands - C", insn);
9923
 
9924
   for (i = recog_data.n_dups - 1; i >= 0; i--)
9925
     {
9926
@@ -679,6 +697,7 @@
9927
                       gen_rtx_REG (mode, op_alt_regno[op][j]), 1);
9928
     }
9929
 
9930
+       ZIP_DEBUG_LINE("Simplify-Operands - C", insn);
9931
   return apply_change_group ();
9932
 }
9933
 
9934
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/reload.c gcc-5.3.0-zip/gcc/reload.c
9935
--- gcc-5.3.0-original/gcc/reload.c     2015-01-15 08:28:42.000000000 -0500
9936
+++ gcc-5.3.0-zip/gcc/reload.c  2016-02-19 08:15:17.546189655 -0500
9937
@@ -2707,8 +2707,17 @@
9938
     no_output_reloads = 1;
9939
 
9940
 #ifdef HAVE_cc0
9941
+  // If the instruction depends upon cc0, such as a branch, if_then_else, or
9942
+  // cond_exec instruction, we cannot change the input so that the instruction
9943
+  // relies on another register--cc0 is specific.  This requries that the
9944
+  // references be only cc0 and (const_int 0), rather than allowing other
9945
+  // registers here as well.
9946
   if (reg_referenced_p (cc0_rtx, PATTERN (insn)))
9947
     no_input_reloads = 1;
9948
+  // If the result of an instruction is the cc0 register, that cannot
9949
+  // be changed, therefore no output reloading is allowed.  This only
9950
+  // works if instructions *only* set the cc0 register, and not multiple
9951
+  // registers.
9952
   if (reg_set_p (cc0_rtx, PATTERN (insn)))
9953
     no_output_reloads = 1;
9954
 #endif
9955
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/testsuite/lib/target-supports.exp gcc-5.3.0-zip/gcc/testsuite/lib/target-supports.exp
9956
--- gcc-5.3.0-original/gcc/testsuite/lib/target-supports.exp    2015-11-26 05:10:58.000000000 -0500
9957
+++ gcc-5.3.0-zip/gcc/testsuite/lib/target-supports.exp 2016-01-30 15:14:21.620586694 -0500
9958
@@ -503,6 +503,11 @@
9959
        return 0
9960
     }
9961
 
9962
+    # Zip CPU doesn't support profiling (yet)
9963
+    if { [istarget zip*] }
9964
+        return 0
9965
+    }
9966
+
9967
     # MinGW does not support -p.
9968
     if { [istarget *-*-mingw*] && $test_what == "-p" } {
9969
        return 0
9970
@@ -986,6 +991,12 @@
9971
        }]
9972
     }
9973
 
9974
+    # No real hardware FPU support for ZipCPU yet--even though the instruction
9975
+    # set supports it, the CPU just isn't ready yet.
9976
+    if { [istarget zip*-*-*] } {
9977
+        return 0
9978
+    }
9979
+
9980
     # This proc is actually checking the availabilty of FPU
9981
     # support for doubles, so on the RX we must fail if the
9982
     # 64-bit double multilib has been selected.
9983
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/tree-ssa-math-opts.c gcc-5.3.0-zip/gcc/tree-ssa-math-opts.c
9984
--- gcc-5.3.0-original/gcc/tree-ssa-math-opts.c 2015-08-11 03:58:07.000000000 -0400
9985
+++ gcc-5.3.0-zip/gcc/tree-ssa-math-opts.c      2016-02-12 11:21:11.309149239 -0500
9986
@@ -972,7 +972,7 @@
9987
     {
9988
       if (val & 1)
9989
        {
9990
-         digit = val & ((1 << POWI_WINDOW_SIZE) - 1);
9991
+         digit = val & ((1l << POWI_WINDOW_SIZE) - 1);
9992
          result += powi_lookup_cost (digit, cache)
9993
                    + POWI_WINDOW_SIZE + 1;
9994
          val >>= POWI_WINDOW_SIZE;
9995
@@ -1012,7 +1012,7 @@
9996
     }
9997
   else if (n & 1)
9998
     {
9999
-      digit = n & ((1 << POWI_WINDOW_SIZE) - 1);
10000
+      digit = n & ((1l << POWI_WINDOW_SIZE) - 1);
10001
       op0 = powi_as_mults_1 (gsi, loc, type, n - digit, cache);
10002
       op1 = powi_as_mults_1 (gsi, loc, type, digit, cache);
10003
     }
10004
@@ -1651,7 +1651,7 @@
10005
 };
10006
 
10007
 #define BITS_PER_MARKER 8
10008
-#define MARKER_MASK ((1 << BITS_PER_MARKER) - 1)
10009
+#define MARKER_MASK ((1l << BITS_PER_MARKER) - 1)
10010
 #define MARKER_BYTE_UNKNOWN MARKER_MASK
10011
 #define HEAD_MARKER(n, size) \
10012
   ((n) & ((uint64_t) MARKER_MASK << (((size) - 1) * BITS_PER_MARKER)))
10013
@@ -1687,7 +1687,7 @@
10014
   /* Zero out the extra bits of N in order to avoid them being shifted
10015
      into the significant bits.  */
10016
   if (size < 64 / BITS_PER_MARKER)
10017
-    n->n &= ((uint64_t) 1 << (size * BITS_PER_MARKER)) - 1;
10018
+    n->n &= ((uint64_t) 1l << (size * BITS_PER_MARKER)) - 1;
10019
 
10020
   switch (code)
10021
     {
10022
@@ -1714,7 +1714,7 @@
10023
     }
10024
   /* Zero unused bits for size.  */
10025
   if (size < 64 / BITS_PER_MARKER)
10026
-    n->n &= ((uint64_t) 1 << (size * BITS_PER_MARKER)) - 1;
10027
+    n->n &= ((uint64_t) 1l << (size * BITS_PER_MARKER)) - 1;
10028
   return true;
10029
 }
10030
 
10031
@@ -1761,7 +1761,7 @@
10032
   n->n = CMPNOP;
10033
 
10034
   if (size < 64 / BITS_PER_MARKER)
10035
-    n->n &= ((uint64_t) 1 << (size * BITS_PER_MARKER)) - 1;
10036
+    n->n &= ((uint64_t) 1l << (size * BITS_PER_MARKER)) - 1;
10037
 
10038
   return true;
10039
 }
10040
@@ -2020,7 +2020,7 @@
10041
          {
10042
            int i, size = TYPE_PRECISION (n->type) / BITS_PER_UNIT;
10043
            uint64_t val = int_cst_value (rhs2), mask = 0;
10044
-           uint64_t tmp = (1 << BITS_PER_UNIT) - 1;
10045
+           uint64_t tmp = (1l << BITS_PER_UNIT) - 1;
10046
 
10047
            /* Only constants masking full bytes are allowed.  */
10048
            for (i = 0; i < size; i++, tmp <<= BITS_PER_UNIT)
10049
@@ -2064,7 +2064,7 @@
10050
              {
10051
                /* If STMT casts to a smaller type mask out the bits not
10052
                   belonging to the target type.  */
10053
-               n->n &= ((uint64_t) 1 << (type_size * BITS_PER_MARKER)) - 1;
10054
+               n->n &= ((uint64_t) 1l << (type_size * BITS_PER_MARKER)) - 1;
10055
              }
10056
            n->type = type;
10057
            if (!n->base_addr)
10058
@@ -2177,7 +2177,7 @@
10059
     {
10060
       uint64_t mask;
10061
 
10062
-      mask = ((uint64_t) 1 << (n->range * BITS_PER_MARKER)) - 1;
10063
+      mask = ((uint64_t) 1l << (n->range * BITS_PER_MARKER)) - 1;
10064
       cmpxchg >>= (64 / BITS_PER_MARKER - n->range) * BITS_PER_MARKER;
10065
       cmpnop &= mask;
10066
     }
10067
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/var-tracking.c gcc-5.3.0-zip/gcc/var-tracking.c
10068
--- gcc-5.3.0-original/gcc/var-tracking.c       2015-03-26 09:19:00.000000000 -0400
10069
+++ gcc-5.3.0-zip/gcc/var-tracking.c    2016-03-05 20:43:22.535221161 -0500
10070
@@ -143,6 +143,13 @@
10071
 #include "rtl-iter.h"
10072
 #include "fibonacci_heap.h"
10073
 
10074
+#ifdef DO_ZIP_DEBUG
10075
+#include <stdio.h>
10076
+extern void zip_debug_rtx(const_rtx);
10077
+#define ZIP_DEBUG_LINE(STR,RTX) do {fprintf(stderr,"%s:%d/%s\n",__FILE__,__LINE__,STR); zip_debug_rtx(RTX); } while(0)
10078
+#else
10079
+#define ZIP_DEBUG_LINE(STR,RTX)
10080
+#endif
10081
 typedef fibonacci_heap <long, basic_block_def> bb_heap_t;
10082
 typedef fibonacci_node <long, basic_block_def> bb_heap_node_t;
10083
 
10084
@@ -6356,6 +6363,7 @@
10085
                machine_mode indmode
10086
                  = TYPE_MODE (TREE_TYPE (argtype));
10087
                rtx mem = gen_rtx_MEM (indmode, x);
10088
+                       ZIP_DEBUG_LINE("Var-tracking mem-ref", mem);
10089
                cselib_val *val = cselib_lookup (mem, indmode, 0, VOIDmode);
10090
                if (val && cselib_preserved_value_p (val))
10091
                  {
10092
@@ -6462,12 +6470,14 @@
10093
       machine_mode mode
10094
        = TYPE_MODE (TREE_TYPE (OBJ_TYPE_REF_EXPR (obj_type_ref)));
10095
       rtx clobbered = gen_rtx_MEM (mode, this_arg);
10096
+                       ZIP_DEBUG_LINE("Var-tracking mem-ref/clobbered", clobbered);
10097
       HOST_WIDE_INT token
10098
        = tree_to_shwi (OBJ_TYPE_REF_TOKEN (obj_type_ref));
10099
       if (token)
10100
        clobbered = plus_constant (mode, clobbered,
10101
                                   token * GET_MODE_SIZE (mode));
10102
       clobbered = gen_rtx_MEM (mode, clobbered);
10103
+       ZIP_DEBUG_LINE("Var-tracking mem-ref/clobbered-2", clobbered);
10104
       x = gen_rtx_CONCAT (mode, gen_rtx_CLOBBER (VOIDmode, pc_rtx), clobbered);
10105
       call_arguments
10106
        = gen_rtx_EXPR_LIST (VOIDmode, x, call_arguments);
10107
@@ -9790,6 +9800,7 @@
10108
              machine_mode indmode
10109
                = TYPE_MODE (TREE_TYPE (TREE_TYPE (parm)));
10110
              rtx mem = gen_rtx_MEM (indmode, incoming);
10111
+       ZIP_DEBUG_LINE("Var-tracking mem-ref/incoming", incoming);
10112
              cselib_val *val = cselib_lookup_from_insn (mem, indmode, true,
10113
                                                         VOIDmode,
10114
                                                         get_insns ());
10115
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/libgcc/config.host gcc-5.3.0-zip/libgcc/config.host
10116
--- gcc-5.3.0-original/libgcc/config.host       2015-10-01 08:01:18.000000000 -0400
10117
+++ gcc-5.3.0-zip/libgcc/config.host    2016-01-30 15:16:00.459883558 -0500
10118
@@ -195,6 +195,9 @@
10119
 tic6x-*-*)
10120
        cpu_type=c6x
10121
        ;;
10122
+zip*)
10123
+       cpu_type=zip
10124
+       ;;
10125
 esac
10126
 
10127
 # Common parts for widely ported systems.
10128
@@ -1300,6 +1303,9 @@
10129
        echo "*** Configuration ${host} not supported" 1>&2
10130
        exit 1
10131
        ;;
10132
+zip*)
10133
+       tmake_file="${tmake_file} t-softfp-sfdf t-softfp"
10134
+       ;;
10135
 esac
10136
 
10137
 case ${host} in
10138
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/libgomp/configure.tgt gcc-5.3.0-zip/libgomp/configure.tgt
10139
--- gcc-5.3.0-original/libgomp/configure.tgt    2015-03-13 06:57:07.000000000 -0400
10140
+++ gcc-5.3.0-zip/libgomp/configure.tgt 2016-01-30 15:16:51.323521641 -0500
10141
@@ -150,6 +150,9 @@
10142
        # Need to link with -lpthread so libgomp.so is self-contained.
10143
        XLDFLAGS="${XLDFLAGS} -lpthread"
10144
        ;;
10145
+  zip*)
10146
+        config_path="bsd posix"
10147
+        ;;
10148
 
10149
   *)
10150
        ;;
10151
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/.rej gcc-5.3.0-zip/.rej
10152
--- gcc-5.3.0-original/.rej     2016-02-05 15:14:37.982942298 -0500
10153
+++ gcc-5.3.0-zip/.rej  1969-12-31 19:00:00.000000000 -0500
10154
@@ -1,389 +0,0 @@
10155
---- gcc-5.2.0.orig/gcc/config/aarch64/aarch64-linux.h  2015-05-12 08:49:59.000000000 +0000
10156
-+++ gcc-5.2.0/gcc/config/aarch64/aarch64-linux.h       2015-10-17 20:29:44.970812436 +0000
10157
-@@ -21,7 +21,7 @@
10158
- #ifndef GCC_AARCH64_LINUX_H
10159
- #define GCC_AARCH64_LINUX_H
10160
-
10161
--#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
10162
-+#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
10163
-
10164
- #undef  ASAN_CC1_SPEC
10165
- #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
10166
---- gcc-5.2.0.orig/gcc/config/alpha/linux-elf.h        2015-01-05 12:33:28.000000000 +0000
10167
-+++ gcc-5.2.0/gcc/config/alpha/linux-elf.h     2015-10-17 20:28:41.529210187 +0000
10168
-@@ -23,8 +23,8 @@
10169
- #define EXTRA_SPECS \
10170
- { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
10171
-
10172
--#define GLIBC_DYNAMIC_LINKER  "/lib/ld-linux.so.2"
10173
--#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
10174
-+#define GLIBC_DYNAMIC_LINKER  "/tools/lib/ld-linux.so.2"
10175
-+#define UCLIBC_DYNAMIC_LINKER "/tools/lib/ld-uClibc.so.0"
10176
- #if DEFAULT_LIBC == LIBC_UCLIBC
10177
- #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
10178
- #elif DEFAULT_LIBC == LIBC_GLIBC
10179
---- gcc-5.2.0.orig/gcc/config/arm/linux-eabi.h 2015-01-05 12:33:28.000000000 +0000
10180
-+++ gcc-5.2.0/gcc/config/arm/linux-eabi.h      2015-10-17 20:28:41.529210187 +0000
10181
-@@ -68,8 +68,8 @@
10182
-    GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI.  */
10183
-
10184
- #undef  GLIBC_DYNAMIC_LINKER
10185
--#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3"
10186
--#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3"
10187
-+#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/tools/lib/ld-linux.so.3"
10188
-+#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/tools/lib/ld-linux-armhf.so.3"
10189
- #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT
10190
-
10191
- #define GLIBC_DYNAMIC_LINKER \
10192
---- gcc-5.2.0.orig/gcc/config/arm/linux-elf.h  2015-06-23 09:26:54.000000000 +0000
10193
-+++ gcc-5.2.0/gcc/config/arm/linux-elf.h       2015-10-17 20:28:41.529210187 +0000
10194
-@@ -62,7 +62,7 @@
10195
-
10196
- #define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
10197
-
10198
--#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
10199
-+#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld-linux.so.2"
10200
-
10201
- #define LINUX_TARGET_LINK_SPEC  "%{h*} \
10202
-    %{static:-Bstatic} \
10203
---- gcc-5.2.0.orig/gcc/config/bfin/linux.h     2015-01-05 12:33:28.000000000 +0000
10204
-+++ gcc-5.2.0/gcc/config/bfin/linux.h  2015-10-17 20:28:41.529210187 +0000
10205
-@@ -45,7 +45,7 @@
10206
-   %{shared:-G -Bdynamic} \
10207
-   %{!shared: %{!static: \
10208
-    %{rdynamic:-export-dynamic} \
10209
--   -dynamic-linker /lib/ld-uClibc.so.0} \
10210
-+   -dynamic-linker /tools/lib/ld-uClibc.so.0} \
10211
-    %{static}} -init __init -fini __fini"
10212
-
10213
- #undef TARGET_SUPPORTS_SYNC_CALLS
10214
---- gcc-5.2.0.orig/gcc/config/cris/linux.h     2015-01-05 12:33:28.000000000 +0000
10215
-+++ gcc-5.2.0/gcc/config/cris/linux.h  2015-10-17 20:28:41.529210187 +0000
10216
-@@ -102,7 +102,7 @@
10217
- #undef CRIS_DEFAULT_CPU_VERSION
10218
- #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
10219
-
10220
--#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
10221
-+#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld.so.1"
10222
-
10223
- #undef CRIS_LINK_SUBTARGET_SPEC
10224
- #define CRIS_LINK_SUBTARGET_SPEC \
10225
---- gcc-5.2.0.orig/gcc/config/freebsd-spec.h   2015-06-25 17:53:14.000000000 +0000
10226
-+++ gcc-5.2.0/gcc/config/freebsd-spec.h        2015-10-17 20:28:41.529210187 +0000
10227
-@@ -129,9 +129,9 @@
10228
- #endif
10229
-
10230
- #if FBSD_MAJOR < 6
10231
--#define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
10232
-+#define FBSD_DYNAMIC_LINKER "/tools/libexec/ld-elf.so.1"
10233
- #else
10234
--#define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1"
10235
-+#define FBSD_DYNAMIC_LINKER "/tools/libexec/ld-elf.so.1"
10236
- #endif
10237
-
10238
- /* NOTE: The freebsd-spec.h header is included also for various
10239
---- gcc-5.2.0.orig/gcc/config/frv/linux.h      2015-01-05 12:33:28.000000000 +0000
10240
-+++ gcc-5.2.0/gcc/config/frv/linux.h   2015-10-17 20:28:41.529210187 +0000
10241
-@@ -34,7 +34,7 @@
10242
- #define ENDFILE_SPEC \
10243
-   "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
10244
-
10245
--#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
10246
-+#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld.so.1"
10247
-
10248
- #undef LINK_SPEC
10249
- #define LINK_SPEC "\
10250
---- gcc-5.2.0.orig/gcc/config/i386/gnu.h       2015-01-05 12:33:28.000000000 +0000
10251
-+++ gcc-5.2.0/gcc/config/i386/gnu.h    2015-10-17 20:28:41.529210187 +0000
10252
-@@ -22,7 +22,7 @@
10253
- #define GNU_USER_LINK_EMULATION "elf_i386"
10254
-
10255
- #undef GNU_USER_DYNAMIC_LINKER
10256
--#define GNU_USER_DYNAMIC_LINKER "/lib/ld.so"
10257
-+#define GNU_USER_DYNAMIC_LINKER "/tools/lib/ld.so"
10258
-
10259
- #undef        STARTFILE_SPEC
10260
- #if defined HAVE_LD_PIE
10261
---- gcc-5.2.0.orig/gcc/config/i386/kfreebsd-gnu.h      2015-01-05 12:33:28.000000000 +0000
10262
-+++ gcc-5.2.0/gcc/config/i386/kfreebsd-gnu.h   2015-10-17 20:28:41.529210187 +0000
10263
-@@ -19,4 +19,4 @@
10264
- <http://www.gnu.org/licenses/>.  */
10265
-
10266
- #define GNU_USER_LINK_EMULATION "elf_i386_fbsd"
10267
--#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
10268
-+#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld.so.1"
10269
---- gcc-5.2.0.orig/gcc/config/i386/kfreebsd-gnu64.h    2015-01-05 12:33:28.000000000 +0000
10270
-+++ gcc-5.2.0/gcc/config/i386/kfreebsd-gnu64.h 2015-10-17 20:28:41.529210187 +0000
10271
-@@ -22,6 +22,6 @@
10272
- #define GNU_USER_LINK_EMULATION64 "elf_x86_64_fbsd"
10273
- #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64_fbsd"
10274
-
10275
--#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
10276
--#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-kfreebsd-x86-64.so.1"
10277
--#define GLIBC_DYNAMIC_LINKERX32 "/lib/ld-kfreebsd-x32.so.1"
10278
-+#define GLIBC_DYNAMIC_LINKER32 "/tools/lib/ld.so.1"
10279
-+#define GLIBC_DYNAMIC_LINKER64 "/tools/lib/ld-kfreebsd-x86-64.so.1"
10280
-+#define GLIBC_DYNAMIC_LINKERX32 "/tools/lib/ld-kfreebsd-x32.so.1"
10281
---- gcc-5.2.0.orig/gcc/config/i386/linux.h     2015-01-05 12:33:28.000000000 +0000
10282
-+++ gcc-5.2.0/gcc/config/i386/linux.h  2015-10-17 20:28:41.529210187 +0000
10283
-@@ -20,4 +20,4 @@
10284
- <http://www.gnu.org/licenses/>.  */
10285
-
10286
- #define GNU_USER_LINK_EMULATION "elf_i386"
10287
--#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
10288
-+#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld-linux.so.2"
10289
---- gcc-5.2.0.orig/gcc/config/i386/linux64.h   2015-01-05 12:33:28.000000000 +0000
10290
-+++ gcc-5.2.0/gcc/config/i386/linux64.h        2015-10-17 20:28:41.529210187 +0000
10291
-@@ -27,6 +27,6 @@
10292
- #define GNU_USER_LINK_EMULATION64 "elf_x86_64"
10293
- #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64"
10294
-
10295
--#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
10296
--#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
10297
--#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
10298
-+#define GLIBC_DYNAMIC_LINKER32 "/tools/lib/ld-linux.so.2"
10299
-+#define GLIBC_DYNAMIC_LINKER64 "/tools/lib64/ld-linux-x86-64.so.2"
10300
-+#define GLIBC_DYNAMIC_LINKERX32 "/tools/libx32/ld-linux-x32.so.2"
10301
---- gcc-5.2.0.orig/gcc/config/ia64/linux.h     2015-01-05 12:33:28.000000000 +0000
10302
-+++ gcc-5.2.0/gcc/config/ia64/linux.h  2015-10-17 20:28:41.529210187 +0000
10303
-@@ -55,7 +55,7 @@
10304
- /* Define this for shared library support because it isn't in the main
10305
-    linux.h file.  */
10306
-
10307
--#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
10308
-+#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld-linux-ia64.so.2"
10309
-
10310
- #undef LINK_SPEC
10311
- #define LINK_SPEC "\
10312
---- gcc-5.2.0.orig/gcc/config/knetbsd-gnu.h    2015-01-05 12:33:28.000000000 +0000
10313
-+++ gcc-5.2.0/gcc/config/knetbsd-gnu.h 2015-10-17 20:28:41.529210187 +0000
10314
-@@ -32,4 +32,4 @@
10315
-
10316
-
10317
- #undef GNU_USER_DYNAMIC_LINKER
10318
--#define GNU_USER_DYNAMIC_LINKER "/lib/ld.so.1"
10319
-+#define GNU_USER_DYNAMIC_LINKER "/tools/lib/ld.so.1"
10320
---- gcc-5.2.0.orig/gcc/config/kopensolaris-gnu.h       2015-01-05 12:33:28.000000000 +0000
10321
-+++ gcc-5.2.0/gcc/config/kopensolaris-gnu.h    2015-10-17 20:28:41.529210187 +0000
10322
-@@ -31,4 +31,5 @@
10323
-   while (0)
10324
-
10325
- #undef GNU_USER_DYNAMIC_LINKER
10326
--#define GNU_USER_DYNAMIC_LINKER "/lib/ld.so.1"
10327
-+#define GNU_USER_DYNAMIC_LINKER "/tools/lib/ld.so.1"
10328
-+
10329
---- gcc-5.2.0.orig/gcc/config/linux.h  2015-01-05 12:33:28.000000000 +0000
10330
-+++ gcc-5.2.0/gcc/config/linux.h       2015-10-17 20:28:41.529210187 +0000
10331
-@@ -73,10 +73,10 @@
10332
-    GLIBC_DYNAMIC_LINKER must be defined for each target using them, or
10333
-    GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets
10334
-    supporting both 32-bit and 64-bit compilation.  */
10335
--#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
10336
--#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
10337
--#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
10338
--#define UCLIBC_DYNAMIC_LINKERX32 "/lib/ldx32-uClibc.so.0"
10339
-+#define UCLIBC_DYNAMIC_LINKER "/tools/lib/ld-uClibc.so.0"
10340
-+#define UCLIBC_DYNAMIC_LINKER32 "/tools/lib/ld-uClibc.so.0"
10341
-+#define UCLIBC_DYNAMIC_LINKER64 "/tools/lib/ld64-uClibc.so.0"
10342
-+#define UCLIBC_DYNAMIC_LINKERX32 "/tools/lib/ldx32-uClibc.so.0"
10343
- #define BIONIC_DYNAMIC_LINKER "/system/bin/linker"
10344
- #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
10345
- #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
10346
---- gcc-5.2.0.orig/gcc/config/lm32/uclinux-elf.h       2015-01-05 12:33:28.000000000 +0000
10347
-+++ gcc-5.2.0/gcc/config/lm32/uclinux-elf.h    2015-10-17 20:28:41.529210187 +0000
10348
-@@ -67,7 +67,7 @@
10349
-    %{shared:-shared} \
10350
-    %{symbolic:-Bsymbolic} \
10351
-    %{rdynamic:-export-dynamic} \
10352
--   -dynamic-linker /lib/ld-linux.so.2"
10353
-+   -dynamic-linker /tools/lib/ld-linux.so.2"
10354
-
10355
- #define TARGET_OS_CPP_BUILTINS() GNU_USER_TARGET_OS_CPP_BUILTINS()
10356
-
10357
---- gcc-5.2.0.orig/gcc/config/m68k/linux.h     2015-01-05 12:33:28.000000000 +0000
10358
-+++ gcc-5.2.0/gcc/config/m68k/linux.h  2015-10-17 20:28:41.533210287 +0000
10359
-@@ -71,7 +71,7 @@
10360
-    When the -shared link option is used a final link is not being
10361
-    done.  */
10362
-
10363
--#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
10364
-+#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld.so.1"
10365
-
10366
- #undef LINK_SPEC
10367
- #define LINK_SPEC "-m m68kelf %{shared} \
10368
---- gcc-5.2.0.orig/gcc/config/microblaze/linux.h       2015-05-28 14:08:19.000000000 +0000
10369
-+++ gcc-5.2.0/gcc/config/microblaze/linux.h    2015-10-17 20:28:41.533210287 +0000
10370
-@@ -28,7 +28,7 @@
10371
- #undef TLS_NEEDS_GOT
10372
- #define TLS_NEEDS_GOT 1
10373
-
10374
--#define DYNAMIC_LINKER "/lib/ld.so.1"
10375
-+#define DYNAMIC_LINKER "/tools/lib/ld.so.1"
10376
- #undef  SUBTARGET_EXTRA_SPECS
10377
- #define SUBTARGET_EXTRA_SPECS \
10378
-   { "dynamic_linker", DYNAMIC_LINKER }
10379
---- gcc-5.2.0.orig/gcc/config/mips/linux.h     2015-01-05 12:33:28.000000000 +0000
10380
-+++ gcc-5.2.0/gcc/config/mips/linux.h  2015-10-17 20:30:30.887975439 +0000
10381
-@@ -22,20 +22,20 @@
10382
- #define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32"
10383
-
10384
- #define GLIBC_DYNAMIC_LINKER32 \
10385
--  "%{mnan=2008:/lib/ld-linux-mipsn8.so.1;:/lib/ld.so.1}"
10386
-+  "%{mnan=2008:/tools/lib/ld-linux-mipsn8.so.1;:/tools/lib/ld.so.1}"
10387
- #define GLIBC_DYNAMIC_LINKER64 \
10388
--  "%{mnan=2008:/lib64/ld-linux-mipsn8.so.1;:/lib64/ld.so.1}"
10389
-+  "%{mnan=2008:/tools/lib64/ld-linux-mipsn8.so.1;:/tools/lib64/ld.so.1}"
10390
- #define GLIBC_DYNAMIC_LINKERN32 \
10391
--  "%{mnan=2008:/lib32/ld-linux-mipsn8.so.1;:/lib32/ld.so.1}"
10392
-+  "%{mnan=2008:/tools/lib32/ld-linux-mipsn8.so.1;:/tools/lib32/ld.so.1}"
10393
-
10394
- #undef UCLIBC_DYNAMIC_LINKER32
10395
- #define UCLIBC_DYNAMIC_LINKER32 \
10396
--  "%{mnan=2008:/lib/ld-uClibc-mipsn8.so.0;:/lib/ld-uClibc.so.0}"
10397
-+  "%{mnan=2008:/tools/lib/ld-uClibc-mipsn8.so.0;:/tools/lib/ld-uClibc.so.0}"
10398
- #undef UCLIBC_DYNAMIC_LINKER64
10399
- #define UCLIBC_DYNAMIC_LINKER64 \
10400
--  "%{mnan=2008:/lib/ld64-uClibc-mipsn8.so.0;:/lib/ld64-uClibc.so.0}"
10401
-+  "%{mnan=2008:/tools/lib/ld64-uClibc-mipsn8.so.0;:/tools/lib/ld64-uClibc.so.0}"
10402
- #define UCLIBC_DYNAMIC_LINKERN32 \
10403
--  "%{mnan=2008:/lib32/ld-uClibc-mipsn8.so.0;:/lib32/ld-uClibc.so.0}"
10404
-+  "%{mnan=2008:/tools/lib32/ld-uClibc-mipsn8.so.0;:/tools/lib32/ld-uClibc.so.0}"
10405
-
10406
- #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
10407
- #define GNU_USER_DYNAMIC_LINKERN32 \
10408
---- gcc-5.2.0.orig/gcc/config/mn10300/linux.h  2015-01-05 12:33:28.000000000 +0000
10409
-+++ gcc-5.2.0/gcc/config/mn10300/linux.h       2015-10-17 20:29:02.941750373 +0000
10410
-@@ -32,7 +32,7 @@
10411
- #undef  ASM_SPEC
10412
- #define ASM_SPEC ""
10413
-
10414
--#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
10415
-+#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld.so.1"
10416
-
10417
- #undef  LINK_SPEC
10418
- #define LINK_SPEC "%{mrelax:--relax} %{shared:-shared} \
10419
---- gcc-5.2.0.orig/gcc/config/pa/pa-linux.h    2015-05-28 14:07:55.000000000 +0000
10420
-+++ gcc-5.2.0/gcc/config/pa/pa-linux.h 2015-10-17 20:29:02.941750373 +0000
10421
-@@ -37,7 +37,7 @@
10422
- /* Define this for shared library support because it isn't in the main
10423
-    linux.h file.  */
10424
-
10425
--#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
10426
-+#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld.so.1"
10427
-
10428
- #undef LINK_SPEC
10429
- #define LINK_SPEC "\
10430
---- gcc-5.2.0.orig/gcc/config/rs6000/linux64.h 2015-03-09 23:18:57.000000000 +0000
10431
-+++ gcc-5.2.0/gcc/config/rs6000/linux64.h      2015-10-17 20:29:02.941750373 +0000
10432
-@@ -357,14 +357,14 @@
10433
- #undef        LINK_OS_DEFAULT_SPEC
10434
- #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
10435
-
10436
--#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
10437
-+#define GLIBC_DYNAMIC_LINKER32 "/tools/lib/ld.so.1"
10438
- #ifdef LINUX64_DEFAULT_ABI_ELFv2
10439
--#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:/lib64/ld64.so.1;:/lib64/ld64.so.2}"
10440
-+#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:/tools/lib64/ld64.so.1;:/tools/lib64/ld64.so.2}"
10441
- #else
10442
--#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:/lib64/ld64.so.2;:/lib64/ld64.so.1}"
10443
-+#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:/tools/lib64/ld64.so.2;:/tools/lib64/ld64.so.1}"
10444
- #endif
10445
--#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
10446
--#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
10447
-+#define UCLIBC_DYNAMIC_LINKER32 "/tools/lib/ld-uClibc.so.0"
10448
-+#define UCLIBC_DYNAMIC_LINKER64 "/tools/lib/ld64-uClibc.so.0"
10449
- #if DEFAULT_LIBC == LIBC_UCLIBC
10450
- #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
10451
- #elif DEFAULT_LIBC == LIBC_GLIBC
10452
---- gcc-5.2.0.orig/gcc/config/rs6000/sysv4.h   2015-01-05 12:33:28.000000000 +0000
10453
-+++ gcc-5.2.0/gcc/config/rs6000/sysv4.h        2015-10-17 20:29:02.941750373 +0000
10454
-@@ -762,8 +762,8 @@
10455
-
10456
- #define LINK_START_LINUX_SPEC ""
10457
-
10458
--#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
10459
--#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
10460
-+#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld.so.1"
10461
-+#define UCLIBC_DYNAMIC_LINKER "/tools/lib/ld-uClibc.so.0"
10462
- #if DEFAULT_LIBC == LIBC_UCLIBC
10463
- #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
10464
- #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
10465
---- gcc-5.2.0.orig/gcc/config/s390/linux.h     2015-05-11 07:14:10.000000000 +0000
10466
-+++ gcc-5.2.0/gcc/config/s390/linux.h  2015-10-17 20:29:02.941750373 +0000
10467
-@@ -60,8 +60,8 @@
10468
- #define MULTILIB_DEFAULTS { "m31" }
10469
- #endif
10470
-
10471
--#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
10472
--#define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1"
10473
-+#define GLIBC_DYNAMIC_LINKER32 "/tools/lib/ld.so.1"
10474
-+#define GLIBC_DYNAMIC_LINKER64 "/tools/lib/ld64.so.1"
10475
-
10476
- #undef  LINK_SPEC
10477
- #define LINK_SPEC \
10478
---- gcc-5.2.0.orig/gcc/config/sh/linux.h       2015-01-05 12:33:28.000000000 +0000
10479
-+++ gcc-5.2.0/gcc/config/sh/linux.h    2015-10-17 20:29:02.941750373 +0000
10480
-@@ -43,7 +43,7 @@
10481
-
10482
- #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
10483
-
10484
--#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
10485
-+#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld-linux.so.2"
10486
-
10487
- #undef SUBTARGET_LINK_EMUL_SUFFIX
10488
- #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
10489
---- gcc-5.2.0.orig/gcc/config/sparc/linux.h    2015-01-05 12:33:28.000000000 +0000
10490
-+++ gcc-5.2.0/gcc/config/sparc/linux.h 2015-10-17 20:29:02.941750373 +0000
10491
-@@ -83,7 +83,7 @@
10492
-    When the -shared link option is used a final link is not being
10493
-    done.  */
10494
-
10495
--#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
10496
-+#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld-linux.so.2"
10497
-
10498
- #undef  LINK_SPEC
10499
- #define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
10500
---- gcc-5.2.0.orig/gcc/config/sparc/linux64.h  2015-01-05 12:33:28.000000000 +0000
10501
-+++ gcc-5.2.0/gcc/config/sparc/linux64.h       2015-10-17 20:29:02.941750373 +0000
10502
-@@ -84,8 +84,8 @@
10503
-    When the -shared link option is used a final link is not being
10504
-    done.  */
10505
-
10506
--#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
10507
--#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2"
10508
-+#define GLIBC_DYNAMIC_LINKER32 "/tools/lib/ld-linux.so.2"
10509
-+#define GLIBC_DYNAMIC_LINKER64 "/tools/lib64/ld-linux.so.2"
10510
-
10511
- #ifdef SPARC_BI_ARCH
10512
-
10513
-@@ -193,7 +193,7 @@
10514
- #else /* !SPARC_BI_ARCH */
10515
-
10516
- #undef LINK_SPEC
10517
--#define LINK_SPEC "-m elf64_sparc -Y P,%R/usr/lib64 %{shared:-shared} \
10518
-+#define LINK_SPEC "-m elf64_sparc -Y P,%R/tools/lib64 %{shared:-shared} \
10519
-   %{!shared: \
10520
-     %{!static: \
10521
-       %{rdynamic:-export-dynamic} \
10522
---- gcc-5.2.0.orig/gcc/config/vax/linux.h      2015-01-05 12:33:28.000000000 +0000
10523
-+++ gcc-5.2.0/gcc/config/vax/linux.h   2015-10-17 20:29:02.941750373 +0000
10524
-@@ -41,7 +41,7 @@
10525
-   %{!shared: \
10526
-     %{!static: \
10527
-       %{rdynamic:-export-dynamic} \
10528
--      -dynamic-linker /lib/ld.so.1} \
10529
-+      -dynamic-linker /tools/lib/ld.so.1} \
10530
-     %{static:-static}}"
10531
-
10532
- #undef  WCHAR_TYPE
10533
---- gcc-5.2.0.orig/gcc/config/xtensa/linux.h   2015-01-05 12:33:28.000000000 +0000
10534
-+++ gcc-5.2.0/gcc/config/xtensa/linux.h        2015-10-17 20:29:02.941750373 +0000
10535
-@@ -44,7 +44,7 @@
10536
-   %{mlongcalls:--longcalls} \
10537
-   %{mno-longcalls:--no-longcalls}"
10538
-
10539
--#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
10540
-+#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld.so.1"
10541
-
10542
- #undef LINK_SPEC
10543
- #define LINK_SPEC \

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.