Gentoo Archives: gentoo-commits

From: "Ryan Hill (dirtyepic)" <dirtyepic@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/gcc/4.3.6/gentoo: 00_all_gcc-4.1-alpha-mieee-default.patch 00_all_gcc-trampolinewarn.patch 01_all_gcc-4.1-alpha-asm-mcpu.patch 03_all_gcc43-java-nomulti.patch 05_all_pr40010-manpages.patch 08_all_gcc-4.1-cross-compile.patch 10_all_gcc-default-format-security.patch 10_all_gcc-default-fortify-source.patch 11_all_gcc-netbsd-symbolic.patch 14_all_gcc-sparc64-bsd.patch 15_all_gcc-libgomp-no-werror.patch 18_all_904-flatten-switch-stmt-00.patch 20_all_mudflap-setuid-env.patch 20_all_s390-gcc-4.3.2-z10-complete.patch 40_all_gcc-4.4-libiberty.h-asprintf.patch 45_all_arm-pic-ssp-segv-pr35965.patch 46_all_armel-hilo-union-class.patch 47_all_arm-unbreak-armv4t.patch 48_all_gfortran-armel-updates.patch 49_all_arm_v7-config.patch 51_all_gcc-3.4-libiberty-pic.patch 53_all_gcc4-superh-default-multilib.patch 61_all_gcc4-ia64-noteGNUstack.patch 61_all_gcc43-pr24170.patch 62_all_gcc4-noteGNUstack.patch 66_all_gcc43-pr25343.patch 68_all_gc c43-pr37661.patch 70_all_gcc43-libjava-headers.patch 73_all_sh-libgcc-stacks.patch 74_all_sh-pr24836.patch 75_all_mips-r10k-cache-barriers.patch 76_all_mips-r10k-scheduling-support.patch 77_all_mips-r10k-support-for-atomic-memory-fixes.patch 78_all_mips-constant-addr.patch 79_all_arm_PR37436.patch 80_all_sparc-biarch.patch 90_all_gcc-freebsd.patch 91_all_gcc-freebsd.patch README.history
Date: Fri, 01 Jul 2011 07:18:13
Message-Id: 20110701071743.2275D20054@flycatcher.gentoo.org
1 dirtyepic 11/07/01 07:17:43
2
3 Added: 00_all_gcc-4.1-alpha-mieee-default.patch
4 00_all_gcc-trampolinewarn.patch
5 01_all_gcc-4.1-alpha-asm-mcpu.patch
6 03_all_gcc43-java-nomulti.patch
7 05_all_pr40010-manpages.patch
8 08_all_gcc-4.1-cross-compile.patch
9 10_all_gcc-default-format-security.patch
10 10_all_gcc-default-fortify-source.patch
11 11_all_gcc-netbsd-symbolic.patch
12 14_all_gcc-sparc64-bsd.patch
13 15_all_gcc-libgomp-no-werror.patch
14 18_all_904-flatten-switch-stmt-00.patch
15 20_all_mudflap-setuid-env.patch
16 20_all_s390-gcc-4.3.2-z10-complete.patch
17 40_all_gcc-4.4-libiberty.h-asprintf.patch
18 45_all_arm-pic-ssp-segv-pr35965.patch
19 46_all_armel-hilo-union-class.patch
20 47_all_arm-unbreak-armv4t.patch
21 48_all_gfortran-armel-updates.patch
22 49_all_arm_v7-config.patch
23 51_all_gcc-3.4-libiberty-pic.patch
24 53_all_gcc4-superh-default-multilib.patch
25 61_all_gcc4-ia64-noteGNUstack.patch
26 61_all_gcc43-pr24170.patch
27 62_all_gcc4-noteGNUstack.patch
28 66_all_gcc43-pr25343.patch
29 68_all_gcc43-pr37661.patch
30 70_all_gcc43-libjava-headers.patch
31 73_all_sh-libgcc-stacks.patch
32 74_all_sh-pr24836.patch
33 75_all_mips-r10k-cache-barriers.patch
34 76_all_mips-r10k-scheduling-support.patch
35 77_all_mips-r10k-support-for-atomic-memory-fixes.patch
36 78_all_mips-constant-addr.patch
37 79_all_arm_PR37436.patch 80_all_sparc-biarch.patch
38 90_all_gcc-freebsd.patch 91_all_gcc-freebsd.patch
39 README.history
40 Log:
41 Initial 4.3.6 patchset based on latest 4.3.5 patchset.
42
43 Revision Changes Path
44 1.1 src/patchsets/gcc/4.3.6/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch
45
46 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch?rev=1.1&view=markup
47 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch?rev=1.1&content-type=text/plain
48
49 Index: 00_all_gcc-4.1-alpha-mieee-default.patch
50 ===================================================================
51 Set the default behavior on alpha to use -mieee since the large majority of
52 time we want this (bad/weird things can happen with packages built without
53 -mieee).
54
55 To satisfy those people who may not want -mieee forced on them all the time,
56 we also provide -mno-ieee.
57
58 Patch by Mike Frysinger <vapier@g.o>
59
60 --- gcc-4.3.0/gcc/config/alpha/alpha.h
61 +++ gcc-4.3.0/gcc/config/alpha/alpha.h
62 @@ -95,6 +95,8 @@
63 while (0)
64 #endif
65
66 +#define CPP_SPEC "%{!no-ieee:-mieee}"
67 +
68 #define WORD_SWITCH_TAKES_ARG(STR) \
69 (!strcmp (STR, "rpath") || DEFAULT_WORD_SWITCH_TAKES_ARG(STR))
70
71 --- gcc-4.3.0/gcc/config/alpha/alpha.opt
72 +++ gcc-4.3.0/gcc/config/alpha/alpha.opt
73 @@ -39,7 +39,7 @@
74 Request IEEE-conformant math library routines (OSF/1)
75
76 mieee
77 -Target Report RejectNegative Mask(IEEE)
78 +Target Report Mask(IEEE)
79 Emit IEEE-conformant code, without inexact exceptions
80
81 mieee-with-inexact
82
83
84
85 1.1 src/patchsets/gcc/4.3.6/gentoo/00_all_gcc-trampolinewarn.patch
86
87 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/00_all_gcc-trampolinewarn.patch?rev=1.1&view=markup
88 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/00_all_gcc-trampolinewarn.patch?rev=1.1&content-type=text/plain
89
90 Index: 00_all_gcc-trampolinewarn.patch
91 ===================================================================
92 This trivial patch causes gcc to emit a warning whenever
93 it generates a trampoline. These are otherwise hard to
94 locate. It is rigged to default ON - to have it default
95 to OFF remove the text 'Init(1)' from the common.opt
96 patch, leaving just 'Common Var(warn_trampolines)'.
97 Kevin F. Quinn <kevquinn@g.o> 17 Jan 2006
98
99 --- gcc/gcc/common.opt
100 +++ gcc/gcc/common.opt
101 @@ -141,6 +141,10 @@
102 Common Var(warn_system_headers)
103 Do not suppress warnings from system headers
104
105 +Wtrampolines
106 +Common Var(warn_trampolines) Init(1)
107 +Warn whenever a trampoline is generated
108 +
109 Wuninitialized
110 Common Var(warn_uninitialized)
111 Warn about uninitialized automatic variables
112 --- gcc/gcc/builtins.c
113 +++ gcc/gcc/builtins.c
114 @@ -5224,6 +5224,9 @@
115 #endif
116 trampolines_created = 1;
117 INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
118 +
119 + if (warn_trampolines)
120 + warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
121
122 return const0_rtx;
123 }
124
125
126
127 1.1 src/patchsets/gcc/4.3.6/gentoo/01_all_gcc-4.1-alpha-asm-mcpu.patch
128
129 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/01_all_gcc-4.1-alpha-asm-mcpu.patch?rev=1.1&view=markup
130 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/01_all_gcc-4.1-alpha-asm-mcpu.patch?rev=1.1&content-type=text/plain
131
132 Index: 01_all_gcc-4.1-alpha-asm-mcpu.patch
133 ===================================================================
134 http://bugs.gentoo.org/170146
135 http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00403.html
136
137 alpha: turn -mcpu=<cpu> into -m<cpu> for assembler all the time
138
139 --- gcc-x/gcc/config/alpha/elf.h
140 +++ gcc-x/gcc/config/alpha/elf.h
141 @@ -46,7 +46,7 @@
142 #define CC1_SPEC "%{G*}"
143
144 #undef ASM_SPEC
145 -#define ASM_SPEC "%{G*} %{relax:-relax} %{!gstabs*:-no-mdebug}%{gstabs*:-mdebug}"
146 +#define ASM_SPEC "%{G*} %{relax:-relax} %{!gstabs*:-no-mdebug}%{gstabs*:-mdebug} %{mcpu=*:-m%*}"
147
148 #undef IDENT_ASM_OP
149 #define IDENT_ASM_OP "\t.ident\t"
150
151
152
153 1.1 src/patchsets/gcc/4.3.6/gentoo/03_all_gcc43-java-nomulti.patch
154
155 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/03_all_gcc43-java-nomulti.patch?rev=1.1&view=markup
156 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/03_all_gcc43-java-nomulti.patch?rev=1.1&content-type=text/plain
157
158 Index: 03_all_gcc43-java-nomulti.patch
159 ===================================================================
160 --- libjava/configure.ac.jj 2007-12-07 17:55:50.000000000 +0100
161 +++ libjava/configure.ac 2007-12-07 18:36:56.000000000 +0100
162 @@ -82,6 +82,13 @@ AC_ARG_ENABLE(java-maintainer-mode,
163 [allow rebuilding of .class and .h files]))
164 AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
165
166 +AC_ARG_ENABLE(libjava-multilib,
167 + AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib]))
168 +if test "$enable_libjava_multilib" = no; then
169 + multilib=no
170 + ac_configure_args="$ac_configure_args --disable-multilib"
171 +fi
172 +
173 # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
174 GCC_NO_EXECUTABLES
175
176 --- libjava/configure.jj 2007-12-07 17:55:50.000000000 +0100
177 +++ libjava/configure 2007-12-07 18:39:58.000000000 +0100
178 @@ -1018,6 +1018,8 @@ Optional Features:
179 --enable-gconf-peer compile GConf native peers for util.preferences
180 --enable-java-maintainer-mode
181 allow rebuilding of .class and .h files
182 + --enable-libjava-multilib
183 + build libjava as multilib
184 --disable-dependency-tracking speeds up one-time build
185 --enable-dependency-tracking do not reject slow dependency extractors
186 --enable-maintainer-mode enable make rules and dependencies not useful
187 @@ -1848,6 +1850,16 @@ else
188 fi
189
190
191 +# Check whether --enable-libjava-multilib was given.
192 +if test "${enable_libjava_multilib+set}" = set; then
193 + enableval=$enable_libjava_multilib;
194 +fi
195 +
196 +if test "$enable_libjava_multilib" = no; then
197 + multilib=no
198 + ac_configure_args="$ac_configure_args --disable-multilib"
199 +fi
200 +
201 # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
202
203
204
205
206
207 1.1 src/patchsets/gcc/4.3.6/gentoo/05_all_pr40010-manpages.patch
208
209 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/05_all_pr40010-manpages.patch?rev=1.1&view=markup
210 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/05_all_pr40010-manpages.patch?rev=1.1&content-type=text/plain
211
212 Index: 05_all_pr40010-manpages.patch
213 ===================================================================
214 Fix manpage generation w/ parallel builds.
215
216 https://bugs.gentoo.org/256608
217 http://gcc.gnu.org/PR40010
218
219 --- a/gcc/Makefile.in
220 +++ b/gcc/Makefile.in
221 @@ -3808,7 +3808,7 @@ cpp.pod: cpp.texi cppenv.texi cppopts.texi
222 # These next rules exist because the output name is not the same as
223 # the input name, so our implicit %.pod rule will not work.
224
225 -gcc.pod: invoke.texi cppenv.texi cppopts.texi
226 +gcc.pod: invoke.texi cppenv.texi cppopts.texi gcc-vers.texi
227 $(STAMP) $@
228 -$(TEXI2POD) $< > $@
229 gfdl.pod: fdl.texi
230
231
232
233 1.1 src/patchsets/gcc/4.3.6/gentoo/08_all_gcc-4.1-cross-compile.patch
234
235 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/08_all_gcc-4.1-cross-compile.patch?rev=1.1&view=markup
236 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/08_all_gcc-4.1-cross-compile.patch?rev=1.1&content-type=text/plain
237
238 Index: 08_all_gcc-4.1-cross-compile.patch
239 ===================================================================
240 Some notes on the 'bootstrap with or without libc headers' debate:
241 http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
242 http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
243
244 --- gcc/unwind-dw2.c
245 +++ gcc/unwind-dw2.c
246 @@ -253,9 +253,11 @@
247 }
248 #endif
249
250 +#ifndef inhibit_libc
251 #ifdef MD_UNWIND_SUPPORT
252 #include MD_UNWIND_SUPPORT
253 #endif
254 +#endif
255
256 /* Extract any interesting information from the CIE for the translation
257 unit F belongs to. Return a pointer to the byte after the augmentation,
258 --- gcc/configure
259 +++ gcc/configure
260 @@ -12857,7 +12857,7 @@ then
261 | powerpc*-*-*,powerpc64*-*-*)
262 CROSS="$CROSS -DNATIVE_CROSS" ;;
263 esac
264 -elif test "x$TARGET_SYSTEM_ROOT" != x; then
265 +elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
266 SYSTEM_HEADER_DIR=$build_system_header_dir
267 fi
268
269 --- gcc/configure.ac
270 +++ gcc/configure.ac
271 @@ -1717,7 +1717,7 @@ then
272 | powerpc*-*-*,powerpc64*-*-*)
273 CROSS="$CROSS -DNATIVE_CROSS" ;;
274 esac
275 -elif test "x$TARGET_SYSTEM_ROOT" != x; then
276 +elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
277 SYSTEM_HEADER_DIR=$build_system_header_dir
278 fi
279
280
281
282
283 1.1 src/patchsets/gcc/4.3.6/gentoo/10_all_gcc-default-format-security.patch
284
285 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/10_all_gcc-default-format-security.patch?rev=1.1&view=markup
286 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/10_all_gcc-default-format-security.patch?rev=1.1&content-type=text/plain
287
288 Index: 10_all_gcc-default-format-security.patch
289 ===================================================================
290 ripped from Debian
291
292 # DP: Turn on -Wformat -Wformat-security by default for C, C++, ObjC, ObjC++.
293
294 --- gcc/c-common.c
295 +++ gcc/c-common.c
296 @@ -277,7 +277,7 @@
297 /* Warn about format/argument anomalies in calls to formatted I/O functions
298 (*printf, *scanf, strftime, strfmon, etc.). */
299
300 -int warn_format;
301 +int warn_format = 1;
302
303 /* Warn about using __null (as NULL in C++) as sentinel. For code compiled
304 with GCC this doesn't matter as __null is guaranteed to have the right
305 --- gcc/c.opt
306 +++ gcc/c.opt
307 @@ -228,7 +228,7 @@
308 Warn about format strings that contain NUL bytes
309
310 Wformat-security
311 -C ObjC C++ ObjC++ Var(warn_format_security) Warning
312 +C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning
313 Warn about possible security problems with format functions
314
315 Wformat-y2k
316 --- gcc/doc/invoke.texi
317 +++ gcc/doc/invoke.texi
318 @@ -2802,6 +2802,9 @@
319 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
320 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
321
322 +NOTE: In Gentoo, this option is enabled by default for C, C++, ObjC, ObjC++.
323 +To disable, use @option{-Wformat=0}.
324 +
325 @item -Wformat-y2k
326 @opindex Wformat-y2k
327 @opindex Wno-format-y2k
328 @@ -2849,6 +2852,11 @@
329 in future warnings may be added to @option{-Wformat-security} that are not
330 included in @option{-Wformat-nonliteral}.)
331
332 +NOTE: In Gentoo, this option is enabled by default for C, C++, ObjC, ObjC++.
333 +To disable, use @option{-Wno-format-security}, or disable all format warnings
334 +with @option{-Wformat=0}. To make format security warnings fatal, specify
335 +@option{-Werror=format-security}.
336 +
337 @item -Wformat=2
338 @opindex Wformat=2
339 @opindex Wno-format=2
340
341
342
343 1.1 src/patchsets/gcc/4.3.6/gentoo/10_all_gcc-default-fortify-source.patch
344
345 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/10_all_gcc-default-fortify-source.patch?rev=1.1&view=markup
346 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/10_all_gcc-default-fortify-source.patch?rev=1.1&content-type=text/plain
347
348 Index: 10_all_gcc-default-fortify-source.patch
349 ===================================================================
350 ripped from Debian
351
352 # DP: Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++.
353
354 --- gcc/doc/invoke.texi
355 +++ gcc/doc/invoke.texi
356 @@ -5204,6 +5204,11 @@
357 Please note the warning under @option{-fgcse} about
358 invoking @option{-O2} on programs that use computed gotos.
359
360 +NOTE: In Gentoo, @option{-D_FORTIFY_SOURCE=2} is set by default, and is
361 +activated when @option{-O} is set to 2 or higher. This enables additional
362 +compile-time and run-time checks for several libc functions. To disable,
363 +specify either @option{-U_FORTIFY_SOURCE} or @option{-D_FORTIFY_SOURCE=0}.
364 +
365 @item -O3
366 @opindex O3
367 Optimize yet more. @option{-O3} turns on all optimizations specified by
368 --- gcc/gcc.c
369 +++ gcc/gcc.c
370 @@ -802,6 +802,7 @@
371 %{H} %C %{D*&U*&A*} %{i*} %Z %i\
372 %{fmudflap:-D_MUDFLAP -include mf-runtime.h}\
373 %{fmudflapth:-D_MUDFLAP -D_MUDFLAPTH -include mf-runtime.h}\
374 + %{!D_FORTIFY_SOURCE:%{!D_FORTIFY_SOURCE=*:%{!U_FORTIFY_SOURCE:-D_FORTIFY_SOURCE=2}}}\
375 %{E|M|MM:%W{o*}}";
376
377 /* This contains cpp options which are common with cc1_options and are passed
378
379
380
381 1.1 src/patchsets/gcc/4.3.6/gentoo/11_all_gcc-netbsd-symbolic.patch
382
383 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/11_all_gcc-netbsd-symbolic.patch?rev=1.1&view=markup
384 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/11_all_gcc-netbsd-symbolic.patch?rev=1.1&content-type=text/plain
385
386 Index: 11_all_gcc-netbsd-symbolic.patch
387 ===================================================================
388 http://bugs.gentoo.org/122698
389
390 --- gcc/config/netbsd-elf.h
391 +++ gcc/config/netbsd-elf.h
392 @@ -83,6 +83,7 @@
393 #define NETBSD_LINK_SPEC_ELF \
394 "%{assert*} %{R*} %{rpath*} \
395 %{shared:-shared} \
396 + %{symbolic:-Bsymbolic} \
397 %{!shared: \
398 -dc -dp \
399 %{!nostdlib: \
400
401
402
403 1.1 src/patchsets/gcc/4.3.6/gentoo/14_all_gcc-sparc64-bsd.patch
404
405 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/14_all_gcc-sparc64-bsd.patch?rev=1.1&view=markup
406 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/14_all_gcc-sparc64-bsd.patch?rev=1.1&content-type=text/plain
407
408 Index: 14_all_gcc-sparc64-bsd.patch
409 ===================================================================
410 --- a/gcc/config/sparc/freebsd.h 2006-02-02 19:55:09 +0000
411 +++ b/gcc/config/sparc/freebsd.h 2007-09-06 23:55:21 +0100
412 @@ -26,9 +26,22 @@
413 /* FreeBSD needs the platform name (sparc64) defined.
414 Emacs needs to know if the arch is 64 or 32-bits. */
415
416 -#undef CPP_CPU64_DEFAULT_SPEC
417 -#define CPP_CPU64_DEFAULT_SPEC \
418 - "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__"
419 +#undef FBSD_TARGET_CPU_CPP_BUILTINS
420 +#define FBSD_TARGET_CPU_CPP_BUILTINS() \
421 + do \
422 + { \
423 + if (TARGET_ARCH64) \
424 + { \
425 + builtin_define ("__sparc64__"); \
426 + builtin_define ("__sparc_v9__"); \
427 + builtin_define ("__sparcv9"); \
428 + } \
429 + else \
430 + builtin_define ("__sparc"); \
431 + builtin_define ("__sparc__"); \
432 + } \
433 + while (0)
434 +
435
436 #define LINK_SPEC "%(link_arch) \
437 %{!mno-relax:%{!r:-relax}} \
438
439
440
441 1.1 src/patchsets/gcc/4.3.6/gentoo/15_all_gcc-libgomp-no-werror.patch
442
443 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/15_all_gcc-libgomp-no-werror.patch?rev=1.1&view=markup
444 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/15_all_gcc-libgomp-no-werror.patch?rev=1.1&content-type=text/plain
445
446 Index: 15_all_gcc-libgomp-no-werror.patch
447 ===================================================================
448 libgomp does not respect --disable-werror
449
450 http://bugs.gentoo.org/229059
451 http://gcc.gnu.org/PR38436
452
453 --- gcc-4.3.2/libgomp/configure
454 +++ gcc-4.3.2/libgomp/configure
455 @@ -3297,7 +3297,7 @@
456
457 # Add -Wall -Werror if we are using GCC.
458 if test "x$GCC" = "xyes"; then
459 - XCFLAGS="$XCFLAGS -Wall -Werror"
460 + XCFLAGS="$XCFLAGS -Wall"
461 fi
462
463 # Find other programs we need.
464
465
466
467 1.1 src/patchsets/gcc/4.3.6/gentoo/18_all_904-flatten-switch-stmt-00.patch
468
469 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/18_all_904-flatten-switch-stmt-00.patch?rev=1.1&view=markup
470 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/18_all_904-flatten-switch-stmt-00.patch?rev=1.1&content-type=text/plain
471
472 Index: 18_all_904-flatten-switch-stmt-00.patch
473 ===================================================================
474 http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html
475
476 Hi,
477
478 The attached patch makes sure that we create smaller object code for
479 simple switch statements. We just make sure to flatten the switch
480 statement into an if-else chain, basically.
481
482 This fixes a size-regression as compared to gcc-3.4, as can be seen
483 below.
484
485 2007-04-15 Bernhard Fischer <..>
486
487 * stmt.c (expand_case): Do not create a complex binary tree when
488 optimizing for size but rather use the simple ordered list.
489 (emit_case_nodes): do not emit jumps to the default_label when
490 optimizing for size.
491
492 Not regtested so far.
493 Comments?
494
495 Attached is the test switch.c mentioned below.
496
497 $ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
498 gcc-$i -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done
499 $ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
500 gcc-$i -UCHAIN -Os -o switch-$i.o -c switch.c ;done
501
502 $ size switch-*.o
503 text data bss dec hex filename
504 169 0 0 169 a9 switch-2.95.o
505 115 0 0 115 73 switch-3.3.o
506 103 0 0 103 67 switch-3.4.o
507 124 0 0 124 7c switch-4.0.o
508 124 0 0 124 7c switch-4.1.o
509 124 0 0 124 7c switch-4.2.orig-HEAD.o
510 95 0 0 95 5f switch-4.3-HEAD.o
511 124 0 0 124 7c switch-4.3.orig-HEAD.o
512 166 0 0 166 a6 switch-CHAIN-2.95.o
513 111 0 0 111 6f switch-CHAIN-3.3.o
514 95 0 0 95 5f switch-CHAIN-3.4.o
515 95 0 0 95 5f switch-CHAIN-4.0.o
516 95 0 0 95 5f switch-CHAIN-4.1.o
517 95 0 0 95 5f switch-CHAIN-4.2.orig-HEAD.o
518 95 0 0 95 5f switch-CHAIN-4.3-HEAD.o
519 95 0 0 95 5f switch-CHAIN-4.3.orig-HEAD.o
520
521
522 Content-Type: text/x-diff; charset=us-ascii
523 Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff"
524
525 Index: gcc-4.2.0/gcc/stmt.c
526 ===================================================================
527 --- gcc-4.2.0.orig/gcc/stmt.c (revision 123843)
528 +++ gcc-4.2.0/gcc/stmt.c (working copy)
529 @@ -2517,7 +2517,11 @@ expand_case (tree exp)
530 use_cost_table
531 = (TREE_CODE (orig_type) != ENUMERAL_TYPE
532 && estimate_case_costs (case_list));
533 - balance_case_nodes (&case_list, NULL);
534 + /* When optimizing for size, we want a straight list to avoid
535 + jumps as much as possible. This basically creates an if-else
536 + chain. */
537 + if (!optimize_size)
538 + balance_case_nodes (&case_list, NULL);
539 emit_case_nodes (index, case_list, default_label, index_type);
540 emit_jump (default_label);
541 }
542 @@ -3075,6 +3079,7 @@ emit_case_nodes (rtx index, case_node_pt
543 {
544 if (!node_has_low_bound (node, index_type))
545 {
546 + if (!optimize_size) /* don't jl to the .default_label. */
547 emit_cmp_and_jump_insns (index,
548 convert_modes
549 (mode, imode,
550
551
552 Content-Type: text/x-csrc; charset=us-ascii
553 Content-Disposition: attachment; filename="switch.c"
554
555 int
556 commutative_tree_code (int code)
557 {
558 #define CASE(val, ret) case val:/* __asm__("# val="#val ",ret="#ret);*/ return ret;
559 #ifndef CHAIN
560 switch (code)
561 {
562 # if 1
563 CASE(1,3)
564 CASE(3,2)
565 CASE(5,8)
566 CASE(7,1)
567 CASE(33,4)
568 CASE(44,9)
569 CASE(55,10)
570 CASE(66,-1)
571 CASE(77,99)
572 CASE(666,0)
573 # else
574 case 1:
575 return 3;
576 case 3:
577 return 2;
578 case 5:
579 return 8;
580 case 7:
581 return 1;
582 case 33:
583 return 4;
584 case 44:
585 return 9;
586 case 55:
587 return 10;
588 case 66:
589 return -1;
590 case 77:
591 return 99;
592 case 666:
593 return 0;
594 # endif
595 default:
596 break;
597 }
598 return 4711;
599
600 #else
601 if (code == 1)
602 return 3;
603 else if (code == 3)
604 return 2;
605 else if (code == 5)
606 return 8;
607 else if (code == 7)
608 return 1;
609 else if (code == 33)
610 return 4;
611 else if (code == 44)
612 return 9;
613 else if (code == 55)
614 return 10;
615 else if (code == 66)
616 return -1;
617 else if (code == 77)
618 return 99;
619 else if (code == 666)
620 return 0;
621 else
622 return 4711;
623 #endif
624 }
625
626
627 --AhhlLboLdkugWU4S--
628
629
630
631
632 1.1 src/patchsets/gcc/4.3.6/gentoo/20_all_mudflap-setuid-env.patch
633
634 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/20_all_mudflap-setuid-env.patch?rev=1.1&view=markup
635 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/20_all_mudflap-setuid-env.patch?rev=1.1&content-type=text/plain
636
637 Index: 20_all_mudflap-setuid-env.patch
638 ===================================================================
639 mudflap accepts options via $MUDFLAP_OPTIONS even when running setuid.
640
641 -viol-gdb option invokes programs upon error detection which is bad.
642 Note that NULL ptr derefs which are unexploitable in userspace programs,
643 then become exploitable.
644
645 http://gcc.gnu.org/PR41433
646 https://bugs.gentoo.org/335290
647
648 --- a/libmudflap/mf-runtime.c
649 +++ b/libmudflap/mf-runtime.c
650 @@ -303,6 +303,14 @@ __mf_set_default_options ()
651 #ifdef LIBMUDFLAPTH
652 __mf_opts.thread_stack = 0;
653 #endif
654 +
655 + /* PR41443: Beware that the above flags will be applied to
656 + setuid/setgid binaries, and cannot be overriden with
657 + $MUDFLAP_OPTIONS. So the defaults must be non-exploitable.
658 +
659 + Should we consider making the default violation_mode something
660 + harsher than viol_nop? OTOH, glibc's MALLOC_CHECK_ is disabled
661 + by default for these same programs. */
662 }
663
664 static struct mudoption
665 @@ -442,7 +450,7 @@ __mf_usage ()
666 "This is a %s%sGCC \"mudflap\" memory-checked binary.\n"
667 "Mudflap is Copyright (C) 2002-2010 Free Software Foundation, Inc.\n"
668 "\n"
669 - "The mudflap code can be controlled by an environment variable:\n"
670 + "Unless setuid, a program's mudflap options be set by an environment variable:\n"
671 "\n"
672 "$ export MUDFLAP_OPTIONS='<options>'\n"
673 "$ <mudflapped_program>\n"
674 @@ -705,7 +713,8 @@ __mf_init ()
675
676 __mf_set_default_options ();
677
678 - ov = getenv ("MUDFLAP_OPTIONS");
679 + if (getuid () == geteuid () && getgid () == getegid ()) /* PR41433, not setuid */
680 + ov = getenv ("MUDFLAP_OPTIONS");
681 if (ov)
682 {
683 int rc = __mfu_set_options (ov);
684
685
686
687 1.1 src/patchsets/gcc/4.3.6/gentoo/20_all_s390-gcc-4.3.2-z10-complete.patch
688
689 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/20_all_s390-gcc-4.3.2-z10-complete.patch?rev=1.1&view=markup
690 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/20_all_s390-gcc-4.3.2-z10-complete.patch?rev=1.1&content-type=text/plain
691
692 Index: 20_all_s390-gcc-4.3.2-z10-complete.patch
693 ===================================================================
694 http://www.ibm.com/developerworks/linux/linux390/toolchain.html#gcc-4.3.2
695
696 This patch enables gcc 4.3.2 to generate code using the new IBM System
697 z10 hardware instructions and provides z10 specific instructions
698 scheduling. When the -march=z10 option is specified, gcc makes use of
699 the z10 instruction extension facility to generate faster executables
700 which are limited to run on a z10 or higher. z10 specific instruction
701 scheduling is enabled by default when using the -march=z10 option but
702 can also be requested separately using the -mtune=z10 option.
703
704 Index: gcc/doc/tm.texi
705 ===================================================================
706 --- gcc/doc/tm.texi (revision 141434)
707 +++ gcc/doc/tm.texi (working copy)
708 @@ -5297,6 +5297,17 @@
709 Format}.
710 @end defmac
711
712 +@defmac TARGET_MEM_CONSTRAINT
713 +A single character to be used instead of the default @code{'m'}
714 +character for general memory addresses. This defines the constraint
715 +letter which matches the memory addresses accepted by
716 +@code{GO_IF_LEGITIMATE_ADDRESS_P}. Define this macro if you want to
717 +support new address formats in your back end without changing the
718 +semantics of the @code{'m'} constraint. This is necessary in order to
719 +preserve functionality of inline assembly constructs using the
720 +@code{'m'} constraint.
721 +@end defmac
722 +
723 @defmac FIND_BASE_TERM (@var{x})
724 A C expression to determine the base term of address @var{x}.
725 This macro is used in only one place: `find_base_term' in alias.c.
726 Index: gcc/doc/md.texi
727 ===================================================================
728 --- gcc/doc/md.texi (revision 141434)
729 +++ gcc/doc/md.texi (working copy)
730 @@ -1050,6 +1050,7 @@
731 * Multi-Alternative:: When an insn has two alternative constraint-patterns.
732 * Class Preferences:: Constraints guide which hard register to put things in.
733 * Modifiers:: More precise control over effects of constraints.
734 +* Disable Insn Alternatives:: Disable insn alternatives using the @code{enabled} attribute.
735 * Machine Constraints:: Existing constraints for some particular machines.
736 * Define Constraints:: How to define machine-specific constraints.
737 * C Constraint Interface:: How to test constraints from C code.
738 @@ -1085,6 +1086,8 @@
739 @item @samp{m}
740 A memory operand is allowed, with any kind of address that the machine
741 supports in general.
742 +Note that the letter used for the general memory constraint can be
743 +re-defined by a back end using the @code{TARGET_MEM_CONSTRAINT} macro.
744
745 @cindex offsettable address
746 @cindex @samp{o} in constraint
747 @@ -3091,6 +3094,99 @@
748 @end table
749
750 @ifset INTERNALS
751 +@node Disable Insn Alternatives
752 +@subsection Disable insn alternatives using the @code{enabled} attribute
753 +@cindex enabled
754 +
755 +The @code{enabled} insn attribute may be used to disable certain insn
756 +alternatives for machine-specific reasons. This is useful when adding
757 +new instructions to an existing pattern which are only available for
758 +certain cpu architecture levels as specified with the @code{-march=}
759 +option.
760 +
761 +If an insn alternative is disabled, then it will never be used. The
762 +compiler treats the constraints for the disabled alternative as
763 +unsatisfiable.
764 +
765 +In order to make use of the @code{enabled} attribute a back end has to add
766 +in the machine description files:
767 +
768 +@enumerate
769 +@item
770 +A definition of the @code{enabled} insn attribute. The attribute is
771 +defined as usual using the @code{define_attr} command. This
772 +definition should be based on other insn attributes and/or target flags.
773 +The @code{enabled} attribute is a numeric attribute and should evaluate to
774 +@code{(const_int 1)} for an enabled alternative and to
775 +@code{(const_int 0)} otherwise.
776 +@item
777 +A definition of another insn attribute used to describe for what
778 +reason an insn alternative might be available or
779 +not. E.g. @code{cpu_facility} as in the example below.
780 +@item
781 +An assignement for the second attribute to each insn definition
782 +combining instructions which are not all available under the same
783 +circumstances. (Note: It obviously only makes sense for definitions
784 +with more than one alternative. Otherwise the insn pattern should be
785 +disabled or enabled using the insn condition.)
786 +@end enumerate
787 +
788 +E.g. the following two patterns could easily be merged using the @code{enabled}
789 +attribute:
790 +
791 +@smallexample
792 +
793 +(define_insn "*movdi_old"
794 + [(set (match_operand:DI 0 "register_operand" "=d")
795 + (match_operand:DI 1 "register_operand" " d"))]
796 + "!TARGET_NEW"
797 + "lgr %0,%1")
798 +
799 +(define_insn "*movdi_new"
800 + [(set (match_operand:DI 0 "register_operand" "=d,f,d")
801 + (match_operand:DI 1 "register_operand" " d,d,f"))]
802 + "TARGET_NEW"
803 + "@@
804 + lgr %0,%1
805 + ldgr %0,%1
806 + lgdr %0,%1")
807 +
808 +@end smallexample
809 +
810 +to:
811 +
812 +@smallexample
813 +
814 +(define_insn "*movdi_combined"
815 + [(set (match_operand:DI 0 "register_operand" "=d,f,d")
816 + (match_operand:DI 1 "register_operand" " d,d,f"))]
817 + ""
818 + "@@
819 + lgr %0,%1
820 + ldgr %0,%1
821 + lgdr %0,%1"
822 + [(set_attr "cpu_facility" "*,new,new")])
823 +
824 +@end smallexample
825 +
826 +with the @code{enabled} attribute defined like this:
827 +
828 +@smallexample
829 +
830 +(define_attr "cpu_facility" "standard,new" (const_string "standard"))
831 +
832 +(define_attr "enabled" ""
833 + (cond [(eq_attr "cpu_facility" "standard") (const_int 1)
834 + (and (eq_attr "cpu_facility" "new")
835 + (ne (symbol_ref "TARGET_NEW") (const_int 0)))
836 + (const_int 1)]
837 + (const_int 0)))
838 +
839 +@end smallexample
840 +
841 +@end ifset
842 +
843 +@ifset INTERNALS
844 @node Define Constraints
845 @subsection Defining Machine-Specific Constraints
846 @cindex defining constraints
847 @@ -6514,6 +6610,22 @@
848 defined and the function to obtain the attribute's value will return
849 @code{int}.
850
851 +There are attributes which are tied to a specific meaning. These
852 +attributes are not free to use for other purposes:
853 +
854 +@table @code
855 +@item length
856 +The @code{length} attribute is used to calculate the length of emitted
857 +code chunks. This is especially important when verifying branch
858 +distances. @xref{Insn Lengths}.
859 +
860 +@item enabled
861 +The @code{enabled} attribute can be defined to prevent certain
862 +alternatives of an insn definition from being used during code
863 +generation. @xref{Disable Insn Alternatives}.
864 +
865 +@end table
866 +
867 @end ifset
868 @ifset INTERNALS
869 @node Expressions
870 Index: gcc/postreload.c
871 ===================================================================
872 --- gcc/postreload.c (revision 141434)
873 +++ gcc/postreload.c (working copy)
874 @@ -542,12 +542,12 @@
875 case '*': case '%':
876 case '0': case '1': case '2': case '3': case '4':
877 case '5': case '6': case '7': case '8': case '9':
878 - case 'm': case '<': case '>': case 'V': case 'o':
879 + case '<': case '>': case 'V': case 'o':
880 case 'E': case 'F': case 'G': case 'H':
881 case 's': case 'i': case 'n':
882 case 'I': case 'J': case 'K': case 'L':
883 case 'M': case 'N': case 'O': case 'P':
884 - case 'p': case 'X':
885 + case 'p': case 'X': case TARGET_MEM_CONSTRAINT:
886 /* These don't say anything we care about. */
887 break;
888
889 Index: gcc/defaults.h
890 ===================================================================
891 --- gcc/defaults.h (revision 141434)
892 +++ gcc/defaults.h (working copy)
893 @@ -902,6 +902,10 @@
894 #define LEGITIMATE_PIC_OPERAND_P(X) 1
895 #endif
896
897 +#ifndef TARGET_MEM_CONSTRAINT
898 +#define TARGET_MEM_CONSTRAINT 'm'
899 +#endif
900 +
901 #ifndef REVERSIBLE_CC_MODE
902 #define REVERSIBLE_CC_MODE(MODE) 0
903 #endif
904 Index: gcc/reload.c
905 ===================================================================
906 --- gcc/reload.c (revision 141434)
907 +++ gcc/reload.c (working copy)
908 @@ -2544,7 +2544,7 @@
909 int noperands;
910 /* These start out as the constraints for the insn
911 and they are chewed up as we consider alternatives. */
912 - char *constraints[MAX_RECOG_OPERANDS];
913 + const char *constraints[MAX_RECOG_OPERANDS];
914 /* These are the preferred classes for an operand, or NO_REGS if it isn't
915 a register. */
916 enum reg_class preferred_class[MAX_RECOG_OPERANDS];
917 @@ -2651,7 +2651,8 @@
918
919 memcpy (operand_mode, recog_data.operand_mode,
920 noperands * sizeof (enum machine_mode));
921 - memcpy (constraints, recog_data.constraints, noperands * sizeof (char *));
922 + memcpy (constraints, recog_data.constraints,
923 + noperands * sizeof (const char *));
924
925 commutative = -1;
926
927 @@ -2662,8 +2663,9 @@
928
929 for (i = 0; i < noperands; i++)
930 {
931 - char *p;
932 + const char *p;
933 int c;
934 + char *end;
935
936 substed_operand[i] = recog_data.operand[i];
937 p = constraints[i];
938 @@ -2707,7 +2709,8 @@
939 case '0': case '1': case '2': case '3': case '4':
940 case '5': case '6': case '7': case '8': case '9':
941 {
942 - c = strtoul (p - 1, &p, 10);
943 + c = strtoul (p - 1, &end, 10);
944 + p = end;
945
946 operands_match[c][i]
947 = operands_match_p (recog_data.operand[c],
948 @@ -2935,11 +2938,21 @@
949 a bad register class to only count 1/3 as much. */
950 int reject = 0;
951
952 + if (!recog_data.alternative_enabled_p[this_alternative_number])
953 + {
954 + int i;
955 +
956 + for (i = 0; i < recog_data.n_operands; i++)
957 + constraints[i] = skip_alternative (constraints[i]);
958 +
959 + continue;
960 + }
961 +
962 this_earlyclobber = 0;
963
964 for (i = 0; i < noperands; i++)
965 {
966 - char *p = constraints[i];
967 + const char *p = constraints[i];
968 char *end;
969 int len;
970 int win = 0;
971 @@ -3203,7 +3216,7 @@
972 badop = 0;
973 break;
974
975 - case 'm':
976 + case TARGET_MEM_CONSTRAINT:
977 if (force_reload)
978 break;
979 if (MEM_P (operand)
980 @@ -3738,7 +3751,7 @@
981 address_reloaded[commutative + 1] = t;
982
983 memcpy (constraints, recog_data.constraints,
984 - noperands * sizeof (char *));
985 + noperands * sizeof (const char *));
986 goto try_swapped;
987 }
988 else
989 @@ -4555,7 +4568,7 @@
990 while (*constraint++ != ',');
991 altnum--;
992 }
993 - /* Scan the requested alternative for 'm' or 'o'.
994 + /* Scan the requested alternative for TARGET_MEM_CONSTRAINT or 'o'.
995 If one of them is present, this alternative accepts the result of
996 passing a constant-pool reference through find_reloads_toplev.
997
998 @@ -4566,7 +4579,7 @@
999 for (; (c = *constraint) && c != ',' && c != '#';
1000 constraint += CONSTRAINT_LEN (c, constraint))
1001 {
1002 - if (c == 'm' || c == 'o')
1003 + if (c == TARGET_MEM_CONSTRAINT || c == 'o')
1004 return true;
1005 #ifdef EXTRA_CONSTRAINT_STR
1006 if (EXTRA_MEMORY_CONSTRAINT (c, constraint)
1007 Index: gcc/genoutput.c
1008 ===================================================================
1009 --- gcc/genoutput.c (revision 141434)
1010 +++ gcc/genoutput.c (working copy)
1011 @@ -1122,7 +1122,10 @@
1012 unsigned int namelen = strlen (name);
1013 struct constraint_data **iter, **slot, *new;
1014
1015 - if (strchr (indep_constraints, name[0]))
1016 + /* The 'm' constraint is special here since that constraint letter
1017 + can be overridden by the back end by defining the
1018 + TARGET_MEM_CONSTRAINT macro. */
1019 + if (strchr (indep_constraints, name[0]) && name[0] != 'm')
1020 {
1021 if (name[1] == '\0')
1022 message_with_line (lineno, "constraint letter '%s' cannot be "
1023 Index: gcc/recog.c
1024 ===================================================================
1025 --- gcc/recog.c (revision 141434)
1026 +++ gcc/recog.c (working copy)
1027 @@ -60,6 +60,14 @@
1028 #endif
1029 #endif
1030
1031 +#ifndef HAVE_ATTR_enabled
1032 +static inline bool
1033 +get_attr_enabled (rtx insn ATTRIBUTE_UNUSED)
1034 +{
1035 + return true;
1036 +}
1037 +#endif
1038 +
1039 static void validate_replace_rtx_1 (rtx *, rtx, rtx, rtx);
1040 static void validate_replace_src_1 (rtx *, void *);
1041 static rtx split_insn (rtx);
1042 @@ -1550,7 +1558,7 @@
1043 result = 1;
1044 break;
1045
1046 - case 'm':
1047 + case TARGET_MEM_CONSTRAINT:
1048 case 'V': /* non-offsettable */
1049 if (memory_operand (op, VOIDmode))
1050 result = 1;
1051 @@ -1684,16 +1692,14 @@
1052 result = 1;
1053 }
1054 #ifdef EXTRA_CONSTRAINT_STR
1055 + else if (EXTRA_MEMORY_CONSTRAINT (c, constraint))
1056 + /* Every memory operand can be reloaded to fit. */
1057 + result = result || memory_operand (op, VOIDmode);
1058 + else if (EXTRA_ADDRESS_CONSTRAINT (c, constraint))
1059 + /* Every address operand can be reloaded to fit. */
1060 + result = result || address_operand (op, VOIDmode);
1061 else if (EXTRA_CONSTRAINT_STR (op, c, constraint))
1062 result = 1;
1063 - else if (EXTRA_MEMORY_CONSTRAINT (c, constraint)
1064 - /* Every memory operand can be reloaded to fit. */
1065 - && memory_operand (op, VOIDmode))
1066 - result = 1;
1067 - else if (EXTRA_ADDRESS_CONSTRAINT (c, constraint)
1068 - /* Every address operand can be reloaded to fit. */
1069 - && address_operand (op, VOIDmode))
1070 - result = 1;
1071 #endif
1072 break;
1073 }
1074 @@ -1927,11 +1933,9 @@
1075 int noperands;
1076 rtx body = PATTERN (insn);
1077
1078 - recog_data.insn = NULL;
1079 recog_data.n_operands = 0;
1080 recog_data.n_alternatives = 0;
1081 recog_data.n_dups = 0;
1082 - which_alternative = -1;
1083
1084 switch (GET_CODE (body))
1085 {
1086 @@ -2011,6 +2015,22 @@
1087 : OP_IN);
1088
1089 gcc_assert (recog_data.n_alternatives <= MAX_RECOG_ALTERNATIVES);
1090 +
1091 + if (INSN_CODE (insn) < 0)
1092 + for (i = 0; i < recog_data.n_alternatives; i++)
1093 + recog_data.alternative_enabled_p[i] = true;
1094 + else
1095 + {
1096 + recog_data.insn = insn;
1097 + for (i = 0; i < recog_data.n_alternatives; i++)
1098 + {
1099 + which_alternative = i;
1100 + recog_data.alternative_enabled_p[i] = get_attr_enabled (insn);
1101 + }
1102 + }
1103 +
1104 + recog_data.insn = NULL;
1105 + which_alternative = -1;
1106 }
1107
1108 /* After calling extract_insn, you can use this function to extract some
1109 @@ -2040,6 +2060,12 @@
1110 op_alt[j].matches = -1;
1111 op_alt[j].matched = -1;
1112
1113 + if (!recog_data.alternative_enabled_p[j])
1114 + {
1115 + p = skip_alternative (p);
1116 + continue;
1117 + }
1118 +
1119 if (*p == '\0' || *p == ',')
1120 {
1121 op_alt[j].anything_ok = 1;
1122 @@ -2089,7 +2115,7 @@
1123 }
1124 continue;
1125
1126 - case 'm':
1127 + case TARGET_MEM_CONSTRAINT:
1128 op_alt[j].memory_ok = 1;
1129 break;
1130 case '<':
1131 @@ -2209,6 +2235,17 @@
1132 int lose = 0;
1133 funny_match_index = 0;
1134
1135 + if (!recog_data.alternative_enabled_p[which_alternative])
1136 + {
1137 + int i;
1138 +
1139 + for (i = 0; i < recog_data.n_operands; i++)
1140 + constraints[i] = skip_alternative (constraints[i]);
1141 +
1142 + which_alternative++;
1143 + continue;
1144 + }
1145 +
1146 for (opno = 0; opno < recog_data.n_operands; opno++)
1147 {
1148 rtx op = recog_data.operand[opno];
1149 @@ -2362,7 +2399,7 @@
1150 win = 1;
1151 break;
1152
1153 - case 'm':
1154 + case TARGET_MEM_CONSTRAINT:
1155 /* Memory operands must be valid, to the extent
1156 required by STRICT. */
1157 if (MEM_P (op))
1158 Index: gcc/recog.h
1159 ===================================================================
1160 --- gcc/recog.h (revision 141434)
1161 +++ gcc/recog.h (working copy)
1162 @@ -50,7 +50,8 @@
1163
1164 /* Nonzero if '&' was found in the constraint string. */
1165 unsigned int earlyclobber:1;
1166 - /* Nonzero if 'm' was found in the constraint string. */
1167 + /* Nonzero if TARGET_MEM_CONSTRAINT was found in the constraint
1168 + string. */
1169 unsigned int memory_ok:1;
1170 /* Nonzero if 'o' was found in the constraint string. */
1171 unsigned int offmem_ok:1;
1172 @@ -142,6 +143,19 @@
1173 }
1174 #endif
1175
1176 +/* Skip chars until the next ',' or the end of the string. This is
1177 + useful to skip alternatives in a constraint string. */
1178 +static inline const char *
1179 +skip_alternative (const char *p)
1180 +{
1181 + const char *r = p;
1182 + while (*r != '\0' && *r != ',')
1183 + r++;
1184 + if (*r == ',')
1185 + r++;
1186 + return r;
1187 +}
1188 +
1189 /* Nonzero means volatile operands are recognized. */
1190 extern int volatile_ok;
1191
1192 @@ -201,6 +215,12 @@
1193 /* The number of alternatives in the constraints for the insn. */
1194 char n_alternatives;
1195
1196 + /* Specifies whether an insn alternative is enabled using the
1197 + `enabled' attribute in the insn pattern definition. For back
1198 + ends not using the `enabled' attribute the array fields are
1199 + always set to `true' in expand_insn. */
1200 + bool alternative_enabled_p [MAX_RECOG_ALTERNATIVES];
1201 +
1202 /* In case we are caching, hold insn data was generated for. */
1203 rtx insn;
1204 };
1205 Index: gcc/genpreds.c
1206 ===================================================================
1207 --- gcc/genpreds.c (revision 141434)
1208 +++ gcc/genpreds.c (working copy)
1209 @@ -690,8 +690,11 @@
1210 for (iter_ = first_constraint; iter_; iter_ = iter_->next_textual)
1211
1212 /* These letters, and all names beginning with them, are reserved for
1213 - generic constraints. */
1214 -static const char generic_constraint_letters[] = "EFVXgimnoprs";
1215 + generic constraints.
1216 + The 'm' constraint is not mentioned here since that constraint
1217 + letter can be overridden by the back end by defining the
1218 + TARGET_MEM_CONSTRAINT macro. */
1219 +static const char generic_constraint_letters[] = "EFVXginoprs";
1220
1221 /* Machine-independent code expects that constraints with these
1222 (initial) letters will allow only (a subset of all) CONST_INTs. */
1223 Index: gcc/regclass.c
1224 ===================================================================
1225 --- gcc/regclass.c (revision 141434)
1226 +++ gcc/regclass.c (working copy)
1227 @@ -1141,8 +1141,9 @@
1228 record_address_regs (GET_MODE (recog_data.operand[i]),
1229 XEXP (recog_data.operand[i], 0),
1230 0, MEM, SCRATCH, frequency * 2);
1231 - else if (constraints[i][0] == 'p'
1232 - || EXTRA_ADDRESS_CONSTRAINT (constraints[i][0], constraints[i]))
1233 + else if (recog_data.alternative_enabled_p[0]
1234 + && (constraints[i][0] == 'p'
1235 + || EXTRA_ADDRESS_CONSTRAINT (constraints[i][0], constraints[i])))
1236 record_address_regs (VOIDmode, recog_data.operand[i], 0, ADDRESS,
1237 SCRATCH, frequency * 2);
1238 }
1239 @@ -1699,7 +1700,7 @@
1240 [(int) base_reg_class (VOIDmode, ADDRESS, SCRATCH)];
1241 break;
1242
1243 - case 'm': case 'o': case 'V':
1244 + case TARGET_MEM_CONSTRAINT: case 'o': case 'V':
1245 /* It doesn't seem worth distinguishing between offsettable
1246 and non-offsettable addresses here. */
1247 allows_mem[i] = 1;
1248 @@ -1930,6 +1931,9 @@
1249 if (alt_fail)
1250 continue;
1251
1252 + if (!recog_data.alternative_enabled_p[alt])
1253 + continue;
1254 +
1255 /* Finally, update the costs with the information we've calculated
1256 about this alternative. */
1257
1258 Index: gcc/config.gcc
1259 ===================================================================
1260 --- gcc/config.gcc (revision 141434)
1261 +++ gcc/config.gcc (working copy)
1262 @@ -3155,7 +3155,7 @@
1263 for which in arch tune; do
1264 eval "val=\$with_$which"
1265 case ${val} in
1266 - "" | g5 | g6 | z900 | z990 | z9-109 | z9-ec)
1267 + "" | g5 | g6 | z900 | z990 | z9-109 | z9-ec | z10)
1268 # OK
1269 ;;
1270 *)
1271 Index: gcc/config/s390/s390.c
1272 ===================================================================
1273 --- gcc/config/s390/s390.c (revision 141434)
1274 +++ gcc/config/s390/s390.c (working copy)
1275 @@ -1,8 +1,9 @@
1276 /* Subroutines used for code generation on IBM S/390 and zSeries
1277 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
1278 - 2007 Free Software Foundation, Inc.
1279 + 2007, 2008 Free Software Foundation, Inc.
1280 Contributed by Hartmut Penner (hpenner@××××××.com) and
1281 - Ulrich Weigand (uweigand@××××××.com).
1282 + Ulrich Weigand (uweigand@××××××.com) and
1283 + Andreas Krebbel (Andreas.Krebbel@××××××.com).
1284
1285 This file is part of GCC.
1286
1287 @@ -188,6 +189,38 @@
1288 COSTS_N_INSNS (24), /* DSGR */
1289 };
1290
1291 +static const
1292 +struct processor_costs z10_cost =
1293 +{
1294 + COSTS_N_INSNS (10), /* M */
1295 + COSTS_N_INSNS (10), /* MGHI */
1296 + COSTS_N_INSNS (10), /* MH */
1297 + COSTS_N_INSNS (10), /* MHI */
1298 + COSTS_N_INSNS (10), /* ML */
1299 + COSTS_N_INSNS (10), /* MR */
1300 + COSTS_N_INSNS (10), /* MS */
1301 + COSTS_N_INSNS (10), /* MSG */
1302 + COSTS_N_INSNS (10), /* MSGF */
1303 + COSTS_N_INSNS (10), /* MSGFR */
1304 + COSTS_N_INSNS (10), /* MSGR */
1305 + COSTS_N_INSNS (10), /* MSR */
1306 + COSTS_N_INSNS (10), /* multiplication in DFmode */
1307 + COSTS_N_INSNS (50), /* MXBR */
1308 + COSTS_N_INSNS (120), /* SQXBR */
1309 + COSTS_N_INSNS (52), /* SQDBR */
1310 + COSTS_N_INSNS (38), /* SQEBR */
1311 + COSTS_N_INSNS (10), /* MADBR */
1312 + COSTS_N_INSNS (10), /* MAEBR */
1313 + COSTS_N_INSNS (111), /* DXBR */
1314 + COSTS_N_INSNS (39), /* DDBR */
1315 + COSTS_N_INSNS (32), /* DEBR */
1316 + COSTS_N_INSNS (160), /* DLGR */
1317 + COSTS_N_INSNS (71), /* DLR */
1318 + COSTS_N_INSNS (71), /* DR */
1319 + COSTS_N_INSNS (71), /* DSGFR */
1320 + COSTS_N_INSNS (71), /* DSGR */
1321 +};
1322 +
1323 extern int reload_completed;
1324
1325 /* Save information from a "cmpxx" operation until the branch or scc is
1326 @@ -1029,6 +1062,41 @@
1327 }
1328 }
1329
1330 +
1331 +/* Return branch condition mask to implement a compare and branch
1332 + specified by CODE. Return -1 for invalid comparisons. */
1333 +
1334 +int
1335 +s390_compare_and_branch_condition_mask (rtx code)
1336 +{
1337 + const int CC0 = 1 << 3;
1338 + const int CC1 = 1 << 2;
1339 + const int CC2 = 1 << 1;
1340 +
1341 + switch (GET_CODE (code))
1342 + {
1343 + case EQ:
1344 + return CC0;
1345 + case NE:
1346 + return CC1 | CC2;
1347 + case LT:
1348 + case LTU:
1349 + return CC1;
1350 + case GT:
1351 + case GTU:
1352 + return CC2;
1353 + case LE:
1354 + case LEU:
1355 + return CC0 | CC1;
1356 + case GE:
1357 + case GEU:
1358 + return CC0 | CC2;
1359 + default:
1360 + gcc_unreachable ();
1361 + }
1362 + return -1;
1363 +}
1364 +
1365 /* If INV is false, return assembler mnemonic string to implement
1366 a branch specified by CODE. If INV is true, return mnemonic
1367 for the corresponding inverted branch. */
1368 @@ -1036,6 +1104,8 @@
1369 static const char *
1370 s390_branch_condition_mnemonic (rtx code, int inv)
1371 {
1372 + int mask;
1373 +
1374 static const char *const mnemonic[16] =
1375 {
1376 NULL, "o", "h", "nle",
1377 @@ -1044,7 +1114,13 @@
1378 "le", "nh", "no", NULL
1379 };
1380
1381 - int mask = s390_branch_condition_mask (code);
1382 + if (GET_CODE (XEXP (code, 0)) == REG
1383 + && REGNO (XEXP (code, 0)) == CC_REGNUM
1384 + && XEXP (code, 1) == const0_rtx)
1385 + mask = s390_branch_condition_mask (code);
1386 + else
1387 + mask = s390_compare_and_branch_condition_mask (code);
1388 +
1389 gcc_assert (mask >= 0);
1390
1391 if (inv)
1392 @@ -1121,6 +1197,67 @@
1393 return part == -1 ? -1 : n_parts - 1 - part;
1394 }
1395
1396 +/* Return true if IN contains a contiguous bitfield in the lower SIZE
1397 + bits and no other bits are set in IN. POS and LENGTH can be used
1398 + to obtain the start position and the length of the bitfield.
1399 +
1400 + POS gives the position of the first bit of the bitfield counting
1401 + from the lowest order bit starting with zero. In order to use this
1402 + value for S/390 instructions this has to be converted to "bits big
1403 + endian" style. */
1404 +
1405 +bool
1406 +s390_contiguous_bitmask_p (unsigned HOST_WIDE_INT in, int size,
1407 + int *pos, int *length)
1408 +{
1409 + int tmp_pos = 0;
1410 + int tmp_length = 0;
1411 + int i;
1412 + unsigned HOST_WIDE_INT mask = 1ULL;
1413 + bool contiguous = false;
1414 +
1415 + for (i = 0; i < size; mask <<= 1, i++)
1416 + {
1417 + if (contiguous)
1418 + {
1419 + if (mask & in)
1420 + tmp_length++;
1421 + else
1422 + break;
1423 + }
1424 + else
1425 + {
1426 + if (mask & in)
1427 + {
1428 + contiguous = true;
1429 + tmp_length++;
1430 + }
1431 + else
1432 + tmp_pos++;
1433 + }
1434 + }
1435 +
1436 + if (!tmp_length)
1437 + return false;
1438 +
1439 + /* Calculate a mask for all bits beyond the contiguous bits. */
1440 + mask = (-1LL & ~(((1ULL << (tmp_length + tmp_pos - 1)) << 1) - 1));
1441 +
1442 + if (mask & in)
1443 + return false;
1444 +
1445 + if (tmp_length + tmp_pos - 1 > size)
1446 + return false;
1447 +
1448 + if (length)
1449 + *length = tmp_length;
1450 +
1451 + if (pos)
1452 + *pos = tmp_pos;
1453 +
1454 + return true;
1455 +}
1456 +
1457 /* Check whether we can (and want to) split a double-word
1458 move in mode MODE from SRC to DST into two single-word
1459 moves, moving the subword FIRST_SUBWORD first. */
1460 @@ -1365,6 +1502,8 @@
1461 | PF_LONG_DISPLACEMENT | PF_EXTIMM},
1462 {"z9-ec", PROCESSOR_2094_Z9_109, PF_IEEE_FLOAT | PF_ZARCH
1463 | PF_LONG_DISPLACEMENT | PF_EXTIMM | PF_DFP },
1464 + {"z10", PROCESSOR_2097_Z10, PF_IEEE_FLOAT | PF_ZARCH
1465 + | PF_LONG_DISPLACEMENT | PF_EXTIMM | PF_DFP | PF_Z10},
1466 };
1467 size_t i;
1468
1469 @@ -1472,13 +1611,21 @@
1470 }
1471
1472 /* Set processor cost function. */
1473 - if (s390_tune == PROCESSOR_2094_Z9_109)
1474 - s390_cost = &z9_109_cost;
1475 - else if (s390_tune == PROCESSOR_2084_Z990)
1476 - s390_cost = &z990_cost;
1477 - else
1478 - s390_cost = &z900_cost;
1479 -
1480 + switch (s390_tune)
1481 + {
1482 + case PROCESSOR_2084_Z990:
1483 + s390_cost = &z990_cost;
1484 + break;
1485 + case PROCESSOR_2094_Z9_109:
1486 + s390_cost = &z9_109_cost;
1487 + break;
1488 + case PROCESSOR_2097_Z10:
1489 + s390_cost = &z10_cost;
1490 + break;
1491 + default:
1492 + s390_cost = &z900_cost;
1493 + }
1494 +
1495 if (TARGET_BACKCHAIN && TARGET_PACKED_STACK && TARGET_HARD_FLOAT)
1496 error ("-mbackchain -mpacked-stack -mhard-float are not supported "
1497 "in combination");
1498 @@ -1992,11 +2139,10 @@
1499 return 0;
1500 if (GET_CODE (op) != MEM)
1501 return 0;
1502 - /* Any invalid address here will be fixed up by reload,
1503 - so accept it for the most generic constraint. */
1504 - if (s390_decompose_address (XEXP (op, 0), &addr)
1505 - && s390_short_displacement (addr.disp))
1506 + if (!s390_decompose_address (XEXP (op, 0), &addr))
1507 return 0;
1508 + if (s390_short_displacement (addr.disp))
1509 + return 0;
1510 break;
1511
1512 case 'U':
1513 @@ -2012,11 +2158,10 @@
1514 case 'W':
1515 if (!TARGET_LONG_DISPLACEMENT)
1516 return 0;
1517 - /* Any invalid address here will be fixed up by reload,
1518 - so accept it for the most generic constraint. */
1519 - if (s390_decompose_address (op, &addr)
1520 - && s390_short_displacement (addr.disp))
1521 + if (!s390_decompose_address (op, &addr))
1522 return 0;
1523 + if (s390_short_displacement (addr.disp))
1524 + return 0;
1525 break;
1526
1527 case 'Y':
1528 @@ -2651,6 +2796,132 @@
1529 return class;
1530 }
1531
1532 +/* Return true if ADDR is of kind symbol_ref or symbol_ref + const_int
1533 + and return these parts in SYMREF and ADDEND. You can pass NULL in
1534 + SYMREF and/or ADDEND if you are not interested in these values. */
1535 +
1536 +static bool
1537 +s390_symref_operand_p (rtx addr, rtx *symref, HOST_WIDE_INT *addend)
1538 +{
1539 + HOST_WIDE_INT tmpaddend = 0;
1540 +
1541 + if (GET_CODE (addr) == CONST)
1542 + addr = XEXP (addr, 0);
1543 +
1544 + if (GET_CODE (addr) == PLUS)
1545 + {
1546 + if (GET_CODE (XEXP (addr, 0)) == SYMBOL_REF
1547 + && CONST_INT_P (XEXP (addr, 1)))
1548 + {
1549 + tmpaddend = INTVAL (XEXP (addr, 1));
1550 + addr = XEXP (addr, 0);
1551 + }
1552 + else
1553 + return false;
1554 + }
1555 + else
1556 + if (GET_CODE (addr) != SYMBOL_REF)
1557 + return false;
1558 +
1559 + if (symref)
1560 + *symref = addr;
1561 + if (addend)
1562 + *addend = tmpaddend;
1563 +
1564 + return true;
1565 +}
1566 +
1567 +/* Return true if ADDR is SYMBOL_REF + addend with addend being a
1568 + multiple of ALIGNMENT and the SYMBOL_REF being naturally
1569 + aligned. */
1570 +
1571 +bool
1572 +s390_check_symref_alignment (rtx addr, HOST_WIDE_INT alignment)
1573 +{
1574 + HOST_WIDE_INT addend;
1575 + rtx symref;
1576 +
1577 + if (!s390_symref_operand_p (addr, &symref, &addend))
1578 + return false;
1579 +
1580 + return (!SYMBOL_REF_NOT_NATURALLY_ALIGNED_P (symref)
1581 + && !(addend & (alignment - 1)));
1582 +}
1583 +
1584 +/* ADDR is moved into REG using larl. If ADDR isn't a valid larl
1585 + operand SCRATCH is used to reload the even part of the address and
1586 + adding one. */
1587 +
1588 +void
1589 +s390_reload_larl_operand (rtx reg, rtx addr, rtx scratch)
1590 +{
1591 + HOST_WIDE_INT addend;
1592 + rtx symref;
1593 +
1594 + if (!s390_symref_operand_p (addr, &symref, &addend))
1595 + gcc_unreachable ();
1596 +
1597 + if (!(addend & 1))
1598 + /* Easy case. The addend is even so larl will do fine. */
1599 + emit_move_insn (reg, addr);
1600 + else
1601 + {
1602 + /* We can leave the scratch register untouched if the target
1603 + register is a valid base register. */
1604 + if (REGNO (reg) < FIRST_PSEUDO_REGISTER
1605 + && REGNO_REG_CLASS (REGNO (reg)) == ADDR_REGS)
1606 + scratch = reg;
1607 +
1608 + gcc_assert (REGNO (scratch) < FIRST_PSEUDO_REGISTER);
1609 + gcc_assert (REGNO_REG_CLASS (REGNO (scratch)) == ADDR_REGS);
1610 +
1611 + if (addend != 1)
1612 + emit_move_insn (scratch,
1613 + gen_rtx_CONST (Pmode,
1614 + gen_rtx_PLUS (Pmode, symref,
1615 + GEN_INT (addend - 1))));
1616 + else
1617 + emit_move_insn (scratch, symref);
1618 +
1619 + /* Increment the address using la in order to avoid clobbering cc. */
1620 + emit_move_insn (reg, gen_rtx_PLUS (Pmode, scratch, const1_rtx));
1621 + }
1622 +}
1623 +
1624 +/* Generate what is necessary to move between REG and MEM using
1625 + SCRATCH. The direction is given by TOMEM. */
1626 +
1627 +void
1628 +s390_reload_symref_address (rtx reg, rtx mem, rtx scratch, bool tomem)
1629 +{
1630 + /* Reload might have pulled a constant out of the literal pool.
1631 + Force it back in. */
1632 + if (CONST_INT_P (mem) || GET_CODE (mem) == CONST_DOUBLE
1633 + || GET_CODE (mem) == CONST)
1634 + mem = force_const_mem (GET_MODE (reg), mem);
1635 +
1636 + gcc_assert (MEM_P (mem));
1637 +
1638 + /* For a load from memory we can leave the scratch register
1639 + untouched if the target register is a valid base register. */
1640 + if (!tomem
1641 + && REGNO (reg) < FIRST_PSEUDO_REGISTER
1642 + && REGNO_REG_CLASS (REGNO (reg)) == ADDR_REGS
1643 + && GET_MODE (reg) == GET_MODE (scratch))
1644 + scratch = reg;
1645 +
1646 + /* Load address into scratch register. Since we can't have a
1647 + secondary reload for a secondary reload we have to cover the case
1648 + where larl would need a secondary reload here as well. */
1649 + s390_reload_larl_operand (scratch, XEXP (mem, 0), scratch);
1650 +
1651 + /* Now we can use a standard load/store to do the move. */
1652 + if (tomem)
1653 + emit_move_insn (replace_equiv_address (mem, scratch), reg);
1654 + else
1655 + emit_move_insn (reg, replace_equiv_address (mem, scratch));
1656 +}
1657 +
1658 /* Inform reload about cases where moving X with a mode MODE to a register in
1659 CLASS requires an extra scratch or immediate register. Return the class
1660 needed for the immediate register. */
1661 @@ -2663,6 +2934,60 @@
1662 if (reg_classes_intersect_p (CC_REGS, class))
1663 return GENERAL_REGS;
1664
1665 + if (TARGET_Z10)
1666 + {
1667 + /* On z10 several optimizer steps may generate larl operands with
1668 + an odd addend. */
1669 + if (in_p
1670 + && s390_symref_operand_p (x, NULL, NULL)
1671 + && mode == Pmode
1672 + && !s390_check_symref_alignment (x, 2))
1673 + sri->icode = ((mode == DImode) ? CODE_FOR_reloaddi_larl_odd_addend_z10
1674 + : CODE_FOR_reloadsi_larl_odd_addend_z10);
1675 +
1676 + /* On z10 we need a scratch register when moving QI, TI or floating
1677 + point mode values from or to a memory location with a SYMBOL_REF
1678 + or if the symref addend of a SI or DI move is not aligned to the
1679 + width of the access. */
1680 + if (MEM_P (x)
1681 + && s390_symref_operand_p (XEXP (x, 0), NULL, NULL)
1682 + && (mode == QImode || mode == TImode || FLOAT_MODE_P (mode)
1683 + || (!TARGET_64BIT && mode == DImode)
1684 + || ((mode == HImode || mode == SImode || mode == DImode)
1685 + && (!s390_check_symref_alignment (XEXP (x, 0),
1686 + GET_MODE_SIZE (mode))))))
1687 + {
1688 +#define __SECONDARY_RELOAD_CASE(M,m) \
1689 + case M##mode: \
1690 + if (TARGET_64BIT) \
1691 + sri->icode = in_p ? CODE_FOR_reload##m##di_toreg_z10 : \
1692 + CODE_FOR_reload##m##di_tomem_z10; \
1693 + else \
1694 + sri->icode = in_p ? CODE_FOR_reload##m##si_toreg_z10 : \
1695 + CODE_FOR_reload##m##si_tomem_z10; \
1696 + break;
1697 +
1698 + switch (GET_MODE (x))
1699 + {
1700 + __SECONDARY_RELOAD_CASE (QI, qi);
1701 + __SECONDARY_RELOAD_CASE (HI, hi);
1702 + __SECONDARY_RELOAD_CASE (SI, si);
1703 + __SECONDARY_RELOAD_CASE (DI, di);
1704 + __SECONDARY_RELOAD_CASE (TI, ti);
1705 + __SECONDARY_RELOAD_CASE (SF, sf);
1706 + __SECONDARY_RELOAD_CASE (DF, df);
1707 + __SECONDARY_RELOAD_CASE (TF, tf);
1708 + __SECONDARY_RELOAD_CASE (SD, sd);
1709 + __SECONDARY_RELOAD_CASE (DD, dd);
1710 + __SECONDARY_RELOAD_CASE (TD, td);
1711 +
1712 + default:
1713 + gcc_unreachable ();
1714 + }
1715 +#undef __SECONDARY_RELOAD_CASE
1716 + }
1717 + }
1718 +
1719 /* We need a scratch register when loading a PLUS expression which
1720 is not a legitimate operand of the LOAD ADDRESS instruction. */
1721 if (in_p && s390_plus_operand (x, mode))
1722 @@ -2769,10 +3094,16 @@
1723 STRICT specifies whether strict register checking applies. */
1724
1725 bool
1726 -legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
1727 - rtx addr, int strict)
1728 +legitimate_address_p (enum machine_mode mode, rtx addr, int strict)
1729 {
1730 struct s390_address ad;
1731 +
1732 + if (TARGET_Z10
1733 + && larl_operand (addr, VOIDmode)
1734 + && (mode == VOIDmode
1735 + || s390_check_symref_alignment (addr, GET_MODE_SIZE (mode))))
1736 + return true;
1737 +
1738 if (!s390_decompose_address (addr, &ad))
1739 return false;
1740
1741 @@ -4010,14 +4341,31 @@
1742 return false;
1743 }
1744
1745 -/* Expand code for the insv template. Return true if successful, false else. */
1746 +/* Expand code for the insv template. Return true if successful. */
1747
1748 -bool
1749 +bool
1750 s390_expand_insv (rtx dest, rtx op1, rtx op2, rtx src)
1751 {
1752 int bitsize = INTVAL (op1);
1753 int bitpos = INTVAL (op2);
1754
1755 + /* On z10 we can use the risbg instruction to implement insv. */
1756 + if (TARGET_Z10
1757 + && ((GET_MODE (dest) == DImode && GET_MODE (src) == DImode)
1758 + || (GET_MODE (dest) == SImode && GET_MODE (src) == SImode)))
1759 + {
1760 + rtx op;
1761 + rtx clobber;
1762 +
1763 + op = gen_rtx_SET (GET_MODE(src),
1764 + gen_rtx_ZERO_EXTRACT (GET_MODE (dest), dest, op1, op2),
1765 + src);
1766 + clobber = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (CCmode, CC_REGNUM));
1767 + emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, op, clobber)));
1768 +
1769 + return true;
1770 + }
1771 +
1772 /* We need byte alignment. */
1773 if (bitsize % BITS_PER_UNIT)
1774 return false;
1775 @@ -4554,6 +4902,13 @@
1776 {
1777 struct s390_address ad;
1778
1779 + if (s390_symref_operand_p (addr, NULL, NULL))
1780 + {
1781 + gcc_assert (TARGET_Z10);
1782 + output_addr_const (file, addr);
1783 + return;
1784 + }
1785 +
1786 if (!s390_decompose_address (addr, &ad)
1787 || (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base)))
1788 || (ad.indx && !REGNO_OK_FOR_INDEX_P (REGNO (ad.indx))))
1789 @@ -4587,6 +4942,7 @@
1790 'Y': print shift count operand.
1791
1792 'b': print integer X as if it's an unsigned byte.
1793 + 'c': print integer X as if it's an signed byte.
1794 'x': print integer X as if it's an unsigned halfword.
1795 'h': print integer X as if it's a signed halfword.
1796 'i': print the first nonzero HImode part of X.
1797 @@ -4732,6 +5088,8 @@
1798 case CONST_INT:
1799 if (code == 'b')
1800 fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) & 0xff);
1801 + else if (code == 'c')
1802 + fprintf (file, HOST_WIDE_INT_PRINT_DEC, ((INTVAL (x) & 0xff) ^ 0x80) - 0x80);
1803 else if (code == 'x')
1804 fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) & 0xffff);
1805 else if (code == 'h')
1806 @@ -4891,6 +5249,7 @@
1807 return 0;
1808 }
1809
1810 +
1811 /* A C statement (sans semicolon) to update the integer scheduling priority
1812 INSN_PRIORITY (INSN). Increase the priority to execute the INSN earlier,
1813 reduce the priority to execute INSN later. Do not define this macro if
1814 @@ -4930,10 +5289,16 @@
1815 static int
1816 s390_issue_rate (void)
1817 {
1818 - if (s390_tune == PROCESSOR_2084_Z990
1819 - || s390_tune == PROCESSOR_2094_Z9_109)
1820 - return 3;
1821 - return 1;
1822 + switch (s390_tune)
1823 + {
1824 + case PROCESSOR_2084_Z990:
1825 + case PROCESSOR_2094_Z9_109:
1826 + return 3;
1827 + case PROCESSOR_2097_Z10:
1828 + return 2;
1829 + default:
1830 + return 1;
1831 + }
1832 }
1833
1834 static int
1835 @@ -8515,11 +8880,30 @@
1836 {
1837 default_encode_section_info (decl, rtl, first);
1838
1839 - /* If a variable has a forced alignment to < 2 bytes, mark it with
1840 - SYMBOL_FLAG_ALIGN1 to prevent it from being used as LARL operand. */
1841 - if (TREE_CODE (decl) == VAR_DECL
1842 - && DECL_USER_ALIGN (decl) && DECL_ALIGN (decl) < 16)
1843 - SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_ALIGN1;
1844 + if (TREE_CODE (decl) == VAR_DECL)
1845 + {
1846 + /* If a variable has a forced alignment to < 2 bytes, mark it
1847 + with SYMBOL_FLAG_ALIGN1 to prevent it from being used as LARL
1848 + operand. */
1849 + if (DECL_USER_ALIGN (decl) && DECL_ALIGN (decl) < 16)
1850 + SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_ALIGN1;
1851 + if (!DECL_SIZE (decl)
1852 + || !DECL_ALIGN (decl)
1853 + || !host_integerp (DECL_SIZE (decl), 0)
1854 + || (DECL_ALIGN (decl) <= 64
1855 + && DECL_ALIGN (decl) != tree_low_cst (DECL_SIZE (decl), 0)))
1856 + SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_NOT_NATURALLY_ALIGNED;
1857 + }
1858 +
1859 + /* Literal pool references don't have a decl so they are handled
1860 + differently here. We rely on the information in the MEM_ALIGN
1861 + entry to decide upon natural alignment. */
1862 + if (MEM_P (rtl)
1863 + && GET_CODE (XEXP (rtl, 0)) == SYMBOL_REF
1864 + && TREE_CONSTANT_POOL_ADDRESS_P (XEXP (rtl, 0))
1865 + && (MEM_ALIGN (rtl) == 0
1866 + || MEM_ALIGN (rtl) < GET_MODE_BITSIZE (GET_MODE (rtl))))
1867 + SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_NOT_NATURALLY_ALIGNED;
1868 }
1869
1870 /* Output thunk to FILE that implements a C++ virtual function call (with
1871 Index: gcc/config/s390/predicates.md
1872 ===================================================================
1873 --- gcc/config/s390/predicates.md (revision 141434)
1874 +++ gcc/config/s390/predicates.md (working copy)
1875 @@ -1,5 +1,5 @@
1876 ;; Predicate definitions for S/390 and zSeries.
1877 -;; Copyright (C) 2005, 2007 Free Software Foundation, Inc.
1878 +;; Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc.
1879 ;; Contributed by Hartmut Penner (hpenner@××××××.com) and
1880 ;; Ulrich Weigand (uweigand@××××××.com).
1881 ;;
1882 @@ -110,7 +110,7 @@
1883 if (GET_CODE (op) == LABEL_REF)
1884 return true;
1885 if (GET_CODE (op) == SYMBOL_REF)
1886 - return ((SYMBOL_REF_FLAGS (op) & SYMBOL_FLAG_ALIGN1) == 0
1887 + return (!SYMBOL_REF_ALIGN1_P (op)
1888 && SYMBOL_REF_TLS_MODEL (op) == 0
1889 && (!flag_pic || SYMBOL_REF_LOCAL_P (op)));
1890
1891 @@ -172,6 +172,18 @@
1892 return (s390_branch_condition_mask (op) >= 0);
1893 })
1894
1895 +(define_predicate "s390_signed_integer_comparison"
1896 + (match_code "eq, ne, lt, gt, le, ge")
1897 +{
1898 + return (s390_compare_and_branch_condition_mask (op) >= 0);
1899 +})
1900 +
1901 +(define_predicate "s390_unsigned_integer_comparison"
1902 + (match_code "eq, ne, ltu, gtu, leu, geu")
1903 +{
1904 + return (s390_compare_and_branch_condition_mask (op) >= 0);
1905 +})
1906 +
1907 ;; Return nonzero if OP is a valid comparison operator
1908 ;; for an ALC condition.
1909
1910 Index: gcc/config/s390/s390.h
1911 ===================================================================
1912 --- gcc/config/s390/s390.h (revision 141434)
1913 +++ gcc/config/s390/s390.h (working copy)
1914 @@ -1,8 +1,9 @@
1915 /* Definitions of target machine for GNU compiler, for IBM S/390
1916 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
1917 - 2007 Free Software Foundation, Inc.
1918 + 2007, 2008 Free Software Foundation, Inc.
1919 Contributed by Hartmut Penner (hpenner@××××××.com) and
1920 Ulrich Weigand (uweigand@××××××.com).
1921 + Andreas Krebbel (Andreas.Krebbel@××××××.com)
1922
1923 This file is part of GCC.
1924
1925 @@ -40,6 +41,7 @@
1926 PROCESSOR_2064_Z900,
1927 PROCESSOR_2084_Z990,
1928 PROCESSOR_2094_Z9_109,
1929 + PROCESSOR_2097_Z10,
1930 PROCESSOR_max
1931 };
1932
1933 @@ -51,7 +53,8 @@
1934 PF_ZARCH = 2,
1935 PF_LONG_DISPLACEMENT = 4,
1936 PF_EXTIMM = 8,
1937 - PF_DFP = 16
1938 + PF_DFP = 16,
1939 + PF_Z10 = 32
1940 };
1941
1942 extern enum processor_type s390_tune;
1943 @@ -60,6 +63,10 @@
1944 extern enum processor_type s390_arch;
1945 extern enum processor_flags s390_arch_flags;
1946
1947 +/* These flags indicate that the generated code should run on a cpu
1948 + providing the respective hardware facility regardless of the
1949 + current cpu mode (ESA or z/Architecture). */
1950 +
1951 #define TARGET_CPU_IEEE_FLOAT \
1952 (s390_arch_flags & PF_IEEE_FLOAT)
1953 #define TARGET_CPU_ZARCH \
1954 @@ -70,13 +77,21 @@
1955 (s390_arch_flags & PF_EXTIMM)
1956 #define TARGET_CPU_DFP \
1957 (s390_arch_flags & PF_DFP)
1958 +#define TARGET_CPU_Z10 \
1959 + (s390_arch_flags & PF_Z10)
1960
1961 +/* These flags indicate that the generated code should run on a cpu
1962 + providing the respective hardware facility when run in
1963 + z/Architecture mode. */
1964 +
1965 #define TARGET_LONG_DISPLACEMENT \
1966 (TARGET_ZARCH && TARGET_CPU_LONG_DISPLACEMENT)
1967 #define TARGET_EXTIMM \
1968 (TARGET_ZARCH && TARGET_CPU_EXTIMM)
1969 #define TARGET_DFP \
1970 - (TARGET_ZARCH && TARGET_CPU_DFP)
1971 + (TARGET_ZARCH && TARGET_CPU_DFP && TARGET_HARD_FLOAT)
1972 +#define TARGET_Z10 \
1973 + (TARGET_ZARCH && TARGET_CPU_Z10)
1974
1975 /* Run-time target specification. */
1976
1977 @@ -485,11 +500,14 @@
1978 #define PREFERRED_RELOAD_CLASS(X, CLASS) \
1979 s390_preferred_reload_class ((X), (CLASS))
1980
1981 -/* We need secondary memory to move data between GPRs and FPRs. */
1982 +/* We need secondary memory to move data between GPRs and FPRs. With
1983 + DFP the ldgr lgdr instructions are available. But these
1984 + instructions do not handle GPR pairs so it is not possible for 31
1985 + bit. */
1986 #define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE) \
1987 ((CLASS1) != (CLASS2) \
1988 && ((CLASS1) == FP_REGS || (CLASS2) == FP_REGS) \
1989 - && (!TARGET_DFP || GET_MODE_SIZE (MODE) != 8))
1990 + && (!TARGET_DFP || !TARGET_64BIT || GET_MODE_SIZE (MODE) != 8))
1991
1992 /* Get_secondary_mem widens its argument to BITS_PER_WORD which loses on 64bit
1993 because the movsi and movsf patterns don't handle r/f moves. */
1994 @@ -688,6 +706,13 @@
1995 /* Maximum number of registers that can appear in a valid memory address. */
1996 #define MAX_REGS_PER_ADDRESS 2
1997
1998 +/* This definition replaces the formerly used 'm' constraint with a
1999 +different constraint letter in order to avoid changing semantics of
2000 +the 'm' constraint when accepting new address formats in
2001 +legitimate_address_p. The constraint letter defined here must not be
2002 +used in insn definitions or inline assemblies. */
2003 +#define TARGET_MEM_CONSTRAINT 'e'
2004 +
2005 /* S/390 has no mode dependent addresses. */
2006 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
2007
2008 @@ -954,7 +979,12 @@
2009 #define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) ((VALUE) = 64, 1)
2010
2011 /* Machine-specific symbol_ref flags. */
2012 -#define SYMBOL_FLAG_ALIGN1 (SYMBOL_FLAG_MACH_DEP << 0)
2013 +#define SYMBOL_FLAG_ALIGN1 (SYMBOL_FLAG_MACH_DEP << 0)
2014 +#define SYMBOL_REF_ALIGN1_P(X) \
2015 + ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_ALIGN1))
2016 +#define SYMBOL_FLAG_NOT_NATURALLY_ALIGNED (SYMBOL_FLAG_MACH_DEP << 1)
2017 +#define SYMBOL_REF_NOT_NATURALLY_ALIGNED_P(X) \
2018 + ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_NOT_NATURALLY_ALIGNED))
2019
2020 /* Check whether integer displacement is in range. */
2021 #define DISP_IN_RANGE(d) \
2022 Index: gcc/config/s390/2084.md
2023 ===================================================================
2024 --- gcc/config/s390/2084.md (revision 141434)
2025 +++ gcc/config/s390/2084.md (working copy)
2026 @@ -243,7 +243,7 @@
2027
2028 (define_insn_reservation "x_itof" 7
2029 (and (eq_attr "cpu" "z990,z9_109")
2030 - (eq_attr "type" "itof"))
2031 + (eq_attr "type" "itoftf,itofdf,itofsf"))
2032 "x_e1_t*3,x-wr-fp")
2033
2034 (define_bypass 1 "x_fsimpdf" "x_fstoredf")
2035 Index: gcc/config/s390/s390.md
2036 ===================================================================
2037 --- gcc/config/s390/s390.md (revision 141434)
2038 +++ gcc/config/s390/s390.md (working copy)
2039 @@ -1,8 +1,9 @@
2040 ;;- Machine description for GNU compiler -- S/390 / zSeries version.
2041 -;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
2042 +;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
2043 ;; Free Software Foundation, Inc.
2044 ;; Contributed by Hartmut Penner (hpenner@××××××.com) and
2045 -;; Ulrich Weigand (uweigand@××××××.com).
2046 +;; Ulrich Weigand (uweigand@××××××.com) and
2047 +;; Andreas Krebbel (Andreas.Krebbel@××××××.com)
2048
2049 ;; This file is part of GCC.
2050
2051 @@ -38,6 +39,7 @@
2052 ;; %Y: print shift count operand.
2053 ;;
2054 ;; %b: print integer X as if it's an unsigned byte.
2055 +;; %c: print integer X as if it's an signed byte.
2056 ;; %x: print integer X as if it's an unsigned halfword.
2057 ;; %h: print integer X as if it's a signed halfword.
2058 ;; %i: print the first nonzero HImode part of X.
2059 @@ -189,7 +191,7 @@
2060 ;; Used to determine defaults for length and other attribute values.
2061
2062 (define_attr "op_type"
2063 - "NN,E,RR,RRE,RX,RS,RSI,RI,SI,S,SS,SSE,RXE,RSE,RIL,RIE,RXY,RSY,SIY,RRF,RRR"
2064 + "NN,E,RR,RRE,RX,RS,RSI,RI,SI,S,SS,SSE,RXE,RSE,RIL,RIE,RXY,RSY,SIY,RRF,RRR,SIL,RRS,RIS"
2065 (const_string "NN"))
2066
2067 ;; Instruction type attribute used for scheduling.
2068 @@ -200,8 +202,12 @@
2069 branch,jsr,fsimptf,fsimpdf,fsimpsf,
2070 floadtf,floaddf,floadsf,fstoredf,fstoresf,
2071 fmultf,fmuldf,fmulsf,fdivtf,fdivdf,fdivsf,
2072 - ftoi,itof,fsqrttf,fsqrtdf,fsqrtsf,
2073 - ftrunctf,ftruncdf,other"
2074 + ftoi,fsqrttf,fsqrtdf,fsqrtsf,
2075 + ftrunctf,ftruncdf, ftruncsd, ftruncdd,
2076 + itoftf, itofdf, itofsf, itofdd, itoftd,
2077 + fdivdd, fdivtd, floaddd, floadsd, fmuldd, fmultd,
2078 + fsimpdd, fsimpsd, fsimptd, fstoredd, fstoresd,
2079 + ftoidfp, other"
2080 (cond [(eq_attr "op_type" "NN") (const_string "other")
2081 (eq_attr "op_type" "SS") (const_string "cs")]
2082 (const_string "integer")))
2083 @@ -215,11 +221,36 @@
2084 (const_string "reg")
2085 (const_string "agen")))
2086
2087 +;; Properties concerning Z10 execution grouping and value forwarding.
2088 +;; z10_super: instruction is superscalar.
2089 +;; z10_super_c: instruction is superscalar and meets the condition of z10_c.
2090 +;; z10_fwd: The instruction reads the value of an operand and stores it into a
2091 +;; target register. It can forward this value to a second instruction that reads
2092 +;; the same register if that second instruction is issued in the same group.
2093 +;; z10_rec: The instruction is in the T pipeline and reads a register. If the
2094 +;; instruction in the S pipe writes to the register, then the T instruction
2095 +;; can immediately read the new value.
2096 +;; z10_fr: union of Z10_fwd and z10_rec.
2097 +;; z10_c: second operand of instruction is a register and read with complemented bits.
2098 +;; z10_cobra: its a compare and branch instruction
2099 +;;
2100 +;; An additional suffix A1, A3, or E1 indicates the respective AGI bypass.
2101 +
2102 +
2103 +(define_attr "z10prop" "none,
2104 + z10_super, z10_super_E1, z10_super_A1, z10_super_c, z10_super_c_E1,
2105 + z10_fwd, z10_fwd_A1, z10_fwd_A3, z10_fwd_E1,
2106 + z10_rec,
2107 + z10_fr, z10_fr_A3, z10_fr_E1,
2108 + z10_c, z10_cobra"
2109 + (const_string "none"))
2110 +
2111 +
2112 ;; Length in bytes.
2113
2114 (define_attr "length" ""
2115 - (cond [(eq_attr "op_type" "E,RR") (const_int 2)
2116 - (eq_attr "op_type" "RX,RI,RRE,RS,RSI,S,SI") (const_int 4)]
2117 + (cond [(eq_attr "op_type" "E,RR") (const_int 2)
2118 + (eq_attr "op_type" "RX,RI,RRE,RS,RSI,S,SI,RRF,RRR") (const_int 4)]
2119 (const_int 6)))
2120
2121
2122 @@ -228,9 +259,41 @@
2123 ;; distinguish between g5 and g6, but there are differences between the two
2124 ;; CPUs could in theory be modeled.
2125
2126 -(define_attr "cpu" "g5,g6,z900,z990,z9_109"
2127 +(define_attr "cpu" "g5,g6,z900,z990,z9_109,z10"
2128 (const (symbol_ref "s390_tune")))
2129
2130 +(define_attr "cpu_facility" "standard,ieee,zarch,longdisp,extimm,dfp,z10"
2131 + (const_string "standard"))
2132 +
2133 +(define_attr "enabled" ""
2134 + (cond [(eq_attr "cpu_facility" "standard")
2135 + (const_int 1)
2136 +
2137 + (and (eq_attr "cpu_facility" "ieee")
2138 + (ne (symbol_ref "TARGET_CPU_IEEE_FLOAT") (const_int 0)))
2139 + (const_int 1)
2140 +
2141 + (and (eq_attr "cpu_facility" "zarch")
2142 + (ne (symbol_ref "TARGET_ZARCH") (const_int 0)))
2143 + (const_int 1)
2144 +
2145 + (and (eq_attr "cpu_facility" "longdisp")
2146 + (ne (symbol_ref "TARGET_LONG_DISPLACEMENT") (const_int 0)))
2147 + (const_int 1)
2148 +
2149 + (and (eq_attr "cpu_facility" "extimm")
2150 + (ne (symbol_ref "TARGET_EXTIMM") (const_int 0)))
2151 + (const_int 1)
2152 +
2153 + (and (eq_attr "cpu_facility" "dfp")
2154 + (ne (symbol_ref "TARGET_DFP") (const_int 0)))
2155 + (const_int 1)
2156 +
2157 + (and (eq_attr "cpu_facility" "z10")
2158 + (ne (symbol_ref "TARGET_Z10") (const_int 0)))
2159 + (const_int 1)]
2160 + (const_int 0)))
2161 +
2162 ;; Pipeline description for z900. For lack of anything better,
2163 ;; this description is also used for the g5 and g6.
2164 (include "2064.md")
2165 @@ -238,6 +301,9 @@
2166 ;; Pipeline description for z990, z9-109 and z9-ec.
2167 (include "2084.md")
2168
2169 +;; Pipeline description for z10
2170 +(include "2097.md")
2171 +
2172 ;; Predicates
2173 (include "predicates.md")
2174
2175 @@ -254,6 +320,7 @@
2176 (define_mode_iterator FP_ALL [TF DF SF (TD "TARGET_HARD_DFP") (DD "TARGET_HARD_DFP")
2177 (SD "TARGET_HARD_DFP")])
2178 (define_mode_iterator FP [TF DF SF (TD "TARGET_HARD_DFP") (DD "TARGET_HARD_DFP")])
2179 +(define_mode_iterator FPALL [TF DF SF TD DD SD])
2180 (define_mode_iterator BFP [TF DF SF])
2181 (define_mode_iterator DFP [TD DD])
2182 (define_mode_iterator DFP_ALL [TD DD SD])
2183 @@ -283,6 +350,7 @@
2184 ;; This mode iterator allows the integer patterns to be defined from the
2185 ;; same template.
2186 (define_mode_iterator INT [(DI "TARGET_64BIT") SI HI QI])
2187 +(define_mode_iterator INTALL [TI DI SI HI QI])
2188
2189 ;; This iterator allows to unify all 'bCOND' expander patterns.
2190 (define_code_iterator COMPARE [eq ne gt gtu lt ltu ge geu le leu unordered
2191 @@ -352,12 +420,6 @@
2192 ;; modes and to an empty string for bfp modes.
2193 (define_mode_attr _d [(TF "") (DF "") (SF "") (TD "d") (DD "d") (SD "d")])
2194
2195 -;; Although it is imprecise for z9-ec we handle all dfp instructions like
2196 -;; bfp regarding the pipeline description.
2197 -(define_mode_attr bfp [(TF "tf") (DF "df") (SF "sf")
2198 - (TD "tf") (DD "df") (SD "sf")])
2199 -
2200 -
2201 ;; In GPR and P templates, a constraint like "<d0>" will expand to "d" in DImode
2202 ;; and "0" in SImode. This allows to combine instructions of which the 31bit
2203 ;; version only operates on one register.
2204 @@ -367,13 +429,13 @@
2205 ;; version only operates on one register. The DImode version needs an additional
2206 ;; register for the assembler output.
2207 (define_mode_attr 1 [(DI "%1,") (SI "")])
2208 -
2209 -;; In SHIFT templates, a string like "s<lr>dl" will expand to "sldl" in
2210 +
2211 +;; In SHIFT templates, a string like "s<lr>dl" will expand to "sldl" in
2212 ;; 'ashift' and "srdl" in 'lshiftrt'.
2213 (define_code_attr lr [(ashift "l") (lshiftrt "r")])
2214
2215 ;; In SHIFT templates, this attribute holds the correct standard name for the
2216 -;; pattern itself and the corresponding function calls.
2217 +;; pattern itself and the corresponding function calls.
2218 (define_code_attr shift [(ashift "ashl") (lshiftrt "lshr")])
2219
2220 ;; This attribute handles differences in the instruction 'type' and will result
2221 @@ -425,7 +487,6 @@
2222 ;; Maximum unsigned integer that fits in MODE.
2223 (define_mode_attr max_uint [(HI "65535") (QI "255")])
2224
2225 -
2226 ;;
2227 ;;- Compare instructions.
2228 ;;
2229 @@ -464,7 +525,8 @@
2230 "@
2231 tm\t%S0,%b1
2232 tmy\t%S0,%b1"
2233 - [(set_attr "op_type" "SI,SIY")])
2234 + [(set_attr "op_type" "SI,SIY")
2235 + (set_attr "z10prop" "z10_super,z10_super")])
2236
2237 (define_insn "*tmdi_reg"
2238 [(set (reg CC_REGNUM)
2239 @@ -480,7 +542,8 @@
2240 tmhl\t%0,%i1
2241 tmlh\t%0,%i1
2242 tmll\t%0,%i1"
2243 - [(set_attr "op_type" "RI")])
2244 + [(set_attr "op_type" "RI")
2245 + (set_attr "z10prop" "z10_super,z10_super,z10_super,z10_super")])
2246
2247 (define_insn "*tmsi_reg"
2248 [(set (reg CC_REGNUM)
2249 @@ -511,19 +574,25 @@
2250
2251 (define_insn "*tstdi_sign"
2252 [(set (reg CC_REGNUM)
2253 - (compare (ashiftrt:DI (ashift:DI (subreg:DI (match_operand:SI 0 "register_operand" "d") 0)
2254 - (const_int 32)) (const_int 32))
2255 - (match_operand:DI 1 "const0_operand" "")))
2256 - (set (match_operand:DI 2 "register_operand" "=d")
2257 + (compare
2258 + (ashiftrt:DI
2259 + (ashift:DI
2260 + (subreg:DI (match_operand:SI 0 "nonimmediate_operand" "d,RT") 0)
2261 + (const_int 32)) (const_int 32))
2262 + (match_operand:DI 1 "const0_operand" "")))
2263 + (set (match_operand:DI 2 "register_operand" "=d,d")
2264 (sign_extend:DI (match_dup 0)))]
2265 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
2266 - "ltgfr\t%2,%0"
2267 - [(set_attr "op_type" "RRE")])
2268 + "ltgfr\t%2,%0
2269 + ltgf\t%2,%0"
2270 + [(set_attr "op_type" "RRE,RXY")
2271 + (set_attr "cpu_facility" "*,z10")
2272 + (set_attr "z10prop" "z10_super_E1,z10_super_E1") ])
2273
2274 ; ltr, lt, ltgr, ltg
2275 (define_insn "*tst<mode>_extimm"
2276 [(set (reg CC_REGNUM)
2277 - (compare (match_operand:GPR 0 "nonimmediate_operand" "d,m")
2278 + (compare (match_operand:GPR 0 "nonimmediate_operand" "d,RT")
2279 (match_operand:GPR 1 "const0_operand" "")))
2280 (set (match_operand:GPR 2 "register_operand" "=d,d")
2281 (match_dup 0))]
2282 @@ -531,19 +600,21 @@
2283 "@
2284 lt<g>r\t%2,%0
2285 lt<g>\t%2,%0"
2286 - [(set_attr "op_type" "RR<E>,RXY")])
2287 + [(set_attr "op_type" "RR<E>,RXY")
2288 + (set_attr "z10prop" "z10_fr_E1,z10_fr_A3") ])
2289
2290 ; ltr, lt, ltgr, ltg
2291 (define_insn "*tst<mode>_cconly_extimm"
2292 [(set (reg CC_REGNUM)
2293 - (compare (match_operand:GPR 0 "nonimmediate_operand" "d,m")
2294 + (compare (match_operand:GPR 0 "nonimmediate_operand" "d,RT")
2295 (match_operand:GPR 1 "const0_operand" "")))
2296 (clobber (match_scratch:GPR 2 "=X,d"))]
2297 "s390_match_ccmode(insn, CCSmode) && TARGET_EXTIMM"
2298 "@
2299 lt<g>r\t%0,%0
2300 lt<g>\t%2,%0"
2301 - [(set_attr "op_type" "RR<E>,RXY")])
2302 + [(set_attr "op_type" "RR<E>,RXY")
2303 + (set_attr "z10prop" "z10_fr_E1,z10_fr_A3")])
2304
2305 (define_insn "*tstdi"
2306 [(set (reg CC_REGNUM)
2307 @@ -553,7 +624,8 @@
2308 (match_dup 0))]
2309 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT && !TARGET_EXTIMM"
2310 "ltgr\t%2,%0"
2311 - [(set_attr "op_type" "RRE")])
2312 + [(set_attr "op_type" "RRE")
2313 + (set_attr "z10prop" "z10_fr_E1")])
2314
2315 (define_insn "*tstsi"
2316 [(set (reg CC_REGNUM)
2317 @@ -566,7 +638,8 @@
2318 ltr\t%2,%0
2319 icm\t%2,15,%S0
2320 icmy\t%2,15,%S0"
2321 - [(set_attr "op_type" "RR,RS,RSY")])
2322 + [(set_attr "op_type" "RR,RS,RSY")
2323 + (set_attr "z10prop" "z10_fr_E1,z10_super_E1,z10_super_E1")])
2324
2325 (define_insn "*tstsi_cconly"
2326 [(set (reg CC_REGNUM)
2327 @@ -578,7 +651,8 @@
2328 ltr\t%0,%0
2329 icm\t%2,15,%S0
2330 icmy\t%2,15,%S0"
2331 - [(set_attr "op_type" "RR,RS,RSY")])
2332 + [(set_attr "op_type" "RR,RS,RSY")
2333 + (set_attr "z10prop" "z10_fr_E1,z10_super_E1,z10_super_E1")])
2334
2335 (define_insn "*tstdi_cconly_31"
2336 [(set (reg CC_REGNUM)
2337 @@ -596,7 +670,8 @@
2338 (match_operand:GPR 1 "const0_operand" "")))]
2339 "s390_match_ccmode(insn, CCSmode)"
2340 "lt<g>r\t%0,%0"
2341 - [(set_attr "op_type" "RR<E>")])
2342 + [(set_attr "op_type" "RR<E>")
2343 + (set_attr "z10prop" "z10_fr_E1")])
2344
2345 ; tst(hi|qi) instruction pattern(s).
2346
2347 @@ -611,7 +686,8 @@
2348 icm\t%2,<icm_lo>,%S0
2349 icmy\t%2,<icm_lo>,%S0
2350 tml\t%0,<max_uint>"
2351 - [(set_attr "op_type" "RS,RSY,RI")])
2352 + [(set_attr "op_type" "RS,RSY,RI")
2353 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super")])
2354
2355 (define_insn "*tsthiCCT_cconly"
2356 [(set (reg CC_REGNUM)
2357 @@ -623,7 +699,8 @@
2358 icm\t%2,3,%S0
2359 icmy\t%2,3,%S0
2360 tml\t%0,65535"
2361 - [(set_attr "op_type" "RS,RSY,RI")])
2362 + [(set_attr "op_type" "RS,RSY,RI")
2363 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super")])
2364
2365 (define_insn "*tstqiCCT_cconly"
2366 [(set (reg CC_REGNUM)
2367 @@ -634,7 +711,8 @@
2368 cli\t%S0,0
2369 cliy\t%S0,0
2370 tml\t%0,255"
2371 - [(set_attr "op_type" "SI,SIY,RI")])
2372 + [(set_attr "op_type" "SI,SIY,RI")
2373 + (set_attr "z10prop" "z10_super,z10_super,*")])
2374
2375 (define_insn "*tst<mode>"
2376 [(set (reg CC_REGNUM)
2377 @@ -646,7 +724,8 @@
2378 "@
2379 icm\t%2,<icm_lo>,%S0
2380 icmy\t%2,<icm_lo>,%S0"
2381 - [(set_attr "op_type" "RS,RSY")])
2382 + [(set_attr "op_type" "RS,RSY")
2383 + (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
2384
2385 (define_insn "*tst<mode>_cconly"
2386 [(set (reg CC_REGNUM)
2387 @@ -657,7 +736,8 @@
2388 "@
2389 icm\t%2,<icm_lo>,%S0
2390 icmy\t%2,<icm_lo>,%S0"
2391 - [(set_attr "op_type" "RS,RSY")])
2392 + [(set_attr "op_type" "RS,RSY")
2393 + (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
2394
2395
2396 ; Compare (equality) instructions
2397 @@ -665,7 +745,7 @@
2398 (define_insn "*cmpdi_cct"
2399 [(set (reg CC_REGNUM)
2400 (compare (match_operand:DI 0 "nonimmediate_operand" "%d,d,d,d,Q")
2401 - (match_operand:DI 1 "general_operand" "d,K,Os,m,BQ")))]
2402 + (match_operand:DI 1 "general_operand" "d,K,Os,RT,BQ")))]
2403 "s390_match_ccmode (insn, CCTmode) && TARGET_64BIT"
2404 "@
2405 cgr\t%0,%1
2406 @@ -673,7 +753,8 @@
2407 cgfi\t%0,%1
2408 cg\t%0,%1
2409 #"
2410 - [(set_attr "op_type" "RRE,RI,RIL,RXY,SS")])
2411 + [(set_attr "op_type" "RRE,RI,RIL,RXY,SS")
2412 + (set_attr "z10prop" "z10_super_c,z10_super,z10_super,z10_super,*")])
2413
2414 (define_insn "*cmpsi_cct"
2415 [(set (reg CC_REGNUM)
2416 @@ -687,97 +768,174 @@
2417 c\t%0,%1
2418 cy\t%0,%1
2419 #"
2420 - [(set_attr "op_type" "RR,RI,RIL,RX,RXY,SS")])
2421 + [(set_attr "op_type" "RR,RI,RIL,RX,RXY,SS")
2422 + (set_attr "z10prop" "z10_super,z10_super,z10_super,z10_super,z10_super,*")])
2423
2424 -
2425 ; Compare (signed) instructions
2426
2427 (define_insn "*cmpdi_ccs_sign"
2428 [(set (reg CC_REGNUM)
2429 - (compare (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m"))
2430 - (match_operand:DI 0 "register_operand" "d,d")))]
2431 + (compare (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand"
2432 + "d,RT,b"))
2433 + (match_operand:DI 0 "register_operand" "d, d,d")))]
2434 "s390_match_ccmode(insn, CCSRmode) && TARGET_64BIT"
2435 "@
2436 cgfr\t%0,%1
2437 - cgf\t%0,%1"
2438 - [(set_attr "op_type" "RRE,RXY")])
2439 + cgf\t%0,%1
2440 + cgfrl\t%0,%1"
2441 + [(set_attr "op_type" "RRE,RXY,RIL")
2442 + (set_attr "z10prop" "z10_c,*,*")
2443 + (set_attr "type" "*,*,larl")])
2444
2445 +
2446 +
2447 (define_insn "*cmpsi_ccs_sign"
2448 [(set (reg CC_REGNUM)
2449 - (compare (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T"))
2450 - (match_operand:SI 0 "register_operand" "d,d")))]
2451 + (compare (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T,b"))
2452 + (match_operand:SI 0 "register_operand" "d,d,d")))]
2453 "s390_match_ccmode(insn, CCSRmode)"
2454 "@
2455 ch\t%0,%1
2456 - chy\t%0,%1"
2457 - [(set_attr "op_type" "RX,RXY")])
2458 + chy\t%0,%1
2459 + chrl\t%0,%1"
2460 + [(set_attr "op_type" "RX,RXY,RIL")
2461 + (set_attr "cpu_facility" "*,*,z10")
2462 + (set_attr "type" "*,*,larl")])
2463
2464 -; cr, chi, cfi, c, cy, cgr, cghi, cgfi, cg
2465 +(define_insn "*cmphi_ccs_z10"
2466 + [(set (reg CC_REGNUM)
2467 + (compare (match_operand:HI 0 "s_operand" "Q")
2468 + (match_operand:HI 1 "immediate_operand" "K")))]
2469 + "s390_match_ccmode(insn, CCSmode) && TARGET_Z10"
2470 + "chhsi\t%0,%1"
2471 + [(set_attr "op_type" "SIL")])
2472 +
2473 +(define_insn "*cmpdi_ccs_signhi_rl"
2474 + [(set (reg CC_REGNUM)
2475 + (compare (sign_extend:DI (match_operand:HI 1 "memory_operand" "RT,b"))
2476 + (match_operand:GPR 0 "register_operand" "d,d")))]
2477 + "s390_match_ccmode(insn, CCSRmode) && TARGET_Z10"
2478 + "@
2479 + cgh\t%0,%1
2480 + cghrl\t%0,%1"
2481 + [(set_attr "op_type" "RXY,RIL")
2482 + (set_attr "type" "*,larl")])
2483 +
2484 +; cr, chi, cfi, c, cy, cgr, cghi, cgfi, cg, chsi, cghsi, crl, cgrl
2485 (define_insn "*cmp<mode>_ccs"
2486 [(set (reg CC_REGNUM)
2487 - (compare (match_operand:GPR 0 "register_operand" "d,d,d,d,d")
2488 - (match_operand:GPR 1 "general_operand" "d,K,Os,R,T")))]
2489 + (compare (match_operand:GPR 0 "nonimmediate_operand"
2490 + "d,d,Q, d,d,d,d")
2491 + (match_operand:GPR 1 "general_operand"
2492 + "d,K,K,Os,R,T,b")))]
2493 "s390_match_ccmode(insn, CCSmode)"
2494 "@
2495 c<g>r\t%0,%1
2496 c<g>hi\t%0,%h1
2497 + c<g>hsi\t%0,%h1
2498 c<g>fi\t%0,%1
2499 c<g>\t%0,%1
2500 - c<y>\t%0,%1"
2501 - [(set_attr "op_type" "RR<E>,RI,RIL,RX<Y>,RXY")])
2502 + c<y>\t%0,%1
2503 + c<g>rl\t%0,%1"
2504 + [(set_attr "op_type" "RR<E>,RI,SIL,RIL,RX<Y>,RXY,RIL")
2505 + (set_attr "cpu_facility" "*,*,z10,extimm,*,*,z10")
2506 + (set_attr "type" "*,*,*,*,*,*,larl")
2507 + (set_attr "z10prop" "z10_super_c,z10_super,z10_super,z10_super,z10_super,z10_super,z10_super")])
2508
2509
2510 ; Compare (unsigned) instructions
2511
2512 +(define_insn "*cmpsi_ccu_zerohi_rlsi"
2513 + [(set (reg CC_REGNUM)
2514 + (compare (zero_extend:SI (mem:HI (match_operand:SI 1
2515 + "larl_operand" "X")))
2516 + (match_operand:SI 0 "register_operand" "d")))]
2517 + "s390_match_ccmode(insn, CCURmode) && TARGET_Z10"
2518 + "clhrl\t%0,%1"
2519 + [(set_attr "op_type" "RIL")
2520 + (set_attr "type" "larl")])
2521 +
2522 +; clhrl, clghrl
2523 +(define_insn "*cmp<GPR:mode>_ccu_zerohi_rldi"
2524 + [(set (reg CC_REGNUM)
2525 + (compare (zero_extend:GPR (mem:HI (match_operand:DI 1
2526 + "larl_operand" "X")))
2527 + (match_operand:GPR 0 "register_operand" "d")))]
2528 + "s390_match_ccmode(insn, CCURmode) && TARGET_Z10"
2529 + "cl<g>hrl\t%0,%1"
2530 + [(set_attr "op_type" "RIL")
2531 + (set_attr "type" "larl")
2532 + (set_attr "z10prop" "z10_super")])
2533 +
2534 (define_insn "*cmpdi_ccu_zero"
2535 [(set (reg CC_REGNUM)
2536 - (compare (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m"))
2537 - (match_operand:DI 0 "register_operand" "d,d")))]
2538 + (compare (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand"
2539 + "d,RT,b"))
2540 + (match_operand:DI 0 "register_operand" "d, d,d")))]
2541 "s390_match_ccmode (insn, CCURmode) && TARGET_64BIT"
2542 "@
2543 clgfr\t%0,%1
2544 - clgf\t%0,%1"
2545 - [(set_attr "op_type" "RRE,RXY")])
2546 + clgf\t%0,%1
2547 + clgfrl\t%0,%1"
2548 + [(set_attr "op_type" "RRE,RXY,RIL")
2549 + (set_attr "cpu_facility" "*,*,z10")
2550 + (set_attr "type" "*,*,larl")
2551 + (set_attr "z10prop" "z10_super_c,z10_super_E1,z10_super")])
2552
2553 (define_insn "*cmpdi_ccu"
2554 [(set (reg CC_REGNUM)
2555 - (compare (match_operand:DI 0 "nonimmediate_operand" "d,d,d,Q,BQ")
2556 - (match_operand:DI 1 "general_operand" "d,Op,m,BQ,Q")))]
2557 + (compare (match_operand:DI 0 "nonimmediate_operand"
2558 + "d, d,d,Q, d, Q,BQ")
2559 + (match_operand:DI 1 "general_operand"
2560 + "d,Op,b,D,RT,BQ,Q")))]
2561 "s390_match_ccmode (insn, CCUmode) && TARGET_64BIT"
2562 "@
2563 clgr\t%0,%1
2564 clgfi\t%0,%1
2565 + clgrl\t%0,%1
2566 + clghsi\t%0,%x1
2567 clg\t%0,%1
2568 #
2569 #"
2570 - [(set_attr "op_type" "RRE,RIL,RXY,SS,SS")])
2571 + [(set_attr "op_type" "RRE,RIL,RIL,SIL,RXY,SS,SS")
2572 + (set_attr "cpu_facility" "*,extimm,z10,z10,*,*,*")
2573 + (set_attr "type" "*,*,larl,*,*,*,*")
2574 + (set_attr "z10prop" "z10_super_c,z10_super,z10_super,z10_super,z10_super,*,*")])
2575
2576 (define_insn "*cmpsi_ccu"
2577 [(set (reg CC_REGNUM)
2578 - (compare (match_operand:SI 0 "nonimmediate_operand" "d,d,d,d,Q,BQ")
2579 - (match_operand:SI 1 "general_operand" "d,Os,R,T,BQ,Q")))]
2580 + (compare (match_operand:SI 0 "nonimmediate_operand" "d, d,d,Q,d,d, Q,BQ")
2581 + (match_operand:SI 1 "general_operand" "d,Os,b,D,R,T,BQ, Q")))]
2582 "s390_match_ccmode (insn, CCUmode)"
2583 "@
2584 clr\t%0,%1
2585 clfi\t%0,%o1
2586 + clrl\t%0,%1
2587 + clfhsi\t%0,%x1
2588 cl\t%0,%1
2589 cly\t%0,%1
2590 #
2591 #"
2592 - [(set_attr "op_type" "RR,RIL,RX,RXY,SS,SS")])
2593 + [(set_attr "op_type" "RR,RIL,RIL,SIL,RX,RXY,SS,SS")
2594 + (set_attr "cpu_facility" "*,extimm,z10,z10,*,*,*,*")
2595 + (set_attr "type" "*,*,larl,*,*,*,*,*")
2596 + (set_attr "z10prop" "z10_super_c,z10_super,z10_super,z10_super,z10_super,z10_super,*,*")])
2597
2598 (define_insn "*cmphi_ccu"
2599 [(set (reg CC_REGNUM)
2600 - (compare (match_operand:HI 0 "nonimmediate_operand" "d,d,Q,BQ")
2601 - (match_operand:HI 1 "general_operand" "Q,S,BQ,Q")))]
2602 + (compare (match_operand:HI 0 "nonimmediate_operand" "d,d,Q,Q,BQ")
2603 + (match_operand:HI 1 "general_operand" "Q,S,D,BQ,Q")))]
2604 "s390_match_ccmode (insn, CCUmode)
2605 && !register_operand (operands[1], HImode)"
2606 "@
2607 clm\t%0,3,%S1
2608 clmy\t%0,3,%S1
2609 + clhhsi\t%0,%1
2610 #
2611 #"
2612 - [(set_attr "op_type" "RS,RSY,SS,SS")])
2613 + [(set_attr "op_type" "RS,RSY,SIL,SS,SS")
2614 + (set_attr "cpu_facility" "*,*,z10,*,*")
2615 + (set_attr "z10prop" "*,*,z10_super,*,*")])
2616
2617 (define_insn "*cmpqi_ccu"
2618 [(set (reg CC_REGNUM)
2619 @@ -792,7 +950,8 @@
2620 cliy\t%S0,%b1
2621 #
2622 #"
2623 - [(set_attr "op_type" "RS,RSY,SI,SIY,SS,SS")])
2624 + [(set_attr "op_type" "RS,RSY,SI,SIY,SS,SS")
2625 + (set_attr "z10prop" "*,*,z10_super,z10_super,*,*")])
2626
2627
2628 ; Block compare (CLC) instruction patterns.
2629 @@ -839,7 +998,7 @@
2630 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT"
2631 "lt<xde><bt>r\t%0,%0"
2632 [(set_attr "op_type" "RRE")
2633 - (set_attr "type" "fsimp<bfp>")])
2634 + (set_attr "type" "fsimp<mode>")])
2635
2636 ; cxtr, cxbr, cdbr, cebr, cxb, cdb, ceb, cxbtr, cdbtr
2637 (define_insn "*cmp<mode>_ccs"
2638 @@ -851,8 +1010,67 @@
2639 c<xde><bt>r\t%0,%1
2640 c<xde>b\t%0,%1"
2641 [(set_attr "op_type" "RRE,RXE")
2642 - (set_attr "type" "fsimp<bfp>")])
2643 + (set_attr "type" "fsimp<mode>")])
2644
2645 +
2646 +; Compare and Branch instructions
2647 +
2648 +; cij, cgij, crj, cgrj, cfi, cgfi, cr, cgr
2649 +; The following instructions do a complementary access of their second
2650 +; operand (z01 only): crj_c, cgrjc, cr, cgr
2651 +(define_insn "*cmp_and_br_signed_<mode>"
2652 + [(set (pc)
2653 + (if_then_else (match_operator 0 "s390_signed_integer_comparison"
2654 + [(match_operand:GPR 1 "register_operand" "d,d")
2655 + (match_operand:GPR 2 "nonmemory_operand" "d,C")])
2656 + (label_ref (match_operand 3 "" ""))
2657 + (pc)))
2658 + (clobber (reg:CC CC_REGNUM))]
2659 + "TARGET_Z10"
2660 +{
2661 + if (get_attr_length (insn) == 6)
2662 + return which_alternative ?
2663 + "c<g>ij%C0\t%1,%c2,%l3" : "c<g>rj%C0\t%1,%2,%l3";
2664 + else
2665 + return which_alternative ?
2666 + "c<g>fi\t%1,%c2\;jg%C0\t%l3" : "c<g>r\t%1,%2\;jg%C0\t%l3";
2667 +}
2668 + [(set_attr "op_type" "RIE")
2669 + (set_attr "type" "branch")
2670 + (set_attr "z10prop" "z10_cobra,z10_super")
2671 + (set (attr "length")
2672 + (if_then_else (lt (abs (minus (pc) (match_dup 3))) (const_int 60000))
2673 + (const_int 6) (const_int 12)))]) ; 8 byte for cr/jg
2674 + ; 10 byte for cgr/jg
2675 +
2676 +; clij, clgij, clrj, clgrj, clfi, clgfi, clr, clgr
2677 +; The following instructions do a complementary access of their second
2678 +; operand (z10 only): clrj, clgrj, clr, clgr
2679 +(define_insn "*cmp_and_br_unsigned_<mode>"
2680 + [(set (pc)
2681 + (if_then_else (match_operator 0 "s390_unsigned_integer_comparison"
2682 + [(match_operand:GPR 1 "register_operand" "d,d")
2683 + (match_operand:GPR 2 "nonmemory_operand" "d,I")])
2684 + (label_ref (match_operand 3 "" ""))
2685 + (pc)))
2686 + (clobber (reg:CC CC_REGNUM))]
2687 + "TARGET_Z10"
2688 +{
2689 + if (get_attr_length (insn) == 6)
2690 + return which_alternative ?
2691 + "cl<g>ij%C0\t%1,%b2,%l3" : "cl<g>rj%C0\t%1,%2,%l3";
2692 + else
2693 + return which_alternative ?
2694 + "cl<g>fi\t%1,%b2\;jg%C0\t%l3" : "cl<g>r\t%1,%2\;jg%C0\t%l3";
2695 +}
2696 + [(set_attr "op_type" "RIE")
2697 + (set_attr "type" "branch")
2698 + (set_attr "z10prop" "z10_cobra,z10_super")
2699 + (set (attr "length")
2700 + (if_then_else (lt (abs (minus (pc) (match_dup 3))) (const_int 60000))
2701 + (const_int 6) (const_int 12)))]) ; 8 byte for clr/jg
2702 + ; 10 byte for clgr/jg
2703 +
2704 ;;
2705 ;;- Move instructions.
2706 ;;
2707 @@ -863,7 +1081,7 @@
2708
2709 (define_insn "movti"
2710 [(set (match_operand:TI 0 "nonimmediate_operand" "=d,QS,d,o,Q")
2711 - (match_operand:TI 1 "general_operand" "QS,d,dPm,d,Q"))]
2712 + (match_operand:TI 1 "general_operand" "QS,d,dPRT,d,Q"))]
2713 "TARGET_64BIT"
2714 "@
2715 lmg\t%0,%N0,%S1
2716 @@ -919,6 +1137,60 @@
2717 ; Patterns used for secondary reloads
2718 ;
2719
2720 +; z10 provides move instructions accepting larl memory operands.
2721 +; Unfortunately there is no such variant for QI, TI and FP mode moves.
2722 +; These patterns are also used for unaligned SI and DI accesses.
2723 +
2724 +(define_expand "reload<INTALL:mode><P:mode>_tomem_z10"
2725 + [(parallel [(match_operand:INTALL 0 "memory_operand" "")
2726 + (match_operand:INTALL 1 "register_operand" "=d")
2727 + (match_operand:P 2 "register_operand" "=&a")])]
2728 + "TARGET_Z10"
2729 +{
2730 + s390_reload_symref_address (operands[1], operands[0], operands[2], 1);
2731 + DONE;
2732 +})
2733 +
2734 +(define_expand "reload<INTALL:mode><P:mode>_toreg_z10"
2735 + [(parallel [(match_operand:INTALL 0 "register_operand" "=d")
2736 + (match_operand:INTALL 1 "memory_operand" "")
2737 + (match_operand:P 2 "register_operand" "=a")])]
2738 + "TARGET_Z10"
2739 +{
2740 + s390_reload_symref_address (operands[0], operands[1], operands[2], 0);
2741 + DONE;
2742 +})
2743 +
2744 +(define_expand "reload<FPALL:mode><P:mode>_tomem_z10"
2745 + [(parallel [(match_operand:FPALL 0 "memory_operand" "")
2746 + (match_operand:FPALL 1 "register_operand" "=d")
2747 + (match_operand:P 2 "register_operand" "=&a")])]
2748 + "TARGET_Z10"
2749 +{
2750 + s390_reload_symref_address (operands[1], operands[0], operands[2], 1);
2751 + DONE;
2752 +})
2753 +
2754 +(define_expand "reload<FPALL:mode><P:mode>_toreg_z10"
2755 + [(parallel [(match_operand:FPALL 0 "register_operand" "=d")
2756 + (match_operand:FPALL 1 "memory_operand" "")
2757 + (match_operand:P 2 "register_operand" "=a")])]
2758 + "TARGET_Z10"
2759 +{
2760 + s390_reload_symref_address (operands[0], operands[1], operands[2], 0);
2761 + DONE;
2762 +})
2763 +
2764 +(define_expand "reload<P:mode>_larl_odd_addend_z10"
2765 + [(parallel [(match_operand:P 0 "register_operand" "=d")
2766 + (match_operand:P 1 "larl_operand" "")
2767 + (match_operand:P 2 "register_operand" "=a")])]
2768 + "TARGET_Z10"
2769 +{
2770 + s390_reload_larl_operand (operands[0], operands[1], operands[2]);
2771 + DONE;
2772 +})
2773 +
2774 ; Handles loading a PLUS (load address) expression
2775
2776 (define_expand "reload<mode>_plus"
2777 @@ -984,16 +1256,17 @@
2778 && !FP_REG_P (operands[0])"
2779 "larl\t%0,%1"
2780 [(set_attr "op_type" "RIL")
2781 - (set_attr "type" "larl")])
2782 + (set_attr "type" "larl")
2783 + (set_attr "z10prop" "z10_super_A1")])
2784
2785 -(define_insn "*movdi_64dfp"
2786 +(define_insn "*movdi_64"
2787 [(set (match_operand:DI 0 "nonimmediate_operand"
2788 - "=d,d,d,d,d,d,d,d,f,d,d,d,d,
2789 - m,!*f,!*f,!*f,!R,!T,d,t,Q,t,?Q")
2790 + "=d,d,d,d,d,d,d,d,f,d,d,d,d,d,
2791 + RT,!*f,!*f,!*f,!R,!T,b,Q,d,t,Q,t,?Q")
2792 (match_operand:DI 1 "general_operand"
2793 - "K,N0HD0,N1HD0,N2HD0,N3HD0,Os,N0SD0,N1SD0,d,f,L,d,m,
2794 - d,*f,R,T,*f,*f,t,d,t,Q,?Q"))]
2795 - "TARGET_64BIT && TARGET_DFP"
2796 + "K,N0HD0,N1HD0,N2HD0,N3HD0,Os,N0SD0,N1SD0,d,f,L,b,d,RT,
2797 + d,*f,R,T,*f,*f,d,K,t,d,t,Q,?Q"))]
2798 + "TARGET_64BIT"
2799 "@
2800 lghi\t%0,%h1
2801 llihh\t%0,%i1
2802 @@ -1006,6 +1279,7 @@
2803 ldgr\t%0,%1
2804 lgdr\t%0,%1
2805 lay\t%0,%a1
2806 + lgrl\t%0,%1
2807 lgr\t%0,%1
2808 lg\t%0,%1
2809 stg\t%1,%0
2810 @@ -1014,81 +1288,50 @@
2811 ldy\t%0,%1
2812 std\t%1,%0
2813 stdy\t%1,%0
2814 + stgrl\t%1,%0
2815 + mvghi\t%0,%1
2816 #
2817 #
2818 stam\t%1,%N1,%S0
2819 lam\t%0,%N0,%S1
2820 #"
2821 - [(set_attr "op_type" "RI,RI,RI,RI,RI,RIL,RIL,RIL,RRE,RRE,RXY,RRE,RXY,RXY,
2822 - RR,RX,RXY,RX,RXY,*,*,RS,RS,SS")
2823 - (set_attr "type" "*,*,*,*,*,*,*,*,floaddf,floaddf,la,lr,load,store,
2824 - floaddf,floaddf,floaddf,fstoredf,fstoredf,*,*,*,*,*")])
2825 + [(set_attr "op_type" "RI,RI,RI,RI,RI,RIL,RIL,RIL,RRE,RRE,RXY,RIL,RRE,RXY,
2826 + RXY,RR,RX,RXY,RX,RXY,RIL,SIL,*,*,RS,RS,SS")
2827 + (set_attr "type" "*,*,*,*,*,*,*,*,floaddf,floaddf,la,larl,lr,load,store,
2828 + floaddf,floaddf,floaddf,fstoredf,fstoredf,larl,*,*,*,
2829 + *,*,*")
2830 + (set_attr "cpu_facility" "*,*,*,*,*,extimm,extimm,extimm,dfp,dfp,longdisp,
2831 + z10,*,*,*,*,*,longdisp,*,longdisp,
2832 + z10,z10,*,*,*,*,*")
2833 + (set_attr "z10prop" "z10_fwd_A1,
2834 + z10_fwd_E1,
2835 + z10_fwd_E1,
2836 + z10_fwd_E1,
2837 + z10_fwd_E1,
2838 + z10_fwd_A1,
2839 + z10_fwd_E1,
2840 + z10_fwd_E1,
2841 + *,
2842 + *,
2843 + z10_fwd_A1,
2844 + z10_fwd_A3,
2845 + z10_fr_E1,
2846 + z10_fwd_A3,
2847 + z10_rec,
2848 + *,
2849 + *,
2850 + *,
2851 + *,
2852 + *,
2853 + z10_rec,
2854 + z10_super,
2855 + *,
2856 + *,
2857 + *,
2858 + *,
2859 + *")
2860 +])
2861
2862 -(define_insn "*movdi_64extimm"
2863 - [(set (match_operand:DI 0 "nonimmediate_operand"
2864 - "=d,d,d,d,d,d,d,d,d,d,d,m,!*f,!*f,!*f,!R,!T,d,t,Q,t,?Q")
2865 - (match_operand:DI 1 "general_operand"
2866 - "K,N0HD0,N1HD0,N2HD0,N3HD0,Os,N0SD0,N1SD0,L,d,m,d,*f,R,T,*f,*f,t,d,t,Q,?Q"))]
2867 - "TARGET_64BIT && TARGET_EXTIMM"
2868 - "@
2869 - lghi\t%0,%h1
2870 - llihh\t%0,%i1
2871 - llihl\t%0,%i1
2872 - llilh\t%0,%i1
2873 - llill\t%0,%i1
2874 - lgfi\t%0,%1
2875 - llihf\t%0,%k1
2876 - llilf\t%0,%k1
2877 - lay\t%0,%a1
2878 - lgr\t%0,%1
2879 - lg\t%0,%1
2880 - stg\t%1,%0
2881 - ldr\t%0,%1
2882 - ld\t%0,%1
2883 - ldy\t%0,%1
2884 - std\t%1,%0
2885 - stdy\t%1,%0
2886 - #
2887 - #
2888 - stam\t%1,%N1,%S0
2889 - lam\t%0,%N0,%S1
2890 - #"
2891 - [(set_attr "op_type" "RI,RI,RI,RI,RI,RIL,RIL,RIL,RXY,RRE,RXY,RXY,
2892 - RR,RX,RXY,RX,RXY,*,*,RS,RS,SS")
2893 - (set_attr "type" "*,*,*,*,*,*,*,*,la,lr,load,store,
2894 - floaddf,floaddf,floaddf,fstoredf,fstoredf,*,*,*,*,*")])
2895 -
2896 -(define_insn "*movdi_64"
2897 - [(set (match_operand:DI 0 "nonimmediate_operand"
2898 - "=d,d,d,d,d,d,d,d,m,!*f,!*f,!*f,!R,!T,d,t,Q,t,?Q")
2899 - (match_operand:DI 1 "general_operand"
2900 - "K,N0HD0,N1HD0,N2HD0,N3HD0,L,d,m,d,*f,R,T,*f,*f,t,d,t,Q,?Q"))]
2901 - "TARGET_64BIT && !TARGET_EXTIMM"
2902 - "@
2903 - lghi\t%0,%h1
2904 - llihh\t%0,%i1
2905 - llihl\t%0,%i1
2906 - llilh\t%0,%i1
2907 - llill\t%0,%i1
2908 - lay\t%0,%a1
2909 - lgr\t%0,%1
2910 - lg\t%0,%1
2911 - stg\t%1,%0
2912 - ldr\t%0,%1
2913 - ld\t%0,%1
2914 - ldy\t%0,%1
2915 - std\t%1,%0
2916 - stdy\t%1,%0
2917 - #
2918 - #
2919 - stam\t%1,%N1,%S0
2920 - lam\t%0,%N0,%S1
2921 - #"
2922 - [(set_attr "op_type" "RI,RI,RI,RI,RI,RXY,RRE,RXY,RXY,
2923 - RR,RX,RXY,RX,RXY,*,*,RS,RS,SS")
2924 - (set_attr "type" "*,*,*,*,*,la,lr,load,store,
2925 - floaddf,floaddf,floaddf,fstoredf,fstoredf,*,*,*,*,*")])
2926 -
2927 (define_split
2928 [(set (match_operand:DI 0 "register_operand" "")
2929 (match_operand:DI 1 "register_operand" ""))]
2930 @@ -1123,8 +1366,10 @@
2931 s390_split_access_reg (operands[0], &operands[3], &operands[4]);")
2932
2933 (define_insn "*movdi_31"
2934 - [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,Q,S,d,o,!*f,!*f,!*f,!R,!T,Q")
2935 - (match_operand:DI 1 "general_operand" "Q,S,d,d,dPm,d,*f,R,T,*f,*f,Q"))]
2936 + [(set (match_operand:DI 0 "nonimmediate_operand"
2937 + "=d,d,Q,S,d ,o,!*f,!*f,!*f,!R,!T,Q,d")
2938 + (match_operand:DI 1 "general_operand"
2939 + " Q,S,d,d,dPRT,d, *f, R, T,*f,*f,Q,b"))]
2940 "!TARGET_64BIT"
2941 "@
2942 lm\t%0,%N0,%S1
2943 @@ -1138,11 +1383,28 @@
2944 ldy\t%0,%1
2945 std\t%1,%0
2946 stdy\t%1,%0
2947 + #
2948 #"
2949 - [(set_attr "op_type" "RS,RSY,RS,RSY,*,*,RR,RX,RXY,RX,RXY,SS")
2950 - (set_attr "type" "lm,lm,stm,stm,*,*,floaddf,floaddf,floaddf,fstoredf,fstoredf,*")])
2951 + [(set_attr "op_type" "RS,RSY,RS,RSY,*,*,RR,RX,RXY,RX,RXY,SS,*")
2952 + (set_attr "type" "lm,lm,stm,stm,*,*,floaddf,floaddf,floaddf,fstoredf,fstoredf,*,*")
2953 + (set_attr "cpu_facility" "*,*,*,*,*,*,*,*,*,*,*,*,z10")])
2954
2955 +; For a load from a symbol ref we can use one of the target registers
2956 +; together with larl to load the address.
2957 (define_split
2958 + [(set (match_operand:DI 0 "register_operand" "")
2959 + (match_operand:DI 1 "memory_operand" ""))]
2960 + "!TARGET_64BIT && reload_completed && TARGET_Z10
2961 + && larl_operand (XEXP (operands[1], 0), SImode)"
2962 + [(set (match_dup 2) (match_dup 3))
2963 + (set (match_dup 0) (match_dup 1))]
2964 +{
2965 + operands[2] = operand_subword (operands[0], 1, 0, DImode);
2966 + operands[3] = XEXP (operands[1], 0);
2967 + operands[1] = replace_equiv_address (operands[1], operands[2]);
2968 +})
2969 +
2970 +(define_split
2971 [(set (match_operand:DI 0 "nonimmediate_operand" "")
2972 (match_operand:DI 1 "general_operand" ""))]
2973 "!TARGET_64BIT && reload_completed
2974 @@ -1203,7 +1465,8 @@
2975 la\t%0,%a1
2976 lay\t%0,%a1"
2977 [(set_attr "op_type" "RX,RXY")
2978 - (set_attr "type" "la")])
2979 + (set_attr "type" "la")
2980 + (set_attr "z10prop" "z10_fwd_A1,z10_fwd_A1")])
2981
2982 (define_peephole2
2983 [(parallel
2984 @@ -1254,13 +1517,14 @@
2985 && !FP_REG_P (operands[0])"
2986 "larl\t%0,%1"
2987 [(set_attr "op_type" "RIL")
2988 - (set_attr "type" "larl")])
2989 + (set_attr "type" "larl")
2990 + (set_attr "z10prop" "z10_super_A1")])
2991
2992 (define_insn "*movsi_zarch"
2993 [(set (match_operand:SI 0 "nonimmediate_operand"
2994 - "=d,d,d,d,d,d,d,d,R,T,!*f,!*f,!*f,!R,!T,d,t,Q,t,?Q")
2995 + "=d,d,d,d,d,d,d,d,d,R,T,!*f,!*f,!*f,!R,!T,d,t,Q,b,Q,t,?Q")
2996 (match_operand:SI 1 "general_operand"
2997 - "K,N0HS0,N1HS0,Os,L,d,R,T,d,d,*f,R,T,*f,*f,t,d,t,Q,?Q"))]
2998 + "K,N0HS0,N1HS0,Os,L,b,d,R,T,d,d,*f,R,T,*f,*f,t,d,t,d,K,Q,?Q"))]
2999 "TARGET_ZARCH"
3000 "@
3001 lhi\t%0,%h1
3002 @@ -1268,6 +1532,7 @@
3003 llill\t%0,%i1
3004 iilf\t%0,%o1
3005 lay\t%0,%a1
3006 + lrl\t%0,%1
3007 lr\t%0,%1
3008 l\t%0,%1
3009 ly\t%0,%1
3010 @@ -1281,12 +1546,60 @@
3011 ear\t%0,%1
3012 sar\t%0,%1
3013 stam\t%1,%1,%S0
3014 + strl\t%1,%0
3015 + mvhi\t%0,%1
3016 lam\t%0,%0,%S1
3017 #"
3018 - [(set_attr "op_type" "RI,RI,RI,RIL,RXY,RR,RX,RXY,RX,RXY,
3019 - RR,RX,RXY,RX,RXY,RRE,RRE,RS,RS,SS")
3020 - (set_attr "type" "*,*,*,*,la,lr,load,load,store,store,
3021 - floadsf,floadsf,floadsf,fstoresf,fstoresf,*,*,*,*,*")])
3022 + [(set_attr "op_type" "RI,RI,RI,RIL,RXY,RIL,RR,RX,RXY,RX,RXY,
3023 + RR,RX,RXY,RX,RXY,RRE,RRE,RS,RIL,SIL,RS,SS")
3024 + (set_attr "type" "*,
3025 + *,
3026 + *,
3027 + *,
3028 + la,
3029 + larl,
3030 + lr,
3031 + load,
3032 + load,
3033 + store,
3034 + store,
3035 + floadsf,
3036 + floadsf,
3037 + floadsf,
3038 + fstoresf,
3039 + fstoresf,
3040 + *,
3041 + *,
3042 + *,
3043 + larl,
3044 + *,
3045 + *,
3046 + *")
3047 + (set_attr "cpu_facility" "*,*,*,extimm,longdisp,z10,*,*,longdisp,*,longdisp,
3048 + *,*,longdisp,*,longdisp,*,*,*,z10,z10,*,*")
3049 + (set_attr "z10prop" "z10_fwd_A1,
3050 + z10_fwd_E1,
3051 + z10_fwd_E1,
3052 + z10_fwd_A1,
3053 + z10_fwd_A1,
3054 + z10_fwd_A3,
3055 + z10_fr_E1,
3056 + z10_fwd_A3,
3057 + z10_fwd_A3,
3058 + z10_super,
3059 + z10_rec,
3060 + *,
3061 + *,
3062 + *,
3063 + *,
3064 + *,
3065 + z10_super_E1,
3066 + z10_super,
3067 + *,
3068 + z10_rec,
3069 + z10_super,
3070 + *,
3071 + *")])
3072
3073 (define_insn "*movsi_esa"
3074 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,R,!*f,!*f,!R,d,t,Q,t,?Q")
3075 @@ -1306,7 +1619,20 @@
3076 lam\t%0,%0,%S1
3077 #"
3078 [(set_attr "op_type" "RI,RR,RX,RX,RR,RX,RX,RRE,RRE,RS,RS,SS")
3079 - (set_attr "type" "*,lr,load,store,floadsf,floadsf,fstoresf,*,*,*,*,*")])
3080 + (set_attr "type" "*,lr,load,store,floadsf,floadsf,fstoresf,*,*,*,*,*")
3081 + (set_attr "z10prop" "z10_fwd_A1,
3082 + z10_fr_E1,
3083 + z10_fwd_A3,
3084 + z10_super,
3085 + *,
3086 + *,
3087 + *,
3088 + z10_super_E1,
3089 + z10_super,
3090 + *,
3091 + *,
3092 + *")
3093 +])
3094
3095 (define_peephole2
3096 [(set (match_operand:SI 0 "register_operand" "")
3097 @@ -1327,7 +1653,8 @@
3098 la\t%0,%a1
3099 lay\t%0,%a1"
3100 [(set_attr "op_type" "RX,RXY")
3101 - (set_attr "type" "la")])
3102 + (set_attr "type" "la")
3103 + (set_attr "z10prop" "z10_fwd_A1,z10_fwd_A1")])
3104
3105 (define_peephole2
3106 [(parallel
3107 @@ -1362,7 +1689,8 @@
3108 la\t%0,%a1
3109 lay\t%0,%a1"
3110 [(set_attr "op_type" "RX,RXY")
3111 - (set_attr "type" "la")])
3112 + (set_attr "type" "la")
3113 + (set_attr "z10prop" "z10_fwd_A1,z10_fwd_A1")])
3114
3115 (define_insn_and_split "*la_31_and_cc"
3116 [(set (match_operand:SI 0 "register_operand" "=d")
3117 @@ -1387,7 +1715,8 @@
3118 la\t%0,%a1
3119 lay\t%0,%a1"
3120 [(set_attr "op_type" "RX")
3121 - (set_attr "type" "la")])
3122 + (set_attr "type" "la")
3123 + (set_attr "z10prop" "z10_fwd_A1,z10_fwd_A1")])
3124
3125 ;
3126 ; movhi instruction pattern(s).
3127 @@ -1412,19 +1741,33 @@
3128 })
3129
3130 (define_insn "*movhi"
3131 - [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,R,T,?Q")
3132 - (match_operand:HI 1 "general_operand" "d,n,R,T,d,d,?Q"))]
3133 + [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,d,R,T,b,Q,?Q")
3134 + (match_operand:HI 1 "general_operand" " d,n,R,T,b,d,d,d,K,?Q"))]
3135 ""
3136 "@
3137 lr\t%0,%1
3138 lhi\t%0,%h1
3139 lh\t%0,%1
3140 lhy\t%0,%1
3141 + lhrl\t%0,%1
3142 sth\t%1,%0
3143 sthy\t%1,%0
3144 + sthrl\t%1,%0
3145 + mvhhi\t%0,%1
3146 #"
3147 - [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SS")
3148 - (set_attr "type" "lr,*,*,*,store,store,*")])
3149 + [(set_attr "op_type" "RR,RI,RX,RXY,RIL,RX,RXY,RIL,SIL,SS")
3150 + (set_attr "type" "lr,*,*,*,larl,store,store,store,*,*")
3151 + (set_attr "cpu_facility" "*,*,*,*,z10,*,*,z10,z10,*")
3152 + (set_attr "z10prop" "z10_fr_E1,
3153 + z10_fwd_A1,
3154 + z10_super_E1,
3155 + z10_super_E1,
3156 + z10_super_E1,
3157 + z10_super,
3158 + z10_rec,
3159 + z10_rec,
3160 + z10_super,
3161 + *")])
3162
3163 (define_peephole2
3164 [(set (match_operand:HI 0 "register_operand" "")
3165 @@ -1473,7 +1816,16 @@
3166 mviy\t%S0,%b1
3167 #"
3168 [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SI,SIY,SS")
3169 - (set_attr "type" "lr,*,*,*,store,store,store,store,*")])
3170 + (set_attr "type" "lr,*,*,*,store,store,store,store,*")
3171 + (set_attr "z10prop" "z10_fr_E1,
3172 + z10_fwd_A1,
3173 + z10_super_E1,
3174 + z10_super_E1,
3175 + z10_super,
3176 + z10_rec,
3177 + z10_super,
3178 + z10_super,
3179 + *")])
3180
3181 (define_peephole2
3182 [(set (match_operand:QI 0 "nonimmediate_operand" "")
3183 @@ -1496,7 +1848,8 @@
3184 "@
3185 ic\t%0,%1
3186 icy\t%0,%1"
3187 - [(set_attr "op_type" "RX,RXY")])
3188 + [(set_attr "op_type" "RX,RXY")
3189 + (set_attr "z10prop" "z10_super_E1,z10_super")])
3190
3191 ;
3192 ; movstricthi instruction pattern(s).
3193 @@ -1510,7 +1863,8 @@
3194 "@
3195 icm\t%0,3,%S1
3196 icmy\t%0,3,%S1"
3197 - [(set_attr "op_type" "RS,RSY")])
3198 + [(set_attr "op_type" "RS,RSY")
3199 + (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
3200
3201 ;
3202 ; movstrictsi instruction pattern(s).
3203 @@ -1526,7 +1880,8 @@
3204 ly\t%0,%1
3205 ear\t%0,%1"
3206 [(set_attr "op_type" "RR,RX,RXY,RRE")
3207 - (set_attr "type" "lr,load,load,*")])
3208 + (set_attr "type" "lr,load,load,*")
3209 + (set_attr "z10prop" "z10_fr_E1,z10_fwd_A3,z10_fwd_A3,z10_super_E1")])
3210
3211 ;
3212 ; mov(tf|td) instruction pattern(s).
3213 @@ -1540,7 +1895,7 @@
3214
3215 (define_insn "*mov<mode>_64"
3216 [(set (match_operand:TD_TF 0 "nonimmediate_operand" "=f,f,f,o, d,QS, d,o,Q")
3217 - (match_operand:TD_TF 1 "general_operand" " G,f,o,f,QS, d,dm,d,Q"))]
3218 + (match_operand:TD_TF 1 "general_operand" " G,f,o,f,QS, d,dRT,d,Q"))]
3219 "TARGET_64BIT"
3220 "@
3221 lzxr\t%0
3222 @@ -1616,7 +1971,7 @@
3223 (define_split
3224 [(set (match_operand:TD_TF 0 "register_operand" "")
3225 (match_operand:TD_TF 1 "memory_operand" ""))]
3226 - "reload_completed && offsettable_memref_p (operands[1])
3227 + "reload_completed && offsettable_memref_p (operands[1])
3228 && FP_REG_P (operands[0])"
3229 [(set (match_dup 2) (match_dup 4))
3230 (set (match_dup 3) (match_dup 5))]
3231 @@ -1657,9 +2012,9 @@
3232
3233 (define_insn "*mov<mode>_64dfp"
3234 [(set (match_operand:DD_DF 0 "nonimmediate_operand"
3235 - "=f,f,f,d,f,f,R,T,d,d,m,?Q")
3236 + "=f,f,f,d,f,f,R,T,d,d,RT,?Q")
3237 (match_operand:DD_DF 1 "general_operand"
3238 - "G,f,d,f,R,T,f,f,d,m,d,?Q"))]
3239 + "G,f,d,f,R,T,f,f,d,RT,d,?Q"))]
3240 "TARGET_64BIT && TARGET_DFP"
3241 "@
3242 lzdr\t%0
3243 @@ -1676,11 +2031,24 @@
3244 #"
3245 [(set_attr "op_type" "RRE,RR,RRE,RRE,RX,RXY,RX,RXY,RRE,RXY,RXY,SS")
3246 (set_attr "type" "fsimpdf,floaddf,floaddf,floaddf,floaddf,floaddf,
3247 - fstoredf,fstoredf,lr,load,store,*")])
3248 + fstoredf,fstoredf,lr,load,store,*")
3249 + (set_attr "z10prop" "*,
3250 + *,
3251 + *,
3252 + *,
3253 + *,
3254 + *,
3255 + *,
3256 + *,
3257 + z10_fr_E1,
3258 + z10_fwd_A3,
3259 + z10_rec,
3260 + *")
3261 +])
3262
3263 (define_insn "*mov<mode>_64"
3264 - [(set (match_operand:DD_DF 0 "nonimmediate_operand" "=f,f,f,f,R,T,d,d,m,?Q")
3265 - (match_operand:DD_DF 1 "general_operand" "G,f,R,T,f,f,d,m,d,?Q"))]
3266 + [(set (match_operand:DD_DF 0 "nonimmediate_operand" "=f,f,f,f,R,T,d, d,RT,?Q")
3267 + (match_operand:DD_DF 1 "general_operand" "G,f,R,T,f,f,d,RT, d,?Q"))]
3268 "TARGET_64BIT"
3269 "@
3270 lzdr\t%0
3271 @@ -1694,14 +2062,24 @@
3272 stg\t%1,%0
3273 #"
3274 [(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RRE,RXY,RXY,SS")
3275 - (set_attr "type" "fsimp<bfp>,fload<bfp>,fload<bfp>,fload<bfp>,
3276 - fstore<bfp>,fstore<bfp>,lr,load,store,*")])
3277 + (set_attr "type" "fsimp<mode>,fload<mode>,fload<mode>,fload<mode>,
3278 + fstore<mode>,fstore<mode>,lr,load,store,*")
3279 + (set_attr "z10prop" "*,
3280 + *,
3281 + *,
3282 + *,
3283 + *,
3284 + *,
3285 + z10_fr_E1,
3286 + z10_fwd_A3,
3287 + z10_rec,
3288 + *")])
3289
3290 (define_insn "*mov<mode>_31"
3291 [(set (match_operand:DD_DF 0 "nonimmediate_operand"
3292 - "=f,f,f,f,R,T,d,d,Q,S, d,o,Q")
3293 + "=f,f,f,f,R,T,d,d,Q,S, d,o,Q")
3294 (match_operand:DD_DF 1 "general_operand"
3295 - " G,f,R,T,f,f,Q,S,d,d,dPm,d,Q"))]
3296 + " G,f,R,T,f,f,Q,S,d,d,dPRT,d,Q"))]
3297 "!TARGET_64BIT"
3298 "@
3299 lzdr\t%0
3300 @@ -1718,8 +2096,8 @@
3301 #
3302 #"
3303 [(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RS,RSY,RS,RSY,*,*,SS")
3304 - (set_attr "type" "fsimp<bfp>,fload<bfp>,fload<bfp>,fload<bfp>,
3305 - fstore<bfp>,fstore<bfp>,lm,lm,stm,stm,*,*,*")])
3306 + (set_attr "type" "fsimp<mode>,fload<mode>,fload<mode>,fload<mode>,
3307 + fstore<mode>,fstore<mode>,lm,lm,stm,stm,*,*,*")])
3308
3309 (define_split
3310 [(set (match_operand:DD_DF 0 "nonimmediate_operand" "")
3311 @@ -1786,8 +2164,20 @@
3312 sty\t%1,%0
3313 #"
3314 [(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS")
3315 - (set_attr "type" "fsimp<bfp>,fload<bfp>,fload<bfp>,fload<bfp>,
3316 - fstore<bfp>,fstore<bfp>,lr,load,load,store,store,*")])
3317 + (set_attr "type" "fsimp<mode>,fload<mode>,fload<mode>,fload<mode>,
3318 + fstore<mode>,fstore<mode>,lr,load,load,store,store,*")
3319 + (set_attr "z10prop" "*,
3320 + *,
3321 + *,
3322 + *,
3323 + *,
3324 + *,
3325 + z10_fr_E1,
3326 + z10_fwd_A3,
3327 + z10_fwd_A3,
3328 + z10_super,
3329 + z10_rec,
3330 + *")])
3331
3332 ;
3333 ; movcc instruction pattern
3334 @@ -1806,7 +2196,8 @@
3335 l\t%1,%0
3336 ly\t%1,%0"
3337 [(set_attr "op_type" "RR,RI,RRE,RX,RXY,RX,RXY")
3338 - (set_attr "type" "lr,*,*,store,store,load,load")])
3339 + (set_attr "type" "lr,*,*,store,store,load,load")
3340 + (set_attr "z10prop" "z10_fr_E1,*,*,z10_super,z10_rec,z10_fwd_A3,z10_fwd_A3")])
3341
3342 ;
3343 ; Block move (MVC) patterns.
3344 @@ -1846,7 +2237,7 @@
3345 (use (match_operand 5 "const_int_operand" ""))])]
3346 "s390_offset_p (operands[0], operands[3], operands[2])
3347 && s390_offset_p (operands[1], operands[4], operands[2])
3348 - && !s390_overlap_p (operands[0], operands[1],
3349 + && !s390_overlap_p (operands[0], operands[1],
3350 INTVAL (operands[2]) + INTVAL (operands[5]))
3351 && INTVAL (operands[2]) + INTVAL (operands[5]) <= 256"
3352 [(parallel
3353 @@ -2045,6 +2436,17 @@
3354 ;; String instructions.
3355 ;;
3356
3357 +(define_insn "*execute_rl"
3358 + [(match_parallel 0 ""
3359 + [(unspec [(match_operand 1 "register_operand" "a")
3360 + (match_operand 2 "" "")
3361 + (match_operand:SI 3 "larl_operand" "X")] UNSPEC_EXECUTE)])]
3362 + "TARGET_Z10 && GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_INT
3363 + && GET_MODE_SIZE (GET_MODE (operands[1])) <= UNITS_PER_WORD"
3364 + "exrl\t%1,%3"
3365 + [(set_attr "op_type" "RIL")
3366 + (set_attr "type" "cs")])
3367 +
3368 (define_insn "*execute"
3369 [(match_parallel 0 ""
3370 [(unspec [(match_operand 1 "register_operand" "a")
3371 @@ -2141,19 +2543,19 @@
3372 "clst\t%0,%1\;jo\t.-4"
3373 [(set_attr "length" "8")
3374 (set_attr "type" "vs")])
3375 -
3376 +
3377 ;
3378 ; movstr instruction pattern.
3379 ;
3380
3381 (define_expand "movstr"
3382 [(set (reg:SI 0) (const_int 0))
3383 - (parallel
3384 + (parallel
3385 [(clobber (match_dup 3))
3386 (set (match_operand:BLK 1 "memory_operand" "")
3387 (match_operand:BLK 2 "memory_operand" ""))
3388 (set (match_operand 0 "register_operand" "")
3389 - (unspec [(match_dup 1)
3390 + (unspec [(match_dup 1)
3391 (match_dup 2)
3392 (reg:SI 0)] UNSPEC_MVST))
3393 (clobber (reg:CC CC_REGNUM))])]
3394 @@ -2174,7 +2576,7 @@
3395 (set (mem:BLK (match_operand:P 1 "register_operand" "0"))
3396 (mem:BLK (match_operand:P 3 "register_operand" "2")))
3397 (set (match_operand:P 0 "register_operand" "=d")
3398 - (unspec [(mem:BLK (match_dup 1))
3399 + (unspec [(mem:BLK (match_dup 1))
3400 (mem:BLK (match_dup 3))
3401 (reg:SI 0)] UNSPEC_MVST))
3402 (clobber (reg:CC CC_REGNUM))]
3403 @@ -2182,16 +2584,16 @@
3404 "mvst\t%1,%2\;jo\t.-4"
3405 [(set_attr "length" "8")
3406 (set_attr "type" "vs")])
3407 -
3408
3409 +
3410 ;
3411 ; movmemM instruction pattern(s).
3412 ;
3413
3414 (define_expand "movmem<mode>"
3415 - [(set (match_operand:BLK 0 "memory_operand" "")
3416 - (match_operand:BLK 1 "memory_operand" ""))
3417 - (use (match_operand:GPR 2 "general_operand" ""))
3418 + [(set (match_operand:BLK 0 "memory_operand" "") ; destination
3419 + (match_operand:BLK 1 "memory_operand" "")) ; source
3420 + (use (match_operand:GPR 2 "general_operand" "")) ; count
3421 (match_operand 3 "" "")]
3422 ""
3423 "s390_expand_movmem (operands[0], operands[1], operands[2]); DONE;")
3424 @@ -2210,15 +2612,16 @@
3425 "operands[3] = gen_rtx_SCRATCH (Pmode);")
3426
3427 (define_insn "*movmem_short"
3428 - [(set (match_operand:BLK 0 "memory_operand" "=Q,Q,Q")
3429 - (match_operand:BLK 1 "memory_operand" "Q,Q,Q"))
3430 - (use (match_operand 2 "nonmemory_operand" "n,a,a"))
3431 - (use (match_operand 3 "immediate_operand" "X,R,X"))
3432 - (clobber (match_scratch 4 "=X,X,&a"))]
3433 + [(set (match_operand:BLK 0 "memory_operand" "=Q,Q,Q,Q")
3434 + (match_operand:BLK 1 "memory_operand" "Q,Q,Q,Q"))
3435 + (use (match_operand 2 "nonmemory_operand" "n,a,a,a"))
3436 + (use (match_operand 3 "immediate_operand" "X,R,X,X"))
3437 + (clobber (match_scratch 4 "=X,X,X,&a"))]
3438 "(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode)
3439 && GET_MODE (operands[4]) == Pmode"
3440 "#"
3441 - [(set_attr "type" "cs")])
3442 + [(set_attr "type" "cs")
3443 + (set_attr "cpu_facility" "*,*,z10,*")])
3444
3445 (define_split
3446 [(set (match_operand:BLK 0 "memory_operand" "")
3447 @@ -2251,11 +2654,25 @@
3448 (match_operand:BLK 1 "memory_operand" ""))
3449 (use (match_operand 2 "register_operand" ""))
3450 (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
3451 + (clobber (scratch))]
3452 + "TARGET_Z10 && reload_completed"
3453 + [(parallel
3454 + [(unspec [(match_dup 2) (const_int 0)
3455 + (label_ref (match_dup 3))] UNSPEC_EXECUTE)
3456 + (set (match_dup 0) (match_dup 1))
3457 + (use (const_int 1))])]
3458 + "operands[3] = gen_label_rtx ();")
3459 +
3460 +(define_split
3461 + [(set (match_operand:BLK 0 "memory_operand" "")
3462 + (match_operand:BLK 1 "memory_operand" ""))
3463 + (use (match_operand 2 "register_operand" ""))
3464 + (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
3465 (clobber (match_operand 3 "register_operand" ""))]
3466 "reload_completed && TARGET_CPU_ZARCH"
3467 [(set (match_dup 3) (label_ref (match_dup 4)))
3468 (parallel
3469 - [(unspec [(match_dup 2) (mem:BLK (match_dup 3))
3470 + [(unspec [(match_dup 2) (mem:BLK (match_dup 3))
3471 (label_ref (match_dup 4))] UNSPEC_EXECUTE)
3472 (set (match_dup 0) (match_dup 1))
3473 (use (const_int 1))])]
3474 @@ -2316,8 +2733,8 @@
3475
3476 (define_expand "signbit<mode>2"
3477 [(set (reg:CCZ CC_REGNUM)
3478 - (unspec:CCZ [(match_operand:FP_ALL 1 "register_operand" "f")
3479 - (match_dup 2)]
3480 + (unspec:CCZ [(match_operand:FP_ALL 1 "register_operand" "f")
3481 + (match_dup 2)]
3482 UNSPEC_TDC_INSN))
3483 (set (match_operand:SI 0 "register_operand" "=d")
3484 (unspec:SI [(reg:CCZ CC_REGNUM)] UNSPEC_CCZ_TO_INT))]
3485 @@ -2328,8 +2745,8 @@
3486
3487 (define_expand "isinf<mode>2"
3488 [(set (reg:CCZ CC_REGNUM)
3489 - (unspec:CCZ [(match_operand:FP_ALL 1 "register_operand" "f")
3490 - (match_dup 2)]
3491 + (unspec:CCZ [(match_operand:FP_ALL 1 "register_operand" "f")
3492 + (match_dup 2)]
3493 UNSPEC_TDC_INSN))
3494 (set (match_operand:SI 0 "register_operand" "=d")
3495 (unspec:SI [(reg:CCZ CC_REGNUM)] UNSPEC_CCZ_TO_INT))]
3496 @@ -2341,16 +2758,16 @@
3497 ; This insn is used to generate all variants of the Test Data Class
3498 ; instruction, namely tcxb, tcdb, and tceb. The insn's first operand
3499 ; is the register to be tested and the second one is the bit mask
3500 -; specifying the required test(s).
3501 +; specifying the required test(s).
3502 ;
3503 (define_insn "*TDC_insn_<mode>"
3504 [(set (reg:CCZ CC_REGNUM)
3505 - (unspec:CCZ [(match_operand:FP_ALL 0 "register_operand" "f")
3506 + (unspec:CCZ [(match_operand:FP_ALL 0 "register_operand" "f")
3507 (match_operand:SI 1 "const_int_operand")] UNSPEC_TDC_INSN))]
3508 "TARGET_HARD_FLOAT"
3509 "t<_d>c<xde><bt>\t%0,%1"
3510 [(set_attr "op_type" "RXE")
3511 - (set_attr "type" "fsimp<bfp>")])
3512 + (set_attr "type" "fsimp<mode>")])
3513
3514 (define_insn_and_split "*ccz_to_int"
3515 [(set (match_operand:SI 0 "register_operand" "=d")
3516 @@ -2389,16 +2806,17 @@
3517 "operands[2] = gen_rtx_SCRATCH (Pmode);")
3518
3519 (define_insn "*clrmem_short"
3520 - [(set (match_operand:BLK 0 "memory_operand" "=Q,Q,Q")
3521 + [(set (match_operand:BLK 0 "memory_operand" "=Q,Q,Q,Q")
3522 (const_int 0))
3523 - (use (match_operand 1 "nonmemory_operand" "n,a,a"))
3524 - (use (match_operand 2 "immediate_operand" "X,R,X"))
3525 - (clobber (match_scratch 3 "=X,X,&a"))
3526 + (use (match_operand 1 "nonmemory_operand" "n,a,a,a"))
3527 + (use (match_operand 2 "immediate_operand" "X,R,X,X"))
3528 + (clobber (match_scratch 3 "=X,X,X,&a"))
3529 (clobber (reg:CC CC_REGNUM))]
3530 "(GET_MODE (operands[1]) == Pmode || GET_MODE (operands[1]) == VOIDmode)
3531 && GET_MODE (operands[3]) == Pmode"
3532 "#"
3533 - [(set_attr "type" "cs")])
3534 + [(set_attr "type" "cs")
3535 + (set_attr "cpu_facility" "*,*,z10,*")])
3536
3537 (define_split
3538 [(set (match_operand:BLK 0 "memory_operand" "")
3539 @@ -2435,19 +2853,35 @@
3540 (const_int 0))
3541 (use (match_operand 1 "register_operand" ""))
3542 (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
3543 + (clobber (scratch))
3544 + (clobber (reg:CC CC_REGNUM))]
3545 + "TARGET_Z10 && reload_completed"
3546 + [(parallel
3547 + [(unspec [(match_dup 1) (const_int 0)
3548 + (label_ref (match_dup 3))] UNSPEC_EXECUTE)
3549 + (set (match_dup 0) (const_int 0))
3550 + (use (const_int 1))
3551 + (clobber (reg:CC CC_REGNUM))])]
3552 + "operands[3] = gen_label_rtx ();")
3553 +
3554 +(define_split
3555 + [(set (match_operand:BLK 0 "memory_operand" "")
3556 + (const_int 0))
3557 + (use (match_operand 1 "register_operand" ""))
3558 + (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
3559 (clobber (match_operand 2 "register_operand" ""))
3560 (clobber (reg:CC CC_REGNUM))]
3561 "reload_completed && TARGET_CPU_ZARCH"
3562 [(set (match_dup 2) (label_ref (match_dup 3)))
3563 (parallel
3564 - [(unspec [(match_dup 1) (mem:BLK (match_dup 2))
3565 + [(unspec [(match_dup 1) (mem:BLK (match_dup 2))
3566 (label_ref (match_dup 3))] UNSPEC_EXECUTE)
3567 (set (match_dup 0) (const_int 0))
3568 (use (const_int 1))
3569 (clobber (reg:CC CC_REGNUM))])]
3570 "operands[3] = gen_label_rtx ();")
3571
3572 -; Initialize a block of arbitrary length with (operands[2] % 256).
3573 +; Initialize a block of arbitrary length with (operands[2] % 256).
3574
3575 (define_expand "setmem_long"
3576 [(parallel
3577 @@ -2530,15 +2964,16 @@
3578
3579 (define_insn "*cmpmem_short"
3580 [(set (reg:CCU CC_REGNUM)
3581 - (compare:CCU (match_operand:BLK 0 "memory_operand" "Q,Q,Q")
3582 - (match_operand:BLK 1 "memory_operand" "Q,Q,Q")))
3583 - (use (match_operand 2 "nonmemory_operand" "n,a,a"))
3584 - (use (match_operand 3 "immediate_operand" "X,R,X"))
3585 - (clobber (match_scratch 4 "=X,X,&a"))]
3586 + (compare:CCU (match_operand:BLK 0 "memory_operand" "Q,Q,Q,Q")
3587 + (match_operand:BLK 1 "memory_operand" "Q,Q,Q,Q")))
3588 + (use (match_operand 2 "nonmemory_operand" "n,a,a,a"))
3589 + (use (match_operand 3 "immediate_operand" "X,R,X,X"))
3590 + (clobber (match_scratch 4 "=X,X,X,&a"))]
3591 "(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode)
3592 && GET_MODE (operands[4]) == Pmode"
3593 "#"
3594 - [(set_attr "type" "cs")])
3595 + [(set_attr "type" "cs")
3596 + (set_attr "cpu_facility" "*,*,z10,*")])
3597
3598 (define_split
3599 [(set (reg:CCU CC_REGNUM)
3600 @@ -2574,11 +3009,26 @@
3601 (match_operand:BLK 1 "memory_operand" "")))
3602 (use (match_operand 2 "register_operand" ""))
3603 (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
3604 + (clobber (scratch))]
3605 + "TARGET_Z10 && reload_completed"
3606 + [(parallel
3607 + [(unspec [(match_dup 2) (const_int 0)
3608 + (label_ref (match_dup 4))] UNSPEC_EXECUTE)
3609 + (set (reg:CCU CC_REGNUM) (compare:CCU (match_dup 0) (match_dup 1)))
3610 + (use (const_int 1))])]
3611 + "operands[4] = gen_label_rtx ();")
3612 +
3613 +(define_split
3614 + [(set (reg:CCU CC_REGNUM)
3615 + (compare:CCU (match_operand:BLK 0 "memory_operand" "")
3616 + (match_operand:BLK 1 "memory_operand" "")))
3617 + (use (match_operand 2 "register_operand" ""))
3618 + (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
3619 (clobber (match_operand 3 "register_operand" ""))]
3620 "reload_completed && TARGET_CPU_ZARCH"
3621 [(set (match_dup 3) (label_ref (match_dup 4)))
3622 (parallel
3623 - [(unspec [(match_dup 2) (mem:BLK (match_dup 3))
3624 + [(unspec [(match_dup 2) (mem:BLK (match_dup 3))
3625 (label_ref (match_dup 4))] UNSPEC_EXECUTE)
3626 (set (reg:CCU CC_REGNUM) (compare:CCU (match_dup 0) (match_dup 1)))
3627 (use (const_int 1))])]
3628 @@ -2683,7 +3133,7 @@
3629
3630 (define_insn_and_split "*cmpint_sign_cc"
3631 [(set (reg CC_REGNUM)
3632 - (compare (ashiftrt:DI (ashift:DI (subreg:DI
3633 + (compare (ashiftrt:DI (ashift:DI (subreg:DI
3634 (unspec:SI [(match_operand:CCU 1 "register_operand" "0")]
3635 UNSPEC_CCU_TO_INT) 0)
3636 (const_int 32)) (const_int 32))
3637 @@ -2717,7 +3167,8 @@
3638 "@
3639 icm\t%0,%2,%S1
3640 icmy\t%0,%2,%S1"
3641 - [(set_attr "op_type" "RS,RSY")])
3642 + [(set_attr "op_type" "RS,RSY")
3643 + (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
3644
3645 (define_insn "*sethighpartdi_64"
3646 [(set (match_operand:DI 0 "register_operand" "=d")
3647 @@ -2737,8 +3188,10 @@
3648 "@
3649 icm\t%0,%2,%S1
3650 icmy\t%0,%2,%S1"
3651 - [(set_attr "op_type" "RS,RSY")])
3652 + [(set_attr "op_type" "RS,RSY")
3653 + (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
3654
3655 +
3656 (define_insn_and_split "*extzv<mode>"
3657 [(set (match_operand:GPR 0 "register_operand" "=d")
3658 (zero_extract:GPR (match_operand:QI 1 "s_operand" "QS")
3659 @@ -2807,6 +3260,85 @@
3660 FAIL;
3661 })
3662
3663 +(define_insn "*insv<mode>_z10"
3664 + [(set (zero_extract:GPR (match_operand:GPR 0 "nonimmediate_operand" "+d")
3665 + (match_operand 1 "const_int_operand" "I")
3666 + (match_operand 2 "const_int_operand" "I"))
3667 + (match_operand:GPR 3 "nonimmediate_operand" "d"))
3668 + (clobber (reg:CC CC_REGNUM))]
3669 + "TARGET_Z10
3670 + && (INTVAL (operands[1]) + INTVAL (operands[2])) <=
3671 + GET_MODE_BITSIZE (<MODE>mode)"
3672 +{
3673 + int start = INTVAL (operands[2]);
3674 + int size = INTVAL (operands[1]);
3675 + int offset = 64 - GET_MODE_BITSIZE (<MODE>mode);
3676 +
3677 + operands[2] = GEN_INT (offset + start); /* start bit position */
3678 + operands[1] = GEN_INT (offset + start + size - 1); /* end bit position */
3679 + operands[4] = GEN_INT (GET_MODE_BITSIZE (<MODE>mode) -
3680 + start - size); /* left shift count */
3681 +
3682 + return "risbg\t%0,%3,%b2,%b1,%b4";
3683 +}
3684 + [(set_attr "op_type" "RIE")
3685 + (set_attr "z10prop" "z10_super_E1")])
3686 +
3687 +; and op1 with a mask being 1 for the selected bits and 0 for the rest
3688 +; and op3=op0 with a mask being 0 for the selected bits and 1 for the rest
3689 +(define_insn "*insv<mode>_z10_noshift"
3690 + [(set (match_operand:GPR 0 "nonimmediate_operand" "=d")
3691 + (ior:GPR (and:GPR (match_operand:GPR 1 "nonimmediate_operand" "d")
3692 + (match_operand 2 "const_int_operand" "n"))
3693 + (and:GPR (match_operand:GPR 3 "nonimmediate_operand" "0")
3694 + (match_operand 4 "const_int_operand" "n"))))
3695 + (clobber (reg:CC CC_REGNUM))]
3696 + "TARGET_Z10
3697 + && s390_contiguous_bitmask_p (INTVAL (operands[2]),
3698 + GET_MODE_BITSIZE (<MODE>mode), NULL, NULL)
3699 + && INTVAL (operands[2]) == ~(INTVAL (operands[4]))"
3700 +
3701 +{
3702 + int start;
3703 + int size;
3704 +
3705 + s390_contiguous_bitmask_p (INTVAL (operands[2]),
3706 + GET_MODE_BITSIZE (<MODE>mode), &start, &size);
3707 +
3708 + operands[5] = GEN_INT (64 - start - size); /* start bit position */
3709 + operands[6] = GEN_INT (64 - 1 - start); /* end bit position */
3710 + operands[7] = const0_rtx; /* left shift count */
3711 +
3712 + return "risbg\t%0,%1,%b5,%b6,%b7";
3713 +}
3714 + [(set_attr "op_type" "RIE")
3715 + (set_attr "z10prop" "z10_super_E1")])
3716 +
3717 +; and op1 with a mask being 1 for the selected bits and 0 for the rest
3718 +(define_insn "*insv<mode>_or_z10_noshift"
3719 + [(set (match_operand:GPR 0 "nonimmediate_operand" "=d")
3720 + (ior:GPR (and:GPR (match_operand:GPR 1 "nonimmediate_operand" "d")
3721 + (match_operand 2 "const_int_operand" "n"))
3722 + (match_operand:GPR 3 "nonimmediate_operand" "0")))
3723 + (clobber (reg:CC CC_REGNUM))]
3724 + "TARGET_Z10
3725 + && s390_contiguous_bitmask_p (INTVAL (operands[2]),
3726 + GET_MODE_BITSIZE (<MODE>mode), NULL, NULL)"
3727 +{
3728 + int start;
3729 + int size;
3730 +
3731 + s390_contiguous_bitmask_p (INTVAL (operands[2]),
3732 + GET_MODE_BITSIZE (<MODE>mode), &start, &size);
3733 +
3734 + operands[4] = GEN_INT (64 - start - size); /* start bit position */
3735 + operands[5] = GEN_INT (64 - 1 - start); /* end bit position */
3736 + operands[6] = const0_rtx; /* left shift count */
3737 +
3738 + return "rosbg\t%0,%1,%b4,%b5,%b6";
3739 +}
3740 + [(set_attr "op_type" "RIE")])
3741 +
3742 (define_insn "*insv<mode>_mem_reg"
3743 [(set (zero_extract:P (match_operand:QI 0 "memory_operand" "+Q,S")
3744 (match_operand 1 "const_int_operand" "n,n")
3745 @@ -2819,10 +3351,11 @@
3746 int size = INTVAL (operands[1]) / BITS_PER_UNIT;
3747
3748 operands[1] = GEN_INT ((1ul << size) - 1);
3749 - return (which_alternative == 0) ? "stcm\t%2,%1,%S0"
3750 + return (which_alternative == 0) ? "stcm\t%2,%1,%S0"
3751 : "stcmy\t%2,%1,%S0";
3752 }
3753 - [(set_attr "op_type" "RS,RSY")])
3754 + [(set_attr "op_type" "RS,RSY")
3755 + (set_attr "z10prop" "z10_super,z10_super")])
3756
3757 (define_insn "*insvdi_mem_reghigh"
3758 [(set (zero_extract:DI (match_operand:QI 0 "memory_operand" "+QS")
3759 @@ -2840,7 +3373,8 @@
3760 operands[1] = GEN_INT ((1ul << size) - 1);
3761 return "stcmh\t%2,%1,%S0";
3762 }
3763 -[(set_attr "op_type" "RSY")])
3764 +[(set_attr "op_type" "RSY")
3765 + (set_attr "z10prop" "z10_super")])
3766
3767 (define_insn "*insv<mode>_reg_imm"
3768 [(set (zero_extract:P (match_operand:P 0 "register_operand" "+d")
3769 @@ -2861,8 +3395,10 @@
3770 default: gcc_unreachable();
3771 }
3772 }
3773 - [(set_attr "op_type" "RI")])
3774 + [(set_attr "op_type" "RI")
3775 + (set_attr "z10prop" "z10_super_E1")])
3776
3777 +
3778 (define_insn "*insv<mode>_reg_extimm"
3779 [(set (zero_extract:P (match_operand:P 0 "register_operand" "+d")
3780 (const_int 32)
3781 @@ -2880,8 +3416,10 @@
3782 default: gcc_unreachable();
3783 }
3784 }
3785 - [(set_attr "op_type" "RIL")])
3786 + [(set_attr "op_type" "RIL")
3787 + (set_attr "z10prop" "z10_fwd_E1")])
3788
3789 +
3790 ;
3791 ; extendsidi2 instruction pattern(s).
3792 ;
3793 @@ -2902,13 +3440,17 @@
3794 })
3795
3796 (define_insn "*extendsidi2"
3797 - [(set (match_operand:DI 0 "register_operand" "=d,d")
3798 - (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
3799 + [(set (match_operand:DI 0 "register_operand" "=d,d,d")
3800 + (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,RT,b")))]
3801 "TARGET_64BIT"
3802 "@
3803 lgfr\t%0,%1
3804 - lgf\t%0,%1"
3805 - [(set_attr "op_type" "RRE,RXY")])
3806 + lgf\t%0,%1
3807 + lgfrl\t%0,%1"
3808 + [(set_attr "op_type" "RRE,RXY,RIL")
3809 + (set_attr "type" "*,*,larl")
3810 + (set_attr "cpu_facility" "*,*,z10")
3811 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1")])
3812
3813 ;
3814 ; extend(hi|qi)(si|di)2 instruction pattern(s).
3815 @@ -2943,34 +3485,43 @@
3816 ;
3817
3818 (define_insn "*extendhidi2_extimm"
3819 - [(set (match_operand:DI 0 "register_operand" "=d,d")
3820 - (sign_extend:DI (match_operand:HI 1 "nonimmediate_operand" "d,m")))]
3821 + [(set (match_operand:DI 0 "register_operand" "=d,d,d")
3822 + (sign_extend:DI (match_operand:HI 1 "general_operand" "d,RT,b")))]
3823 "TARGET_64BIT && TARGET_EXTIMM"
3824 "@
3825 lghr\t%0,%1
3826 - lgh\t%0,%1"
3827 - [(set_attr "op_type" "RRE,RXY")])
3828 + lgh\t%0,%1
3829 + lghrl\t%0,%1"
3830 + [(set_attr "op_type" "RRE,RXY,RIL")
3831 + (set_attr "type" "*,*,larl")
3832 + (set_attr "cpu_facility" "extimm,extimm,z10")
3833 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1")])
3834
3835 (define_insn "*extendhidi2"
3836 [(set (match_operand:DI 0 "register_operand" "=d")
3837 - (sign_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
3838 + (sign_extend:DI (match_operand:HI 1 "memory_operand" "RT")))]
3839 "TARGET_64BIT"
3840 "lgh\t%0,%1"
3841 - [(set_attr "op_type" "RXY")])
3842 + [(set_attr "op_type" "RXY")
3843 + (set_attr "z10prop" "z10_super_E1")])
3844
3845 ;
3846 ; extendhisi2 instruction pattern(s).
3847 ;
3848
3849 (define_insn "*extendhisi2_extimm"
3850 - [(set (match_operand:SI 0 "register_operand" "=d,d,d")
3851 - (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "d,R,T")))]
3852 + [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
3853 + (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" " d,R,T,b")))]
3854 "TARGET_EXTIMM"
3855 "@
3856 lhr\t%0,%1
3857 lh\t%0,%1
3858 - lhy\t%0,%1"
3859 - [(set_attr "op_type" "RRE,RX,RXY")])
3860 + lhy\t%0,%1
3861 + lhrl\t%0,%1"
3862 + [(set_attr "op_type" "RRE,RX,RXY,RIL")
3863 + (set_attr "type" "*,*,*,larl")
3864 + (set_attr "cpu_facility" "extimm,extimm,extimm,z10")
3865 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1,z10_super_E1")])
3866
3867 (define_insn "*extendhisi2"
3868 [(set (match_operand:SI 0 "register_operand" "=d,d")
3869 @@ -2979,7 +3530,8 @@
3870 "@
3871 lh\t%0,%1
3872 lhy\t%0,%1"
3873 - [(set_attr "op_type" "RX,RXY")])
3874 + [(set_attr "op_type" "RX,RXY")
3875 + (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
3876
3877 ;
3878 ; extendqi(si|di)2 instruction pattern(s).
3879 @@ -2988,20 +3540,22 @@
3880 ; lbr, lgbr, lb, lgb
3881 (define_insn "*extendqi<mode>2_extimm"
3882 [(set (match_operand:GPR 0 "register_operand" "=d,d")
3883 - (sign_extend:GPR (match_operand:QI 1 "nonimmediate_operand" "d,m")))]
3884 + (sign_extend:GPR (match_operand:QI 1 "nonimmediate_operand" "d,RT")))]
3885 "TARGET_EXTIMM"
3886 "@
3887 l<g>br\t%0,%1
3888 l<g>b\t%0,%1"
3889 - [(set_attr "op_type" "RRE,RXY")])
3890 + [(set_attr "op_type" "RRE,RXY")
3891 + (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
3892
3893 ; lb, lgb
3894 (define_insn "*extendqi<mode>2"
3895 [(set (match_operand:GPR 0 "register_operand" "=d")
3896 - (sign_extend:GPR (match_operand:QI 1 "memory_operand" "m")))]
3897 + (sign_extend:GPR (match_operand:QI 1 "memory_operand" "RT")))]
3898 "!TARGET_EXTIMM && TARGET_LONG_DISPLACEMENT"
3899 "l<g>b\t%0,%1"
3900 - [(set_attr "op_type" "RXY")])
3901 + [(set_attr "op_type" "RXY")
3902 + (set_attr "z10prop" "z10_super_E1")])
3903
3904 (define_insn_and_split "*extendqi<mode>2_short_displ"
3905 [(set (match_operand:GPR 0 "register_operand" "=d")
3906 @@ -3042,13 +3596,17 @@
3907 })
3908
3909 (define_insn "*zero_extendsidi2"
3910 - [(set (match_operand:DI 0 "register_operand" "=d,d")
3911 - (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
3912 + [(set (match_operand:DI 0 "register_operand" "=d,d,d")
3913 + (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,RT,b")))]
3914 "TARGET_64BIT"
3915 "@
3916 llgfr\t%0,%1
3917 - llgf\t%0,%1"
3918 - [(set_attr "op_type" "RRE,RXY")])
3919 + llgf\t%0,%1
3920 + llgfrl\t%0,%1"
3921 + [(set_attr "op_type" "RRE,RXY,RIL")
3922 + (set_attr "type" "*,*,larl")
3923 + (set_attr "cpu_facility" "*,*,z10")
3924 + (set_attr "z10prop" "z10_fwd_E1,z10_fwd_A3,z10_fwd_A3")])
3925
3926 ;
3927 ; LLGT-type instructions (zero-extend from 31 bit to 64 bit).
3928 @@ -3056,15 +3614,16 @@
3929
3930 (define_insn "*llgt_sidi"
3931 [(set (match_operand:DI 0 "register_operand" "=d")
3932 - (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
3933 + (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "RT") 0)
3934 (const_int 2147483647)))]
3935 "TARGET_64BIT"
3936 "llgt\t%0,%1"
3937 - [(set_attr "op_type" "RXE")])
3938 + [(set_attr "op_type" "RXE")
3939 + (set_attr "z10prop" "z10_super_E1")])
3940
3941 (define_insn_and_split "*llgt_sidi_split"
3942 [(set (match_operand:DI 0 "register_operand" "=d")
3943 - (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
3944 + (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "RT") 0)
3945 (const_int 2147483647)))
3946 (clobber (reg:CC CC_REGNUM))]
3947 "TARGET_64BIT"
3948 @@ -3077,13 +3636,14 @@
3949
3950 (define_insn "*llgt_sisi"
3951 [(set (match_operand:SI 0 "register_operand" "=d,d")
3952 - (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,m")
3953 + (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,RT")
3954 (const_int 2147483647)))]
3955 "TARGET_ZARCH"
3956 "@
3957 llgtr\t%0,%1
3958 llgt\t%0,%1"
3959 - [(set_attr "op_type" "RRE,RXE")])
3960 + [(set_attr "op_type" "RRE,RXE")
3961 + (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
3962
3963 (define_insn "*llgt_didi"
3964 [(set (match_operand:DI 0 "register_operand" "=d,d")
3965 @@ -3093,7 +3653,8 @@
3966 "@
3967 llgtr\t%0,%1
3968 llgt\t%0,%N1"
3969 - [(set_attr "op_type" "RRE,RXE")])
3970 + [(set_attr "op_type" "RRE,RXE")
3971 + (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
3972
3973 (define_split
3974 [(set (match_operand:GPR 0 "register_operand" "")
3975 @@ -3124,7 +3685,7 @@
3976 }
3977 else if (!TARGET_EXTIMM)
3978 {
3979 - rtx bitcount = GEN_INT (GET_MODE_BITSIZE(DImode) -
3980 + rtx bitcount = GEN_INT (GET_MODE_BITSIZE(DImode) -
3981 GET_MODE_BITSIZE(<MODE>mode));
3982 operands[1] = gen_lowpart (DImode, operands[1]);
3983 emit_insn (gen_ashldi3 (operands[0], operands[1], bitcount));
3984 @@ -3141,29 +3702,45 @@
3985 if (!TARGET_EXTIMM)
3986 {
3987 operands[1] = gen_lowpart (SImode, operands[1]);
3988 - emit_insn (gen_andsi3 (operands[0], operands[1],
3989 + emit_insn (gen_andsi3 (operands[0], operands[1],
3990 GEN_INT ((1 << GET_MODE_BITSIZE(<MODE>mode)) - 1)));
3991 DONE;
3992 }
3993 })
3994
3995 +; llhrl, llghrl
3996 +(define_insn "*zero_extendhi<mode>2_z10"
3997 + [(set (match_operand:GPR 0 "register_operand" "=d,d,d")
3998 + (zero_extend:GPR (match_operand:HI 1 "nonimmediate_operand" "d,RT,b")))]
3999 + "TARGET_Z10"
4000 + "@
4001 + ll<g>hr\t%0,%1
4002 + ll<g>h\t%0,%1
4003 + ll<g>hrl\t%0,%1"
4004 + [(set_attr "op_type" "RXY,RRE,RIL")
4005 + (set_attr "type" "*,*,larl")
4006 + (set_attr "cpu_facility" "*,*,z10")
4007 + (set_attr "z10prop" "z10_fwd_A3")])
4008 +
4009 ; llhr, llcr, llghr, llgcr, llh, llc, llgh, llgc
4010 (define_insn "*zero_extend<HQI:mode><GPR:mode>2_extimm"
4011 [(set (match_operand:GPR 0 "register_operand" "=d,d")
4012 - (zero_extend:GPR (match_operand:HQI 1 "nonimmediate_operand" "d,m")))]
4013 + (zero_extend:GPR (match_operand:HQI 1 "nonimmediate_operand" "d,RT")))]
4014 "TARGET_EXTIMM"
4015 "@
4016 ll<g><hc>r\t%0,%1
4017 ll<g><hc>\t%0,%1"
4018 - [(set_attr "op_type" "RRE,RXY")])
4019 + [(set_attr "op_type" "RRE,RXY")
4020 + (set_attr "z10prop" "z10_super_E1,z10_fwd_A3")])
4021
4022 ; llgh, llgc
4023 (define_insn "*zero_extend<HQI:mode><GPR:mode>2"
4024 [(set (match_operand:GPR 0 "register_operand" "=d")
4025 - (zero_extend:GPR (match_operand:HQI 1 "memory_operand" "m")))]
4026 + (zero_extend:GPR (match_operand:HQI 1 "memory_operand" "RT")))]
4027 "TARGET_ZARCH && !TARGET_EXTIMM"
4028 "llg<hc>\t%0,%1"
4029 - [(set_attr "op_type" "RXY")])
4030 + [(set_attr "op_type" "RXY")
4031 + (set_attr "z10prop" "z10_fwd_A3")])
4032
4033 (define_insn_and_split "*zero_extendhisi2_31"
4034 [(set (match_operand:SI 0 "register_operand" "=&d")
4035 @@ -3180,7 +3757,7 @@
4036
4037 (define_insn_and_split "*zero_extendqisi2_31"
4038 [(set (match_operand:SI 0 "register_operand" "=&d")
4039 - (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
4040 + (zero_extend:SI (match_operand:QI 1 "memory_operand" "RT")))]
4041 "!TARGET_ZARCH"
4042 "#"
4043 "&& reload_completed"
4044 @@ -3204,14 +3781,15 @@
4045
4046 (define_insn "*zero_extendqihi2_64"
4047 [(set (match_operand:HI 0 "register_operand" "=d")
4048 - (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
4049 + (zero_extend:HI (match_operand:QI 1 "memory_operand" "RT")))]
4050 "TARGET_ZARCH && !TARGET_EXTIMM"
4051 "llgc\t%0,%1"
4052 - [(set_attr "op_type" "RXY")])
4053 + [(set_attr "op_type" "RXY")
4054 + (set_attr "z10prop" "z10_fwd_A3")])
4055
4056 (define_insn_and_split "*zero_extendqihi2_31"
4057 [(set (match_operand:HI 0 "register_operand" "=&d")
4058 - (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
4059 + (zero_extend:HI (match_operand:QI 1 "memory_operand" "RT")))]
4060 "!TARGET_ZARCH"
4061 "#"
4062 "&& reload_completed"
4063 @@ -3228,8 +3806,8 @@
4064 [(set (match_operand:DI 0 "register_operand" "")
4065 (unsigned_fix:DI (match_operand:DD 1 "register_operand" "")))
4066 (clobber (match_scratch:TD 2 "=f"))])]
4067 -
4068 - "TARGET_HARD_FLOAT && TARGET_HARD_DFP"
4069 +
4070 + "TARGET_HARD_DFP"
4071 {
4072 rtx label1 = gen_label_rtx ();
4073 rtx label2 = gen_label_rtx ();
4074 @@ -3240,7 +3818,7 @@
4075 decimal_real_from_string (&sub, "18446744073709551616.0"); /* 2^64 */
4076
4077 /* 2^63 can't be represented as 64bit DFP number with full precision. The
4078 - solution is doing the check and the subtraction in TD mode and using a
4079 + solution is doing the check and the subtraction in TD mode and using a
4080 TD -> DI convert afterwards. */
4081 emit_insn (gen_extendddtd2 (temp, operands[1]));
4082 temp = force_reg (TDmode, temp);
4083 @@ -3261,17 +3839,17 @@
4084 (define_expand "fixuns_trunctddi2"
4085 [(set (match_operand:DI 0 "register_operand" "")
4086 (unsigned_fix:DI (match_operand:TD 1 "register_operand" "")))]
4087 - "TARGET_HARD_FLOAT && TARGET_HARD_DFP"
4088 + "TARGET_HARD_DFP"
4089 {
4090 rtx label1 = gen_label_rtx ();
4091 rtx label2 = gen_label_rtx ();
4092 rtx temp = gen_reg_rtx (TDmode);
4093 REAL_VALUE_TYPE cmp, sub;
4094 -
4095 +
4096 operands[1] = force_reg (TDmode, operands[1]);
4097 decimal_real_from_string (&cmp, "9223372036854775808.0"); /* 2^63 */
4098 decimal_real_from_string (&sub, "18446744073709551616.0"); /* 2^64 */
4099 -
4100 +
4101 emit_insn (gen_cmptd (operands[1],
4102 CONST_DOUBLE_FROM_REAL_VALUE (cmp, TDmode)));
4103 emit_jump_insn (gen_blt (label1));
4104 @@ -3287,7 +3865,7 @@
4105 })
4106
4107 ;
4108 -; fixuns_trunc(sf|df)(si|di)2 and fix_trunc(sf|df)(si|di)2
4109 +; fixuns_trunc(sf|df)(si|di)2 and fix_trunc(sf|df)(si|di)2
4110 ; instruction pattern(s).
4111 ;
4112
4113 @@ -3300,11 +3878,11 @@
4114 rtx label2 = gen_label_rtx ();
4115 rtx temp = gen_reg_rtx (<BFP:MODE>mode);
4116 REAL_VALUE_TYPE cmp, sub;
4117 -
4118 +
4119 operands[1] = force_reg (<BFP:MODE>mode, operands[1]);
4120 real_2expN (&cmp, GET_MODE_BITSIZE(<GPR:MODE>mode) - 1, <BFP:MODE>mode);
4121 real_2expN (&sub, GET_MODE_BITSIZE(<GPR:MODE>mode), <BFP:MODE>mode);
4122 -
4123 +
4124 emit_insn (gen_cmp<BFP:mode> (operands[1],
4125 CONST_DOUBLE_FROM_REAL_VALUE (cmp, <BFP:MODE>mode)));
4126 emit_jump_insn (gen_blt (label1));
4127 @@ -3350,7 +3928,7 @@
4128 (define_expand "fix_trunc<mode>di2"
4129 [(set (match_operand:DI 0 "register_operand" "")
4130 (fix:DI (match_operand:DFP 1 "nonimmediate_operand" "")))]
4131 - "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_HARD_DFP"
4132 + "TARGET_64BIT && TARGET_HARD_DFP"
4133 {
4134 operands[1] = force_reg (<MODE>mode, operands[1]);
4135 emit_insn (gen_fix_trunc<mode>di2_dfp (operands[0], operands[1],
4136 @@ -3364,10 +3942,10 @@
4137 (fix:DI (match_operand:DFP 1 "register_operand" "f")))
4138 (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND)
4139 (clobber (reg:CC CC_REGNUM))]
4140 - "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_HARD_DFP"
4141 + "TARGET_64BIT && TARGET_HARD_DFP"
4142 "cg<DFP:xde>tr\t%0,%h2,%1"
4143 [(set_attr "op_type" "RRF")
4144 - (set_attr "type" "ftoi")])
4145 + (set_attr "type" "ftoidfp")])
4146
4147
4148 ;
4149 @@ -3394,7 +3972,7 @@
4150 "TARGET_64BIT && TARGET_HARD_FLOAT"
4151 "c<xde>g<bt>r\t%0,%1"
4152 [(set_attr "op_type" "RRE")
4153 - (set_attr "type" "itof" )])
4154 + (set_attr "type" "itof<mode>" )])
4155
4156 ; cxfbr, cdfbr, cefbr
4157 (define_insn "floatsi<mode>2"
4158 @@ -3403,7 +3981,7 @@
4159 "TARGET_HARD_FLOAT"
4160 "c<xde>fbr\t%0,%1"
4161 [(set_attr "op_type" "RRE")
4162 - (set_attr "type" "itof" )])
4163 + (set_attr "type" "itof<mode>" )])
4164
4165
4166 ;
4167 @@ -3430,7 +4008,7 @@
4168 "TARGET_HARD_FLOAT"
4169 "l<xde>xbr\t%2,%1\;l<xde>r\t%0,%2"
4170 [(set_attr "length" "6")
4171 - (set_attr "type" "ftrunctf")])
4172 + (set_attr "type" "ftrunctf")])
4173
4174 ;
4175 ; trunctddd2 and truncddsd2 instruction pattern(s).
4176 @@ -3440,18 +4018,18 @@
4177 [(set (match_operand:DD 0 "register_operand" "=f")
4178 (float_truncate:DD (match_operand:TD 1 "register_operand" "f")))
4179 (clobber (match_scratch:TD 2 "=f"))]
4180 - "TARGET_HARD_FLOAT && TARGET_HARD_DFP"
4181 + "TARGET_HARD_DFP"
4182 "ldxtr\t%2,0,%1,0\;ldr\t%0,%2"
4183 [(set_attr "length" "6")
4184 - (set_attr "type" "ftrunctf")])
4185 + (set_attr "type" "ftruncdd")])
4186
4187 (define_insn "truncddsd2"
4188 [(set (match_operand:SD 0 "register_operand" "=f")
4189 (float_truncate:SD (match_operand:DD 1 "register_operand" "f")))]
4190 - "TARGET_HARD_FLOAT && TARGET_HARD_DFP"
4191 + "TARGET_HARD_DFP"
4192 "ledtr\t%0,0,%1,0"
4193 [(set_attr "op_type" "RRF")
4194 - (set_attr "type" "fsimptf")])
4195 + (set_attr "type" "ftruncsd")])
4196
4197 ;
4198 ; extend(sf|df)(df|tf)2 instruction pattern(s).
4199 @@ -3476,7 +4054,7 @@
4200 (define_insn "extendddtd2"
4201 [(set (match_operand:TD 0 "register_operand" "=f")
4202 (float_extend:TD (match_operand:DD 1 "register_operand" "f")))]
4203 - "TARGET_HARD_FLOAT && TARGET_HARD_DFP"
4204 + "TARGET_HARD_DFP"
4205 "lxdtr\t%0,%1,0"
4206 [(set_attr "op_type" "RRF")
4207 (set_attr "type" "fsimptf")])
4208 @@ -3484,7 +4062,7 @@
4209 (define_insn "extendsddd2"
4210 [(set (match_operand:DD 0 "register_operand" "=f")
4211 (float_extend:DD (match_operand:SD 1 "register_operand" "f")))]
4212 - "TARGET_HARD_FLOAT && TARGET_HARD_DFP"
4213 + "TARGET_HARD_DFP"
4214 "ldetr\t%0,%1,0"
4215 [(set_attr "op_type" "RRF")
4216 (set_attr "type" "fsimptf")])
4217 @@ -3497,7 +4075,7 @@
4218 (float_truncate:DFP_ALL (reg:BFP FPR2_REGNUM)))
4219 (use (reg:SI GPR0_REGNUM))
4220 (clobber (reg:CC CC_REGNUM))]
4221 - "TARGET_HARD_FLOAT && TARGET_DFP"
4222 + "TARGET_HARD_DFP"
4223 "pfpo")
4224
4225 (define_insn "*trunc<DFP_ALL:mode><BFP:mode>2"
4226 @@ -3505,7 +4083,7 @@
4227 (float_truncate:BFP (reg:DFP_ALL FPR2_REGNUM)))
4228 (use (reg:SI GPR0_REGNUM))
4229 (clobber (reg:CC CC_REGNUM))]
4230 - "TARGET_HARD_FLOAT && TARGET_DFP"
4231 + "TARGET_HARD_DFP"
4232 "pfpo")
4233
4234 (define_expand "trunc<BFP:mode><DFP_ALL:mode>2"
4235 @@ -3518,7 +4096,7 @@
4236 (clobber (reg:CC CC_REGNUM))])
4237 (set (match_operand:DFP_ALL 0 "nonimmediate_operand" "")
4238 (reg:DFP_ALL FPR0_REGNUM))]
4239 - "TARGET_HARD_FLOAT && TARGET_DFP
4240 + "TARGET_HARD_DFP
4241 && GET_MODE_SIZE (<BFP:MODE>mode) > GET_MODE_SIZE (<DFP_ALL:MODE>mode)"
4242 {
4243 HOST_WIDE_INT flags;
4244 @@ -3539,7 +4117,7 @@
4245 (use (reg:SI GPR0_REGNUM))
4246 (clobber (reg:CC CC_REGNUM))])
4247 (set (match_operand:BFP 0 "nonimmediate_operand" "") (reg:BFP FPR0_REGNUM))]
4248 - "TARGET_HARD_FLOAT && TARGET_DFP
4249 + "TARGET_HARD_DFP
4250 && GET_MODE_SIZE (<DFP_ALL:MODE>mode) >= GET_MODE_SIZE (<BFP:MODE>mode)"
4251 {
4252 HOST_WIDE_INT flags;
4253 @@ -3559,14 +4137,14 @@
4254 [(set (reg:DFP_ALL FPR0_REGNUM) (float_extend:DFP_ALL (reg:BFP FPR2_REGNUM)))
4255 (use (reg:SI GPR0_REGNUM))
4256 (clobber (reg:CC CC_REGNUM))]
4257 - "TARGET_HARD_FLOAT && TARGET_DFP"
4258 + "TARGET_HARD_DFP"
4259 "pfpo")
4260
4261 (define_insn "*extend<DFP_ALL:mode><BFP:mode>2"
4262 [(set (reg:BFP FPR0_REGNUM) (float_extend:BFP (reg:DFP_ALL FPR2_REGNUM)))
4263 (use (reg:SI GPR0_REGNUM))
4264 (clobber (reg:CC CC_REGNUM))]
4265 - "TARGET_HARD_FLOAT && TARGET_DFP"
4266 + "TARGET_HARD_DFP"
4267 "pfpo")
4268
4269 (define_expand "extend<BFP:mode><DFP_ALL:mode>2"
4270 @@ -3579,7 +4157,7 @@
4271 (clobber (reg:CC CC_REGNUM))])
4272 (set (match_operand:DFP_ALL 0 "nonimmediate_operand" "")
4273 (reg:DFP_ALL FPR0_REGNUM))]
4274 - "TARGET_HARD_FLOAT && TARGET_DFP
4275 + "TARGET_HARD_DFP
4276 && GET_MODE_SIZE (<BFP:MODE>mode) <= GET_MODE_SIZE (<DFP_ALL:MODE>mode)"
4277 {
4278 HOST_WIDE_INT flags;
4279 @@ -3600,7 +4178,7 @@
4280 (use (reg:SI GPR0_REGNUM))
4281 (clobber (reg:CC CC_REGNUM))])
4282 (set (match_operand:BFP 0 "nonimmediate_operand" "") (reg:BFP FPR0_REGNUM))]
4283 - "TARGET_HARD_FLOAT && TARGET_DFP
4284 + "TARGET_HARD_DFP
4285 && GET_MODE_SIZE (<DFP_ALL:MODE>mode) < GET_MODE_SIZE (<BFP:MODE>mode)"
4286 {
4287 HOST_WIDE_INT flags;
4288 @@ -3659,7 +4237,7 @@
4289
4290 (define_expand "adddi3"
4291 [(parallel
4292 - [(set (match_operand:DI 0 "register_operand" "")
4293 + [(set (match_operand:DI 0 "nonimmediate_operand" "")
4294 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "")
4295 (match_operand:DI 2 "general_operand" "")))
4296 (clobber (reg:CC CC_REGNUM))])]
4297 @@ -3668,7 +4246,7 @@
4298
4299 (define_insn "*adddi3_sign"
4300 [(set (match_operand:DI 0 "register_operand" "=d,d")
4301 - (plus:DI (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
4302 + (plus:DI (sign_extend:DI (match_operand:SI 2 "general_operand" "d,RT"))
4303 (match_operand:DI 1 "register_operand" "0,0")))
4304 (clobber (reg:CC CC_REGNUM))]
4305 "TARGET_64BIT"
4306 @@ -3679,7 +4257,7 @@
4307
4308 (define_insn "*adddi3_zero_cc"
4309 [(set (reg CC_REGNUM)
4310 - (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
4311 + (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,RT"))
4312 (match_operand:DI 1 "register_operand" "0,0"))
4313 (const_int 0)))
4314 (set (match_operand:DI 0 "register_operand" "=d,d")
4315 @@ -3688,11 +4266,12 @@
4316 "@
4317 algfr\t%0,%2
4318 algf\t%0,%2"
4319 - [(set_attr "op_type" "RRE,RXY")])
4320 + [(set_attr "op_type" "RRE,RXY")
4321 + (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
4322
4323 (define_insn "*adddi3_zero_cconly"
4324 [(set (reg CC_REGNUM)
4325 - (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
4326 + (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,RT"))
4327 (match_operand:DI 1 "register_operand" "0,0"))
4328 (const_int 0)))
4329 (clobber (match_scratch:DI 0 "=d,d"))]
4330 @@ -3700,21 +4279,23 @@
4331 "@
4332 algfr\t%0,%2
4333 algf\t%0,%2"
4334 - [(set_attr "op_type" "RRE,RXY")])
4335 + [(set_attr "op_type" "RRE,RXY")
4336 + (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
4337
4338 (define_insn "*adddi3_zero"
4339 [(set (match_operand:DI 0 "register_operand" "=d,d")
4340 - (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
4341 + (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,RT"))
4342 (match_operand:DI 1 "register_operand" "0,0")))
4343 (clobber (reg:CC CC_REGNUM))]
4344 "TARGET_64BIT"
4345 "@
4346 algfr\t%0,%2
4347 algf\t%0,%2"
4348 - [(set_attr "op_type" "RRE,RXY")])
4349 + [(set_attr "op_type" "RRE,RXY")
4350 + (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
4351
4352 (define_insn_and_split "*adddi3_31z"
4353 - [(set (match_operand:DI 0 "register_operand" "=&d")
4354 + [(set (match_operand:DI 0 "nonimmediate_operand" "=&d")
4355 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0")
4356 (match_operand:DI 2 "general_operand" "do") ) )
4357 (clobber (reg:CC CC_REGNUM))]
4358 @@ -3739,7 +4320,7 @@
4359 operands[8] = operand_subword (operands[2], 1, 0, DImode);")
4360
4361 (define_insn_and_split "*adddi3_31"
4362 - [(set (match_operand:DI 0 "register_operand" "=&d")
4363 + [(set (match_operand:DI 0 "nonimmediate_operand" "=&d")
4364 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0")
4365 (match_operand:DI 2 "general_operand" "do") ) )
4366 (clobber (reg:CC CC_REGNUM))]
4367 @@ -3776,7 +4357,7 @@
4368
4369 (define_expand "addsi3"
4370 [(parallel
4371 - [(set (match_operand:SI 0 "register_operand" "")
4372 + [(set (match_operand:SI 0 "nonimmediate_operand" "")
4373 (plus:SI (match_operand:SI 1 "nonimmediate_operand" "")
4374 (match_operand:SI 2 "general_operand" "")))
4375 (clobber (reg:CC CC_REGNUM))])]
4376 @@ -3798,11 +4379,11 @@
4377 ; add(di|si)3 instruction pattern(s).
4378 ;
4379
4380 -; ar, ahi, alfi, slfi, a, ay, agr, aghi, algfi, slgfi, ag
4381 +; ar, ahi, alfi, slfi, a, ay, agr, aghi, algfi, slgfi, ag, asi, agsi
4382 (define_insn "*add<mode>3"
4383 - [(set (match_operand:GPR 0 "register_operand" "=d,d,d,d,d,d")
4384 - (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,0,0,0,0,0")
4385 - (match_operand:GPR 2 "general_operand" "d,K,Op,On,R,T") ) )
4386 + [(set (match_operand:GPR 0 "nonimmediate_operand" "=d,d,d,d,d,d,QS")
4387 + (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,0,0,0,0,0,0")
4388 + (match_operand:GPR 2 "general_operand" "d,K,Op,On,R,T,C") ) )
4389 (clobber (reg:CC CC_REGNUM))]
4390 ""
4391 "@
4392 @@ -3811,16 +4392,25 @@
4393 al<g>fi\t%0,%2
4394 sl<g>fi\t%0,%n2
4395 a<g>\t%0,%2
4396 - a<y>\t%0,%2"
4397 - [(set_attr "op_type" "RR<E>,RI,RIL,RIL,RX<Y>,RXY")])
4398 + a<y>\t%0,%2
4399 + a<g>si\t%0,%c2"
4400 + [(set_attr "op_type" "RR<E>,RI,RIL,RIL,RX<Y>,RXY,SIY")
4401 + (set_attr "cpu_facility" "*,*,extimm,extimm,*,*,z10")
4402 + (set_attr "z10prop" "z10_super_E1,
4403 + z10_super_E1,
4404 + z10_super_E1,
4405 + z10_super_E1,
4406 + z10_super_E1,
4407 + z10_super_E1,
4408 + z10_super_E1")])
4409
4410 -; alr, alfi, slfi, al, aly, algr, algfi, slgfi, alg
4411 +; alr, alfi, slfi, al, aly, algr, algfi, slgfi, alg, alsi, algsi
4412 (define_insn "*add<mode>3_carry1_cc"
4413 [(set (reg CC_REGNUM)
4414 - (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,0,0,0,0")
4415 - (match_operand:GPR 2 "general_operand" "d,Op,On,R,T"))
4416 + (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,0,0,0,0,0")
4417 + (match_operand:GPR 2 "general_operand" "d,Op,On,R,T,C"))
4418 (match_dup 1)))
4419 - (set (match_operand:GPR 0 "register_operand" "=d,d,d,d,d")
4420 + (set (match_operand:GPR 0 "nonimmediate_operand" "=d,d,d,d,d,d")
4421 (plus:GPR (match_dup 1) (match_dup 2)))]
4422 "s390_match_ccmode (insn, CCL1mode)"
4423 "@
4424 @@ -3828,8 +4418,16 @@
4425 al<g>fi\t%0,%2
4426 sl<g>fi\t%0,%n2
4427 al<g>\t%0,%2
4428 - al<y>\t%0,%2"
4429 - [(set_attr "op_type" "RR<E>,RIL,RIL,RX<Y>,RXY")])
4430 + al<y>\t%0,%2
4431 + al<g>si\t%0,%c2"
4432 + [(set_attr "op_type" "RR<E>,RIL,RIL,RX<Y>,RXY,SIY")
4433 + (set_attr "cpu_facility" "*,extimm,extimm,*,*,z10")
4434 + (set_attr "z10prop" "z10_super_E1,
4435 + z10_super_E1,
4436 + z10_super_E1,
4437 + z10_super_E1,
4438 + z10_super_E1,
4439 + z10_super_E1")])
4440
4441 ; alr, al, aly, algr, alg
4442 (define_insn "*add<mode>3_carry1_cconly"
4443 @@ -3843,15 +4441,16 @@
4444 al<g>r\t%0,%2
4445 al<g>\t%0,%2
4446 al<y>\t%0,%2"
4447 - [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
4448 + [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
4449 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1")])
4450
4451 -; alr, alfi, slfi, al, aly, algr, algfi, slgfi, alg
4452 +; alr, alfi, slfi, al, aly, algr, algfi, slgfi, alg, alsi, algsi
4453 (define_insn "*add<mode>3_carry2_cc"
4454 [(set (reg CC_REGNUM)
4455 - (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,0,0,0,0")
4456 - (match_operand:GPR 2 "general_operand" "d,Op,On,R,T"))
4457 + (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,0,0,0,0,0")
4458 + (match_operand:GPR 2 "general_operand" "d,Op,On,R,T,C"))
4459 (match_dup 2)))
4460 - (set (match_operand:GPR 0 "register_operand" "=d,d,d,d,d")
4461 + (set (match_operand:GPR 0 "nonimmediate_operand" "=d,d,d,d,d,RS")
4462 (plus:GPR (match_dup 1) (match_dup 2)))]
4463 "s390_match_ccmode (insn, CCL1mode)"
4464 "@
4465 @@ -3859,8 +4458,16 @@
4466 al<g>fi\t%0,%2
4467 sl<g>fi\t%0,%n2
4468 al<g>\t%0,%2
4469 - al<y>\t%0,%2"
4470 - [(set_attr "op_type" "RR<E>,RIL,RIL,RX<Y>,RXY")])
4471 + al<y>\t%0,%2
4472 + al<g>si\t%0,%c2"
4473 + [(set_attr "op_type" "RR<E>,RIL,RIL,RX<Y>,RXY,SIY")
4474 + (set_attr "cpu_facility" "*,extimm,extimm,*,*,z10")
4475 + (set_attr "z10prop" "z10_super_E1,
4476 + z10_super_E1,
4477 + z10_super_E1,
4478 + z10_super_E1,
4479 + z10_super_E1,
4480 + z10_super_E1")])
4481
4482 ; alr, al, aly, algr, alg
4483 (define_insn "*add<mode>3_carry2_cconly"
4484 @@ -3874,15 +4481,16 @@
4485 al<g>r\t%0,%2
4486 al<g>\t%0,%2
4487 al<y>\t%0,%2"
4488 - [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
4489 + [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
4490 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1")])
4491
4492 -; alr, alfi, slfi, al, aly, algr, algfi, slgfi, alg
4493 +; alr, alfi, slfi, al, aly, algr, algfi, slgfi, alg, alsi, algsi
4494 (define_insn "*add<mode>3_cc"
4495 [(set (reg CC_REGNUM)
4496 - (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,0,0,0,0")
4497 - (match_operand:GPR 2 "general_operand" "d,Op,On,R,T"))
4498 + (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,0,0,0,0,0")
4499 + (match_operand:GPR 2 "general_operand" "d,Op,On,R,T,C"))
4500 (const_int 0)))
4501 - (set (match_operand:GPR 0 "register_operand" "=d,d,d,d,d")
4502 + (set (match_operand:GPR 0 "nonimmediate_operand" "=d,d,d,d,d,RS")
4503 (plus:GPR (match_dup 1) (match_dup 2)))]
4504 "s390_match_ccmode (insn, CCLmode)"
4505 "@
4506 @@ -3890,8 +4498,16 @@
4507 al<g>fi\t%0,%2
4508 sl<g>fi\t%0,%n2
4509 al<g>\t%0,%2
4510 - al<y>\t%0,%2"
4511 - [(set_attr "op_type" "RR<E>,RIL,RIL,RX<Y>,RXY")])
4512 + al<y>\t%0,%2
4513 + al<g>si\t%0,%c2"
4514 + [(set_attr "op_type" "RR<E>,RIL,RIL,RX<Y>,RXY,SIY")
4515 + (set_attr "cpu_facility" "*,extimm,extimm,*,*,z10")
4516 + (set_attr "z10prop" "z10_super_E1,
4517 + z10_super_E1,
4518 + z10_super_E1,
4519 + z10_super_E1,
4520 + z10_super_E1,
4521 + z10_super_E1")])
4522
4523 ; alr, al, aly, algr, alg
4524 (define_insn "*add<mode>3_cconly"
4525 @@ -3905,7 +4521,8 @@
4526 al<g>r\t%0,%2
4527 al<g>\t%0,%2
4528 al<y>\t%0,%2"
4529 - [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
4530 + [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
4531 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1")])
4532
4533 ; alr, al, aly, algr, alg
4534 (define_insn "*add<mode>3_cconly2"
4535 @@ -3918,24 +4535,29 @@
4536 al<g>r\t%0,%2
4537 al<g>\t%0,%2
4538 al<y>\t%0,%2"
4539 - [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
4540 + [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
4541 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1")])
4542
4543 -; ahi, afi, aghi, agfi
4544 +; ahi, afi, aghi, agfi, asi, agsi
4545 (define_insn "*add<mode>3_imm_cc"
4546 [(set (reg CC_REGNUM)
4547 - (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "0,0")
4548 - (match_operand:GPR 2 "const_int_operand" "K,Os"))
4549 + (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "0,0,0")
4550 + (match_operand:GPR 2 "const_int_operand" "K,Os,C"))
4551 (const_int 0)))
4552 - (set (match_operand:GPR 0 "register_operand" "=d,d")
4553 + (set (match_operand:GPR 0 "nonimmediate_operand" "=d,d,QS")
4554 (plus:GPR (match_dup 1) (match_dup 2)))]
4555 "s390_match_ccmode (insn, CCAmode)
4556 && (CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\")
4557 - || CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'O', \"Os\"))
4558 + || CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'O', \"Os\")
4559 + || CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'C', \"C\"))
4560 && INTVAL (operands[2]) != -((HOST_WIDE_INT)1 << (GET_MODE_BITSIZE(<MODE>mode) - 1))"
4561 "@
4562 a<g>hi\t%0,%h2
4563 - a<g>fi\t%0,%2"
4564 - [(set_attr "op_type" "RI,RIL")])
4565 + a<g>fi\t%0,%2
4566 + a<g>si\t%0,%c2"
4567 + [(set_attr "op_type" "RI,RIL,SIY")
4568 + (set_attr "cpu_facility" "*,extimm,z10")
4569 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1")])
4570
4571 ;
4572 ; add(tf|df|sf|td|dd)3 instruction pattern(s).
4573 @@ -3952,7 +4574,7 @@
4574 a<xde><bt>r\t%0,<op1>%2
4575 a<xde>b\t%0,%2"
4576 [(set_attr "op_type" "<RRer>,RXE")
4577 - (set_attr "type" "fsimp<bfp>")])
4578 + (set_attr "type" "fsimp<mode>")])
4579
4580 ; axbr, adbr, aebr, axb, adb, aeb, adtr, axtr
4581 (define_insn "*add<mode>3_cc"
4582 @@ -3967,7 +4589,7 @@
4583 a<xde><bt>r\t%0,<op1>%2
4584 a<xde>b\t%0,%2"
4585 [(set_attr "op_type" "<RRer>,RXE")
4586 - (set_attr "type" "fsimp<bfp>")])
4587 + (set_attr "type" "fsimp<mode>")])
4588
4589 ; axbr, adbr, aebr, axb, adb, aeb, adtr, axtr
4590 (define_insn "*add<mode>3_cconly"
4591 @@ -3981,7 +4603,7 @@
4592 a<xde><bt>r\t%0,<op1>%2
4593 a<xde>b\t%0,%2"
4594 [(set_attr "op_type" "<RRer>,RXE")
4595 - (set_attr "type" "fsimp<bfp>")])
4596 + (set_attr "type" "fsimp<mode>")])
4597
4598
4599 ;;
4600 @@ -4032,18 +4654,19 @@
4601 (define_insn "*subdi3_sign"
4602 [(set (match_operand:DI 0 "register_operand" "=d,d")
4603 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
4604 - (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m"))))
4605 + (sign_extend:DI (match_operand:SI 2 "general_operand" "d,RT"))))
4606 (clobber (reg:CC CC_REGNUM))]
4607 "TARGET_64BIT"
4608 "@
4609 sgfr\t%0,%2
4610 sgf\t%0,%2"
4611 - [(set_attr "op_type" "RRE,RXY")])
4612 + [(set_attr "op_type" "RRE,RXY")
4613 + (set_attr "z10prop" "z10_c,*")])
4614
4615 (define_insn "*subdi3_zero_cc"
4616 [(set (reg CC_REGNUM)
4617 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
4618 - (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))
4619 + (zero_extend:DI (match_operand:SI 2 "general_operand" "d,RT")))
4620 (const_int 0)))
4621 (set (match_operand:DI 0 "register_operand" "=d,d")
4622 (minus:DI (match_dup 1) (zero_extend:DI (match_dup 2))))]
4623 @@ -4051,30 +4674,33 @@
4624 "@
4625 slgfr\t%0,%2
4626 slgf\t%0,%2"
4627 - [(set_attr "op_type" "RRE,RXY")])
4628 + [(set_attr "op_type" "RRE,RXY")
4629 + (set_attr "z10prop" "z10_super_c_E1,z10_super_E1")])
4630
4631 (define_insn "*subdi3_zero_cconly"
4632 [(set (reg CC_REGNUM)
4633 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
4634 - (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))
4635 + (zero_extend:DI (match_operand:SI 2 "general_operand" "d,RT")))
4636 (const_int 0)))
4637 (clobber (match_scratch:DI 0 "=d,d"))]
4638 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
4639 "@
4640 slgfr\t%0,%2
4641 slgf\t%0,%2"
4642 - [(set_attr "op_type" "RRE,RXY")])
4643 + [(set_attr "op_type" "RRE,RXY")
4644 + (set_attr "z10prop" "z10_super_c_E1,z10_super_E1")])
4645
4646 (define_insn "*subdi3_zero"
4647 [(set (match_operand:DI 0 "register_operand" "=d,d")
4648 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
4649 - (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))))
4650 + (zero_extend:DI (match_operand:SI 2 "general_operand" "d,RT"))))
4651 (clobber (reg:CC CC_REGNUM))]
4652 "TARGET_64BIT"
4653 "@
4654 slgfr\t%0,%2
4655 slgf\t%0,%2"
4656 - [(set_attr "op_type" "RRE,RXY")])
4657 + [(set_attr "op_type" "RRE,RXY")
4658 + (set_attr "z10prop" "z10_super_c_E1,z10_super_E1")])
4659
4660 (define_insn_and_split "*subdi3_31z"
4661 [(set (match_operand:DI 0 "register_operand" "=&d")
4662 @@ -4171,7 +4797,8 @@
4663 s<g>r\t%0,%2
4664 s<g>\t%0,%2
4665 s<y>\t%0,%2"
4666 - [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
4667 + [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
4668 + (set_attr "z10prop" "z10_super_c_E1,z10_super_E1,z10_super_E1")])
4669
4670 ; slr, sl, sly, slgr, slg
4671 (define_insn "*sub<mode>3_borrow_cc"
4672 @@ -4186,7 +4813,8 @@
4673 sl<g>r\t%0,%2
4674 sl<g>\t%0,%2
4675 sl<y>\t%0,%2"
4676 - [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
4677 + [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
4678 + (set_attr "z10prop" "z10_super_c_E1,z10_super_E1,z10_super_E1")])
4679
4680 ; slr, sl, sly, slgr, slg
4681 (define_insn "*sub<mode>3_borrow_cconly"
4682 @@ -4200,7 +4828,8 @@
4683 sl<g>r\t%0,%2
4684 sl<g>\t%0,%2
4685 sl<y>\t%0,%2"
4686 - [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
4687 + [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
4688 + (set_attr "z10prop" "z10_super_c_E1,z10_super_E1,z10_super_E1")])
4689
4690 ; slr, sl, sly, slgr, slg
4691 (define_insn "*sub<mode>3_cc"
4692 @@ -4215,7 +4844,8 @@
4693 sl<g>r\t%0,%2
4694 sl<g>\t%0,%2
4695 sl<y>\t%0,%2"
4696 - [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
4697 + [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
4698 + (set_attr "z10prop" "z10_super_c_E1,z10_super_E1,z10_super_E1")])
4699
4700 ; slr, sl, sly, slgr, slg
4701 (define_insn "*sub<mode>3_cc2"
4702 @@ -4229,7 +4859,8 @@
4703 sl<g>r\t%0,%2
4704 sl<g>\t%0,%2
4705 sl<y>\t%0,%2"
4706 - [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
4707 + [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
4708 + (set_attr "z10prop" "z10_super_c_E1,z10_super_E1,z10_super_E1")])
4709
4710 ; slr, sl, sly, slgr, slg
4711 (define_insn "*sub<mode>3_cconly"
4712 @@ -4243,8 +4874,10 @@
4713 sl<g>r\t%0,%2
4714 sl<g>\t%0,%2
4715 sl<y>\t%0,%2"
4716 - [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
4717 + [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
4718 + (set_attr "z10prop" "z10_super_c_E1,z10_super_E1,z10_super_E1")])
4719
4720 +
4721 ; slr, sl, sly, slgr, slg
4722 (define_insn "*sub<mode>3_cconly2"
4723 [(set (reg CC_REGNUM)
4724 @@ -4256,8 +4889,10 @@
4725 sl<g>r\t%0,%2
4726 sl<g>\t%0,%2
4727 sl<y>\t%0,%2"
4728 - [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
4729 + [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
4730 + (set_attr "z10prop" "z10_super_c_E1,z10_super_E1,z10_super_E1")])
4731
4732 +
4733 ;
4734 ; sub(tf|df|sf|td|dd)3 instruction pattern(s).
4735 ;
4736 @@ -4273,7 +4908,7 @@
4737 s<xde><bt>r\t%0,<op1>%2
4738 s<xde>b\t%0,%2"
4739 [(set_attr "op_type" "<RRer>,RXE")
4740 - (set_attr "type" "fsimp<bfp>")])
4741 + (set_attr "type" "fsimp<mode>")])
4742
4743 ; sxbr, sdbr, sebr, sxb, sdb, seb, sxtr, sdtr
4744 (define_insn "*sub<mode>3_cc"
4745 @@ -4288,7 +4923,7 @@
4746 s<xde><bt>r\t%0,<op1>%2
4747 s<xde>b\t%0,%2"
4748 [(set_attr "op_type" "<RRer>,RXE")
4749 - (set_attr "type" "fsimp<bfp>")])
4750 + (set_attr "type" "fsimp<mode>")])
4751
4752 ; sxbr, sdbr, sebr, sxb, sdb, seb, sxtr, sdtr
4753 (define_insn "*sub<mode>3_cconly"
4754 @@ -4302,7 +4937,7 @@
4755 s<xde><bt>r\t%0,<op1>%2
4756 s<xde>b\t%0,%2"
4757 [(set_attr "op_type" "<RRer>,RXE")
4758 - (set_attr "type" "fsimp<bfp>")])
4759 + (set_attr "type" "fsimp<mode>")])
4760
4761
4762 ;;
4763 @@ -4324,7 +4959,7 @@
4764 (compare
4765 (plus:GPR (plus:GPR (match_operand:GPR 3 "s390_alc_comparison" "")
4766 (match_operand:GPR 1 "nonimmediate_operand" "%0,0"))
4767 - (match_operand:GPR 2 "general_operand" "d,m"))
4768 + (match_operand:GPR 2 "general_operand" "d,RT"))
4769 (match_dup 1)))
4770 (set (match_operand:GPR 0 "register_operand" "=d,d")
4771 (plus:GPR (plus:GPR (match_dup 3) (match_dup 1)) (match_dup 2)))]
4772 @@ -4340,7 +4975,7 @@
4773 (compare
4774 (plus:GPR (plus:GPR (match_operand:GPR 3 "s390_alc_comparison" "")
4775 (match_operand:GPR 1 "nonimmediate_operand" "%0,0"))
4776 - (match_operand:GPR 2 "general_operand" "d,m"))
4777 + (match_operand:GPR 2 "general_operand" "d,RT"))
4778 (match_dup 1)))
4779 (clobber (match_scratch:GPR 0 "=d,d"))]
4780 "s390_match_ccmode (insn, CCL1mode) && TARGET_CPU_ZARCH"
4781 @@ -4357,7 +4992,7 @@
4782 (compare
4783 (plus:GPR (plus:GPR (match_operand:GPR 3 "s390_alc_comparison" "")
4784 (match_operand:GPR 1 "nonimmediate_operand" "%0,0"))
4785 - (match_operand:GPR 2 "general_operand" "d,m"))
4786 + (match_operand:GPR 2 "general_operand" "d,RT"))
4787 (match_dup 2)))
4788 (set (match_operand:GPR 0 "register_operand" "=d,d")
4789 (plus:GPR (plus:GPR (match_dup 3) (match_dup 1)) (match_dup 2)))]
4790 @@ -4373,7 +5008,7 @@
4791 (compare
4792 (plus:GPR (plus:GPR (match_operand:GPR 3 "s390_alc_comparison" "")
4793 (match_operand:GPR 1 "nonimmediate_operand" "%0,0"))
4794 - (match_operand:GPR 2 "general_operand" "d,m"))
4795 + (match_operand:GPR 2 "general_operand" "d,RT"))
4796 (match_dup 2)))
4797 (clobber (match_scratch:GPR 0 "=d,d"))]
4798 "s390_match_ccmode (insn, CCL1mode) && TARGET_CPU_ZARCH"
4799 @@ -4388,7 +5023,7 @@
4800 (compare
4801 (plus:GPR (plus:GPR (match_operand:GPR 3 "s390_alc_comparison" "")
4802 (match_operand:GPR 1 "nonimmediate_operand" "%0,0"))
4803 - (match_operand:GPR 2 "general_operand" "d,m"))
4804 + (match_operand:GPR 2 "general_operand" "d,RT"))
4805 (const_int 0)))
4806 (set (match_operand:GPR 0 "register_operand" "=d,d")
4807 (plus:GPR (plus:GPR (match_dup 3) (match_dup 1)) (match_dup 2)))]
4808 @@ -4403,7 +5038,7 @@
4809 [(set (match_operand:GPR 0 "register_operand" "=d,d")
4810 (plus:GPR (plus:GPR (match_operand:GPR 3 "s390_alc_comparison" "")
4811 (match_operand:GPR 1 "nonimmediate_operand" "%0,0"))
4812 - (match_operand:GPR 2 "general_operand" "d,m")))
4813 + (match_operand:GPR 2 "general_operand" "d,RT")))
4814 (clobber (reg:CC CC_REGNUM))]
4815 "TARGET_CPU_ZARCH"
4816 "@
4817 @@ -4416,7 +5051,7 @@
4818 [(set (reg CC_REGNUM)
4819 (compare
4820 (minus:GPR (minus:GPR (match_operand:GPR 1 "nonimmediate_operand" "0,0")
4821 - (match_operand:GPR 2 "general_operand" "d,m"))
4822 + (match_operand:GPR 2 "general_operand" "d,RT"))
4823 (match_operand:GPR 3 "s390_slb_comparison" ""))
4824 (const_int 0)))
4825 (set (match_operand:GPR 0 "register_operand" "=d,d")
4826 @@ -4425,20 +5060,22 @@
4827 "@
4828 slb<g>r\t%0,%2
4829 slb<g>\t%0,%2"
4830 - [(set_attr "op_type" "RRE,RXY")])
4831 + [(set_attr "op_type" "RRE,RXY")
4832 + (set_attr "z10prop" "z10_c,*")])
4833
4834 ; slbr, slb, slbgr, slbg
4835 (define_insn "*sub<mode>3_slb"
4836 [(set (match_operand:GPR 0 "register_operand" "=d,d")
4837 (minus:GPR (minus:GPR (match_operand:GPR 1 "nonimmediate_operand" "0,0")
4838 - (match_operand:GPR 2 "general_operand" "d,m"))
4839 + (match_operand:GPR 2 "general_operand" "d,RT"))
4840 (match_operand:GPR 3 "s390_slb_comparison" "")))
4841 (clobber (reg:CC CC_REGNUM))]
4842 "TARGET_CPU_ZARCH"
4843 "@
4844 slb<g>r\t%0,%2
4845 slb<g>\t%0,%2"
4846 - [(set_attr "op_type" "RRE,RXY")])
4847 + [(set_attr "op_type" "RRE,RXY")
4848 + (set_attr "z10prop" "z10_c,*")])
4849
4850 (define_expand "add<mode>cc"
4851 [(match_operand:GPR 0 "register_operand" "")
4852 @@ -4446,9 +5083,9 @@
4853 (match_operand:GPR 2 "register_operand" "")
4854 (match_operand:GPR 3 "const_int_operand" "")]
4855 "TARGET_CPU_ZARCH"
4856 - "if (!s390_expand_addcc (GET_CODE (operands[1]),
4857 - s390_compare_op0, s390_compare_op1,
4858 - operands[0], operands[2],
4859 + "if (!s390_expand_addcc (GET_CODE (operands[1]),
4860 + s390_compare_op0, s390_compare_op1,
4861 + operands[0], operands[2],
4862 operands[3])) FAIL; DONE;")
4863
4864 ;
4865 @@ -4504,7 +5141,7 @@
4866 [(set (match_dup 0) (xor:SI (match_dup 0) (const_int 1)))
4867 (clobber (reg:CC CC_REGNUM))])]
4868 ""
4869 -{
4870 +{
4871 if (!s390_compare_emitted || GET_MODE (s390_compare_emitted) != CCZ1mode)
4872 FAIL;
4873 operands[1] = s390_emit_compare (NE, s390_compare_op0, s390_compare_op1);
4874 @@ -4513,7 +5150,7 @@
4875
4876 (define_insn_and_split "*sne"
4877 [(set (match_operand:SI 0 "register_operand" "=d")
4878 - (ne:SI (match_operand:CCZ1 1 "register_operand" "0")
4879 + (ne:SI (match_operand:CCZ1 1 "register_operand" "0")
4880 (const_int 0)))
4881 (clobber (reg:CC CC_REGNUM))]
4882 ""
4883 @@ -4534,69 +5171,78 @@
4884
4885 (define_insn "*muldi3_sign"
4886 [(set (match_operand:DI 0 "register_operand" "=d,d")
4887 - (mult:DI (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "d,m"))
4888 + (mult:DI (sign_extend:DI (match_operand:SI 2 "general_operand" "d,RT"))
4889 (match_operand:DI 1 "register_operand" "0,0")))]
4890 "TARGET_64BIT"
4891 "@
4892 msgfr\t%0,%2
4893 msgf\t%0,%2"
4894 - [(set_attr "op_type" "RRE,RXY")
4895 - (set_attr "type" "imuldi")])
4896 + [(set_attr "op_type" "RRE,RXY")
4897 + (set_attr "type" "imuldi")])
4898
4899 (define_insn "muldi3"
4900 - [(set (match_operand:DI 0 "register_operand" "=d,d,d")
4901 - (mult:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0")
4902 - (match_operand:DI 2 "general_operand" "d,K,m")))]
4903 + [(set (match_operand:DI 0 "register_operand" "=d,d,d,d")
4904 + (mult:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0")
4905 + (match_operand:DI 2 "general_operand" "d,K,RT,Os")))]
4906 "TARGET_64BIT"
4907 "@
4908 msgr\t%0,%2
4909 mghi\t%0,%h2
4910 - msg\t%0,%2"
4911 - [(set_attr "op_type" "RRE,RI,RXY")
4912 - (set_attr "type" "imuldi")])
4913 + msg\t%0,%2
4914 + msgfi\t%0,%2"
4915 + [(set_attr "op_type" "RRE,RI,RXY,RIL")
4916 + (set_attr "type" "imuldi")
4917 + (set_attr "cpu_facility" "*,*,*,z10")])
4918
4919 ;
4920 ; mulsi3 instruction pattern(s).
4921 ;
4922
4923 (define_insn "*mulsi3_sign"
4924 - [(set (match_operand:SI 0 "register_operand" "=d")
4925 - (mult:SI (sign_extend:SI (match_operand:HI 2 "memory_operand" "R"))
4926 - (match_operand:SI 1 "register_operand" "0")))]
4927 + [(set (match_operand:SI 0 "register_operand" "=d,d")
4928 + (mult:SI (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T"))
4929 + (match_operand:SI 1 "register_operand" "0,0")))]
4930 ""
4931 - "mh\t%0,%2"
4932 - [(set_attr "op_type" "RX")
4933 - (set_attr "type" "imulhi")])
4934 + "@
4935 + mh\t%0,%2
4936 + mhy\t%0,%2"
4937 + [(set_attr "op_type" "RX,RXY")
4938 + (set_attr "type" "imulhi")
4939 + (set_attr "cpu_facility" "*,z10")])
4940
4941 (define_insn "mulsi3"
4942 - [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
4943 - (mult:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
4944 - (match_operand:SI 2 "general_operand" "d,K,R,T")))]
4945 + [(set (match_operand:SI 0 "register_operand" "=d,d,d,d,d")
4946 + (mult:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0,0")
4947 + (match_operand:SI 2 "general_operand" "d,K,R,T,Os")))]
4948 ""
4949 "@
4950 msr\t%0,%2
4951 mhi\t%0,%h2
4952 ms\t%0,%2
4953 - msy\t%0,%2"
4954 - [(set_attr "op_type" "RRE,RI,RX,RXY")
4955 - (set_attr "type" "imulsi,imulhi,imulsi,imulsi")])
4956 + msy\t%0,%2
4957 + msfi\t%0,%2"
4958 + [(set_attr "op_type" "RRE,RI,RX,RXY,RIL")
4959 + (set_attr "type" "imulsi,imulhi,imulsi,imulsi,imulsi")
4960 + (set_attr "cpu_facility" "*,*,*,*,z10")])
4961
4962 ;
4963 ; mulsidi3 instruction pattern(s).
4964 ;
4965
4966 (define_insn "mulsidi3"
4967 - [(set (match_operand:DI 0 "register_operand" "=d,d")
4968 + [(set (match_operand:DI 0 "register_operand" "=d,d,d")
4969 (mult:DI (sign_extend:DI
4970 - (match_operand:SI 1 "register_operand" "%0,0"))
4971 + (match_operand:SI 1 "register_operand" "%0,0,0"))
4972 (sign_extend:DI
4973 - (match_operand:SI 2 "nonimmediate_operand" "d,R"))))]
4974 + (match_operand:SI 2 "nonimmediate_operand" "d,R,T"))))]
4975 "!TARGET_64BIT"
4976 "@
4977 mr\t%0,%2
4978 - m\t%0,%2"
4979 - [(set_attr "op_type" "RR,RX")
4980 - (set_attr "type" "imulsi")])
4981 + m\t%0,%2
4982 + mfy\t%0,%2"
4983 + [(set_attr "op_type" "RR,RX,RXY")
4984 + (set_attr "type" "imulsi")
4985 + (set_attr "cpu_facility" "*,*,z10")])
4986
4987 ;
4988 ; umulsidi3 instruction pattern(s).
4989 @@ -4607,7 +5253,7 @@
4990 (mult:DI (zero_extend:DI
4991 (match_operand:SI 1 "register_operand" "%0,0"))
4992 (zero_extend:DI
4993 - (match_operand:SI 2 "nonimmediate_operand" "d,m"))))]
4994 + (match_operand:SI 2 "nonimmediate_operand" "d,RT"))))]
4995 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4996 "@
4997 mlr\t%0,%2
4998 @@ -4619,7 +5265,7 @@
4999 ; mul(tf|df|sf|td|dd)3 instruction pattern(s).
5000 ;
5001
5002 -; mxbr mdbr, meebr, mxb, mxb, meeb, mdtr, mxtr
5003 +; mxbr, mdbr, meebr, mxb, mxb, meeb, mdtr, mxtr
5004 (define_insn "mul<mode>3"
5005 [(set (match_operand:FP 0 "register_operand" "=f,f")
5006 (mult:FP (match_operand:FP 1 "nonimmediate_operand" "%<f0>,0")
5007 @@ -4629,9 +5275,9 @@
5008 m<xdee><bt>r\t%0,<op1>%2
5009 m<xdee>b\t%0,%2"
5010 [(set_attr "op_type" "<RRer>,RXE")
5011 - (set_attr "type" "fmul<bfp>")])
5012 + (set_attr "type" "fmul<mode>")])
5013
5014 -; maxbr, madbr, maebr, maxb, madb, maeb
5015 +; madbr, maebr, maxb, madb, maeb
5016 (define_insn "*fmadd<mode>"
5017 [(set (match_operand:DSF 0 "register_operand" "=f,f")
5018 (plus:DSF (mult:DSF (match_operand:DSF 1 "register_operand" "%f,f")
5019 @@ -4697,7 +5343,7 @@
5020 (ashift:TI
5021 (zero_extend:TI
5022 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
5023 - (match_operand:DI 2 "general_operand" "d,m")))
5024 + (match_operand:DI 2 "general_operand" "d,RT")))
5025 (const_int 64))
5026 (zero_extend:TI (div:DI (match_dup 1) (match_dup 2)))))]
5027 "TARGET_64BIT"
5028 @@ -4714,7 +5360,7 @@
5029 (zero_extend:TI
5030 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
5031 (sign_extend:DI
5032 - (match_operand:SI 2 "nonimmediate_operand" "d,m"))))
5033 + (match_operand:SI 2 "nonimmediate_operand" "d,RT"))))
5034 (const_int 64))
5035 (zero_extend:TI
5036 (div:DI (match_dup 1) (sign_extend:DI (match_dup 2))))))]
5037 @@ -4773,7 +5419,7 @@
5038 (truncate:DI
5039 (umod:TI (match_operand:TI 1 "register_operand" "0,0")
5040 (zero_extend:TI
5041 - (match_operand:DI 2 "nonimmediate_operand" "d,m")))))
5042 + (match_operand:DI 2 "nonimmediate_operand" "d,RT")))))
5043 (const_int 64))
5044 (zero_extend:TI
5045 (truncate:DI
5046 @@ -4891,7 +5537,7 @@
5047 (truncate:SI
5048 (umod:DI (match_operand:DI 1 "register_operand" "0,0")
5049 (zero_extend:DI
5050 - (match_operand:SI 2 "nonimmediate_operand" "d,m")))))
5051 + (match_operand:SI 2 "nonimmediate_operand" "d,RT")))))
5052 (const_int 32))
5053 (zero_extend:DI
5054 (truncate:SI
5055 @@ -5089,7 +5735,7 @@
5056 d<xde><bt>r\t%0,<op1>%2
5057 d<xde>b\t%0,%2"
5058 [(set_attr "op_type" "<RRer>,RXE")
5059 - (set_attr "type" "fdiv<bfp>")])
5060 + (set_attr "type" "fdiv<mode>")])
5061
5062
5063 ;;
5064 @@ -5111,7 +5757,7 @@
5065 (define_insn "*anddi3_cc"
5066 [(set (reg CC_REGNUM)
5067 (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5068 - (match_operand:DI 2 "general_operand" "d,m"))
5069 + (match_operand:DI 2 "general_operand" "d,RT"))
5070 (const_int 0)))
5071 (set (match_operand:DI 0 "register_operand" "=d,d")
5072 (and:DI (match_dup 1) (match_dup 2)))]
5073 @@ -5119,12 +5765,13 @@
5074 "@
5075 ngr\t%0,%2
5076 ng\t%0,%2"
5077 - [(set_attr "op_type" "RRE,RXY")])
5078 + [(set_attr "op_type" "RRE,RXY")
5079 + (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
5080
5081 (define_insn "*anddi3_cconly"
5082 [(set (reg CC_REGNUM)
5083 (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5084 - (match_operand:DI 2 "general_operand" "d,m"))
5085 + (match_operand:DI 2 "general_operand" "d,RT"))
5086 (const_int 0)))
5087 (clobber (match_scratch:DI 0 "=d,d"))]
5088 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT
5089 @@ -5133,16 +5780,17 @@
5090 "@
5091 ngr\t%0,%2
5092 ng\t%0,%2"
5093 - [(set_attr "op_type" "RRE,RXY")])
5094 + [(set_attr "op_type" "RRE,RXY")
5095 + (set_attr "z10prop" "z10_super_E1, z10_super_E1")])
5096
5097 -(define_insn "*anddi3_extimm"
5098 +(define_insn "*anddi3"
5099 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,d,d,d,d,AQ,Q")
5100 (and:DI (match_operand:DI 1 "nonimmediate_operand"
5101 "%d,o,0,0,0,0,0,0,0,0,0,0")
5102 (match_operand:DI 2 "general_operand"
5103 - "M,M,N0HDF,N1HDF,N2HDF,N3HDF,N0SDF,N1SDF,d,m,NxQDF,Q")))
5104 + "M,M,N0HDF,N1HDF,N2HDF,N3HDF,N0SDF,N1SDF,d,RT,NxQDF,Q")))
5105 (clobber (reg:CC CC_REGNUM))]
5106 - "TARGET_64BIT && TARGET_EXTIMM && s390_logical_operator_ok_p (operands)"
5107 + "TARGET_64BIT && s390_logical_operator_ok_p (operands)"
5108 "@
5109 #
5110 #
5111 @@ -5156,29 +5804,21 @@
5112 ng\t%0,%2
5113 #
5114 #"
5115 - [(set_attr "op_type" "RRE,RXE,RI,RI,RI,RI,RIL,RIL,RRE,RXY,SI,SS")])
5116 + [(set_attr "op_type" "RRE,RXE,RI,RI,RI,RI,RIL,RIL,RRE,RXY,SI,SS")
5117 + (set_attr "cpu_facility" "*,*,*,*,*,*,extimm,extimm,*,*,*,*")
5118 + (set_attr "z10prop" "*,
5119 + *,
5120 + z10_super_E1,
5121 + z10_super_E1,
5122 + z10_super_E1,
5123 + z10_super_E1,
5124 + z10_super_E1,
5125 + z10_super_E1,
5126 + z10_super_E1,
5127 + z10_super_E1,
5128 + *,
5129 + *")])
5130
5131 -(define_insn "*anddi3"
5132 - [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,d,d,AQ,Q")
5133 - (and:DI (match_operand:DI 1 "nonimmediate_operand"
5134 - "%d,o,0,0,0,0,0,0,0,0")
5135 - (match_operand:DI 2 "general_operand"
5136 - "M,M,N0HDF,N1HDF,N2HDF,N3HDF,d,m,NxQDF,Q")))
5137 - (clobber (reg:CC CC_REGNUM))]
5138 - "TARGET_64BIT && !TARGET_EXTIMM && s390_logical_operator_ok_p (operands)"
5139 - "@
5140 - #
5141 - #
5142 - nihh\t%0,%j2
5143 - nihl\t%0,%j2
5144 - nilh\t%0,%j2
5145 - nill\t%0,%j2
5146 - ngr\t%0,%2
5147 - ng\t%0,%2
5148 - #
5149 - #"
5150 - [(set_attr "op_type" "RRE,RXE,RI,RI,RI,RI,RRE,RXY,SI,SS")])
5151 -
5152 (define_split
5153 [(set (match_operand:DI 0 "s_operand" "")
5154 (and:DI (match_dup 0) (match_operand:DI 1 "immediate_operand" "")))
5155 @@ -5207,7 +5847,8 @@
5156 nr\t%0,%2
5157 n\t%0,%2
5158 ny\t%0,%2"
5159 - [(set_attr "op_type" "RIL,RR,RX,RXY")])
5160 + [(set_attr "op_type" "RIL,RR,RX,RXY")
5161 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1,z10_super_E1")])
5162
5163 (define_insn "*andsi3_cconly"
5164 [(set (reg CC_REGNUM)
5165 @@ -5223,7 +5864,8 @@
5166 nr\t%0,%2
5167 n\t%0,%2
5168 ny\t%0,%2"
5169 - [(set_attr "op_type" "RIL,RR,RX,RXY")])
5170 + [(set_attr "op_type" "RIL,RR,RX,RXY")
5171 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1,z10_super_E1")])
5172
5173 (define_insn "*andsi3_zarch"
5174 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,d,d,d,d,d,AQ,Q")
5175 @@ -5244,7 +5886,17 @@
5176 ny\t%0,%2
5177 #
5178 #"
5179 - [(set_attr "op_type" "RRE,RXE,RI,RI,RIL,RR,RX,RXY,SI,SS")])
5180 + [(set_attr "op_type" "RRE,RXE,RI,RI,RIL,RR,RX,RXY,SI,SS")
5181 + (set_attr "z10prop" "*,
5182 + *,
5183 + z10_super_E1,
5184 + z10_super_E1,
5185 + z10_super_E1,
5186 + z10_super_E1,
5187 + z10_super_E1,
5188 + z10_super_E1,
5189 + *,
5190 + *")])
5191
5192 (define_insn "*andsi3_esa"
5193 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,AQ,Q")
5194 @@ -5257,8 +5909,10 @@
5195 n\t%0,%2
5196 #
5197 #"
5198 - [(set_attr "op_type" "RR,RX,SI,SS")])
5199 + [(set_attr "op_type" "RR,RX,SI,SS")
5200 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,*,*")])
5201
5202 +
5203 (define_split
5204 [(set (match_operand:SI 0 "s_operand" "")
5205 (and:SI (match_dup 0) (match_operand:SI 1 "immediate_operand" "")))
5206 @@ -5284,7 +5938,9 @@
5207 nill\t%0,%x2
5208 #
5209 #"
5210 - [(set_attr "op_type" "RR,RI,SI,SS")])
5211 + [(set_attr "op_type" "RR,RI,SI,SS")
5212 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,*,*")
5213 +])
5214
5215 (define_insn "*andhi3_esa"
5216 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,AQ,Q")
5217 @@ -5296,7 +5952,9 @@
5218 nr\t%0,%2
5219 #
5220 #"
5221 - [(set_attr "op_type" "RR,SI,SS")])
5222 + [(set_attr "op_type" "RR,SI,SS")
5223 + (set_attr "z10prop" "z10_super_E1,*,*")
5224 +])
5225
5226 (define_split
5227 [(set (match_operand:HI 0 "s_operand" "")
5228 @@ -5324,7 +5982,8 @@
5229 ni\t%S0,%b2
5230 niy\t%S0,%b2
5231 #"
5232 - [(set_attr "op_type" "RR,RI,SI,SIY,SS")])
5233 + [(set_attr "op_type" "RR,RI,SI,SIY,SS")
5234 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super,z10_super,*")])
5235
5236 (define_insn "*andqi3_esa"
5237 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,Q,Q")
5238 @@ -5336,7 +5995,8 @@
5239 nr\t%0,%2
5240 ni\t%S0,%b2
5241 #"
5242 - [(set_attr "op_type" "RR,SI,SS")])
5243 + [(set_attr "op_type" "RR,SI,SS")
5244 + (set_attr "z10prop" "z10_super_E1,z10_super,*")])
5245
5246 ;
5247 ; Block and (NC) patterns.
5248 @@ -5385,7 +6045,7 @@
5249 (clobber (reg:CC CC_REGNUM))])]
5250 "s390_offset_p (operands[0], operands[3], operands[2])
5251 && s390_offset_p (operands[1], operands[4], operands[2])
5252 - && !s390_overlap_p (operands[0], operands[1],
5253 + && !s390_overlap_p (operands[0], operands[1],
5254 INTVAL (operands[2]) + INTVAL (operands[5]))
5255 && INTVAL (operands[2]) + INTVAL (operands[5]) <= 256"
5256 [(parallel
5257 @@ -5416,7 +6076,7 @@
5258 (define_insn "*iordi3_cc"
5259 [(set (reg CC_REGNUM)
5260 (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5261 - (match_operand:DI 2 "general_operand" "d,m"))
5262 + (match_operand:DI 2 "general_operand" "d,RT"))
5263 (const_int 0)))
5264 (set (match_operand:DI 0 "register_operand" "=d,d")
5265 (ior:DI (match_dup 1) (match_dup 2)))]
5266 @@ -5424,27 +6084,29 @@
5267 "@
5268 ogr\t%0,%2
5269 og\t%0,%2"
5270 - [(set_attr "op_type" "RRE,RXY")])
5271 + [(set_attr "op_type" "RRE,RXY")
5272 + (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
5273
5274 (define_insn "*iordi3_cconly"
5275 [(set (reg CC_REGNUM)
5276 (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5277 - (match_operand:DI 2 "general_operand" "d,m"))
5278 + (match_operand:DI 2 "general_operand" "d,RT"))
5279 (const_int 0)))
5280 (clobber (match_scratch:DI 0 "=d,d"))]
5281 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5282 "@
5283 ogr\t%0,%2
5284 og\t%0,%2"
5285 - [(set_attr "op_type" "RRE,RXY")])
5286 + [(set_attr "op_type" "RRE,RXY")
5287 + (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
5288
5289 -(define_insn "*iordi3_extimm"
5290 +(define_insn "*iordi3"
5291 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,d,d,AQ,Q")
5292 (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0,0,0,0,0,0,0")
5293 (match_operand:DI 2 "general_operand"
5294 - "N0HD0,N1HD0,N2HD0,N3HD0,N0SD0,N1SD0,d,m,NxQD0,Q")))
5295 + "N0HD0,N1HD0,N2HD0,N3HD0,N0SD0,N1SD0,d,RT,NxQD0,Q")))
5296 (clobber (reg:CC CC_REGNUM))]
5297 - "TARGET_64BIT && TARGET_EXTIMM && s390_logical_operator_ok_p (operands)"
5298 + "TARGET_64BIT && s390_logical_operator_ok_p (operands)"
5299 "@
5300 oihh\t%0,%i2
5301 oihl\t%0,%i2
5302 @@ -5456,26 +6118,19 @@
5303 og\t%0,%2
5304 #
5305 #"
5306 - [(set_attr "op_type" "RI,RI,RI,RI,RIL,RIL,RRE,RXY,SI,SS")])
5307 + [(set_attr "op_type" "RI,RI,RI,RI,RIL,RIL,RRE,RXY,SI,SS")
5308 + (set_attr "cpu_facility" "*,*,*,*,extimm,extimm,*,*,*,*")
5309 + (set_attr "z10prop" "z10_super_E1,
5310 + z10_super_E1,
5311 + z10_super_E1,
5312 + z10_super_E1,
5313 + z10_super_E1,
5314 + z10_super_E1,
5315 + z10_super_E1,
5316 + z10_super_E1,
5317 + *,
5318 + *")])
5319
5320 -(define_insn "*iordi3"
5321 - [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,AQ,Q")
5322 - (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0,0,0,0,0")
5323 - (match_operand:DI 2 "general_operand"
5324 - "N0HD0,N1HD0,N2HD0,N3HD0,d,m,NxQD0,Q")))
5325 - (clobber (reg:CC CC_REGNUM))]
5326 - "TARGET_64BIT && !TARGET_EXTIMM && s390_logical_operator_ok_p (operands)"
5327 - "@
5328 - oihh\t%0,%i2
5329 - oihl\t%0,%i2
5330 - oilh\t%0,%i2
5331 - oill\t%0,%i2
5332 - ogr\t%0,%2
5333 - og\t%0,%2
5334 - #
5335 - #"
5336 - [(set_attr "op_type" "RI,RI,RI,RI,RRE,RXY,SI,SS")])
5337 -
5338 (define_split
5339 [(set (match_operand:DI 0 "s_operand" "")
5340 (ior:DI (match_dup 0) (match_operand:DI 1 "immediate_operand" "")))
5341 @@ -5503,7 +6158,8 @@
5342 or\t%0,%2
5343 o\t%0,%2
5344 oy\t%0,%2"
5345 - [(set_attr "op_type" "RIL,RR,RX,RXY")])
5346 + [(set_attr "op_type" "RIL,RR,RX,RXY")
5347 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1,z10_super_E1")])
5348
5349 (define_insn "*iorsi3_cconly"
5350 [(set (reg CC_REGNUM)
5351 @@ -5517,7 +6173,8 @@
5352 or\t%0,%2
5353 o\t%0,%2
5354 oy\t%0,%2"
5355 - [(set_attr "op_type" "RIL,RR,RX,RXY")])
5356 + [(set_attr "op_type" "RIL,RR,RX,RXY")
5357 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1,z10_super_E1")])
5358
5359 (define_insn "*iorsi3_zarch"
5360 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,d,d,d,AQ,Q")
5361 @@ -5534,7 +6191,15 @@
5362 oy\t%0,%2
5363 #
5364 #"
5365 - [(set_attr "op_type" "RI,RI,RIL,RR,RX,RXY,SI,SS")])
5366 + [(set_attr "op_type" "RI,RI,RIL,RR,RX,RXY,SI,SS")
5367 + (set_attr "z10prop" "z10_super_E1,
5368 + z10_super_E1,
5369 + z10_super_E1,
5370 + z10_super_E1,
5371 + z10_super_E1,
5372 + z10_super_E1,
5373 + *,
5374 + *")])
5375
5376 (define_insn "*iorsi3_esa"
5377 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,AQ,Q")
5378 @@ -5547,7 +6212,8 @@
5379 o\t%0,%2
5380 #
5381 #"
5382 - [(set_attr "op_type" "RR,RX,SI,SS")])
5383 + [(set_attr "op_type" "RR,RX,SI,SS")
5384 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,*,*")])
5385
5386 (define_split
5387 [(set (match_operand:SI 0 "s_operand" "")
5388 @@ -5574,7 +6240,8 @@
5389 oill\t%0,%x2
5390 #
5391 #"
5392 - [(set_attr "op_type" "RR,RI,SI,SS")])
5393 + [(set_attr "op_type" "RR,RI,SI,SS")
5394 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,*,*")])
5395
5396 (define_insn "*iorhi3_esa"
5397 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,AQ,Q")
5398 @@ -5586,7 +6253,8 @@
5399 or\t%0,%2
5400 #
5401 #"
5402 - [(set_attr "op_type" "RR,SI,SS")])
5403 + [(set_attr "op_type" "RR,SI,SS")
5404 + (set_attr "z10prop" "z10_super_E1,*,*")])
5405
5406 (define_split
5407 [(set (match_operand:HI 0 "s_operand" "")
5408 @@ -5614,7 +6282,8 @@
5409 oi\t%S0,%b2
5410 oiy\t%S0,%b2
5411 #"
5412 - [(set_attr "op_type" "RR,RI,SI,SIY,SS")])
5413 + [(set_attr "op_type" "RR,RI,SI,SIY,SS")
5414 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super,z10_super,*")])
5415
5416 (define_insn "*iorqi3_esa"
5417 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,Q,Q")
5418 @@ -5626,7 +6295,8 @@
5419 or\t%0,%2
5420 oi\t%S0,%b2
5421 #"
5422 - [(set_attr "op_type" "RR,SI,SS")])
5423 + [(set_attr "op_type" "RR,SI,SS")
5424 + (set_attr "z10prop" "z10_super_E1,z10_super,*")])
5425
5426 ;
5427 ; Block inclusive or (OC) patterns.
5428 @@ -5675,7 +6345,7 @@
5429 (clobber (reg:CC CC_REGNUM))])]
5430 "s390_offset_p (operands[0], operands[3], operands[2])
5431 && s390_offset_p (operands[1], operands[4], operands[2])
5432 - && !s390_overlap_p (operands[0], operands[1],
5433 + && !s390_overlap_p (operands[0], operands[1],
5434 INTVAL (operands[2]) + INTVAL (operands[5]))
5435 && INTVAL (operands[2]) + INTVAL (operands[5]) <= 256"
5436 [(parallel
5437 @@ -5706,7 +6376,7 @@
5438 (define_insn "*xordi3_cc"
5439 [(set (reg CC_REGNUM)
5440 (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5441 - (match_operand:DI 2 "general_operand" "d,m"))
5442 + (match_operand:DI 2 "general_operand" "d,RT"))
5443 (const_int 0)))
5444 (set (match_operand:DI 0 "register_operand" "=d,d")
5445 (xor:DI (match_dup 1) (match_dup 2)))]
5446 @@ -5714,26 +6384,28 @@
5447 "@
5448 xgr\t%0,%2
5449 xg\t%0,%2"
5450 - [(set_attr "op_type" "RRE,RXY")])
5451 + [(set_attr "op_type" "RRE,RXY")
5452 + (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
5453
5454 (define_insn "*xordi3_cconly"
5455 [(set (reg CC_REGNUM)
5456 (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5457 - (match_operand:DI 2 "general_operand" "d,m"))
5458 + (match_operand:DI 2 "general_operand" "d,RT"))
5459 (const_int 0)))
5460 (clobber (match_scratch:DI 0 "=d,d"))]
5461 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5462 "@
5463 xgr\t%0,%2
5464 xg\t%0,%2"
5465 - [(set_attr "op_type" "RRE,RXY")])
5466 + [(set_attr "op_type" "RRE,RXY")
5467 + (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
5468
5469 -(define_insn "*xordi3_extimm"
5470 +(define_insn "*xordi3"
5471 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,AQ,Q")
5472 (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0,0,0")
5473 - (match_operand:DI 2 "general_operand" "N0SD0,N1SD0,d,m,NxQD0,Q")))
5474 + (match_operand:DI 2 "general_operand" "N0SD0,N1SD0,d,RT,NxQD0,Q")))
5475 (clobber (reg:CC CC_REGNUM))]
5476 - "TARGET_64BIT && TARGET_EXTIMM && s390_logical_operator_ok_p (operands)"
5477 + "TARGET_64BIT && s390_logical_operator_ok_p (operands)"
5478 "@
5479 xihf\t%0,%k2
5480 xilf\t%0,%k2
5481 @@ -5741,21 +6413,10 @@
5482 xg\t%0,%2
5483 #
5484 #"
5485 - [(set_attr "op_type" "RIL,RIL,RRE,RXY,SI,SS")])
5486 + [(set_attr "op_type" "RIL,RIL,RRE,RXY,SI,SS")
5487 + (set_attr "cpu_facility" "extimm,extimm,*,*,*,*")
5488 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1,z10_super_E1,*,*")])
5489
5490 -(define_insn "*xordi3"
5491 - [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,AQ,Q")
5492 - (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0")
5493 - (match_operand:DI 2 "general_operand" "d,m,NxQD0,Q")))
5494 - (clobber (reg:CC CC_REGNUM))]
5495 - "TARGET_64BIT && !TARGET_EXTIMM && s390_logical_operator_ok_p (operands)"
5496 - "@
5497 - xgr\t%0,%2
5498 - xg\t%0,%2
5499 - #
5500 - #"
5501 - [(set_attr "op_type" "RRE,RXY,SI,SS")])
5502 -
5503 (define_split
5504 [(set (match_operand:DI 0 "s_operand" "")
5505 (xor:DI (match_dup 0) (match_operand:DI 1 "immediate_operand" "")))
5506 @@ -5783,7 +6444,8 @@
5507 xr\t%0,%2
5508 x\t%0,%2
5509 xy\t%0,%2"
5510 - [(set_attr "op_type" "RIL,RR,RX,RXY")])
5511 + [(set_attr "op_type" "RIL,RR,RX,RXY")
5512 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1,z10_super_E1")])
5513
5514 (define_insn "*xorsi3_cconly"
5515 [(set (reg CC_REGNUM)
5516 @@ -5797,7 +6459,8 @@
5517 xr\t%0,%2
5518 x\t%0,%2
5519 xy\t%0,%2"
5520 - [(set_attr "op_type" "RIL,RR,RX,RXY")])
5521 + [(set_attr "op_type" "RIL,RR,RX,RXY")
5522 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1,z10_super_E1")])
5523
5524 (define_insn "*xorsi3"
5525 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,d,AQ,Q")
5526 @@ -5812,7 +6475,8 @@
5527 xy\t%0,%2
5528 #
5529 #"
5530 - [(set_attr "op_type" "RIL,RR,RX,RXY,SI,SS")])
5531 + [(set_attr "op_type" "RIL,RR,RX,RXY,SI,SS")
5532 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1,z10_super_E1,*,*")])
5533
5534 (define_split
5535 [(set (match_operand:SI 0 "s_operand" "")
5536 @@ -5839,7 +6503,8 @@
5537 xr\t%0,%2
5538 #
5539 #"
5540 - [(set_attr "op_type" "RIL,RR,SI,SS")])
5541 + [(set_attr "op_type" "RIL,RR,SI,SS")
5542 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,*,*")])
5543
5544 (define_split
5545 [(set (match_operand:HI 0 "s_operand" "")
5546 @@ -5867,8 +6532,10 @@
5547 xi\t%S0,%b2
5548 xiy\t%S0,%b2
5549 #"
5550 - [(set_attr "op_type" "RIL,RR,SI,SIY,SS")])
5551 + [(set_attr "op_type" "RIL,RR,SI,SIY,SS")
5552 + (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super,z10_super,*")])
5553
5554 +
5555 ;
5556 ; Block exclusive or (XC) patterns.
5557 ;
5558 @@ -5916,7 +6583,7 @@
5559 (clobber (reg:CC CC_REGNUM))])]
5560 "s390_offset_p (operands[0], operands[3], operands[2])
5561 && s390_offset_p (operands[1], operands[4], operands[2])
5562 - && !s390_overlap_p (operands[0], operands[1],
5563 + && !s390_overlap_p (operands[0], operands[1],
5564 INTVAL (operands[2]) + INTVAL (operands[5]))
5565 && INTVAL (operands[2]) + INTVAL (operands[5]) <= 256"
5566 [(parallel
5567 @@ -5988,7 +6655,7 @@
5568 "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)"
5569 "lcgfr\t%0,%1"
5570 [(set_attr "op_type" "RRE")])
5571 -
5572 +
5573 (define_insn "*negdi2_sign"
5574 [(set (match_operand:DI 0 "register_operand" "=d")
5575 (neg:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d"))))
5576 @@ -6006,7 +6673,8 @@
5577 (neg:GPR (match_dup 1)))]
5578 "s390_match_ccmode (insn, CCAmode)"
5579 "lc<g>r\t%0,%1"
5580 - [(set_attr "op_type" "RR<E>")])
5581 + [(set_attr "op_type" "RR<E>")
5582 + (set_attr "z10prop" "z10_super_c_E1")])
5583
5584 ; lcr, lcgr
5585 (define_insn "*neg<mode>2_cconly"
5586 @@ -6016,7 +6684,8 @@
5587 (clobber (match_scratch:GPR 0 "=d"))]
5588 "s390_match_ccmode (insn, CCAmode)"
5589 "lc<g>r\t%0,%1"
5590 - [(set_attr "op_type" "RR<E>")])
5591 + [(set_attr "op_type" "RR<E>")
5592 + (set_attr "z10prop" "z10_super_c_E1")])
5593
5594 ; lcr, lcgr
5595 (define_insn "*neg<mode>2"
5596 @@ -6025,7 +6694,8 @@
5597 (clobber (reg:CC CC_REGNUM))]
5598 ""
5599 "lc<g>r\t%0,%1"
5600 - [(set_attr "op_type" "RR<E>")])
5601 + [(set_attr "op_type" "RR<E>")
5602 + (set_attr "z10prop" "z10_super_c_E1")])
5603
5604 (define_insn_and_split "*negdi2_31"
5605 [(set (match_operand:DI 0 "register_operand" "=d")
5606 @@ -6094,10 +6764,10 @@
5607 (define_insn "*neg<mode>2_nocc"
5608 [(set (match_operand:FP 0 "register_operand" "=f")
5609 (neg:FP (match_operand:FP 1 "register_operand" "<fT0>")))]
5610 - "TARGET_HARD_FLOAT && TARGET_DFP"
5611 + "TARGET_DFP"
5612 "lcdfr\t%0,%1"
5613 [(set_attr "op_type" "RRE")
5614 - (set_attr "type" "fsimp<bfp>")])
5615 + (set_attr "type" "fsimp<mode>")])
5616
5617 ; lcxbr, lcdbr, lcebr
5618 (define_insn "*neg<mode>2"
5619 @@ -6147,9 +6817,10 @@
5620 (abs:GPR (match_dup 1)))]
5621 "s390_match_ccmode (insn, CCAmode)"
5622 "lp<g>r\t%0,%1"
5623 - [(set_attr "op_type" "RR<E>")])
5624 + [(set_attr "op_type" "RR<E>")
5625 + (set_attr "z10prop" "z10_c")])
5626
5627 -; lpr, lpgr
5628 +; lpr, lpgr
5629 (define_insn "*abs<mode>2_cconly"
5630 [(set (reg CC_REGNUM)
5631 (compare (abs:GPR (match_operand:GPR 1 "register_operand" "d"))
5632 @@ -6157,7 +6828,8 @@
5633 (clobber (match_scratch:GPR 0 "=d"))]
5634 "s390_match_ccmode (insn, CCAmode)"
5635 "lp<g>r\t%0,%1"
5636 - [(set_attr "op_type" "RR<E>")])
5637 + [(set_attr "op_type" "RR<E>")
5638 + (set_attr "z10prop" "z10_c")])
5639
5640 ; lpr, lpgr
5641 (define_insn "abs<mode>2"
5642 @@ -6166,7 +6838,8 @@
5643 (clobber (reg:CC CC_REGNUM))]
5644 ""
5645 "lp<g>r\t%0,%1"
5646 - [(set_attr "op_type" "RR<E>")])
5647 + [(set_attr "op_type" "RR<E>")
5648 + (set_attr "z10prop" "z10_c")])
5649
5650 ;
5651 ; abs(df|sf)2 instruction pattern(s).
5652 @@ -6207,10 +6880,10 @@
5653 (define_insn "*abs<mode>2_nocc"
5654 [(set (match_operand:FP 0 "register_operand" "=f")
5655 (abs:FP (match_operand:FP 1 "register_operand" "<fT0>")))]
5656 - "TARGET_HARD_FLOAT && TARGET_DFP"
5657 + "TARGET_DFP"
5658 "lpdfr\t%0,%1"
5659 [(set_attr "op_type" "RRE")
5660 - (set_attr "type" "fsimp<bfp>")])
5661 + (set_attr "type" "fsimp<mode>")])
5662
5663 ; lpxbr, lpdbr, lpebr
5664 (define_insn "*abs<mode>2"
5665 @@ -6242,7 +6915,7 @@
5666 "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)"
5667 "lngfr\t%0,%1"
5668 [(set_attr "op_type" "RRE")])
5669 -
5670 +
5671 (define_insn "*negabsdi2_sign"
5672 [(set (match_operand:DI 0 "register_operand" "=d")
5673 (neg:DI (abs:DI (sign_extend:DI
5674 @@ -6261,7 +6934,8 @@
5675 (neg:GPR (abs:GPR (match_dup 1))))]
5676 "s390_match_ccmode (insn, CCAmode)"
5677 "ln<g>r\t%0,%1"
5678 - [(set_attr "op_type" "RR<E>")])
5679 + [(set_attr "op_type" "RR<E>")
5680 + (set_attr "z10prop" "z10_c")])
5681
5682 ; lnr, lngr
5683 (define_insn "*negabs<mode>2_cconly"
5684 @@ -6271,7 +6945,8 @@
5685 (clobber (match_scratch:GPR 0 "=d"))]
5686 "s390_match_ccmode (insn, CCAmode)"
5687 "ln<g>r\t%0,%1"
5688 - [(set_attr "op_type" "RR<E>")])
5689 + [(set_attr "op_type" "RR<E>")
5690 + (set_attr "z10prop" "z10_c")])
5691
5692 ; lnr, lngr
5693 (define_insn "*negabs<mode>2"
5694 @@ -6280,7 +6955,8 @@
5695 (clobber (reg:CC CC_REGNUM))]
5696 ""
5697 "ln<g>r\t%0,%1"
5698 - [(set_attr "op_type" "RR<E>")])
5699 + [(set_attr "op_type" "RR<E>")
5700 + (set_attr "z10prop" "z10_c")])
5701
5702 ;
5703 ; Floating point
5704 @@ -6313,10 +6989,10 @@
5705 (define_insn "*negabs<mode>2_nocc"
5706 [(set (match_operand:FP 0 "register_operand" "=f")
5707 (neg:FP (abs:FP (match_operand:BFP 1 "register_operand" "<fT0>"))))]
5708 - "TARGET_HARD_FLOAT && TARGET_DFP"
5709 + "TARGET_DFP"
5710 "lndfr\t%0,%1"
5711 [(set_attr "op_type" "RRE")
5712 - (set_attr "type" "fsimp<bfp>")])
5713 + (set_attr "type" "fsimp<mode>")])
5714
5715 ; lnxbr, lndbr, lnebr
5716 (define_insn "*negabs<mode>2"
5717 @@ -6336,12 +7012,12 @@
5718 (define_insn "copysign<mode>3"
5719 [(set (match_operand:FP 0 "register_operand" "=f")
5720 (unspec:FP [(match_operand:FP 1 "register_operand" "<fT0>")
5721 - (match_operand:FP 2 "register_operand" "f")]
5722 + (match_operand:FP 2 "register_operand" "f")]
5723 UNSPEC_COPYSIGN))]
5724 - "TARGET_HARD_FLOAT && TARGET_DFP"
5725 + "TARGET_DFP"
5726 "cpsdr\t%0,%2,%1"
5727 [(set_attr "op_type" "RRF")
5728 - (set_attr "type" "fsimp<bfp>")])
5729 + (set_attr "type" "fsimp<mode>")])
5730
5731 ;;
5732 ;;- Square root instructions.
5733 @@ -6351,7 +7027,7 @@
5734 ; sqrt(df|sf)2 instruction pattern(s).
5735 ;
5736
5737 -; sqxbr, sqdbr, sqebr, sqxb, sqdb, sqeb
5738 +; sqxbr, sqdbr, sqebr, sqdb, sqeb
5739 (define_insn "sqrt<mode>2"
5740 [(set (match_operand:BFP 0 "register_operand" "=f,f")
5741 (sqrt:BFP (match_operand:BFP 1 "general_operand" "f,<Rf>")))]
5742 @@ -6398,7 +7074,7 @@
5743
5744 emit_insn (gen_clztidi2 (wide_reg, operands[1], msb));
5745
5746 - insn = emit_move_insn (operands[0], gen_highpart (DImode, wide_reg));
5747 + insn = emit_move_insn (operands[0], gen_highpart (DImode, wide_reg));
5748 set_unique_reg_note (insn, REG_EQUAL, clz_equal);
5749
5750 DONE;
5751 @@ -6407,16 +7083,16 @@
5752 (define_insn "clztidi2"
5753 [(set (match_operand:TI 0 "register_operand" "=d")
5754 (ior:TI
5755 - (ashift:TI
5756 - (zero_extend:TI
5757 + (ashift:TI
5758 + (zero_extend:TI
5759 (xor:DI (match_operand:DI 1 "register_operand" "d")
5760 (lshiftrt (match_operand:DI 2 "const_int_operand" "")
5761 (subreg:SI (clz:DI (match_dup 1)) 4))))
5762 -
5763 +
5764 (const_int 64))
5765 (zero_extend:TI (clz:DI (match_dup 1)))))
5766 (clobber (reg:CC CC_REGNUM))]
5767 - "(unsigned HOST_WIDE_INT) INTVAL (operands[2])
5768 + "(unsigned HOST_WIDE_INT) INTVAL (operands[2])
5769 == (unsigned HOST_WIDE_INT) 1 << 63
5770 && TARGET_EXTIMM && TARGET_64BIT"
5771 "flogr\t%0,%1"
5772 @@ -6439,7 +7115,8 @@
5773 "TARGET_CPU_ZARCH"
5774 "rll<g>\t%0,%1,%Y2"
5775 [(set_attr "op_type" "RSE")
5776 - (set_attr "atype" "reg")])
5777 + (set_attr "atype" "reg")
5778 + (set_attr "z10prop" "z10_super_E1")])
5779
5780 ; rll, rllg
5781 (define_insn "*rotl<mode>3_and"
5782 @@ -6450,7 +7127,8 @@
5783 "TARGET_CPU_ZARCH && (INTVAL (operands[3]) & 63) == 63"
5784 "rll<g>\t%0,%1,%Y2"
5785 [(set_attr "op_type" "RSE")
5786 - (set_attr "atype" "reg")])
5787 + (set_attr "atype" "reg")
5788 + (set_attr "z10prop" "z10_super_E1")])
5789
5790
5791 ;;
5792 @@ -6486,7 +7164,8 @@
5793 ""
5794 "s<lr>l<g>\t%0,<1>%Y2"
5795 [(set_attr "op_type" "RS<E>")
5796 - (set_attr "atype" "reg")])
5797 + (set_attr "atype" "reg")
5798 + (set_attr "z10prop" "z10_super_E1")])
5799
5800 ; sldl, srdl
5801 (define_insn "*<shift>di3_31_and"
5802 @@ -6508,7 +7187,8 @@
5803 "(INTVAL (operands[3]) & 63) == 63"
5804 "s<lr>l<g>\t%0,<1>%Y2"
5805 [(set_attr "op_type" "RS<E>")
5806 - (set_attr "atype" "reg")])
5807 + (set_attr "atype" "reg")
5808 + (set_attr "z10prop" "z10_super_E1")])
5809
5810 ;
5811 ; ashr(di|si)3 instruction pattern(s).
5812 @@ -6567,7 +7247,8 @@
5813 "s390_match_ccmode(insn, CCSmode)"
5814 "sra<g>\t%0,<1>%Y2"
5815 [(set_attr "op_type" "RS<E>")
5816 - (set_attr "atype" "reg")])
5817 + (set_attr "atype" "reg")
5818 + (set_attr "z10prop" "z10_super_E1")])
5819
5820 ; sra, srag
5821 (define_insn "*ashr<mode>3_cconly"
5822 @@ -6579,7 +7260,8 @@
5823 "s390_match_ccmode(insn, CCSmode)"
5824 "sra<g>\t%0,<1>%Y2"
5825 [(set_attr "op_type" "RS<E>")
5826 - (set_attr "atype" "reg")])
5827 + (set_attr "atype" "reg")
5828 + (set_attr "z10prop" "z10_super_E1")])
5829
5830 ; sra, srag
5831 (define_insn "*ashr<mode>3"
5832 @@ -6590,7 +7272,8 @@
5833 ""
5834 "sra<g>\t%0,<1>%Y2"
5835 [(set_attr "op_type" "RS<E>")
5836 - (set_attr "atype" "reg")])
5837 + (set_attr "atype" "reg")
5838 + (set_attr "z10prop" "z10_super_E1")])
5839
5840
5841 ; shift pattern with implicit ANDs
5842 @@ -6645,7 +7328,8 @@
5843 "s390_match_ccmode(insn, CCSmode) && (INTVAL (operands[3]) & 63) == 63"
5844 "sra<g>\t%0,<1>%Y2"
5845 [(set_attr "op_type" "RS<E>")
5846 - (set_attr "atype" "reg")])
5847 + (set_attr "atype" "reg")
5848 + (set_attr "z10prop" "z10_super_E1")])
5849
5850 ; sra, srag
5851 (define_insn "*ashr<mode>3_cconly_and"
5852 @@ -6658,7 +7342,8 @@
5853 "s390_match_ccmode(insn, CCSmode) && (INTVAL (operands[3]) & 63) == 63"
5854 "sra<g>\t%0,<1>%Y2"
5855 [(set_attr "op_type" "RS<E>")
5856 - (set_attr "atype" "reg")])
5857 + (set_attr "atype" "reg")
5858 + (set_attr "z10prop" "z10_super_E1")])
5859
5860 ; sra, srag
5861 (define_insn "*ashr<mode>3_and"
5862 @@ -6670,7 +7355,8 @@
5863 "(INTVAL (operands[3]) & 63) == 63"
5864 "sra<g>\t%0,<1>%Y2"
5865 [(set_attr "op_type" "RS<E>")
5866 - (set_attr "atype" "reg")])
5867 + (set_attr "atype" "reg")
5868 + (set_attr "z10prop" "z10_super_E1")])
5869
5870
5871 ;;
5872 @@ -6830,7 +7516,7 @@
5873 ""
5874 {
5875 if (operands[1] != const0_rtx) FAIL;
5876 - operands[0] = s390_emit_compare (GET_CODE (operands[0]),
5877 + operands[0] = s390_emit_compare (GET_CODE (operands[0]),
5878 s390_compare_op0, s390_compare_op1);
5879 })
5880
5881 @@ -6842,6 +7528,34 @@
5882 [(set_attr "op_type" "RI")
5883 (set_attr "type" "branch")])
5884
5885 +; crt, cgrt, cit, cgit
5886 +(define_insn "*cmp_and_trap_signed_int<mode>"
5887 + [(trap_if (match_operator 0 "s390_signed_integer_comparison"
5888 + [(match_operand:GPR 1 "register_operand" "d,d")
5889 + (match_operand:GPR 2 "nonmemory_operand" "d,K")])
5890 + (const_int 0))]
5891 + "TARGET_Z10"
5892 + "@
5893 + c<g>rt%C0\t%1,%2
5894 + c<g>it%C0\t%1,%h2"
5895 + [(set_attr "op_type" "RRF,RIE")
5896 + (set_attr "type" "branch")
5897 + (set_attr "z10prop" "z10_c,*")])
5898 +
5899 +; clrt, clgrt, clfit, clgit
5900 +(define_insn "*cmp_and_trap_unsigned_int<mode>"
5901 + [(trap_if (match_operator 0 "s390_unsigned_integer_comparison"
5902 + [(match_operand:GPR 1 "register_operand" "d,d")
5903 + (match_operand:GPR 2 "nonmemory_operand" "d,D")])
5904 + (const_int 0))]
5905 + "TARGET_Z10"
5906 + "@
5907 + cl<g>rt%C0\t%1,%2
5908 + cl<gf>it%C0\t%1,%x2"
5909 + [(set_attr "op_type" "RRF,RIE")
5910 + (set_attr "type" "branch")
5911 + (set_attr "z10prop" "z10_c,*")])
5912 +
5913 ;;
5914 ;;- Loop instructions.
5915 ;;
5916 @@ -6902,6 +7616,9 @@
5917 (pc)))]
5918 ""
5919 [(set_attr "op_type" "RI")
5920 + ; Strictly speaking, the z10 properties are valid for brct only, however, it does not
5921 + ; hurt us in the (rare) case of ahi.
5922 + (set_attr "z10prop" "z10_super")
5923 (set_attr "type" "branch")
5924 (set (attr "length")
5925 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
5926 @@ -6941,6 +7658,9 @@
5927 (pc)))]
5928 ""
5929 [(set_attr "op_type" "RI")
5930 + ; Strictly speaking, the z10 properties are valid for brct only, however, it does not
5931 + ; hurt us in the (rare) case of ahi.
5932 + (set_attr "z10prop" "z10_super")
5933 (set_attr "type" "branch")
5934 (set (attr "length")
5935 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
5936 @@ -7007,6 +7727,9 @@
5937 (pc)))]
5938 ""
5939 [(set_attr "op_type" "RI")
5940 + ; Strictly speaking, the z10 properties are valid for brct only, however, it does not
5941 + ; hurt us in the (rare) case of ahi.
5942 + (set_attr "z10prop" "z10_super")
5943 (set_attr "type" "branch")
5944 (set (attr "length")
5945 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
5946 @@ -7073,7 +7796,8 @@
5947 (if_then_else (match_operand 0 "register_operand" "")
5948 (const_string "RR") (const_string "RX")))
5949 (set_attr "type" "branch")
5950 - (set_attr "atype" "agen")])
5951 + (set_attr "atype" "agen")
5952 + (set_attr "z10prop" "z10_super")])
5953
5954 ;
5955 ; casesi instruction pattern(s).
5956 @@ -7411,12 +8135,13 @@
5957
5958 (define_insn "*tls_load_64"
5959 [(set (match_operand:DI 0 "register_operand" "=d")
5960 - (unspec:DI [(match_operand:DI 1 "memory_operand" "m")
5961 + (unspec:DI [(match_operand:DI 1 "memory_operand" "RT")
5962 (match_operand:DI 2 "" "")]
5963 UNSPEC_TLS_LOAD))]
5964 "TARGET_64BIT"
5965 "lg\t%0,%1%J2"
5966 - [(set_attr "op_type" "RXE")])
5967 + [(set_attr "op_type" "RXE")
5968 + (set_attr "z10prop" "z10_fwd_A3")])
5969
5970 (define_insn "*tls_load_31"
5971 [(set (match_operand:SI 0 "register_operand" "=d,d")
5972 @@ -7427,7 +8152,8 @@
5973 "@
5974 l\t%0,%1%J2
5975 ly\t%0,%1%J2"
5976 - [(set_attr "op_type" "RX,RXY")])
5977 + [(set_attr "op_type" "RX,RXY")
5978 + (set_attr "z10prop" "z10_fwd_A3,z10_fwd_A3")])
5979
5980 (define_insn "*bras_tls"
5981 [(set (match_operand 0 "" "")
5982 @@ -7497,6 +8223,8 @@
5983 ""
5984 "bcr\t15,0"
5985 [(set_attr "op_type" "RR")])
5986 +; Although bcr is superscalar on Z10, this variant will never become part of
5987 +; an execution group.
5988
5989 ;
5990 ; compare and swap patterns.
5991 @@ -7529,7 +8257,7 @@
5992 (set (reg:CCZ1 CC_REGNUM)
5993 (compare:CCZ1 (match_dup 1) (match_dup 2)))])]
5994 ""
5995 - "s390_expand_cs_hqi (<MODE>mode, operands[0], operands[1],
5996 + "s390_expand_cs_hqi (<MODE>mode, operands[0], operands[1],
5997 operands[2], operands[3]); DONE;")
5998
5999 (define_expand "sync_compare_and_swap_cc<mode>"
6000 @@ -7582,7 +8310,7 @@
6001 UNSPECV_CAS))
6002 (set (reg:CCZ1 CC_REGNUM)
6003 (compare:CCZ1 (match_dup 1) (match_dup 2)))]
6004 - ""
6005 + ""
6006 "cs<g>\t%0,%3,%S1"
6007 [(set_attr "op_type" "RS<E>")
6008 (set_attr "type" "sem")])
6009 @@ -7597,7 +8325,7 @@
6010 (match_operand:HQI 1 "memory_operand")
6011 (match_operand:HQI 2 "general_operand")]
6012 ""
6013 - "s390_expand_atomic (<MODE>mode, SET, operands[0], operands[1],
6014 + "s390_expand_atomic (<MODE>mode, SET, operands[0], operands[1],
6015 operands[2], false); DONE;")
6016
6017 (define_expand "sync_<atomic><mode>"
6018 @@ -7605,7 +8333,7 @@
6019 (ATOMIC:HQI (match_dup 0)
6020 (match_operand:HQI 1 "general_operand")))]
6021 ""
6022 - "s390_expand_atomic (<MODE>mode, <CODE>, NULL_RTX, operands[0],
6023 + "s390_expand_atomic (<MODE>mode, <CODE>, NULL_RTX, operands[0],
6024 operands[1], false); DONE;")
6025
6026 (define_expand "sync_old_<atomic><mode>"
6027 @@ -7615,16 +8343,16 @@
6028 (ATOMIC:HQI (match_dup 1)
6029 (match_operand:HQI 2 "general_operand")))]
6030 ""
6031 - "s390_expand_atomic (<MODE>mode, <CODE>, operands[0], operands[1],
6032 + "s390_expand_atomic (<MODE>mode, <CODE>, operands[0], operands[1],
6033 operands[2], false); DONE;")
6034
6035 (define_expand "sync_new_<atomic><mode>"
6036 [(set (match_operand:HQI 0 "register_operand")
6037 (ATOMIC:HQI (match_operand:HQI 1 "memory_operand")
6038 - (match_operand:HQI 2 "general_operand")))
6039 + (match_operand:HQI 2 "general_operand")))
6040 (set (match_dup 1) (ATOMIC:HQI (match_dup 1) (match_dup 2)))]
6041 ""
6042 - "s390_expand_atomic (<MODE>mode, <CODE>, operands[0], operands[1],
6043 + "s390_expand_atomic (<MODE>mode, <CODE>, operands[0], operands[1],
6044 operands[2], true); DONE;")
6045
6046 ;;
6047 @@ -7736,7 +8464,7 @@
6048
6049 if (TARGET_BACKCHAIN)
6050 temp = force_reg (Pmode, operand_subword (operands[1], 0, 0, mode));
6051 -
6052 +
6053 emit_move_insn (base, operand_subword (operands[1], 2, 0, mode));
6054 emit_move_insn (operands[0], operand_subword (operands[1], 1, 0, mode));
6055
6056 @@ -7824,7 +8552,8 @@
6057 "TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
6058 "larl\t%0,%1"
6059 [(set_attr "op_type" "RIL")
6060 - (set_attr "type" "larl")])
6061 + (set_attr "type" "larl")
6062 + (set_attr "z10prop" "z10_super_A1")])
6063
6064 (define_insn "main_pool"
6065 [(set (match_operand 0 "register_operand" "=a")
6066 @@ -7833,7 +8562,7 @@
6067 {
6068 gcc_unreachable ();
6069 }
6070 - [(set (attr "type")
6071 + [(set (attr "type")
6072 (if_then_else (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0))
6073 (const_string "larl") (const_string "la")))])
6074
6075 @@ -7851,7 +8580,8 @@
6076 "TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
6077 "larl\t%0,%1"
6078 [(set_attr "op_type" "RIL")
6079 - (set_attr "type" "larl")])
6080 + (set_attr "type" "larl")
6081 + (set_attr "z10prop" "z10_super_A1")])
6082
6083 (define_insn "pool"
6084 [(unspec_volatile [(match_operand 0 "const_int_operand" "n")] UNSPECV_POOL)]
6085 @@ -7988,3 +8718,31 @@
6086 ""
6087 ""
6088 [(set_attr "length" "0")])
6089 +
6090 +
6091 +;
6092 +; Data prefetch patterns
6093 +;
6094 +
6095 +(define_insn "prefetch"
6096 + [(prefetch (match_operand 0 "address_operand" "UW,X")
6097 + (match_operand:SI 1 "const_int_operand" "n,n")
6098 + (match_operand:SI 2 "const_int_operand" "n,n"))]
6099 + "TARGET_Z10"
6100 +{
6101 + if (larl_operand (operands[0], Pmode))
6102 + return INTVAL (operands[1]) == 1 ? "pfdrl\t2,%a0" : "pfdrl\t1,%a0";
6103 +
6104 + if (s390_mem_constraint ("W", operands[0])
6105 + || s390_mem_constraint ("U", operands[0]))
6106 + return INTVAL (operands[1]) == 1 ? "pfd\t2,%a0" : "pfd\t1,%a0";
6107 +
6108 + /* This point might be reached if op0 is a larl operand with an
6109 + uneven addend. In this case we simply omit issuing a prefetch
6110 + instruction. */
6111 +
6112 + return "";
6113 +}
6114 + [(set_attr "type" "load,larl")
6115 + (set_attr "op_type" "RXY,RIL")
6116 + (set_attr "z10prop" "z10_super")])
6117 Index: gcc/config/s390/2097.md
6118 ===================================================================
6119 --- gcc/config/s390/2097.md (revision 0)
6120 +++ gcc/config/s390/2097.md (revision 0)
6121 @@ -0,0 +1,764 @@
6122 +;; Scheduling description for z10 (cpu 2097).
6123 +;; Copyright (C) 2008 Free Software Foundation, Inc.
6124 +;; Contributed by Wolfgang Gellerich (gellerich@××××××.com).
6125 +
6126 +
6127 +; General naming conventions used in this file:
6128 +; - The two pipelines are called S and T, respectively.
6129 +; - A name ending "_S" or "_T" indicates that something happens in
6130 +; (or belongs to) this pipeline.
6131 +; - A name ending "_ANY" indicates that something happens in (or belongs
6132 +; to) either of the two pipelines.
6133 +; - A name ending "_BOTH" indicates that something happens in (or belongs
6134 +; to) both pipelines.
6135 +
6136 +
6137 +;; Automaton and components.
6138 +
6139 +(define_automaton "z10_cpu")
6140 +
6141 +(define_cpu_unit "z10_e1_S, z10_e1_T" "z10_cpu")
6142 +(define_reservation "z10_e1_ANY" "(z10_e1_S | z10_e1_T)")
6143 +(define_reservation "z10_e1_BOTH" "(z10_e1_S + z10_e1_T)")
6144 +
6145 +
6146 +; Both pipelines can execute a branch instruction, and branch
6147 +; instructions can be grouped with all other groupable instructions
6148 +; but not with a second branch instruction.
6149 +
6150 +(define_cpu_unit "z10_branch_ANY" "z10_cpu")
6151 +
6152 +(define_insn_reservation "z10_branch" 4
6153 + (and (eq_attr "cpu" "z10")
6154 + (eq_attr "type" "branch"))
6155 + "z10_branch_ANY + z10_e1_ANY, z10_Gate_ANY")
6156 +
6157 +
6158 +; Z10 operand and result forwarding.
6159 +
6160 +; Instructions marked with the attributes as z10_fwd or z10_fr can
6161 +; forward a value they load from one of their operants into a register
6162 +; if the instruction in the second pipeline reads the same register.
6163 +; The second operation must be superscalar. Instructions marked as
6164 +; z10_rec or z10_fr can receive a value they read from a register is
6165 +; this register gets updated by an instruction in the first pipeline.
6166 +; The first instruction must be superscalar.
6167 +
6168 +
6169 +; Forwarding from z10_fwd and z10_fr to z10_super.
6170 +
6171 +(define_bypass 0 "z10_la_fwd, z10_la_fwd_A1, z10_larl_fwd, z10_larl_fwd_A3, \
6172 + z10_load_fwd, z10_load_fwd_A3, \
6173 + z10_other_fwd, z10_other_fwd_A1, z10_other_fwd_A3, \
6174 + z10_other_fr, z10_other_fr_A3, z10_other_fr_E1, \
6175 + z10_other_fwd_E1, z10_lr_fr, z10_lr_fr_E1, \
6176 + z10_int_fwd, z10_int_fwd_A1, z10_int_fwd_A3, \
6177 + z10_int_fwd_E1, z10_int_fr, z10_int_fr_E1, \
6178 + z10_int_fr_A3"
6179 + "z10_other_super, z10_other_super_c_E1, z10_other_super_E1, \
6180 + z10_int_super, z10_int_super_E1, \
6181 + z10_lr, z10_store_super")
6182 +
6183 +
6184 +; Forwarding from z10_super to frz10_ and z10_rec.
6185 +
6186 +(define_bypass 0 "z10_other_super, z10_other_super_E1, z10_other_super_c_E1, \
6187 + z10_int_super, z10_int_super_E1, \
6188 + z10_larl_super_E1, z10_larl_super, \
6189 + z10_store_super"
6190 + "z10_int_fr, z10_int_fr_E1, z10_int_fr_A3, \
6191 + z10_other_fr, z10_other_fr_A3, z10_lr_fr, z10_lr_fr_E1, \
6192 + z10_other_fr_E1, z10_store_rec")
6193 +
6194 +
6195 +; Forwarding from z10_fwd and z10_fr to z10_rec and z10_fr.
6196 +
6197 +(define_bypass 0 "z10_la_fwd, z10_la_fwd_A1, z10_larl_fwd, z10_larl_fwd_A3, \
6198 + z10_load_fwd, z10_load_fwd_A3, \
6199 + z10_other_fwd, z10_other_fwd_A1, z10_other_fwd_A3, \
6200 + z10_other_fr, z10_other_fr_A3, z10_other_fr_E1, \
6201 + z10_other_fwd_E1, \
6202 + z10_lr_fr, z10_lr_fr_E1, \
6203 + z10_int_fwd, z10_int_fwd_A1, z10_int_fwd_A3, \
6204 + z10_int_fwd_E1, z10_int_fr, z10_int_fr_E1, \
6205 + z10_int_fr_A3"
6206 + "z10_int_fr, z10_int_fr_E1, z10_int_fr_A3, \
6207 + z10_other_fr, z10_other_fr_A3, z10_lr_fr, z10_lr_fr_E1, \
6208 + z10_other_fr_E1, z10_store_rec")
6209 +
6210 +
6211 +;
6212 +; Simple insns
6213 +;
6214 +
6215 +; Here is the cycle diagram for FXU-executed instructions:
6216 +; ... A1 A2 A3 E1 P1 P2 P3 R0 ...
6217 +; ^ ^ ^
6218 +; | | updated GPR is available
6219 +; | write to GPR
6220 +; instruction reads GPR during this cycle
6221 +
6222 +
6223 +; Variants of z10_int follow.
6224 +
6225 +(define_insn_reservation "z10_int" 6
6226 + (and (and (eq_attr "cpu" "z10")
6227 + (eq_attr "type" "integer"))
6228 + (and (eq_attr "atype" "reg")
6229 + (and (and (eq_attr "z10prop" "!z10_super")
6230 + (eq_attr "z10prop" "!z10_super_c"))
6231 + (and (and (and (and (eq_attr "z10prop" "!z10_super_E1")
6232 + (eq_attr "z10prop" "!z10_super_c_E1"))
6233 + (eq_attr "z10prop" "!z10_fwd"))
6234 + (and (eq_attr "z10prop" "!z10_fwd_A1")
6235 + (eq_attr "z10prop" "!z10_fwd_A3")))
6236 + (and (and (eq_attr "z10prop" "!z10_fwd_E1")
6237 + (eq_attr "z10prop" "!z10_fr"))
6238 + (and (eq_attr "z10prop" "!z10_fr_E1")
6239 + (eq_attr "z10prop" "!z10_fr_A3")))))))
6240 + "z10_e1_ANY, z10_Gate_ANY")
6241 +
6242 +(define_insn_reservation "z10_int_super" 6
6243 + (and (eq_attr "cpu" "z10")
6244 + (and (eq_attr "type" "integer")
6245 + (and (eq_attr "atype" "reg")
6246 + (ior (eq_attr "z10prop" "z10_super")
6247 + (eq_attr "z10prop" "z10_super_c")))))
6248 + "z10_e1_ANY, z10_Gate_ANY")
6249 +
6250 +(define_insn_reservation "z10_int_super_E1" 6
6251 + (and (eq_attr "cpu" "z10")
6252 + (and (eq_attr "type" "integer")
6253 + (and (eq_attr "atype" "reg")
6254 + (ior (eq_attr "z10prop" "z10_super_E1")
6255 + (eq_attr "z10prop" "z10_super_c_E1")))))
6256 + "z10_e1_ANY, z10_Gate_ANY")
6257 +
6258 +(define_insn_reservation "z10_int_fwd" 6
6259 + (and (eq_attr "cpu" "z10")
6260 + (and (eq_attr "type" "integer")
6261 + (and (eq_attr "atype" "reg")
6262 + (eq_attr "z10prop" "z10_fwd"))))
6263 + "z10_e1_ANY, z10_Gate_ANY")
6264 +
6265 +(define_insn_reservation "z10_int_fwd_A1" 6
6266 + (and (eq_attr "cpu" "z10")
6267 + (and (eq_attr "type" "integer")
6268 + (and (eq_attr "atype" "reg")
6269 + (eq_attr "z10prop" "z10_fwd_A1"))))
6270 + "z10_e1_ANY, z10_Gate_ANY")
6271 +
6272 +(define_insn_reservation "z10_int_fwd_A3" 6
6273 + (and (eq_attr "cpu" "z10")
6274 + (and (eq_attr "type" "integer")
6275 + (and (eq_attr "atype" "reg")
6276 + (eq_attr "z10prop" "z10_fwd_A3"))))
6277 + "z10_e1_ANY, z10_Gate_ANY")
6278 +
6279 +(define_insn_reservation "z10_int_fwd_E1" 6
6280 + (and (eq_attr "cpu" "z10")
6281 + (and (eq_attr "type" "integer")
6282 + (and (eq_attr "atype" "reg")
6283 + (eq_attr "z10prop" "z10_fwd_E1"))))
6284 + "z10_e1_ANY, z10_Gate_ANY")
6285 +
6286 +(define_insn_reservation "z10_int_fr" 6
6287 + (and (eq_attr "cpu" "z10")
6288 + (and (eq_attr "type" "integer")
6289 + (and (eq_attr "atype" "reg")
6290 + (eq_attr "z10prop" "z10_fr"))))
6291 + "z10_e1_ANY, z10_Gate_ANY")
6292 +
6293 +(define_insn_reservation "z10_int_fr_E1" 6
6294 + (and (eq_attr "cpu" "z10")
6295 + (and (eq_attr "type" "integer")
6296 + (and (eq_attr "atype" "reg")
6297 + (eq_attr "z10prop" "z10_fr_E1"))))
6298 + "z10_e1_ANY, z10_Gate_ANY")
6299 +
6300 +(define_insn_reservation "z10_int_fr_A3" 6
6301 + (and (eq_attr "cpu" "z10")
6302 + (and (eq_attr "type" "integer")
6303 + (and (eq_attr "atype" "reg")
6304 + (eq_attr "z10prop" "z10_fr_A3"))))
6305 + "z10_e1_ANY, z10_Gate_ANY")
6306 +
6307 +; END of z10_int variants
6308 +
6309 +
6310 +(define_insn_reservation "z10_agen" 6
6311 + (and (eq_attr "cpu" "z10")
6312 + (and (eq_attr "type" "integer")
6313 + (eq_attr "atype" "agen")))
6314 + "z10_e1_ANY, z10_Gate_ANY")
6315 +
6316 +
6317 +(define_insn_reservation "z10_lr" 6
6318 + (and (eq_attr "cpu" "z10")
6319 + (and (eq_attr "type" "lr")
6320 + (and (eq_attr "z10prop" "!z10_fr")
6321 + (eq_attr "z10prop" "!z10_fr_E1"))))
6322 + "z10_e1_ANY, z10_Gate_ANY")
6323 +
6324 +(define_insn_reservation "z10_lr_fr" 6
6325 + (and (eq_attr "cpu" "z10")
6326 + (and (eq_attr "type" "lr")
6327 + (eq_attr "z10prop" "z10_fr")))
6328 + "z10_e1_ANY, z10_Gate_ANY")
6329 +; "z10_e1_ANY")
6330 +
6331 +(define_insn_reservation "z10_lr_fr_E1" 6
6332 + (and (eq_attr "cpu" "z10")
6333 + (and (eq_attr "type" "lr")
6334 + (eq_attr "z10prop" "z10_fr_E1")))
6335 + "z10_e1_ANY, z10_Gate_ANY")
6336 +; "z10_e1_ANY")
6337 +
6338 +
6339 +(define_insn_reservation "z10_la" 6
6340 + (and (eq_attr "cpu" "z10")
6341 + (and (eq_attr "type" "la")
6342 + (and (eq_attr "z10prop" "!z10_fwd")
6343 + (eq_attr "z10prop" "!z10_fwd_A1"))))
6344 + "z10_e1_ANY, z10_Gate_ANY")
6345 +
6346 +(define_insn_reservation "z10_la_fwd" 6
6347 + (and (eq_attr "cpu" "z10")
6348 + (and (eq_attr "type" "la")
6349 + (eq_attr "z10prop" "z10_fwd")))
6350 + "z10_e1_ANY, z10_Gate_ANY")
6351 +; "z10_e1_ANY")
6352 +
6353 +(define_insn_reservation "z10_la_fwd_A1" 6
6354 + (and (eq_attr "cpu" "z10")
6355 + (and (eq_attr "type" "la")
6356 + (eq_attr "z10prop" "z10_fwd_A1")))
6357 + "z10_e1_ANY, z10_Gate_ANY")
6358 +; "z10_e1_ANY")
6359 +
6360 +
6361 +; larl-type instructions
6362 +
6363 +(define_insn_reservation "z10_larl" 6
6364 + (and (eq_attr "cpu" "z10")
6365 + (and (eq_attr "type" "larl")
6366 + (and (eq_attr "z10prop" "!z10_super_A1")
6367 + (and (eq_attr "z10prop" "!z10_fwd")
6368 + (and (eq_attr "z10prop" "!z10_fwd_A3")
6369 + (and (eq_attr "z10prop" "!z10_super")
6370 + (eq_attr "z10prop" "!z10_super_c"))
6371 + (and (eq_attr "z10prop" "!z10_super_E1")
6372 + (eq_attr "z10prop" "!z10_super_c_E1")))))))
6373 + "z10_e1_ANY, z10_Gate_ANY")
6374 +
6375 +(define_insn_reservation "z10_larl_super" 6
6376 + (and (eq_attr "cpu" "z10")
6377 + (and (eq_attr "type" "larl")
6378 + (and (eq_attr "z10prop" "z10_super")
6379 + (eq_attr "z10prop" "z10_super_c"))))
6380 + "z10_e1_ANY, z10_Gate_ANY")
6381 +
6382 +(define_insn_reservation "z10_larl_fwd" 6
6383 + (and (eq_attr "cpu" "z10")
6384 + (and (eq_attr "type" "larl")
6385 + (eq_attr "z10prop" "z10_fwd")))
6386 + "z10_e1_ANY, z10_Gate_ANY")
6387 +
6388 +(define_insn_reservation "z10_larl_fwd_A3" 6
6389 + (and (eq_attr "cpu" "z10")
6390 + (and (eq_attr "type" "larl")
6391 + (eq_attr "z10prop" "z10_fwd_A3")))
6392 + "z10_e1_ANY, z10_Gate_ANY")
6393 +
6394 +
6395 +(define_insn_reservation "z10_larl_A1" 6
6396 + (and (eq_attr "cpu" "z10")
6397 + (and (eq_attr "type" "larl")
6398 + (eq_attr "z10prop" "z10_super_A1")))
6399 + "z10_e1_ANY, z10_Gate_ANY")
6400 +; "z10_e1_ANY")
6401 +
6402 +(define_insn_reservation "z10_larl_super_E1" 6
6403 + (and (eq_attr "cpu" "z10")
6404 + (and (eq_attr "type" "larl")
6405 + (ior (eq_attr "z10prop" "z10_super_E1")
6406 + (eq_attr "z10prop" "z10_super_c_E1"))))
6407 + "z10_e1_ANY, z10_Gate_ANY")
6408 +; "z10_e1_ANY")
6409 +
6410 +
6411 +(define_insn_reservation "z10_load" 6
6412 + (and (eq_attr "cpu" "z10")
6413 + (and (eq_attr "type" "load")
6414 + (and (eq_attr "z10prop" "!z10_fwd")
6415 + (eq_attr "z10prop" "!z10_fwd_A3"))))
6416 + "z10_e1_ANY, z10_Gate_ANY")
6417 +
6418 +(define_insn_reservation "z10_load_fwd" 6
6419 + (and (eq_attr "cpu" "z10")
6420 + (and (eq_attr "type" "load")
6421 + (eq_attr "z10prop" "z10_fwd")))
6422 + "z10_e1_ANY, z10_Gate_ANY")
6423 +; "z10_e1_ANY")
6424 +
6425 +(define_insn_reservation "z10_load_fwd_A3" 6
6426 + (and (eq_attr "cpu" "z10")
6427 + (and (eq_attr "type" "load")
6428 + (eq_attr "z10prop" "z10_fwd_A3")))
6429 + "z10_e1_ANY, z10_Gate_ANY")
6430 +; "z10_e1_ANY")
6431 +
6432 +(define_insn_reservation "z10_store" 6
6433 + (and (eq_attr "cpu" "z10")
6434 + (and (eq_attr "type" "store")
6435 + (and (eq_attr "z10prop" "!z10_rec")
6436 + (and (eq_attr "z10prop" "!z10_super")
6437 + (eq_attr "z10prop" "!z10_super_c")))))
6438 + "z10_e1_ANY, z10_Gate_ANY")
6439 +
6440 +(define_insn_reservation "z10_store_super" 6
6441 + (and (eq_attr "cpu" "z10")
6442 + (and (eq_attr "type" "store")
6443 + (ior (eq_attr "z10prop" "z10_super")
6444 + (eq_attr "z10prop" "z10_super_c"))))
6445 + "z10_e1_ANY, z10_Gate_ANY")
6446 +
6447 +(define_insn_reservation "z10_store_rec" 6
6448 + (and (eq_attr "cpu" "z10")
6449 + (and (eq_attr "type" "store")
6450 + (eq_attr "z10prop" "z10_rec")))
6451 + "z10_e1_ANY, z10_Gate_ANY")
6452 +
6453 +; The default_latency is chosen to drain off the pipeline.
6454 +(define_insn_reservation "z10_call" 14
6455 + (and (eq_attr "cpu" "z10")
6456 + (eq_attr "type" "jsr"))
6457 + "z10_e1_BOTH*4, z10_Gate_BOTH")
6458 +
6459 +; The default latency is for worst case. CS and CSG take one
6460 +; cycle only (i.e. latency would be 6).
6461 +(define_insn_reservation "z10_sem" 9
6462 + (and (eq_attr "cpu" "z10")
6463 + (eq_attr "type" "sem"))
6464 + "z10_e1_BOTH*5, z10_Gate_ANY")
6465 +
6466 +(define_insn_reservation "z10_cs" 6
6467 + (and (eq_attr "cpu" "z10")
6468 + (eq_attr "type" "cs"))
6469 + "z10_e1_BOTH, z10_Gate_BOTH")
6470 +
6471 +(define_insn_reservation "z10_vs" 6
6472 + (and (eq_attr "cpu" "z10")
6473 + (eq_attr "type" "vs"))
6474 + "z10_e1_BOTH*4, z10_Gate_BOTH")
6475 +
6476 +; Load and store multiple. Actual number of cycles
6477 +; in unknown at compile.time.
6478 +(define_insn_reservation "z10_stm" 10
6479 + (and (eq_attr "cpu" "z10")
6480 + (ior (eq_attr "type" "stm")
6481 + (eq_attr "type" "lm")))
6482 + "z10_e1_BOTH*4, z10_Gate_BOTH")
6483 +
6484 +
6485 +; Subsets of z10_other follow.
6486 +
6487 +(define_insn_reservation "z10_other" 6
6488 + (and (and (eq_attr "cpu" "z10")
6489 + (eq_attr "type" "other"))
6490 + (and (and (eq_attr "z10prop" "!z10_fwd")
6491 + (eq_attr "z10prop" "!z10_fwd_A1"))
6492 + (and (and (and (eq_attr "z10prop" "!z10_fr_A3")
6493 + (eq_attr "z10prop" "!z10_fwd_A3"))
6494 + (and (eq_attr "z10prop" "!z10_fr")
6495 + (eq_attr "z10prop" "!z10_fr_E1")))
6496 + (and (and (and (eq_attr "z10prop" "!z10_super")
6497 + (eq_attr "z10prop" "!z10_super_c"))
6498 + (eq_attr "z10prop" "!z10_super_c_E1"))
6499 + (and (eq_attr "z10prop" "!z10_super_E1")
6500 + (eq_attr "z10prop" "!z10_fwd_E1"))))))
6501 + "z10_e1_BOTH, z10_Gate_BOTH")
6502 +
6503 +(define_insn_reservation "z10_other_fr_E1" 6
6504 + (and (eq_attr "cpu" "z10")
6505 + (and (eq_attr "type" "other")
6506 + (eq_attr "z10prop" "z10_fr_E1")))
6507 + "z10_e1_BOTH, z10_Gate_BOTH")
6508 +
6509 +(define_insn_reservation "z10_other_super_c_E1" 6
6510 + (and (eq_attr "cpu" "z10")
6511 + (and (eq_attr "type" "other")
6512 + (eq_attr "z10prop" "z10_super_c_E1")))
6513 + "z10_e1_BOTH, z10_Gate_BOTH")
6514 +
6515 +(define_insn_reservation "z10_other_super_E1" 6
6516 + (and (eq_attr "cpu" "z10")
6517 + (and (eq_attr "type" "other")
6518 + (eq_attr "z10prop" "z10_super_E1")))
6519 + "z10_e1_BOTH, z10_Gate_BOTH")
6520 +
6521 +(define_insn_reservation "z10_other_fwd_E1" 6
6522 + (and (eq_attr "cpu" "z10")
6523 + (and (eq_attr "type" "other")
6524 + (eq_attr "z10prop" "z10_fwd_E1")))
6525 + "z10_e1_BOTH, z10_Gate_BOTH")
6526 +
6527 +(define_insn_reservation "z10_other_fwd" 6
6528 + (and (eq_attr "cpu" "z10")
6529 + (and (eq_attr "type" "other")
6530 + (eq_attr "z10prop" "z10_fwd")))
6531 + "z10_e1_BOTH, z10_Gate_BOTH")
6532 +
6533 +(define_insn_reservation "z10_other_fwd_A3" 6
6534 + (and (eq_attr "cpu" "z10")
6535 + (and (eq_attr "type" "other")
6536 + (eq_attr "z10prop" "z10_fwd_A3")))
6537 + "z10_e1_BOTH, z10_Gate_BOTH")
6538 +
6539 +(define_insn_reservation "z10_other_fwd_A1" 6
6540 + (and (eq_attr "cpu" "z10")
6541 + (and (eq_attr "type" "other")
6542 + (eq_attr "z10prop" "z10_fwd_A1")))
6543 + "z10_e1_BOTH, z10_Gate_BOTH")
6544 +
6545 +(define_insn_reservation "z10_other_fr" 6
6546 + (and (eq_attr "cpu" "z10")
6547 + (and (eq_attr "type" "other")
6548 + (eq_attr "z10prop" "z10_fr")))
6549 + "z10_e1_BOTH, z10_Gate_BOTH")
6550 +
6551 +(define_insn_reservation "z10_other_fr_A3" 6
6552 + (and (eq_attr "cpu" "z10")
6553 + (and (eq_attr "type" "other")
6554 + (eq_attr "z10prop" "z10_fr_A3")))
6555 + "z10_e1_BOTH, z10_Gate_BOTH")
6556 +
6557 +(define_insn_reservation "z10_other_super" 6
6558 + (and (eq_attr "cpu" "z10")
6559 + (and (eq_attr "type" "other")
6560 + (ior (eq_attr "z10prop" "z10_super")
6561 + (eq_attr "z10prop" "z10_super_c"))))
6562 + "z10_e1_BOTH, z10_Gate_BOTH")
6563 +
6564 +; END of z10_other subsets.
6565 +
6566 +
6567 +;
6568 +; Floating point insns
6569 +;
6570 +
6571 +; Z10 executes the following integer operations in the BFU pipeline.
6572 +
6573 +(define_insn_reservation "z10_mul_sidi" 12
6574 + (and (eq_attr "cpu" "z10")
6575 + (eq_attr "type" "imulsi,imuldi,imulhi"))
6576 + "z10_e1_BOTH, z10_Gate_FP")
6577 +
6578 +; Some variants take fewer cycles, but that is not relevant here.
6579 +(define_insn_reservation "z10_div" 162
6580 + (and (eq_attr "cpu" "z10")
6581 + (eq_attr "type" "idiv"))
6582 + "z10_e1_BOTH*4, z10_Gate_FP")
6583 +
6584 +
6585 +; BFP multiplication and general instructions
6586 +
6587 +(define_insn_reservation "z10_fsimpdf" 12
6588 + (and (eq_attr "cpu" "z10")
6589 + (eq_attr "type" "fsimpdf,fmuldf"))
6590 + "z10_e1_BOTH, z10_Gate_FP")
6591 +; Wg "z10_e1_T, z10_Gate_FP")
6592 +
6593 +(define_insn_reservation "z10_fsimpsf" 12
6594 + (and (eq_attr "cpu" "z10")
6595 + (eq_attr "type" "fsimpsf,fmulsf"))
6596 + "z10_e1_BOTH, z10_Gate_FP")
6597 +; Wg "z10_e1_T, z10_Gate_FP")
6598 +
6599 +(define_insn_reservation "z10_fmultf" 52
6600 + (and (eq_attr "cpu" "z10")
6601 + (eq_attr "type" "fmultf"))
6602 + "z10_e1_BOTH*4, z10_Gate_FP")
6603 +; Wg "z10_e1_T*4, z10_Gate_FP")
6604 +
6605 +(define_insn_reservation "z10_fsimptf" 14
6606 + (and (eq_attr "cpu" "z10")
6607 + (eq_attr "type" "fsimptf"))
6608 + "z10_e1_BOTH*2, z10_Gate_FP")
6609 +; Wg "z10_e1_T*2, z10_Gate_FP")
6610 +
6611 +
6612 +; BFP division
6613 +
6614 +(define_insn_reservation "z10_fdivtf" 113
6615 + (and (eq_attr "cpu" "z10")
6616 + (eq_attr "type" "fdivtf"))
6617 + "z10_e1_T*4, z10_Gate_FP")
6618 +
6619 +(define_insn_reservation "z10_fdivdf" 41
6620 + (and (eq_attr "cpu" "z10")
6621 + (eq_attr "type" "fdivdf"))
6622 + "z10_e1_T*4, z10_Gate_FP")
6623 +
6624 +(define_insn_reservation "z10_fdivsf" 34
6625 + (and (eq_attr "cpu" "z10")
6626 + (eq_attr "type" "fdivsf"))
6627 + "z10_e1_T*4, z10_Gate_FP")
6628 +
6629 +
6630 +; BFP sqrt
6631 +
6632 +(define_insn_reservation "z10_fsqrtsf" 41
6633 + (and (eq_attr "cpu" "z10")
6634 + (eq_attr "type" "fsqrtsf"))
6635 + "z10_e1_T*4, z10_Gate_FP")
6636 +
6637 +(define_insn_reservation "z10_fsqrtdf" 54
6638 + (and (eq_attr "cpu" "z10")
6639 + (eq_attr "type" "fsqrtdf"))
6640 + "z10_e1_T*4, z10_Gate_FP")
6641 +
6642 +(define_insn_reservation "z10_fsqrtf" 122
6643 + (and (eq_attr "cpu" "z10")
6644 + (eq_attr "type" "fsqrttf"))
6645 + "z10_e1_T*4, z10_Gate_FP")
6646 +
6647 +
6648 +; BFP load and store
6649 +
6650 +(define_insn_reservation "z10_floadtf" 12
6651 + (and (eq_attr "cpu" "z10")
6652 + (eq_attr "type" "floadtf"))
6653 + "z10_e1_T, z10_Gate_FP")
6654 +
6655 +(define_insn_reservation "z10_floaddf" 12
6656 + (and (eq_attr "cpu" "z10")
6657 + (eq_attr "type" "floaddf"))
6658 + "z10_e1_T, z10_Gate_FP")
6659 +
6660 +(define_insn_reservation "z10_floadsf" 12
6661 + (and (eq_attr "cpu" "z10")
6662 + (eq_attr "type" "floadsf"))
6663 + "z10_e1_T, z10_Gate_FP")
6664 +
6665 +(define_insn_reservation "z10_fstoredf" 12
6666 + (and (eq_attr "cpu" "z10")
6667 + (eq_attr "type" "fstoredf,fstoredd"))
6668 + "z10_e1_T, z10_Gate_FP")
6669 +
6670 +(define_insn_reservation "z10_fstoresf" 12
6671 + (and (eq_attr "cpu" "z10")
6672 + (eq_attr "type" "fstoresf,fstoresd"))
6673 + "z10_e1_T, z10_Gate_FP")
6674 +
6675 +
6676 +; BFP truncate
6677 +(define_insn_reservation "z10_ftrunctf" 12
6678 + (and (eq_attr "cpu" "z10")
6679 + (eq_attr "type" "ftrunctf"))
6680 + "z10_e1_T, z10_Gate_FP")
6681 +
6682 +(define_insn_reservation "z10_ftruncdf" 16
6683 + (and (eq_attr "cpu" "z10")
6684 + (eq_attr "type" "ftruncdf"))
6685 + "z10_e1_T, z10_Gate_FP")
6686 +
6687 +
6688 +; Conversion between BFP and int.
6689 +(define_insn_reservation "z10_ftoi" 13
6690 + (and (eq_attr "cpu" "z10")
6691 + (eq_attr "type" "ftoi"))
6692 + "z10_e1_T, z10_Gate_FP")
6693 +
6694 +(define_insn_reservation "z10_itoftf" 14
6695 + (and (eq_attr "cpu" "z10")
6696 + (eq_attr "type" "itoftf"))
6697 + "z10_e1_T*2, z10_Gate_FP")
6698 +
6699 +(define_insn_reservation "z10_itofsfdf" 12
6700 + (and (eq_attr "cpu" "z10")
6701 + (eq_attr "type" "itofdf,itofsf"))
6702 + "z10_e1_T, z10_Gate_FP")
6703 +
6704 +
6705 +
6706 +; BFP-related bypasses. There is no bypass for extended mode.
6707 +(define_bypass 1 "z10_fsimpdf" "z10_fstoredf")
6708 +(define_bypass 1 "z10_fsimpsf" "z10_fstoresf")
6709 +(define_bypass 1 "z10_floaddf" "z10_fsimpdf, z10_fstoredf, z10_floaddf")
6710 +(define_bypass 1 "z10_floadsf" "z10_fsimpsf, z10_fstoresf, z10_floadsf")
6711 +
6712 +
6713 +;
6714 +; insn_reservations for DFP instructions.
6715 +;
6716 +
6717 +; Exact number of cycles is not known at compile-time.
6718 +(define_insn_reservation "z10_fdivddtd" 40
6719 + (and (eq_attr "cpu" "z10")
6720 + (eq_attr "type" "fdivdd,fdivtd"))
6721 + "z10_e1_BOTH,z10_Gate_DFU")
6722 +
6723 +(define_insn_reservation "z10_ftruncsd" 38
6724 + (and (eq_attr "cpu" "z10")
6725 + (eq_attr "type" "ftruncsd"))
6726 + "z10_e1_BOTH*4,z10_Gate_DFU")
6727 +
6728 +(define_insn_reservation "z10_ftruncdd" 340
6729 + (and (eq_attr "cpu" "z10")
6730 + (eq_attr "type" "ftruncsd"))
6731 + "z10_e1_BOTH*4,z10_Gate_DFU")
6732 +
6733 +(define_insn_reservation "z10_floaddd" 12
6734 + (and (eq_attr "cpu" "z10")
6735 + (eq_attr "type" "floaddd"))
6736 + "z10_e1_BOTH,z10_Gate_DFU")
6737 +
6738 +(define_insn_reservation "z10_floadsd" 12
6739 + (and (eq_attr "cpu" "z10")
6740 + (eq_attr "type" "floadsd"))
6741 + "z10_e1_BOTH,z10_Gate_DFU")
6742 +
6743 +; Exact number of cycles is not known at compile-time.
6744 +(define_insn_reservation "z10_fmulddtd" 35
6745 + (and (eq_attr "cpu" "z10")
6746 + (eq_attr "type" "fmuldd,fmultd"))
6747 + "z10_e1_BOTH,z10_Gate_DFU")
6748 +
6749 +(define_insn_reservation "z10_fsimpdd" 17
6750 + (and (eq_attr "cpu" "z10")
6751 + (eq_attr "type" "fsimpdd"))
6752 + "z10_e1_BOTH,z10_Gate_DFU")
6753 +
6754 +(define_insn_reservation "z10_fsimpsd" 17
6755 + (and (eq_attr "cpu" "z10")
6756 + (eq_attr "type" "fsimpsd"))
6757 + "z10_e1_BOTH,z10_Gate_DFU")
6758 +
6759 +(define_insn_reservation "z10_fsimptd" 18
6760 + (and (eq_attr "cpu" "z10")
6761 + (eq_attr "type" "fsimptd"))
6762 + "z10_e1_BOTH,z10_Gate_DFU")
6763 +
6764 +(define_insn_reservation "z10_itofdd" 36
6765 + (and (eq_attr "cpu" "z10")
6766 + (eq_attr "type" "itofdd"))
6767 + "z10_e1_BOTH*3,z10_Gate_DFU")
6768 +
6769 +(define_insn_reservation "z10_itoftd" 49
6770 + (and (eq_attr "cpu" "z10")
6771 + (eq_attr "type" "itoftd"))
6772 + "z10_e1_BOTH*3,z10_Gate_DFU")
6773 +
6774 +; Exact number of cycles is not known at compile-time.
6775 +(define_insn_reservation "z10_ftoidfp" 30
6776 + (and (eq_attr "cpu" "z10")
6777 + (eq_attr "type" "ftoidfp"))
6778 + "z10_e1_BOTH*3,z10_Gate_DFU")
6779 +
6780 +
6781 +;
6782 +; Address-related bypasses
6783 +;
6784 +
6785 +; Here is the cycle diagram for Address-related bypasses:
6786 +; ... G1 G2 G3 A0 A1 A2 A3 E1 P1 P2 P3 R0 ...
6787 +; ^ ^ ^ ^ ^
6788 +; | | | | E1-type bypasses provide the new addr AFTER this cycle
6789 +; | | | A3-type bypasses provide the new addr AFTER this cycle
6790 +; | | A1-type bypasses provide the new addr AFTER this cycle
6791 +; | AGI resolution, actual USE of address is DURING this cycle
6792 +; AGI detection
6793 +
6794 +(define_bypass 3 "z10_larl_A1, z10_la_fwd_A1, z10_other_fwd_A1, \
6795 + z10_int_fwd_A1"
6796 + "z10_agen, z10_la, z10_branch, z10_call, z10_load, \
6797 + z10_store, \
6798 + z10_cs, z10_stm, z10_other"
6799 + "s390_agen_dep_p")
6800 +
6801 +
6802 +(define_bypass 5 "z10_larl_fwd_A3, z10_load_fwd_A3, z10_other_fwd_A3, \
6803 + z10_other_fr_A3, z10_int_fwd_A3, z10_int_fr_A3"
6804 + "z10_agen, z10_la, z10_branch, z10_call, z10_load, \
6805 + z10_store, \
6806 + z10_cs, z10_stm, z10_other"
6807 + "s390_agen_dep_p")
6808 +
6809 +(define_bypass 6 "z10_other_fr_E1, z10_other_super_c_E1, z10_other_super_E1, \
6810 + z10_other_fwd_E1, \
6811 + z10_lr_fr_E1, z10_larl_super_E1, \
6812 + z10_int_super_E1, z10_int_fwd_E1, z10_int_fr_E1"
6813 + "z10_agen, z10_la, z10_branch, z10_call, z10_load, \
6814 + z10_store, \
6815 + z10_cs, z10_stm, z10_other"
6816 + "s390_agen_dep_p")
6817 +
6818 +
6819 +
6820 +;
6821 +; Try to avoid transitions between DFU-, BFU- and FXU-executed instructions as there is a
6822 +; dispatch delay required.
6823 +;
6824 +
6825 +
6826 +; Declaration for some pseudo-pipeline stages that reflect the
6827 +; dispatch gap when issueing an INT/FXU/BFU-executed instruction after
6828 +; an instruction executed by a different unit has been executed. The
6829 +; approach is that we pretend a pipelined execution of BFU operations
6830 +; with as many stages as the gap is long and request that none of
6831 +; these stages is busy when issueing a FXU- or DFU-executed
6832 +; instruction. Similar for FXU- and DFU-executed instructions.
6833 +
6834 +; Declaration for FPU stages.
6835 +(define_cpu_unit "z10_f0, z10_f1, z10_f2, z10_f3, z10_f4, z10_f5, z10_f6, \
6836 + z10_f7, z10_f8, z10_f9, z10_f10, z10_f11, z10_f12" "z10_cpu")
6837 +(define_reservation "z10_FP_PP" "z10_f0, z10_f1, z10_f2, z10_f3, z10_f4, \
6838 + z10_f5, z10_f6, z10_f7, z10_f8, z10_f9, z10_f10, z10_f11, \
6839 + z10_f12")
6840 +
6841 +; Declaration for FXU stages.
6842 +(define_cpu_unit "z10_S1, z10_S2, z10_S3, z10_S4, z10_S5, z10_S6" "z10_cpu")
6843 +(define_cpu_unit "z10_T1, z10_T2, z10_T3, z10_T4, z10_T5, z10_T6" "z10_cpu")
6844 +(define_reservation "z10_INT_PP" "z10_S1 | z10_T1, z10_S2 | z10_T2, z10_S3 \
6845 + | z10_T3, z10_S4 | z10_T4, z10_S5 | \
6846 + z10_T5, z10_S6 | z10_T6")
6847 +
6848 +; Declaration for DFU stages.
6849 +(define_cpu_unit "z10_d0, z10_d1, z10_d2, z10_d3, z10_d4, z10_d5, z10_d6"
6850 + "z10_cpu")
6851 +(define_reservation "z10_DFU_PP" "z10_d0, z10_d1, z10_d2, z10_d3, z10_d4, \
6852 + z10_d5, z10_d6")
6853 +
6854 +
6855 +; Pseudo-units representing whether the respective unit is available
6856 +; in the sense that using it does not cause a dispatch delay.
6857 +
6858 +(define_cpu_unit "z10_S_avail, z10_T_avail, z10_FP_avail, z10_DFU_avail"
6859 + "z10_cpu")
6860 +
6861 +(absence_set "z10_FP_avail"
6862 + "z10_S1, z10_S2, z10_S3, z10_S4, z10_S5, z10_S6, z10_T1, z10_T2, z10_T3, z10_T4, \
6863 + z10_T5, z10_T6, \
6864 + z10_d0, z10_d1, z10_d2, z10_d3, z10_d4, z10_d5, z10_d6")
6865 +
6866 +(absence_set "z10_S_avail,z10_T_avail"
6867 + "z10_f0, z10_f1, z10_f2, z10_f3, z10_f4, z10_f5, z10_f6, z10_f7, \
6868 + z10_f8, z10_f9, z10_f10, z10_f11, z10_f12, \
6869 + z10_d0, z10_d1, z10_d2, z10_d3, z10_d4, z10_d5, z10_d6")
6870 +
6871 +(absence_set "z10_DFU_avail"
6872 + "z10_S1, z10_S2, z10_S3, z10_S4, z10_S5, z10_S6, z10_T1, z10_T2, z10_T3, z10_T4, \
6873 + z10_T5, z10_T6, \
6874 + z10_f0, z10_f1, z10_f2, z10_f3, z10_f4, z10_f5, z10_f6, z10_f7, \
6875 + z10_f8, z10_f9, z10_f10, z10_f11, z10_f12")
6876 +
6877 +
6878 +; Pseudo-units to be used in insn_reservations.
6879 +
6880 +(define_reservation "z10_Gate_ANY" "((z10_S_avail | z10_T_avail), z10_INT_PP)")
6881 +(define_reservation "z10_Gate_BOTH" "((z10_S_avail + z10_T_avail), z10_INT_PP)")
6882 +
6883 +(define_reservation "z10_Gate_FP" "z10_FP_avail, z10_FP_PP")
6884 +
6885 +(define_reservation "z10_Gate_DFU" "z10_DFU_avail, z10_DFU_PP")
6886 Index: gcc/config/s390/constraints.md
6887 ===================================================================
6888 --- gcc/config/s390/constraints.md (revision 141434)
6889 +++ gcc/config/s390/constraints.md (working copy)
6890 @@ -1,5 +1,5 @@
6891 ;; Constraints definitions belonging to the gcc backend for IBM S/390.
6892 -;; Copyright (C) 2006, 2007 Free Software Foundation, Inc.
6893 +;; Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
6894 ;; Written by Wolfgang Gellerich, using code and information found in
6895 ;; files s390.md, s390.h, and s390.c.
6896 ;;
6897 @@ -24,10 +24,14 @@
6898 ;; Special constraints for s/390 machine description:
6899 ;;
6900 ;; a -- Any address register from 1 to 15.
6901 +;; b -- Memory operand whose address is a symbol reference or a symbol
6902 +;; reference + constant which can be proven to be naturally aligned.
6903 ;; c -- Condition code register 33.
6904 ;; d -- Any register from 0 to 15.
6905 ;; f -- Floating point registers.
6906 ;; t -- Access registers 36 and 37.
6907 +;; C -- A signed 8-bit constant (-128..127)
6908 +;; D -- An unsigned 16-bit constant (0..65535)
6909 ;; G -- Const double zero operand
6910 ;; I -- An 8-bit constant (0..255).
6911 ;; J -- A 12-bit constant (0..4095).
6912 @@ -102,6 +106,19 @@
6913 ;; General constraints for constants.
6914 ;;
6915
6916 +(define_constraint "C"
6917 + "@internal
6918 + An 8-bit signed immediate constant (-128..127)"
6919 + (and (match_code "const_int")
6920 + (match_test "ival >= -128 && ival <= 127")))
6921 +
6922 +
6923 +(define_constraint "D"
6924 + "An unsigned 16-bit constant (0..65535)"
6925 + (and (match_code "const_int")
6926 + (match_test "ival >= 0 && ival <= 65535")))
6927 +
6928 +
6929 (define_constraint "G"
6930 "@internal
6931 Const double zero operand"
6932 @@ -127,7 +144,6 @@
6933 (match_test "ival >= -32768 && ival <= 32767")))
6934
6935
6936 -
6937 (define_constraint "L"
6938 "Value appropriate as displacement.
6939 (0..4095) for short displacement
6940 @@ -355,7 +371,6 @@
6941 (match_test "s390_mem_constraint (\"Q\", op)"))
6942
6943
6944 -
6945 (define_memory_constraint "R"
6946 "Memory reference with index register and short displacement"
6947 (match_test "s390_mem_constraint (\"R\", op)"))
6948 @@ -371,7 +386,28 @@
6949 (match_test "s390_mem_constraint (\"T\", op)"))
6950
6951
6952 +(define_memory_constraint "b"
6953 + "Memory reference whose address is a naturally aligned symbol reference."
6954 + (match_test "MEM_P (op)
6955 + && s390_check_symref_alignment (XEXP (op, 0),
6956 + GET_MODE_SIZE (GET_MODE (op)))"))
6957
6958 +(define_memory_constraint "e"
6959 + "Matches all memory references available on the current architecture
6960 +level. This constraint will never be used and using it in an inline
6961 +assembly is *always* a bug since there is no instruction accepting all
6962 +those addresses. It just serves as a placeholder for a generic memory
6963 +constraint."
6964 + (match_test "legitimate_address_p (GET_MODE (op), op, 1)"))
6965 +
6966 +; This defines 'm' as normal memory constraint. This is only possible
6967 +; since the standard memory constraint is re-defined in s390.h using
6968 +; the TARGET_MEM_CONSTRAINT macro.
6969 +(define_memory_constraint "m"
6970 + "Matches the most general memory address for pre-z10 machines."
6971 + (match_test "s390_mem_constraint (\"R\", op)
6972 + || s390_mem_constraint (\"T\", op)"))
6973 +
6974 (define_memory_constraint "AQ"
6975 "@internal
6976 Offsettable memory reference without index register and with short displacement"
6977 @@ -425,7 +461,6 @@
6978 (match_test "s390_mem_constraint (\"BT\", op)"))
6979
6980
6981 -
6982 (define_address_constraint "U"
6983 "Pointer with short displacement"
6984 (match_test "s390_mem_constraint (\"U\", op)"))
6985 Index: gcc/config/s390/s390-protos.h
6986 ===================================================================
6987 --- gcc/config/s390/s390-protos.h (revision 141434)
6988 +++ gcc/config/s390/s390-protos.h (working copy)
6989 @@ -1,5 +1,7 @@
6990 /* Definitions of target machine for GNU compiler, for IBM S/390.
6991 - Copyright (C) 2000, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
6992 + Copyright (C) 2000, 2002, 2003, 2004, 2005, 2007, 2008 Free
6993 + Software Foundation, Inc.
6994 +
6995 Contributed by Hartmut Penner (hpenner@××××××.com)
6996
6997 This file is part of GCC.
6998 @@ -27,9 +29,9 @@
6999 extern int s390_O_constraint_str (const char c, HOST_WIDE_INT value);
7000 extern int s390_N_constraint_str (const char *str, HOST_WIDE_INT value);
7001 extern int s390_float_const_zero_p (rtx value);
7002 +extern bool s390_check_symref_alignment (rtx addr, HOST_WIDE_INT alignment);
7003
7004
7005 -
7006 /* Declare functions in s390.c. */
7007
7008 extern void optimization_options (int, int);
7009 @@ -51,6 +53,7 @@
7010 extern int s390_const_double_ok_for_constraint_p (rtx, int, const char *);
7011 extern int s390_single_part (rtx, enum machine_mode, enum machine_mode, int);
7012 extern unsigned HOST_WIDE_INT s390_extract_part (rtx, enum machine_mode, int);
7013 +extern bool s390_contiguous_bitmask_p (unsigned HOST_WIDE_INT, int, int *, int *);
7014 extern bool s390_split_ok_p (rtx, rtx, enum machine_mode, int);
7015 extern bool s390_overlap_p (rtx, rtx, HOST_WIDE_INT);
7016 extern bool s390_offset_p (rtx, rtx, rtx);
7017 @@ -80,6 +83,8 @@
7018 extern enum reg_class s390_secondary_output_reload_class (enum reg_class,
7019 enum machine_mode,
7020 rtx);
7021 +extern void s390_reload_larl_operand (rtx , rtx , rtx);
7022 +extern void s390_reload_symref_address (rtx , rtx , rtx , bool);
7023 extern void s390_expand_plus_operand (rtx, rtx, rtx);
7024 extern void emit_symbolic_move (rtx *);
7025 extern void s390_load_address (rtx, rtx);
7026 @@ -113,6 +118,7 @@
7027 extern bool s390_legitimate_address_without_index_p (rtx);
7028 extern bool s390_decompose_shift_count (rtx, rtx *, HOST_WIDE_INT *);
7029 extern int s390_branch_condition_mask (rtx);
7030 +extern int s390_compare_and_branch_condition_mask (rtx);
7031
7032 #endif /* RTX_CODE */
7033
7034 Index: gcc/stmt.c
7035 ===================================================================
7036 --- gcc/stmt.c (revision 141434)
7037 +++ gcc/stmt.c (working copy)
7038 @@ -364,7 +364,7 @@
7039 }
7040 break;
7041
7042 - case 'V': case 'm': case 'o':
7043 + case 'V': case TARGET_MEM_CONSTRAINT: case 'o':
7044 *allows_mem = true;
7045 break;
7046
7047 @@ -463,7 +463,7 @@
7048 }
7049 break;
7050
7051 - case 'V': case 'm': case 'o':
7052 + case 'V': case TARGET_MEM_CONSTRAINT: case 'o':
7053 *allows_mem = true;
7054 break;
7055
7056 Index: gcc/reload1.c
7057 ===================================================================
7058 --- gcc/reload1.c (revision 141434)
7059 +++ gcc/reload1.c (working copy)
7060 @@ -1455,11 +1455,11 @@
7061 switch (c)
7062 {
7063 case '=': case '+': case '*': case '%': case '?': case '!':
7064 - case '0': case '1': case '2': case '3': case '4': case 'm':
7065 - case '<': case '>': case 'V': case 'o': case '&': case 'E':
7066 - case 'F': case 's': case 'i': case 'n': case 'X': case 'I':
7067 - case 'J': case 'K': case 'L': case 'M': case 'N': case 'O':
7068 - case 'P':
7069 + case '0': case '1': case '2': case '3': case '4': case '<':
7070 + case '>': case 'V': case 'o': case '&': case 'E': case 'F':
7071 + case 's': case 'i': case 'n': case 'X': case 'I': case 'J':
7072 + case 'K': case 'L': case 'M': case 'N': case 'O': case 'P':
7073 + case TARGET_MEM_CONSTRAINT:
7074 break;
7075
7076 case 'p':
7077
7078
7079
7080 1.1 src/patchsets/gcc/4.3.6/gentoo/40_all_gcc-4.4-libiberty.h-asprintf.patch
7081
7082 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/40_all_gcc-4.4-libiberty.h-asprintf.patch?rev=1.1&view=markup
7083 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/40_all_gcc-4.4-libiberty.h-asprintf.patch?rev=1.1&content-type=text/plain
7084
7085 Index: 40_all_gcc-4.4-libiberty.h-asprintf.patch
7086 ===================================================================
7087 2008-07-25 Magnus Granberg <zorry@×××.nu>
7088
7089 * include/libiberty.h (asprintf): Don't declare if defined as a macro
7090
7091 --- include/libiberty.h.zorry
7092 +++ include/libiberty.h
7093 @@ -554,8 +554,11 @@
7094 /* Like sprintf but provides a pointer to malloc'd storage, which must
7095 be freed by the caller. */
7096
7097 +/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */
7098 +#ifndef asprintf
7099 extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
7100 #endif
7101 +#endif
7102
7103 #if !HAVE_DECL_VASPRINTF
7104 /* Like vsprintf but provides a pointer to malloc'd storage, which
7105
7106
7107
7108 1.1 src/patchsets/gcc/4.3.6/gentoo/45_all_arm-pic-ssp-segv-pr35965.patch
7109
7110 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/45_all_arm-pic-ssp-segv-pr35965.patch?rev=1.1&view=markup
7111 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/45_all_arm-pic-ssp-segv-pr35965.patch?rev=1.1&content-type=text/plain
7112
7113 Index: 45_all_arm-pic-ssp-segv-pr35965.patch
7114 ===================================================================
7115 http://gcc.gnu.org/ml/gcc-patches/2008-06/msg01641.html
7116 http://bugs.gentoo.org/248061
7117 http://gcc.gnu.org/PR35965
7118
7119 From: Julian Brown <julian at codesourcery dot com>
7120 To: gcc-patches at gcc dot gnu dot org
7121 Cc: paul at codesourcery dot com
7122 Date: Thu, 26 Jun 2008 11:08:39 +0100
7123 Subject: [PATCH, ARM] Fix PIC + -fstack-protector (PR35965)
7124 __________________________________________________________________
7125
7126 Hi,
7127
7128 This patch fixes the test case in PR35965. The problem was that using
7129 a -fstack-protector[-all] option causes arm.c:require_pic_register() to
7130 be called from function.c:stack_protect_prologue() (via validize_mem).
7131 The logic in require_pic_register is either expecting to be called "as
7132 part of the rtx cost estimation process", or whilst emitting RTL for
7133 a function.
7134
7135 During the stack_protect_prologue call, we have something like the
7136 latter case: RTL is emitted (to load the _GLOBAL_OFFSET_TABLE_ pointer
7137 into a pseudo-reg), although current_ir_type () still returns
7138 IR_GIMPLE. This means that cfun->machine->pic_reg is initialised with
7139 two different pseudo-regs representing the GOT pointer during the
7140 compilation of a single function: an attempt is made to use the first to
7141 access the stack-protector-related variable __stack_check_guard, but
7142 only the second is actually loaded with the GOT pointer. The missing
7143 GOT pointer is then optimised away leaving only the offset (relative to
7144 address zero), and the resulting bad memory access causes a segfault at
7145 runtime in the compiled code.
7146
7147 The attached patch just makes sure that the cfun->machine->pic_reg
7148 variable is only set once per-function, which suffices to fix the
7149 problem, but might not be the cleanest possible solution. E.g. the MIPS
7150 backend checks the variable "currently_expanding_to_rtl" in a
7151 (presumably) similar situation, but although that condition is true
7152 during the stack_protect_prologue call, adding it to the condition in
7153 arm.c:require_pic_register, e.g.:
7154
7155 if (current_ir_type () != IR_GIMPLE || currently_expanding_to_rtl)
7156
7157 Causes a crash in the subsequent code:
7158
7159 ...
7160 start_sequence ();
7161
7162 arm_load_pic_register (0UL);
7163
7164 seq = get_insns ();
7165 end_sequence ();
7166 emit_insn_after (seq, entry_of_function ()); // boom!
7167 }
7168
7169 because some BB-related fields are apparently not yet initialised
7170 properly. Maybe the stack_protect_prologue() call needs to be lower
7171 down cfgexpand.c:tree_expand_cfg for this to work.
7172
7173 The attached patch is tested with cross to arm-none-linux-gnueabi. OK
7174 for mainline? (The bug is present on 4.3 too, so the patch might be
7175 needed there also.)
7176
7177 Julian
7178
7179 ChangeLog
7180
7181 gcc/
7182 * config/arm/arm.c (require_pic_register): Only set
7183 cfun->machine->pic_reg once per function.
7184
7185 Index: gcc/config/arm/arm.c
7186 ===================================================================
7187 --- gcc/config/arm/arm.c (revision 137103)
7188 +++ gcc/config/arm/arm.c (working copy)
7189 @@ -3394,7 +3394,8 @@ require_pic_register (void)
7190 gcc_assert (can_create_pseudo_p ());
7191 if (arm_pic_register != INVALID_REGNUM)
7192 {
7193 - cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register);
7194 + if (!cfun->machine->pic_reg)
7195 + cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register);
7196
7197 /* Play games to avoid marking the function as needing pic
7198 if we are being called as part of the cost-estimation
7199 @@ -3406,7 +3407,8 @@ require_pic_register (void)
7200 {
7201 rtx seq;
7202
7203 - cfun->machine->pic_reg = gen_reg_rtx (Pmode);
7204 + if (!cfun->machine->pic_reg)
7205 + cfun->machine->pic_reg = gen_reg_rtx (Pmode);
7206
7207 /* Play games to avoid marking the function as needing pic
7208 if we are being called as part of the cost-estimation
7209 __________________________________________________________________
7210
7211
7212
7213 1.1 src/patchsets/gcc/4.3.6/gentoo/46_all_armel-hilo-union-class.patch
7214
7215 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/46_all_armel-hilo-union-class.patch?rev=1.1&view=markup
7216 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/46_all_armel-hilo-union-class.patch?rev=1.1&content-type=text/plain
7217
7218 Index: 46_all_armel-hilo-union-class.patch
7219 ===================================================================
7220 ripped from Debian
7221
7222 This patch fixes a reload ICE in the Fortran vector_subscript_1.f90
7223 test case (as part of the work Andrew Jenner and I have been doing at
7224 CodeSourcery to fix ObjC and Fortran for Debian). It's been submitted
7225 for comments to gcc-patches@ also:
7226
7227 http://gcc.gnu.org/ml/gcc-patches/2008-04/msg02033.html
7228
7229 So, an alternative patch may appear in due course, although this one
7230 works fine for the test case in question.
7231
7232 Cheers,
7233
7234 Julian
7235
7236 ChangeLog
7237
7238 gcc/
7239 * config/arm/arm.h (reg_class): Add HILO_REGS class as union of
7240 HI_REGS and LO_REGS.
7241 (REG_CLASS_NAMES): Likewise.
7242 (REG_CLASS_CONTENTS): Likewise.
7243 (PREFERRED_RELOAD_CLASS): Prefer LO_REGS for HILO_REGS reloads.
7244 * config/arm/arm.md (*thumb1_movsi_insn): Only use
7245 for !optimize_size.
7246 (*thumb1_movsi_insn_osize): New. Use for optimize_size Thumb-1
7247
7248 Index: gcc/config/arm/arm.h
7249 ===================================================================
7250 --- gcc/config/arm/arm.h (revision 206057)
7251 +++ gcc/config/arm/arm.h (working copy)
7252 @@ -1107,6 +1107,7 @@ enum reg_class
7253 STACK_REG,
7254 BASE_REGS,
7255 HI_REGS,
7256 + HILO_REGS,
7257 CC_REG,
7258 VFPCC_REG,
7259 GENERAL_REGS,
7260 @@ -1132,6 +1133,7 @@ enum reg_class
7261 "STACK_REG", \
7262 "BASE_REGS", \
7263 "HI_REGS", \
7264 + "HILO_REGS", \
7265 "CC_REG", \
7266 "VFPCC_REG", \
7267 "GENERAL_REGS", \
7268 @@ -1156,6 +1158,7 @@ enum reg_class
7269 { 0x00002000, 0x00000000, 0x00000000, 0x00000000 }, /* STACK_REG */ \
7270 { 0x000020FF, 0x00000000, 0x00000000, 0x00000000 }, /* BASE_REGS */ \
7271 { 0x0000FF00, 0x00000000, 0x00000000, 0x00000000 }, /* HI_REGS */ \
7272 + { 0x0000FFFF, 0x00000000, 0x00000000, 0x00000000 }, /* HILO_REGS */ \
7273 { 0x01000000, 0x00000000, 0x00000000, 0x00000000 }, /* CC_REG */ \
7274 { 0x00000000, 0x00000000, 0x00000000, 0x80000000 }, /* VFPCC_REG */ \
7275 { 0x0200FFFF, 0x00000000, 0x00000000, 0x00000000 }, /* GENERAL_REGS */ \
7276 @@ -1217,7 +1220,8 @@ enum reg_class
7277 #define PREFERRED_RELOAD_CLASS(X, CLASS) \
7278 (TARGET_ARM ? (CLASS) : \
7279 ((CLASS) == GENERAL_REGS || (CLASS) == HI_REGS \
7280 - || (CLASS) == NO_REGS ? LO_REGS : (CLASS)))
7281 + || (CLASS) == HILO_REGS || (CLASS) == NO_REGS \
7282 + ? LO_REGS : (CLASS)))
7283
7284 /* Must leave BASE_REGS reloads alone */
7285 #define THUMB_SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \
7286 Index: gcc/config/arm/arm.md
7287 ===================================================================
7288 --- gcc/config/arm/arm.md (revision 206057)
7289 +++ gcc/config/arm/arm.md (working copy)
7290 @@ -4823,7 +4823,30 @@
7291 (match_operand:SI 1 "general_operand" "l, I,J,K,>,l,mi,l,*lh"))]
7292 "TARGET_THUMB1
7293 && ( register_operand (operands[0], SImode)
7294 - || register_operand (operands[1], SImode))"
7295 + || register_operand (operands[1], SImode))
7296 + && !optimize_size"
7297 + "@
7298 + mov %0, %1
7299 + mov %0, %1
7300 + #
7301 + #
7302 + ldmia\\t%1, {%0}
7303 + stmia\\t%0, {%1}
7304 + ldr\\t%0, %1
7305 + str\\t%1, %0
7306 + mov\\t%0, %1"
7307 + [(set_attr "length" "2,2,4,4,2,2,2,2,2")
7308 + (set_attr "type" "*,*,*,*,load1,store1,load1,store1,*")
7309 + (set_attr "pool_range" "*,*,*,*,*,*,1020,*,*")]
7310 +)
7311 +
7312 +(define_insn "*thumb1_movsi_insn_osize"
7313 + [(set (match_operand:SI 0 "nonimmediate_operand" "=l,l,l,l,l,>,l, m,*l*h")
7314 + (match_operand:SI 1 "general_operand" "l, I,J,K,>,l,mi,l,*l*h"))]
7315 + "TARGET_THUMB1
7316 + && ( register_operand (operands[0], SImode)
7317 + || register_operand (operands[1], SImode))
7318 + && optimize_size"
7319 "@
7320 mov %0, %1
7321 mov %0, %1
7322
7323
7324
7325 1.1 src/patchsets/gcc/4.3.6/gentoo/47_all_arm-unbreak-armv4t.patch
7326
7327 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/47_all_arm-unbreak-armv4t.patch?rev=1.1&view=markup
7328 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/47_all_arm-unbreak-armv4t.patch?rev=1.1&content-type=text/plain
7329
7330 Index: 47_all_arm-unbreak-armv4t.patch
7331 ===================================================================
7332 http://sourceware.org/ml/crossgcc/2008-05/msg00009.html
7333
7334 gcc defaults to armv5t for all targets even armv4t
7335
7336 --- gcc/config/arm/linux-eabi.h
7337 +++ gcc/config/arm/linux-eabi.h
7338 @@ -45,7 +45,7 @@
7339 The ARM10TDMI core is the default for armv5t, so set
7340 SUBTARGET_CPU_DEFAULT to achieve this. */
7341 #undef SUBTARGET_CPU_DEFAULT
7342 -#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
7343 +#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
7344
7345 /* TARGET_BIG_ENDIAN_DEFAULT is set in
7346 config.gcc for big endian configurations. */
7347
7348
7349
7350 1.1 src/patchsets/gcc/4.3.6/gentoo/48_all_gfortran-armel-updates.patch
7351
7352 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/48_all_gfortran-armel-updates.patch?rev=1.1&view=markup
7353 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/48_all_gfortran-armel-updates.patch?rev=1.1&content-type=text/plain
7354
7355 Index: 48_all_gfortran-armel-updates.patch
7356 ===================================================================
7357 ripped from Debian
7358
7359 ARM EABI (armel) Fortran support patches
7360
7361 ChangeLog (enum-size-warning)
7362
7363 gcc/testsuite/
7364 * gfortran.dg/enum_10.f90: Use -Wl,--no-enum-size-warning on
7365 arm*-*-linux*eabi.
7366
7367 ChangeLog (line-endings)
7368
7369 gcc/testsuite/
7370 * gfortran.dg/fmt_l.f90: Modify dg-output regexp to allow it to
7371 match lines ending with CRLF.
7372
7373 ChangeLog (nested-function-alignment)
7374
7375 gcc/
7376 * config/arm/arm.c: (arm_compute_static_chain_stack_bytes): New
7377 function.
7378 (arm_compute_initial_elimination_offset): Use it.
7379 (arm_compute_save_reg_mask): Include static chain save slot when
7380 calculating alignment.
7381 (arm_get_frame_offsets): Ditto.
7382
7383 ChangeLog (r12)
7384
7385 gcc/
7386 * config/arm/arm.c: (thumb1_compute_save_reg_mask): Ensure we
7387 have a low register saved that we can use to decrement the stack
7388 when the stack decrement could be too big for an immediate value
7389 in a single insn.
7390 (thumb1_expand_prologue): Avoid using r12 for stack decrement.
7391
7392 Index: gcc/testsuite/gfortran.dg/enum_10.f90
7393 ===================================================================
7394 *** gcc/testsuite/gfortran.dg/enum_10.f90 (revision 197947)
7395 --- gcc/testsuite/gfortran.dg/enum_10.f90 (working copy)
7396 ***************
7397 *** 1,6 ****
7398 --- 1,7 ----
7399 ! { dg-do run }
7400 ! { dg-additional-sources enum_10.c }
7401 ! { dg-options "-fshort-enums -w" }
7402 + ! { dg-options "-fshort-enums -w -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
7403 ! Make sure short enums are indeed interoperable with the
7404 ! corresponding C type.
7405
7406 Index: gcc/testsuite/gfortran.dg/fmt_l.f90
7407 ===================================================================
7408 --- gcc/testsuite/gfortran.dg/fmt_l.f90 (revision 197947)
7409 +++ gcc/testsuite/gfortran.dg/fmt_l.f90 (working copy)
7410 @@ -51,35 +51,35 @@
7411 if (l8 .neqv. .false.) call abort
7412
7413 end program test_l
7414 -! { dg-output "At line 14 of file.*" }
7415 -! { dg-output "Fortran runtime warning: Positive width required in format\n" }
7416 -! { dg-output "At line 15 of file.*" }
7417 -! { dg-output "Fortran runtime warning: Positive width required in format\n" }
7418 -! { dg-output "At line 19 of file.*" }
7419 -! { dg-output "Fortran runtime warning: Positive width required in format\n" }
7420 -! { dg-output "At line 20 of file.*" }
7421 -! { dg-output "Fortran runtime warning: Positive width required in format\n" }
7422 -! { dg-output "At line 24 of file.*" }
7423 -! { dg-output "Fortran runtime warning: Positive width required in format\n" }
7424 -! { dg-output "At line 25 of file.*" }
7425 -! { dg-output "Fortran runtime warning: Positive width required in format\n" }
7426 -! { dg-output "At line 29 of file.*" }
7427 -! { dg-output "Fortran runtime warning: Positive width required in format\n" }
7428 -! { dg-output "At line 30 of file.*" }
7429 -! { dg-output "Fortran runtime warning: Positive width required in format\n" }
7430 -! { dg-output "At line 34 of file.*" }
7431 -! { dg-output "Fortran runtime warning: Positive width required in format\n" }
7432 -! { dg-output "At line 35 of file.*" }
7433 -! { dg-output "Fortran runtime warning: Positive width required in format\n" }
7434 -! { dg-output "At line 39 of file.*" }
7435 -! { dg-output "Fortran runtime warning: Positive width required in format\n" }
7436 -! { dg-output "At line 40 of file.*" }
7437 -! { dg-output "Fortran runtime warning: Positive width required in format\n" }
7438 -! { dg-output "At line 44 of file.*" }
7439 -! { dg-output "Fortran runtime warning: Positive width required in format\n" }
7440 -! { dg-output "At line 45 of file.*" }
7441 -! { dg-output "Fortran runtime warning: Positive width required in format\n" }
7442 -! { dg-output "At line 49 of file.*" }
7443 -! { dg-output "Fortran runtime warning: Positive width required in format\n" }
7444 -! { dg-output "At line 50 of file.*" }
7445 -! { dg-output "Fortran runtime warning: Positive width required in format\n" }
7446 +! { dg-output "At line 14 of file.*\n" }
7447 +! { dg-output "Fortran runtime warning: Positive width required in format.\r?\n" }
7448 +! { dg-output "At line 15 of file.*\n" }
7449 +! { dg-output "Fortran runtime warning: Positive width required in format.\r?\n" }
7450 +! { dg-output "At line 19 of file.*\n" }
7451 +! { dg-output "Fortran runtime warning: Positive width required in format.\r?\n" }
7452 +! { dg-output "At line 20 of file.*\n" }
7453 +! { dg-output "Fortran runtime warning: Positive width required in format.\r?\n" }
7454 +! { dg-output "At line 24 of file.*\n" }
7455 +! { dg-output "Fortran runtime warning: Positive width required in format.\r?\n" }
7456 +! { dg-output "At line 25 of file.*\n" }
7457 +! { dg-output "Fortran runtime warning: Positive width required in format.\r?\n" }
7458 +! { dg-output "At line 29 of file.*\n" }
7459 +! { dg-output "Fortran runtime warning: Positive width required in format.\r?\n" }
7460 +! { dg-output "At line 30 of file.*\n" }
7461 +! { dg-output "Fortran runtime warning: Positive width required in format.\r?\n" }
7462 +! { dg-output "At line 34 of file.*\n" }
7463 +! { dg-output "Fortran runtime warning: Positive width required in format.\r?\n" }
7464 +! { dg-output "At line 35 of file.*\n" }
7465 +! { dg-output "Fortran runtime warning: Positive width required in format.\r?\n" }
7466 +! { dg-output "At line 39 of file.*\n" }
7467 +! { dg-output "Fortran runtime warning: Positive width required in format.\r?\n" }
7468 +! { dg-output "At line 40 of file.*\n" }
7469 +! { dg-output "Fortran runtime warning: Positive width required in format.\r?\n" }
7470 +! { dg-output "At line 44 of file.*\n" }
7471 +! { dg-output "Fortran runtime warning: Positive width required in format.\r?\n" }
7472 +! { dg-output "At line 45 of file.*\n" }
7473 +! { dg-output "Fortran runtime warning: Positive width required in format.\r?\n" }
7474 +! { dg-output "At line 49 of file.*\n" }
7475 +! { dg-output "Fortran runtime warning: Positive width required in format.\r?\n" }
7476 +! { dg-output "At line 50 of file.*\n" }
7477 +! { dg-output "Fortran runtime warning: Positive width required in format.\r?\n" }
7478 Index: gcc/config/arm/arm.c
7479 ===================================================================
7480 --- gcc/config/arm/arm.c (revision 206067)
7481 +++ gcc/config/arm/arm.c (working copy)
7482 @@ -62,6 +62,7 @@ const struct attribute_spec arm_attribut
7483 void (*arm_lang_output_object_attributes_hook)(void);
7484
7485 /* Forward function declarations. */
7486 +static int arm_compute_static_chain_stack_bytes (void);
7487 static arm_stack_offsets *arm_get_frame_offsets (void);
7488 static void arm_add_gc_roots (void);
7489 static int arm_gen_constant (enum rtx_code, enum machine_mode, rtx,
7490 @@ -10753,6 +10754,24 @@ arm_compute_save_reg0_reg12_mask (void)
7491 }
7492
7493
7494 +/* Compute the number of bytes used to store the static chain register on the
7495 + stack, above the stack frame. We need to know this accurately to get the
7496 + alignment of the rest of the stack frame correct. */
7497 +
7498 +static int arm_compute_static_chain_stack_bytes (void)
7499 +{
7500 + unsigned long func_type = arm_current_func_type ();
7501 + int static_chain_stack_bytes = 0;
7502 +
7503 + if (frame_pointer_needed && TARGET_ARM &&
7504 + IS_NESTED (func_type) &&
7505 + df_regs_ever_live_p (3) && current_function_pretend_args_size == 0)
7506 + static_chain_stack_bytes = 4;
7507 +
7508 + return static_chain_stack_bytes;
7509 +}
7510 +
7511 +
7512 /* Compute a bit mask of which registers need to be
7513 saved on the stack for the current function. */
7514
7515 @@ -10804,7 +10823,9 @@ arm_compute_save_reg_mask (void)
7516
7517 if (TARGET_REALLY_IWMMXT
7518 && ((bit_count (save_reg_mask)
7519 - + ARM_NUM_INTS (current_function_pretend_args_size)) % 2) != 0)
7520 + + ARM_NUM_INTS (current_function_pretend_args_size +
7521 + arm_compute_static_chain_stack_bytes())
7522 + ) % 2) != 0)
7523 {
7524 /* The total number of registers that are going to be pushed
7525 onto the stack is odd. We need to ensure that the stack
7526 @@ -11926,7 +11947,13 @@ thumb_force_lr_save (void)
7527 from the soft frame pointer to the hard frame pointer.
7528
7529 SFP may point just inside the local variables block to ensure correct
7530 - alignment. */
7531 + alignment.
7532 +
7533 + FIXME: Under some circumstances arm_expand_prologue() may save the static
7534 + chain register on the stack before the normal function prologue. For
7535 + historical reasons all our offsets are wrong in this case, and
7536 + arm_compute_static_chain_stack_bytes is used to compensate.
7537 + arm_compute_initial_elimination_offset uses the same correction. */
7538
7539
7540 /* Calculate stack offsets. These are used to calculate register elimination
7541 @@ -12032,9 +12059,11 @@ arm_get_frame_offsets (void)
7542 if (ARM_DOUBLEWORD_ALIGN)
7543 {
7544 /* Ensure SP remains doubleword aligned. */
7545 - if (offsets->outgoing_args & 7)
7546 + if ((offsets->outgoing_args +
7547 + arm_compute_static_chain_stack_bytes()) & 7)
7548 offsets->outgoing_args += 4;
7549 - gcc_assert (!(offsets->outgoing_args & 7));
7550 + gcc_assert (!((offsets->outgoing_args +
7551 + arm_compute_static_chain_stack_bytes()) & 7));
7552 }
7553
7554 return offsets;
7555 @@ -12069,14 +12098,9 @@ arm_compute_initial_elimination_offset (
7556 return offsets->soft_frame - offsets->saved_args;
7557
7558 case ARM_HARD_FRAME_POINTER_REGNUM:
7559 - /* If there is no stack frame then the hard
7560 - frame pointer and the arg pointer coincide. */
7561 - if (offsets->frame == offsets->saved_regs)
7562 - return 0;
7563 - /* FIXME: Not sure about this. Maybe we should always return 0 ? */
7564 - return (frame_pointer_needed
7565 - && cfun->static_chain_decl != NULL
7566 - && ! cfun->machine->uses_anonymous_args) ? 4 : 0;
7567 + /* This is only non-zero in the case where the static chain register
7568 + is stored above the frame. */
7569 + return arm_compute_static_chain_stack_bytes();
7570
7571 case STACK_POINTER_REGNUM:
7572 /* If nothing has been pushed on the stack at all
7573 @@ -12347,6 +12371,8 @@ arm_expand_prologue (void)
7574 insn = emit_set_insn (gen_rtx_REG (SImode, 3), ip_rtx);
7575 else if (args_to_push == 0)
7576 {
7577 + gcc_assert(arm_compute_static_chain_stack_bytes() == 4);
7578 +
7579 rtx dwarf;
7580
7581 insn = gen_rtx_PRE_DEC (SImode, stack_pointer_rtx);
7582 Index: gcc/config/arm/arm.c
7583 ===================================================================
7584 --- gcc/config/arm/arm.c (revision 206069)
7585 +++ gcc/config/arm/arm.c (working copy)
7586 @@ -10910,6 +10910,26 @@ thumb1_compute_save_reg_mask (void)
7587 mask |= 1 << reg;
7588 }
7589
7590 + /* The 504 below is 8 bytes less than 512 because there are two possible
7591 + alignment words. We can't tell here if they will be present or not so we
7592 + have to play it safe and assume that they are. */
7593 + if ((CALLER_INTERWORKING_SLOT_SIZE +
7594 + ROUND_UP_WORD (get_frame_size ()) +
7595 + current_function_outgoing_args_size) >= 504)
7596 + {
7597 + /* This is the same as the code in thumb1_expand_prologue() which
7598 + determines which register to use for stack decrement. */
7599 + for (reg = LAST_ARG_REGNUM + 1; reg <= LAST_LO_REGNUM; reg++)
7600 + if (mask & (1 << reg))
7601 + break;
7602 +
7603 + if (reg > LAST_LO_REGNUM)
7604 + {
7605 + /* Make sure we have a register available for stack decrement. */
7606 + mask |= 1 << LAST_LO_REGNUM;
7607 + }
7608 + }
7609 +
7610 return mask;
7611 }
7612
7613 @@ -16787,62 +16807,25 @@ thumb1_expand_prologue (void)
7614 been pushed at the start of the prologue and so we can corrupt
7615 it now. */
7616 for (regno = LAST_ARG_REGNUM + 1; regno <= LAST_LO_REGNUM; regno++)
7617 - if (live_regs_mask & (1 << regno)
7618 - && !(frame_pointer_needed
7619 - && (regno == THUMB_HARD_FRAME_POINTER_REGNUM)))
7620 + if (live_regs_mask & (1 << regno))
7621 break;
7622
7623 - if (regno > LAST_LO_REGNUM) /* Very unlikely. */
7624 - {
7625 - rtx spare = gen_rtx_REG (SImode, IP_REGNUM);
7626 + gcc_assert(regno <= LAST_LO_REGNUM);
7627
7628 - /* Choose an arbitrary, non-argument low register. */
7629 - reg = gen_rtx_REG (SImode, LAST_LO_REGNUM);
7630 + reg = gen_rtx_REG (SImode, regno);
7631
7632 - /* Save it by copying it into a high, scratch register. */
7633 - emit_insn (gen_movsi (spare, reg));
7634 - /* Add a USE to stop propagate_one_insn() from barfing. */
7635 - emit_insn (gen_prologue_use (spare));
7636 + emit_insn (gen_movsi (reg, GEN_INT (- amount)));
7637
7638 - /* Decrement the stack. */
7639 - emit_insn (gen_movsi (reg, GEN_INT (- amount)));
7640 - insn = emit_insn (gen_addsi3 (stack_pointer_rtx,
7641 - stack_pointer_rtx, reg));
7642 - RTX_FRAME_RELATED_P (insn) = 1;
7643 - dwarf = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
7644 - plus_constant (stack_pointer_rtx,
7645 - -amount));
7646 - RTX_FRAME_RELATED_P (dwarf) = 1;
7647 - REG_NOTES (insn)
7648 - = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
7649 - REG_NOTES (insn));
7650 -
7651 - /* Restore the low register's original value. */
7652 - emit_insn (gen_movsi (reg, spare));
7653 -
7654 - /* Emit a USE of the restored scratch register, so that flow
7655 - analysis will not consider the restore redundant. The
7656 - register won't be used again in this function and isn't
7657 - restored by the epilogue. */
7658 - emit_insn (gen_prologue_use (reg));
7659 - }
7660 - else
7661 - {
7662 - reg = gen_rtx_REG (SImode, regno);
7663 -
7664 - emit_insn (gen_movsi (reg, GEN_INT (- amount)));
7665 -
7666 - insn = emit_insn (gen_addsi3 (stack_pointer_rtx,
7667 - stack_pointer_rtx, reg));
7668 - RTX_FRAME_RELATED_P (insn) = 1;
7669 - dwarf = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
7670 - plus_constant (stack_pointer_rtx,
7671 - -amount));
7672 - RTX_FRAME_RELATED_P (dwarf) = 1;
7673 - REG_NOTES (insn)
7674 - = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
7675 - REG_NOTES (insn));
7676 - }
7677 + insn = emit_insn (gen_addsi3 (stack_pointer_rtx,
7678 + stack_pointer_rtx, reg));
7679 + RTX_FRAME_RELATED_P (insn) = 1;
7680 + dwarf = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
7681 + plus_constant (stack_pointer_rtx,
7682 + -amount));
7683 + RTX_FRAME_RELATED_P (dwarf) = 1;
7684 + REG_NOTES (insn)
7685 + = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
7686 + REG_NOTES (insn));
7687 }
7688 }
7689
7690
7691
7692
7693 1.1 src/patchsets/gcc/4.3.6/gentoo/49_all_arm_v7-config.patch
7694
7695 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/49_all_arm_v7-config.patch?rev=1.1&view=markup
7696 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/49_all_arm_v7-config.patch?rev=1.1&content-type=text/plain
7697
7698 Index: 49_all_arm_v7-config.patch
7699 ===================================================================
7700 --- gcc/config.gcc
7701 +++ gcc/config.gcc
7702 @@ -2891,8 +2891,9 @@
7703
7704 case "$with_arch" in
7705 "" \
7706 - | armv[23456] | armv2a | armv3m | armv4t | armv5t \
7707 + | armv[234567] | armv2a | armv3m | armv4t | armv5t \
7708 | armv5te | armv6j |armv6k | armv6z | armv6zk \
7709 + | armv7-a | armv7-m | armv7-r \
7710 | iwmmxt | ep9312)
7711 # OK
7712 ;;
7713
7714
7715
7716 1.1 src/patchsets/gcc/4.3.6/gentoo/51_all_gcc-3.4-libiberty-pic.patch
7717
7718 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/51_all_gcc-3.4-libiberty-pic.patch?rev=1.1&view=markup
7719 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/51_all_gcc-3.4-libiberty-pic.patch?rev=1.1&content-type=text/plain
7720
7721 Index: 51_all_gcc-3.4-libiberty-pic.patch
7722 ===================================================================
7723 --- gcc-4.1.0-orig/libiberty/Makefile.in 2006-03-01 15:49:14.000000000 -0500
7724 +++ gcc-4.1.0/libiberty/Makefile.in 2006-03-01 18:10:46.000000000 -0500
7725 @@ -232,6 +232,7 @@
7726 $(AR) $(AR_FLAGS) $(TARGETLIB) \
7727 $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
7728 $(RANLIB) $(TARGETLIB); \
7729 + cp $(TARGETLIB) ../ ; \
7730 cd ..; \
7731 else true; fi
7732
7733
7734
7735
7736 1.1 src/patchsets/gcc/4.3.6/gentoo/53_all_gcc4-superh-default-multilib.patch
7737
7738 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/53_all_gcc4-superh-default-multilib.patch?rev=1.1&view=markup
7739 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/53_all_gcc4-superh-default-multilib.patch?rev=1.1&content-type=text/plain
7740
7741 Index: 53_all_gcc4-superh-default-multilib.patch
7742 ===================================================================
7743 The gcc-3.x toolchains would contain all the targets by default. With gcc-4,
7744 you have to actually list out the multilibs you want or you will end up with
7745 just one when using targets like 'sh4-linux-gnu'.
7746
7747 The resulting toolchain can't even build a kernel as the kernel needs to build
7748 with the nofpu flag to be sure that no fpu ops are generated.
7749
7750 Here we restore the gcc-3.x behavior; the additional overhead of building all
7751 of these multilibs by default is negligible.
7752
7753 http://bugs.gentoo.org/140205
7754
7755 --- gcc-4.2.0/gcc/config.gcc
7756 +++ gcc-4.2.0/gcc/config.gcc
7757 @@ -2092,7 +2092,7 @@
7758 if test x${sh_multilibs} = x ; then
7759 case ${target} in
7760 sh64-superh-linux* | \
7761 - sh[1234]*) sh_multilibs=${sh_cpu_target} ;;
7762 + sh[1234]*) sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;;
7763 sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
7764 sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
7765 sh*-*-linux*) sh_multilibs=m1,m3e,m4 ;;
7766
7767
7768
7769 1.1 src/patchsets/gcc/4.3.6/gentoo/61_all_gcc4-ia64-noteGNUstack.patch
7770
7771 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/61_all_gcc4-ia64-noteGNUstack.patch?rev=1.1&view=markup
7772 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/61_all_gcc4-ia64-noteGNUstack.patch?rev=1.1&content-type=text/plain
7773
7774 Index: 61_all_gcc4-ia64-noteGNUstack.patch
7775 ===================================================================
7776 2004-09-20 Jakub Jelinek <jakub@××××××.com>
7777
7778 * config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
7779 on ppc64-linux.
7780
7781 * config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
7782 ia64-linux.
7783 * config/ia64/crtbegin.asm: Likewise.
7784 * config/ia64/crtend.asm: Likewise.
7785 * config/ia64/crti.asm: Likewise.
7786 * config/ia64/crtn.asm: Likewise.
7787
7788 2004-05-14 Jakub Jelinek <jakub@××××××.com>
7789
7790 * config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
7791
7792 --- gcc/config/ia64/linux.h.jj 2004-05-14 07:21:27.000000000 -0400
7793 +++ gcc/config/ia64/linux.h 2004-05-14 09:21:09.000000000 -0400
7794 @@ -5,6 +5,8 @@
7795
7796 #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
7797
7798 +#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
7799 +
7800 /* This is for -profile to use -lc_p instead of -lc. */
7801 #undef CC1_SPEC
7802 #define CC1_SPEC "%{profile:-p} %{G*}"
7803 --- gcc/config/rs6000/ppc-asm.h.jj 2003-06-04 18:40:59.000000000 +0200
7804 +++ gcc/config/rs6000/ppc-asm.h 2004-09-20 14:17:47.259396058 +0200
7805 @@ -158,7 +158,7 @@ GLUE(.L,name): \
7806 .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
7807 #endif
7808
7809 -#if defined __linux__ && !defined __powerpc64__
7810 +#if defined __linux__
7811 .section .note.GNU-stack
7812 .previous
7813 #endif
7814 --- gcc/config/ia64/lib1funcs.asm.jj 2003-10-27 11:45:17.000000000 +0100
7815 +++ gcc/config/ia64/lib1funcs.asm 2004-09-20 14:26:28.094132706 +0200
7816 @@ -741,3 +741,7 @@ __floattitf:
7817 .endp __floattitf
7818
7819 #endif
7820 +
7821 +#ifdef __linux__
7822 +.section .note.GNU-stack; .previous
7823 +#endif
7824 --- gcc/config/ia64/crtend.asm.jj 2004-05-20 14:36:14.000000000 +0200
7825 +++ gcc/config/ia64/crtend.asm 2004-09-20 14:25:57.329580329 +0200
7826 @@ -113,3 +113,7 @@ __do_global_ctors_aux:
7827
7828 br.ret.sptk.many rp
7829 .endp __do_global_ctors_aux
7830 +
7831 +#ifdef __linux__
7832 +.section .note.GNU-stack; .previous
7833 +#endif
7834 --- gcc/config/ia64/crti.asm.jj 2003-04-02 17:14:15.000000000 +0200
7835 +++ gcc/config/ia64/crti.asm 2004-09-20 14:26:06.852894092 +0200
7836 @@ -64,3 +64,7 @@ _fini:
7837 .body
7838
7839 # end of crti.asm
7840 +
7841 +#ifdef __linux__
7842 +.section .note.GNU-stack; .previous
7843 +#endif
7844 --- gcc/config/ia64/crtbegin.asm.jj 2004-05-20 14:36:14.000000000 +0200
7845 +++ gcc/config/ia64/crtbegin.asm 2004-09-20 14:25:47.105390566 +0200
7846 @@ -246,3 +246,7 @@ __do_jv_register_classes:
7847 .weak __cxa_finalize
7848 #endif
7849 .weak _Jv_RegisterClasses
7850 +
7851 +#ifdef __linux__
7852 +.section .note.GNU-stack; .previous
7853 +#endif
7854 --- gcc/config/ia64/crtn.asm.jj 2003-04-02 17:14:15.000000000 +0200
7855 +++ gcc/config/ia64/crtn.asm 2004-09-20 14:26:16.381206878 +0200
7856 @@ -54,3 +54,7 @@
7857 br.ret.sptk.many b0
7858
7859 # end of crtn.asm
7860 +
7861 +#ifdef __linux__
7862 +.section .note.GNU-stack; .previous
7863 +#endif
7864
7865
7866
7867 1.1 src/patchsets/gcc/4.3.6/gentoo/61_all_gcc43-pr24170.patch
7868
7869 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/61_all_gcc43-pr24170.patch?rev=1.1&view=markup
7870 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/61_all_gcc43-pr24170.patch?rev=1.1&content-type=text/plain
7871
7872 Index: 61_all_gcc43-pr24170.patch
7873 ===================================================================
7874 http://gcc.gnu.org/PR24170
7875
7876 2008-02-20 Tom Tromey <tromey@××××××.com>
7877
7878 PR libgcj/24170:
7879 * java/io/natFilePosix.cc (File::performList): Don't use
7880 readdir_r.
7881 * configure, include/config.h.in: Rebuilt.
7882 * configure.ac: Don't check for readdir_r.
7883
7884 Index: libjava/configure.ac
7885 ===================================================================
7886 --- libjava/configure.ac (revision 132490)
7887 +++ libjava/configure.ac (revision 132491)
7888 @@ -1023,7 +1023,7 @@
7889 PLATFORMNET=NoNet
7890 else
7891 AC_CHECK_FUNCS([strerror_r select fstat open fsync sleep opendir \
7892 - localtime_r readdir_r getpwuid_r getcwd \
7893 + localtime_r getpwuid_r getcwd \
7894 access stat lstat mkdir rename rmdir unlink utime chmod readlink \
7895 nl_langinfo setlocale \
7896 inet_pton uname inet_ntoa \
7897 Index: libjava/include/config.h.in
7898 ===================================================================
7899 --- libjava/include/config.h.in (revision 132490)
7900 +++ libjava/include/config.h.in (revision 132491)
7901 @@ -214,9 +214,6 @@
7902 /* Define to 1 if you have the <pwd.h> header file. */
7903 #undef HAVE_PWD_H
7904
7905 -/* Define to 1 if you have the `readdir_r' function. */
7906 -#undef HAVE_READDIR_R
7907 -
7908 /* Define to 1 if you have the `readlink' function. */
7909 #undef HAVE_READLINK
7910
7911 Index: libjava/java/io/natFilePosix.cc
7912 ===================================================================
7913 --- libjava/java/io/natFilePosix.cc (revision 132490)
7914 +++ libjava/java/io/natFilePosix.cc (revision 132491)
7915 @@ -1,6 +1,6 @@
7916 // natFile.cc - Native part of File class for POSIX.
7917
7918 -/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006
7919 +/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2008
7920 Free Software Foundation
7921
7922 This file is part of libgcj.
7923 @@ -292,13 +292,7 @@
7924
7925 java::util::ArrayList *list = new java::util::ArrayList ();
7926 struct dirent *d;
7927 -#if defined(HAVE_READDIR_R) && defined(_POSIX_PTHREAD_SEMANTICS)
7928 - int name_max = pathconf (buf, _PC_NAME_MAX);
7929 - char dbuf[sizeof (struct dirent) + name_max + 1];
7930 - while (readdir_r (dir, (struct dirent *) dbuf, &d) == 0 && d != NULL)
7931 -#else /* HAVE_READDIR_R */
7932 while ((d = readdir (dir)) != NULL)
7933 -#endif /* HAVE_READDIR_R */
7934 {
7935 // Omit "." and "..".
7936 if (d->d_name[0] == '.'
7937
7938
7939
7940 1.1 src/patchsets/gcc/4.3.6/gentoo/62_all_gcc4-noteGNUstack.patch
7941
7942 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/62_all_gcc4-noteGNUstack.patch?rev=1.1&view=markup
7943 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/62_all_gcc4-noteGNUstack.patch?rev=1.1&content-type=text/plain
7944
7945 Index: 62_all_gcc4-noteGNUstack.patch
7946 ===================================================================
7947 2005-02-08 Jakub Jelinek <jakub@××××××.com>
7948
7949 * src/alpha/osf.S: Add .note.GNU-stack on Linux.
7950 * src/s390/sysv.S: Likewise.
7951 * src/powerpc/linux64.S: Likewise.
7952 * src/powerpc/linux64_closure.S: Likewise.
7953 * src/powerpc/ppc_closure.S: Likewise.
7954 * src/powerpc/sysv.S: Likewise.
7955 * src/x86/unix64.S: Likewise.
7956 * src/x86/sysv.S: Likewise.
7957 * src/sparc/v8.S: Likewise.
7958 * src/sparc/v9.S: Likewise.
7959 * src/m68k/sysv.S: Likewise.
7960 * src/ia64/unix.S: Likewise.
7961 * src/arm/sysv.S: Likewise.
7962
7963 * ia64_save_regs_in_stack.s: Moved to...
7964 * ia64_save_regs_in_stack.S: ... this. Add .note.GNU-stack
7965 on Linux.
7966
7967 --- libffi/src/alpha/osf.S.jj 2003-10-23 09:55:21.000000000 +0200
7968 +++ libffi/src/alpha/osf.S 2005-02-08 16:12:40.215425842 +0100
7969 @@ -352,4 +352,8 @@ $LASFDE3:
7970 .byte 0x12 # uleb128 0x12
7971 .align 3
7972 $LEFDE3:
7973 +
7974 +#ifdef __linux__
7975 + .section .note.GNU-stack,"",@progbits
7976 +#endif
7977 #endif
7978 --- libffi/src/s390/sysv.S.jj 2003-10-23 09:55:21.000000000 +0200
7979 +++ libffi/src/s390/sysv.S 2005-02-08 16:22:30.810943388 +0100
7980 @@ -427,3 +427,6 @@ ffi_closure_SYSV:
7981
7982 #endif
7983
7984 +#if defined __ELF__ && defined __linux__
7985 + .section .note.GNU-stack,"",@progbits
7986 +#endif
7987 --- libffi/src/powerpc/linux64.S.jj 2004-09-03 12:35:54.000000000 +0200
7988 +++ libffi/src/powerpc/linux64.S 2005-02-08 16:18:41.998808639 +0100
7989 @@ -174,3 +174,7 @@ ffi_call_LINUX64:
7990 .align 3
7991 .LEFDE1:
7992 #endif
7993 +
7994 +#if defined __ELF__ && defined __linux__
7995 + .section .note.GNU-stack,"",@progbits
7996 +#endif
7997 --- libffi/src/powerpc/linux64_closure.S.jj 2004-09-03 12:35:54.000000000 +0200
7998 +++ libffi/src/powerpc/linux64_closure.S 2005-02-08 16:18:53.821697060 +0100
7999 @@ -203,3 +203,7 @@ ffi_closure_LINUX64:
8000 .align 3
8001 .LEFDE1:
8002 #endif
8003 +
8004 +#if defined __ELF__ && defined __linux__
8005 + .section .note.GNU-stack,"",@progbits
8006 +#endif
8007 --- libffi/src/powerpc/ppc_closure.S.jj 2004-09-03 12:35:54.000000000 +0200
8008 +++ libffi/src/powerpc/ppc_closure.S 2005-02-08 16:18:25.734713428 +0100
8009 @@ -248,3 +248,7 @@ END(ffi_closure_SYSV)
8010 .LEFDE1:
8011
8012 #endif
8013 +
8014 +#if defined __ELF__ && defined __linux__
8015 + .section .note.GNU-stack,"",@progbits
8016 +#endif
8017 --- libffi/src/powerpc/sysv.S.jj 2004-09-03 12:35:54.000000000 +0200
8018 +++ libffi/src/powerpc/sysv.S 2005-02-08 16:18:13.673867518 +0100
8019 @@ -187,3 +187,7 @@ END(ffi_call_SYSV)
8020 .align 2
8021 .LEFDE1:
8022 #endif
8023 +
8024 +#if defined __ELF__ && defined __linux__
8025 + .section .note.GNU-stack,"",@progbits
8026 +#endif
8027 --- libffi/src/x86/unix64.S.jj 2004-12-27 13:01:37.000000000 +0100
8028 +++ libffi/src/x86/unix64.S 2005-02-08 16:25:38.656395947 +0100
8029 @@ -373,3 +373,7 @@ ffi_closure_unix64:
8030 .LEFDE3:
8031
8032 #endif /* __x86_64__ */
8033 +
8034 +#if defined __ELF__ && defined __linux__
8035 + .section .note.GNU-stack,"",@progbits
8036 +#endif
8037 --- libffi/src/x86/sysv.S.jj 2003-10-23 09:55:21.000000000 +0200
8038 +++ libffi/src/x86/sysv.S 2005-02-08 16:25:28.197263821 +0100
8039 @@ -182,3 +182,7 @@ epilogue:
8040 .LEFDE1:
8041
8042 #endif /* ifndef __x86_64__ */
8043 +
8044 +#if defined __ELF__ && defined __linux__
8045 + .section .note.GNU-stack,"",@progbits
8046 +#endif
8047 --- libffi/src/sparc/v8.S.jj 2004-11-24 22:02:00.000000000 +0100
8048 +++ libffi/src/sparc/v8.S 2005-02-08 16:22:55.220583988 +0100
8049 @@ -265,3 +265,7 @@ done2:
8050 .byte 0x1f ! uleb128 0x1f
8051 .align WS
8052 .LLEFDE2:
8053 +
8054 +#if defined __ELF__ && defined __linux__
8055 + .section .note.GNU-stack,"",@progbits
8056 +#endif
8057 --- libffi/src/sparc/v9.S.jj 2004-01-26 11:34:57.000000000 +0100
8058 +++ libffi/src/sparc/v9.S 2005-02-08 16:25:12.153129117 +0100
8059 @@ -300,3 +300,7 @@ longdouble1:
8060 .align 8
8061 .LLEFDE2:
8062 #endif
8063 +
8064 +#ifdef __linux__
8065 + .section .note.GNU-stack,"",@progbits
8066 +#endif
8067 --- libffi/src/m68k/sysv.S.jj 2003-10-23 09:55:21.000000000 +0200
8068 +++ libffi/src/m68k/sysv.S 2005-02-08 16:16:18.341466343 +0100
8069 @@ -95,3 +95,7 @@ epilogue:
8070 rts
8071 CFI_ENDPROC()
8072 .size ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV
8073 +
8074 +#if defined __ELF__ && defined __linux__
8075 + .section .note.GNU-stack,"",@progbits
8076 +#endif
8077 --- libffi/src/ia64/unix.S.jj 2005-01-04 15:42:01.000000000 +0100
8078 +++ libffi/src/ia64/unix.S 2005-02-08 16:16:01.253518356 +0100
8079 @@ -572,3 +572,7 @@ ffi_closure_unix:
8080 data8 @pcrel(.Lld_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT
8081 data8 @pcrel(.Lld_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE
8082 data8 @pcrel(.Lld_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE
8083 +
8084 +#if defined __ELF__ && defined __linux__
8085 + .section .note.GNU-stack,"",@progbits
8086 +#endif
8087 --- libffi/src/arm/sysv.S.jj 2004-10-28 15:10:11.000000000 +0200
8088 +++ libffi/src/arm/sysv.S 2005-02-08 16:14:02.282767581 +0100
8089 @@ -207,3 +207,6 @@ LSYM(Lepilogue):
8090 UNWIND .fnend
8091 .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
8092
8093 +#if defined __ELF__ && defined __linux__
8094 + .section .note.GNU-stack,"",%progbits
8095 +#endif
8096 --- boehm-gc/ia64_save_regs_in_stack.S.jj 2005-02-08 16:32:57.368040486 +0100
8097 +++ boehm-gc/ia64_save_regs_in_stack.S 2005-02-08 16:33:36.243096641 +0100
8098 @@ -0,0 +1,15 @@
8099 + .text
8100 + .align 16
8101 + .global GC_save_regs_in_stack
8102 + .proc GC_save_regs_in_stack
8103 +GC_save_regs_in_stack:
8104 + .bodyfoo.mpg
8105 + flushrs
8106 + ;;
8107 + mov r8=ar.bsp
8108 + br.ret.sptk.few rp
8109 + .endp GC_save_regs_in_stack
8110 +
8111 +#ifdef __linux__
8112 + .section .note.GNU-stack,"",@progbits
8113 +#endif
8114 --- boehm-gc/ia64_save_regs_in_stack.s.jj 2004-06-30 09:32:52.000000000 +0200
8115 +++ boehm-gc/ia64_save_regs_in_stack.s 2005-02-08 16:32:51.555078799 +0100
8116 @@ -1,12 +0,0 @@
8117 - .text
8118 - .align 16
8119 - .global GC_save_regs_in_stack
8120 - .proc GC_save_regs_in_stack
8121 -GC_save_regs_in_stack:
8122 - .body
8123 - flushrs
8124 - ;;
8125 - mov r8=ar.bsp
8126 - br.ret.sptk.few rp
8127 - .endp GC_save_regs_in_stack
8128 -
8129
8130
8131
8132 1.1 src/patchsets/gcc/4.3.6/gentoo/66_all_gcc43-pr25343.patch
8133
8134 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/66_all_gcc43-pr25343.patch?rev=1.1&view=markup
8135 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/66_all_gcc43-pr25343.patch?rev=1.1&content-type=text/plain
8136
8137 Index: 66_all_gcc43-pr25343.patch
8138 ===================================================================
8139 http://gcc.gnu.org/PR25343
8140
8141 sniped from Debian
8142
8143 2008-04-27 Roman Zippel <zippel@××××××××××.org>
8144
8145 * config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __mc68000__.
8146
8147 Index: gcc/config/host-linux.c
8148 ===================================================================
8149 --- gcc/config/host-linux.c
8150 +++ gcc/config/host-linux.c
8151 @@ -85,6 +85,8 @@
8152 # define TRY_EMPTY_VM_SPACE 0x8000000000
8153 #elif defined(__sparc__)
8154 # define TRY_EMPTY_VM_SPACE 0x60000000
8155 +#elif defined(__mc68000__)
8156 +# define TRY_EMPTY_VM_SPACE 0x40000000
8157 #else
8158 # define TRY_EMPTY_VM_SPACE 0
8159 #endif
8160
8161
8162
8163
8164 1.1 src/patchsets/gcc/4.3.6/gentoo/68_all_gcc43-pr37661.patch
8165
8166 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/68_all_gcc43-pr37661.patch?rev=1.1&view=markup
8167 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/68_all_gcc43-pr37661.patch?rev=1.1&content-type=text/plain
8168
8169 Index: 68_all_gcc43-pr37661.patch
8170 ===================================================================
8171 http://gcc.gnu.org/PR37661
8172 http://gcc.gnu.org/ml/gcc-patches/2008-08/msg00910.html
8173 Fix SPARC64 int-to-TFmode conversions
8174
8175 2008-08-13 Joseph Myers <joseph@××××××××××××.com>
8176
8177 * config/sparc/sparc.c (emit_soft_tfmode_cvt): Explicitly sign or
8178 zero extend SImode values being converted to TFmode before passing
8179 to libcalls.
8180
8181 Index: gcc/config/sparc/sparc.c
8182 ===================================================================
8183 --- gcc/config/sparc/sparc.c (revision 139036)
8184 +++ gcc/config/sparc/sparc.c (working copy)
8185 @@ -2371,6 +2371,8 @@
8186 {
8187 case SImode:
8188 func = "_Qp_itoq";
8189 + if (TARGET_ARCH64)
8190 + operands[1] = gen_rtx_SIGN_EXTEND (DImode, operands[1]);
8191 break;
8192 case DImode:
8193 func = "_Qp_xtoq";
8194 @@ -2385,6 +2387,8 @@
8195 {
8196 case SImode:
8197 func = "_Qp_uitoq";
8198 + if (TARGET_ARCH64)
8199 + operands[1] = gen_rtx_ZERO_EXTEND (DImode, operands[1]);
8200 break;
8201 case DImode:
8202 func = "_Qp_uxtoq";
8203
8204
8205
8206
8207 1.1 src/patchsets/gcc/4.3.6/gentoo/70_all_gcc43-libjava-headers.patch
8208
8209 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/70_all_gcc43-libjava-headers.patch?rev=1.1&view=markup
8210 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/70_all_gcc43-libjava-headers.patch?rev=1.1&content-type=text/plain
8211
8212 Index: 70_all_gcc43-libjava-headers.patch
8213 ===================================================================
8214 fix from upstream for warnings:
8215 gcc-4.3.2/libjava/classpath/native/fdlibm/dtoa.c:913: warning: incompatible implicit declaration of built-in function 'free'
8216 gcc-4.3.2/libjava/classpath/native/fdlibm/dtoa.c:918: warning: incompatible implicit declaration of built-in function 'free'
8217
8218 2008-06-18 Ralf Wildenhues <Ralf.Wildenhues@×××.de>
8219
8220 * native/fdlibm/dtoa.c: include stdlib.h, for 'free'.
8221
8222 Index: libjava/classpath/native/fdlibm/dtoa.c
8223 ===================================================================
8224 --- libjava/classpath/native/fdlibm/dtoa.c (revision 136907)
8225 +++ libjava/classpath/native/fdlibm/dtoa.c (revision 136908)
8226 @@ -28,6 +28,7 @@
8227
8228 #include "mprec.h"
8229 #include <string.h>
8230 +#include <stdlib.h>
8231
8232 static int
8233 _DEFUN (quorem,
8234
8235
8236
8237 1.1 src/patchsets/gcc/4.3.6/gentoo/73_all_sh-libgcc-stacks.patch
8238
8239 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/73_all_sh-libgcc-stacks.patch?rev=1.1&view=markup
8240 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/73_all_sh-libgcc-stacks.patch?rev=1.1&content-type=text/plain
8241
8242 Index: 73_all_sh-libgcc-stacks.patch
8243 ===================================================================
8244 http://gcc.gnu.org/PR38627
8245
8246 make sure objects in libgcc.a have GNU-stack markings:
8247 !WX --- --- 4.3.2/_ashiftrt.o
8248 !WX --- --- 4.3.2/_ashiftrt_n.o
8249 !WX --- --- 4.3.2/_ashiftlt.o
8250 !WX --- --- 4.3.2/_lshiftrt.o
8251 !WX --- --- 4.3.2/_movmem.o
8252 !WX --- --- 4.3.2/_movmem_i4.o
8253 !WX --- --- 4.3.2/_mulsi3.o
8254 !WX --- --- 4.3.2/_sdivsi3.o
8255 !WX --- --- 4.3.2/_sdivsi3_i4.o
8256 !WX --- --- 4.3.2/_udivsi3.o
8257 !WX --- --- 4.3.2/_udivsi3_i4.o
8258 !WX --- --- 4.3.2/_set_fpscr.o
8259 !WX --- --- 4.3.2/_div_table.o
8260 !WX --- --- 4.3.2/_udiv_qrnnd_16.o
8261 !WX --- --- 4.3.2/_ic_invalidate.o
8262 !WX --- --- 4.3.2/_ic_invalidate_array.o
8263 !WX --- --- 4.3.2/linux-atomic.o
8264
8265 --- gcc/config/sh/lib1funcs.asm
8266 +++ gcc/config/sh/lib1funcs.asm
8267 @@ -34,6 +34,11 @@
8268 !! recoded in assembly by Toshiyasu Morita
8269 !! tm@××××××.com
8270
8271 +#if defined(__ELF__) && defined(__linux__)
8272 +.section .note.GNU-stack,"",%progbits
8273 +.previous
8274 +#endif
8275 +
8276 /* SH2 optimizations for ___ashrsi3, ___ashlsi3, ___lshrsi3 and
8277 ELF local label prefixes by J"orn Rennecke
8278 amylaar@××××××.com */
8279 --- gcc/config/sh/linux-atomic.asm
8280 +++ gcc/config/sh/linux-atomic.asm
8281 @@ -138,3 +138,6 @@
8282 ATOMIC_FETCH_AND_COMBOP(nand,and,not,4,l,mov)
8283
8284 #endif /* ! __SH5__ */
8285 +
8286 +.section .note.GNU-stack,"",%progbits
8287 +.previous
8288
8289
8290
8291 1.1 src/patchsets/gcc/4.3.6/gentoo/74_all_sh-pr24836.patch
8292
8293 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/74_all_sh-pr24836.patch?rev=1.1&view=markup
8294 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/74_all_sh-pr24836.patch?rev=1.1&content-type=text/plain
8295
8296 Index: 74_all_sh-pr24836.patch
8297 ===================================================================
8298 http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
8299 http://gcc.gnu.org/PR24836
8300
8301 --- gcc/gcc/configure.ac
8302 +++ gcc/gcc/configure.ac
8303 @@ -2446,7 +2446,7 @@
8304 tls_first_minor=14
8305 tls_as_opt="-m64 -Aesame --fatal-warnings"
8306 ;;
8307 - sh-*-* | sh[34]-*-*)
8308 + sh-*-* | sh[34]*-*-*)
8309 conftest_s='
8310 .section ".tdata","awT",@progbits
8311 foo: .long 25
8312 --- gcc/gcc/configure
8313 +++ gcc/gcc/configure
8314 @@ -14846,7 +14846,7 @@
8315 tls_first_minor=14
8316 tls_as_opt="-m64 -Aesame --fatal-warnings"
8317 ;;
8318 - sh-*-* | sh[34]-*-*)
8319 + sh-*-* | sh[34]*-*-*)
8320 conftest_s='
8321 .section ".tdata","awT",@progbits
8322 foo: .long 25
8323
8324
8325
8326 1.1 src/patchsets/gcc/4.3.6/gentoo/75_all_mips-r10k-cache-barriers.patch
8327
8328 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/75_all_mips-r10k-cache-barriers.patch?rev=1.1&view=markup
8329 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/75_all_mips-r10k-cache-barriers.patch?rev=1.1&content-type=text/plain
8330
8331 Index: 75_all_mips-r10k-cache-barriers.patch
8332 ===================================================================
8333 backport from gcc-4.4
8334
8335 http://bugs.gentoo.org/233231
8336
8337 --- gcc-4.3.2/gcc/config/mips/mips-ftypes.def
8338 +++ gcc-4.3.2/gcc/config/mips/mips-ftypes.def
8339 @@ -87,6 +87,7 @@ DEF_MIPS_FTYPE (1, (V4QI, V4QI))
8340 DEF_MIPS_FTYPE (2, (V4QI, V4QI, SI))
8341 DEF_MIPS_FTYPE (2, (V4QI, V4QI, V4QI))
8342
8343 +DEF_MIPS_FTYPE (2, (VOID, SI, CVPOINTER))
8344 DEF_MIPS_FTYPE (2, (VOID, SI, SI))
8345 DEF_MIPS_FTYPE (2, (VOID, V2HI, V2HI))
8346 DEF_MIPS_FTYPE (2, (VOID, V4QI, V4QI))
8347 --- gcc-4.3.2/gcc/config/mips/mips.c
8348 +++ gcc-4.3.2/gcc/config/mips/mips.c
8349 @@ -147,6 +147,13 @@ enum mips_address_type {
8350 ADDRESS_SYMBOLIC
8351 };
8352
8353 +/* Enumerates the setting of the -mr10k-cache-barrier option. */
8354 +enum mips_r10k_cache_barrier_setting {
8355 + R10K_CACHE_BARRIER_NONE,
8356 + R10K_CACHE_BARRIER_STORE,
8357 + R10K_CACHE_BARRIER_LOAD_STORE
8358 +};
8359 +
8360 /* Macros to create an enumeration identifier for a function prototype. */
8361 #define MIPS_FTYPE_NAME1(A, B) MIPS_##A##_FTYPE_##B
8362 #define MIPS_FTYPE_NAME2(A, B, C) MIPS_##A##_FTYPE_##B##_##C
8363 @@ -455,6 +462,9 @@ static int mips_base_align_functions; /*
8364 /* The -mcode-readable setting. */
8365 enum mips_code_readable_setting mips_code_readable = CODE_READABLE_YES;
8366
8367 +/* The -mr10k-cache-barrier setting. */
8368 +static enum mips_r10k_cache_barrier_setting mips_r10k_cache_barrier;
8369 +
8370 /* Index [M][R] is true if register R is allowed to hold a value of mode M. */
8371 bool mips_hard_regno_mode_ok[(int) MAX_MACHINE_MODE][FIRST_PSEUDO_REGISTER];
8372
8373 @@ -9899,6 +9909,23 @@ mips_prefetch_cookie (rtx write, rtx loc
8374 return GEN_INT (INTVAL (write) + 6);
8375 }
8376
8377 +/* Flags that indicate when a built-in function is available.
8378 +
8379 + BUILTIN_AVAIL_NON_MIPS16
8380 + The function is available on the current target, but only
8381 + in non-MIPS16 mode. */
8382 +#define BUILTIN_AVAIL_NON_MIPS16 1
8383 +
8384 +/* Declare an availability predicate for built-in functions that
8385 + require non-MIPS16 mode and also require COND to be true.
8386 + NAME is the main part of the predicate's name. */
8387 +#define AVAIL_NON_MIPS16(NAME, COND) \
8388 +static unsigned int \
8389 +mips_builtin_avail_##NAME (void) \
8390 +{ \
8391 + return (COND) ? BUILTIN_AVAIL_NON_MIPS16 : 0; \
8392 +}
8393 +
8394 /* This structure describes a single built-in function. */
8395 struct mips_builtin_description {
8396 /* The code of the main .md file instruction. See mips_builtin_type
8397 @@ -9917,309 +9944,301 @@ struct mips_builtin_description {
8398 /* The function's prototype. */
8399 enum mips_function_type function_type;
8400
8401 - /* The target flags required for this function. */
8402 - int target_flags;
8403 + /* Whether the function is available. */
8404 + unsigned int (*avail) (void);
8405 };
8406
8407 -/* Define a MIPS_BUILTIN_DIRECT function for instruction CODE_FOR_mips_<INSN>.
8408 - FUNCTION_TYPE and TARGET_FLAGS are mips_builtin_description fields. */
8409 -#define DIRECT_BUILTIN(INSN, FUNCTION_TYPE, TARGET_FLAGS) \
8410 - { CODE_FOR_mips_ ## INSN, 0, "__builtin_mips_" #INSN, \
8411 - MIPS_BUILTIN_DIRECT, FUNCTION_TYPE, TARGET_FLAGS }
8412 +AVAIL_NON_MIPS16 (paired_single, TARGET_PAIRED_SINGLE_FLOAT)
8413 +AVAIL_NON_MIPS16 (sb1_paired_single, TARGET_SB1 && TARGET_PAIRED_SINGLE_FLOAT)
8414 +AVAIL_NON_MIPS16 (mips3d, TARGET_MIPS3D)
8415 +AVAIL_NON_MIPS16 (dsp, TARGET_DSP)
8416 +AVAIL_NON_MIPS16 (dspr2, TARGET_DSPR2)
8417 +AVAIL_NON_MIPS16 (dsp_32, !TARGET_64BIT && TARGET_DSP)
8418 +AVAIL_NON_MIPS16 (dspr2_32, !TARGET_64BIT && TARGET_DSPR2)
8419 +AVAIL_NON_MIPS16 (cache, TARGET_CACHE_BUILTIN)
8420 +
8421 +/* Construct a mips_builtin_description from the given arguments.
8422 +
8423 + INSN is the name of the associated instruction pattern, without the
8424 + leading CODE_FOR_mips_.
8425 +
8426 + CODE is the floating-point condition code associated with the
8427 + function. It can be 'f' if the field is not applicable.
8428 +
8429 + NAME is the name of the function itself, without the leading
8430 + "__builtin_mips_".
8431 +
8432 + BUILTIN_TYPE and FUNCTION_TYPE are mips_builtin_description fields.
8433 +
8434 + AVAIL is the name of the availability predicate, without the leading
8435 + mips_builtin_avail_. */
8436 +#define MIPS_BUILTIN(INSN, COND, NAME, BUILTIN_TYPE, \
8437 + FUNCTION_TYPE, AVAIL) \
8438 + { CODE_FOR_mips_ ## INSN, MIPS_FP_COND_ ## COND, \
8439 + "__builtin_mips_" NAME, BUILTIN_TYPE, FUNCTION_TYPE, \
8440 + mips_builtin_avail_ ## AVAIL }
8441 +
8442 +/* Define __builtin_mips_<INSN>, which is a MIPS_BUILTIN_DIRECT function
8443 + mapped to instruction CODE_FOR_mips_<INSN>, FUNCTION_TYPE and AVAIL
8444 + are as for MIPS_BUILTIN. */
8445 +#define DIRECT_BUILTIN(INSN, FUNCTION_TYPE, AVAIL) \
8446 + MIPS_BUILTIN (INSN, f, #INSN, MIPS_BUILTIN_DIRECT, FUNCTION_TYPE, AVAIL)
8447
8448 /* Define __builtin_mips_<INSN>_<COND>_{s,d} functions, both of which
8449 - require TARGET_FLAGS. */
8450 -#define CMP_SCALAR_BUILTINS(INSN, COND, TARGET_FLAGS) \
8451 - { CODE_FOR_mips_ ## INSN ## _cond_s, MIPS_FP_COND_ ## COND, \
8452 - "__builtin_mips_" #INSN "_" #COND "_s", \
8453 - MIPS_BUILTIN_CMP_SINGLE, MIPS_INT_FTYPE_SF_SF, TARGET_FLAGS }, \
8454 - { CODE_FOR_mips_ ## INSN ## _cond_d, MIPS_FP_COND_ ## COND, \
8455 - "__builtin_mips_" #INSN "_" #COND "_d", \
8456 - MIPS_BUILTIN_CMP_SINGLE, MIPS_INT_FTYPE_DF_DF, TARGET_FLAGS }
8457 + are subject to mips_builtin_avail_<AVAIL>. */
8458 +#define CMP_SCALAR_BUILTINS(INSN, COND, AVAIL) \
8459 + MIPS_BUILTIN (INSN ## _cond_s, COND, #INSN "_" #COND "_s", \
8460 + MIPS_BUILTIN_CMP_SINGLE, MIPS_INT_FTYPE_SF_SF, AVAIL), \
8461 + MIPS_BUILTIN (INSN ## _cond_d, COND, #INSN "_" #COND "_d", \
8462 + MIPS_BUILTIN_CMP_SINGLE, MIPS_INT_FTYPE_DF_DF, AVAIL)
8463
8464 /* Define __builtin_mips_{any,all,upper,lower}_<INSN>_<COND>_ps.
8465 - The lower and upper forms require TARGET_FLAGS while the any and all
8466 - forms require MASK_MIPS3D. */
8467 -#define CMP_PS_BUILTINS(INSN, COND, TARGET_FLAGS) \
8468 - { CODE_FOR_mips_ ## INSN ## _cond_ps, MIPS_FP_COND_ ## COND, \
8469 - "__builtin_mips_any_" #INSN "_" #COND "_ps", \
8470 - MIPS_BUILTIN_CMP_ANY, MIPS_INT_FTYPE_V2SF_V2SF, MASK_MIPS3D }, \
8471 - { CODE_FOR_mips_ ## INSN ## _cond_ps, MIPS_FP_COND_ ## COND, \
8472 - "__builtin_mips_all_" #INSN "_" #COND "_ps", \
8473 - MIPS_BUILTIN_CMP_ALL, MIPS_INT_FTYPE_V2SF_V2SF, MASK_MIPS3D }, \
8474 - { CODE_FOR_mips_ ## INSN ## _cond_ps, MIPS_FP_COND_ ## COND, \
8475 - "__builtin_mips_lower_" #INSN "_" #COND "_ps", \
8476 - MIPS_BUILTIN_CMP_LOWER, MIPS_INT_FTYPE_V2SF_V2SF, TARGET_FLAGS }, \
8477 - { CODE_FOR_mips_ ## INSN ## _cond_ps, MIPS_FP_COND_ ## COND, \
8478 - "__builtin_mips_upper_" #INSN "_" #COND "_ps", \
8479 - MIPS_BUILTIN_CMP_UPPER, MIPS_INT_FTYPE_V2SF_V2SF, TARGET_FLAGS }
8480 + The lower and upper forms are subject to mips_builtin_avail_<AVAIL>
8481 + while the any and all forms are subject to mips_builtin_avail_mips3d. */
8482 +#define CMP_PS_BUILTINS(INSN, COND, AVAIL) \
8483 + MIPS_BUILTIN (INSN ## _cond_ps, COND, "any_" #INSN "_" #COND "_ps", \
8484 + MIPS_BUILTIN_CMP_ANY, MIPS_INT_FTYPE_V2SF_V2SF, \
8485 + mips3d), \
8486 + MIPS_BUILTIN (INSN ## _cond_ps, COND, "all_" #INSN "_" #COND "_ps", \
8487 + MIPS_BUILTIN_CMP_ALL, MIPS_INT_FTYPE_V2SF_V2SF, \
8488 + mips3d), \
8489 + MIPS_BUILTIN (INSN ## _cond_ps, COND, "lower_" #INSN "_" #COND "_ps", \
8490 + MIPS_BUILTIN_CMP_LOWER, MIPS_INT_FTYPE_V2SF_V2SF, \
8491 + AVAIL), \
8492 + MIPS_BUILTIN (INSN ## _cond_ps, COND, "upper_" #INSN "_" #COND "_ps", \
8493 + MIPS_BUILTIN_CMP_UPPER, MIPS_INT_FTYPE_V2SF_V2SF, \
8494 + AVAIL)
8495
8496 /* Define __builtin_mips_{any,all}_<INSN>_<COND>_4s. The functions
8497 - require MASK_MIPS3D. */
8498 + are subject to mips_builtin_avail_mips3d. */
8499 #define CMP_4S_BUILTINS(INSN, COND) \
8500 - { CODE_FOR_mips_ ## INSN ## _cond_4s, MIPS_FP_COND_ ## COND, \
8501 - "__builtin_mips_any_" #INSN "_" #COND "_4s", \
8502 - MIPS_BUILTIN_CMP_ANY, MIPS_INT_FTYPE_V2SF_V2SF_V2SF_V2SF, \
8503 - MASK_MIPS3D }, \
8504 - { CODE_FOR_mips_ ## INSN ## _cond_4s, MIPS_FP_COND_ ## COND, \
8505 - "__builtin_mips_all_" #INSN "_" #COND "_4s", \
8506 - MIPS_BUILTIN_CMP_ALL, MIPS_INT_FTYPE_V2SF_V2SF_V2SF_V2SF, \
8507 - MASK_MIPS3D }
8508 + MIPS_BUILTIN (INSN ## _cond_4s, COND, "any_" #INSN "_" #COND "_4s", \
8509 + MIPS_BUILTIN_CMP_ANY, \
8510 + MIPS_INT_FTYPE_V2SF_V2SF_V2SF_V2SF, mips3d), \
8511 + MIPS_BUILTIN (INSN ## _cond_4s, COND, "all_" #INSN "_" #COND "_4s", \
8512 + MIPS_BUILTIN_CMP_ALL, \
8513 + MIPS_INT_FTYPE_V2SF_V2SF_V2SF_V2SF, mips3d)
8514
8515 /* Define __builtin_mips_mov{t,f}_<INSN>_<COND>_ps. The comparison
8516 - instruction requires TARGET_FLAGS. */
8517 -#define MOVTF_BUILTINS(INSN, COND, TARGET_FLAGS) \
8518 - { CODE_FOR_mips_ ## INSN ## _cond_ps, MIPS_FP_COND_ ## COND, \
8519 - "__builtin_mips_movt_" #INSN "_" #COND "_ps", \
8520 - MIPS_BUILTIN_MOVT, MIPS_V2SF_FTYPE_V2SF_V2SF_V2SF_V2SF, \
8521 - TARGET_FLAGS }, \
8522 - { CODE_FOR_mips_ ## INSN ## _cond_ps, MIPS_FP_COND_ ## COND, \
8523 - "__builtin_mips_movf_" #INSN "_" #COND "_ps", \
8524 - MIPS_BUILTIN_MOVF, MIPS_V2SF_FTYPE_V2SF_V2SF_V2SF_V2SF, \
8525 - TARGET_FLAGS }
8526 + instruction requires mips_builtin_avail_<AVAIL>. */
8527 +#define MOVTF_BUILTINS(INSN, COND, AVAIL) \
8528 + MIPS_BUILTIN (INSN ## _cond_ps, COND, "movt_" #INSN "_" #COND "_ps", \
8529 + MIPS_BUILTIN_MOVT, MIPS_V2SF_FTYPE_V2SF_V2SF_V2SF_V2SF, \
8530 + AVAIL), \
8531 + MIPS_BUILTIN (INSN ## _cond_ps, COND, "movf_" #INSN "_" #COND "_ps", \
8532 + MIPS_BUILTIN_MOVF, MIPS_V2SF_FTYPE_V2SF_V2SF_V2SF_V2SF, \
8533 + AVAIL)
8534
8535 /* Define all the built-in functions related to C.cond.fmt condition COND. */
8536 #define CMP_BUILTINS(COND) \
8537 - MOVTF_BUILTINS (c, COND, MASK_PAIRED_SINGLE_FLOAT), \
8538 - MOVTF_BUILTINS (cabs, COND, MASK_MIPS3D), \
8539 - CMP_SCALAR_BUILTINS (cabs, COND, MASK_MIPS3D), \
8540 - CMP_PS_BUILTINS (c, COND, MASK_PAIRED_SINGLE_FLOAT), \
8541 - CMP_PS_BUILTINS (cabs, COND, MASK_MIPS3D), \
8542 + MOVTF_BUILTINS (c, COND, paired_single), \
8543 + MOVTF_BUILTINS (cabs, COND, mips3d), \
8544 + CMP_SCALAR_BUILTINS (cabs, COND, mips3d), \
8545 + CMP_PS_BUILTINS (c, COND, paired_single), \
8546 + CMP_PS_BUILTINS (cabs, COND, mips3d), \
8547 CMP_4S_BUILTINS (c, COND), \
8548 CMP_4S_BUILTINS (cabs, COND)
8549
8550 -static const struct mips_builtin_description mips_ps_bdesc[] = {
8551 - DIRECT_BUILTIN (pll_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, MASK_PAIRED_SINGLE_FLOAT),
8552 - DIRECT_BUILTIN (pul_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, MASK_PAIRED_SINGLE_FLOAT),
8553 - DIRECT_BUILTIN (plu_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, MASK_PAIRED_SINGLE_FLOAT),
8554 - DIRECT_BUILTIN (puu_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, MASK_PAIRED_SINGLE_FLOAT),
8555 - DIRECT_BUILTIN (cvt_ps_s, MIPS_V2SF_FTYPE_SF_SF, MASK_PAIRED_SINGLE_FLOAT),
8556 - DIRECT_BUILTIN (cvt_s_pl, MIPS_SF_FTYPE_V2SF, MASK_PAIRED_SINGLE_FLOAT),
8557 - DIRECT_BUILTIN (cvt_s_pu, MIPS_SF_FTYPE_V2SF, MASK_PAIRED_SINGLE_FLOAT),
8558 - DIRECT_BUILTIN (abs_ps, MIPS_V2SF_FTYPE_V2SF, MASK_PAIRED_SINGLE_FLOAT),
8559 -
8560 - DIRECT_BUILTIN (alnv_ps, MIPS_V2SF_FTYPE_V2SF_V2SF_INT,
8561 - MASK_PAIRED_SINGLE_FLOAT),
8562 - DIRECT_BUILTIN (addr_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, MASK_MIPS3D),
8563 - DIRECT_BUILTIN (mulr_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, MASK_MIPS3D),
8564 - DIRECT_BUILTIN (cvt_pw_ps, MIPS_V2SF_FTYPE_V2SF, MASK_MIPS3D),
8565 - DIRECT_BUILTIN (cvt_ps_pw, MIPS_V2SF_FTYPE_V2SF, MASK_MIPS3D),
8566 -
8567 - DIRECT_BUILTIN (recip1_s, MIPS_SF_FTYPE_SF, MASK_MIPS3D),
8568 - DIRECT_BUILTIN (recip1_d, MIPS_DF_FTYPE_DF, MASK_MIPS3D),
8569 - DIRECT_BUILTIN (recip1_ps, MIPS_V2SF_FTYPE_V2SF, MASK_MIPS3D),
8570 - DIRECT_BUILTIN (recip2_s, MIPS_SF_FTYPE_SF_SF, MASK_MIPS3D),
8571 - DIRECT_BUILTIN (recip2_d, MIPS_DF_FTYPE_DF_DF, MASK_MIPS3D),
8572 - DIRECT_BUILTIN (recip2_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, MASK_MIPS3D),
8573 -
8574 - DIRECT_BUILTIN (rsqrt1_s, MIPS_SF_FTYPE_SF, MASK_MIPS3D),
8575 - DIRECT_BUILTIN (rsqrt1_d, MIPS_DF_FTYPE_DF, MASK_MIPS3D),
8576 - DIRECT_BUILTIN (rsqrt1_ps, MIPS_V2SF_FTYPE_V2SF, MASK_MIPS3D),
8577 - DIRECT_BUILTIN (rsqrt2_s, MIPS_SF_FTYPE_SF_SF, MASK_MIPS3D),
8578 - DIRECT_BUILTIN (rsqrt2_d, MIPS_DF_FTYPE_DF_DF, MASK_MIPS3D),
8579 - DIRECT_BUILTIN (rsqrt2_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, MASK_MIPS3D),
8580 +/* Define __builtin_mips_<INSN>, which is a MIPS_BUILTIN_DIRECT_NO_TARGET
8581 + function mapped to instruction CODE_FOR_mips_<INSN>, FUNCTION_TYPE
8582 + and AVAIL are as for MIPS_BUILTIN. */
8583 +#define DIRECT_NO_TARGET_BUILTIN(INSN, FUNCTION_TYPE, AVAIL) \
8584 + MIPS_BUILTIN (INSN, f, #INSN, MIPS_BUILTIN_DIRECT_NO_TARGET, \
8585 + FUNCTION_TYPE, AVAIL)
8586
8587 - MIPS_FP_CONDITIONS (CMP_BUILTINS)
8588 -};
8589 -
8590 -/* Built-in functions for the SB-1 processor. */
8591 +/* Define __builtin_mips_bposge<VALUE>. <VALUE> is 32 for the MIPS32 DSP
8592 + branch instruction. AVAIL is as for MIPS_BUILTIN. */
8593 +#define BPOSGE_BUILTIN(VALUE, AVAIL) \
8594 + MIPS_BUILTIN (bposge, f, "bposge" #VALUE, \
8595 + MIPS_BUILTIN_BPOSGE ## VALUE, MIPS_SI_FTYPE_VOID, AVAIL)
8596
8597 #define CODE_FOR_mips_sqrt_ps CODE_FOR_sqrtv2sf2
8598 -
8599 -static const struct mips_builtin_description mips_sb1_bdesc[] = {
8600 - DIRECT_BUILTIN (sqrt_ps, MIPS_V2SF_FTYPE_V2SF, MASK_PAIRED_SINGLE_FLOAT)
8601 -};
8602 -
8603 -/* Built-in functions for the DSP ASE. */
8604 -
8605 #define CODE_FOR_mips_addq_ph CODE_FOR_addv2hi3
8606 #define CODE_FOR_mips_addu_qb CODE_FOR_addv4qi3
8607 #define CODE_FOR_mips_subq_ph CODE_FOR_subv2hi3
8608 #define CODE_FOR_mips_subu_qb CODE_FOR_subv4qi3
8609 #define CODE_FOR_mips_mul_ph CODE_FOR_mulv2hi3
8610
8611 -/* Define a MIPS_BUILTIN_DIRECT_NO_TARGET function for instruction
8612 - CODE_FOR_mips_<INSN>. FUNCTION_TYPE and TARGET_FLAGS are
8613 - mips_builtin_description fields. */
8614 -#define DIRECT_NO_TARGET_BUILTIN(INSN, FUNCTION_TYPE, TARGET_FLAGS) \
8615 - { CODE_FOR_mips_ ## INSN, 0, "__builtin_mips_" #INSN, \
8616 - MIPS_BUILTIN_DIRECT_NO_TARGET, FUNCTION_TYPE, TARGET_FLAGS }
8617 +static const struct mips_builtin_description mips_builtins[] = {
8618 + DIRECT_BUILTIN (pll_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, paired_single),
8619 + DIRECT_BUILTIN (pul_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, paired_single),
8620 + DIRECT_BUILTIN (plu_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, paired_single),
8621 + DIRECT_BUILTIN (puu_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, paired_single),
8622 + DIRECT_BUILTIN (cvt_ps_s, MIPS_V2SF_FTYPE_SF_SF, paired_single),
8623 + DIRECT_BUILTIN (cvt_s_pl, MIPS_SF_FTYPE_V2SF, paired_single),
8624 + DIRECT_BUILTIN (cvt_s_pu, MIPS_SF_FTYPE_V2SF, paired_single),
8625 + DIRECT_BUILTIN (abs_ps, MIPS_V2SF_FTYPE_V2SF, paired_single),
8626 +
8627 + DIRECT_BUILTIN (alnv_ps, MIPS_V2SF_FTYPE_V2SF_V2SF_INT, paired_single),
8628 + DIRECT_BUILTIN (addr_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, mips3d),
8629 + DIRECT_BUILTIN (mulr_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, mips3d),
8630 + DIRECT_BUILTIN (cvt_pw_ps, MIPS_V2SF_FTYPE_V2SF, mips3d),
8631 + DIRECT_BUILTIN (cvt_ps_pw, MIPS_V2SF_FTYPE_V2SF, mips3d),
8632 +
8633 + DIRECT_BUILTIN (recip1_s, MIPS_SF_FTYPE_SF, mips3d),
8634 + DIRECT_BUILTIN (recip1_d, MIPS_DF_FTYPE_DF, mips3d),
8635 + DIRECT_BUILTIN (recip1_ps, MIPS_V2SF_FTYPE_V2SF, mips3d),
8636 + DIRECT_BUILTIN (recip2_s, MIPS_SF_FTYPE_SF_SF, mips3d),
8637 + DIRECT_BUILTIN (recip2_d, MIPS_DF_FTYPE_DF_DF, mips3d),
8638 + DIRECT_BUILTIN (recip2_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, mips3d),
8639 +
8640 + DIRECT_BUILTIN (rsqrt1_s, MIPS_SF_FTYPE_SF, mips3d),
8641 + DIRECT_BUILTIN (rsqrt1_d, MIPS_DF_FTYPE_DF, mips3d),
8642 + DIRECT_BUILTIN (rsqrt1_ps, MIPS_V2SF_FTYPE_V2SF, mips3d),
8643 + DIRECT_BUILTIN (rsqrt2_s, MIPS_SF_FTYPE_SF_SF, mips3d),
8644 + DIRECT_BUILTIN (rsqrt2_d, MIPS_DF_FTYPE_DF_DF, mips3d),
8645 + DIRECT_BUILTIN (rsqrt2_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, mips3d),
8646 +
8647 + MIPS_FP_CONDITIONS (CMP_BUILTINS),
8648 +
8649 + /* Built-in functions for the SB-1 processor. */
8650 + DIRECT_BUILTIN (sqrt_ps, MIPS_V2SF_FTYPE_V2SF, sb1_paired_single),
8651 +
8652 + /* Built-in functions for the DSP ASE (32-bit and 64-bit). */
8653 + DIRECT_BUILTIN (addq_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dsp),
8654 + DIRECT_BUILTIN (addq_s_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dsp),
8655 + DIRECT_BUILTIN (addq_s_w, MIPS_SI_FTYPE_SI_SI, dsp),
8656 + DIRECT_BUILTIN (addu_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, dsp),
8657 + DIRECT_BUILTIN (addu_s_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, dsp),
8658 + DIRECT_BUILTIN (subq_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dsp),
8659 + DIRECT_BUILTIN (subq_s_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dsp),
8660 + DIRECT_BUILTIN (subq_s_w, MIPS_SI_FTYPE_SI_SI, dsp),
8661 + DIRECT_BUILTIN (subu_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, dsp),
8662 + DIRECT_BUILTIN (subu_s_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, dsp),
8663 + DIRECT_BUILTIN (addsc, MIPS_SI_FTYPE_SI_SI, dsp),
8664 + DIRECT_BUILTIN (addwc, MIPS_SI_FTYPE_SI_SI, dsp),
8665 + DIRECT_BUILTIN (modsub, MIPS_SI_FTYPE_SI_SI, dsp),
8666 + DIRECT_BUILTIN (raddu_w_qb, MIPS_SI_FTYPE_V4QI, dsp),
8667 + DIRECT_BUILTIN (absq_s_ph, MIPS_V2HI_FTYPE_V2HI, dsp),
8668 + DIRECT_BUILTIN (absq_s_w, MIPS_SI_FTYPE_SI, dsp),
8669 + DIRECT_BUILTIN (precrq_qb_ph, MIPS_V4QI_FTYPE_V2HI_V2HI, dsp),
8670 + DIRECT_BUILTIN (precrq_ph_w, MIPS_V2HI_FTYPE_SI_SI, dsp),
8671 + DIRECT_BUILTIN (precrq_rs_ph_w, MIPS_V2HI_FTYPE_SI_SI, dsp),
8672 + DIRECT_BUILTIN (precrqu_s_qb_ph, MIPS_V4QI_FTYPE_V2HI_V2HI, dsp),
8673 + DIRECT_BUILTIN (preceq_w_phl, MIPS_SI_FTYPE_V2HI, dsp),
8674 + DIRECT_BUILTIN (preceq_w_phr, MIPS_SI_FTYPE_V2HI, dsp),
8675 + DIRECT_BUILTIN (precequ_ph_qbl, MIPS_V2HI_FTYPE_V4QI, dsp),
8676 + DIRECT_BUILTIN (precequ_ph_qbr, MIPS_V2HI_FTYPE_V4QI, dsp),
8677 + DIRECT_BUILTIN (precequ_ph_qbla, MIPS_V2HI_FTYPE_V4QI, dsp),
8678 + DIRECT_BUILTIN (precequ_ph_qbra, MIPS_V2HI_FTYPE_V4QI, dsp),
8679 + DIRECT_BUILTIN (preceu_ph_qbl, MIPS_V2HI_FTYPE_V4QI, dsp),
8680 + DIRECT_BUILTIN (preceu_ph_qbr, MIPS_V2HI_FTYPE_V4QI, dsp),
8681 + DIRECT_BUILTIN (preceu_ph_qbla, MIPS_V2HI_FTYPE_V4QI, dsp),
8682 + DIRECT_BUILTIN (preceu_ph_qbra, MIPS_V2HI_FTYPE_V4QI, dsp),
8683 + DIRECT_BUILTIN (shll_qb, MIPS_V4QI_FTYPE_V4QI_SI, dsp),
8684 + DIRECT_BUILTIN (shll_ph, MIPS_V2HI_FTYPE_V2HI_SI, dsp),
8685 + DIRECT_BUILTIN (shll_s_ph, MIPS_V2HI_FTYPE_V2HI_SI, dsp),
8686 + DIRECT_BUILTIN (shll_s_w, MIPS_SI_FTYPE_SI_SI, dsp),
8687 + DIRECT_BUILTIN (shrl_qb, MIPS_V4QI_FTYPE_V4QI_SI, dsp),
8688 + DIRECT_BUILTIN (shra_ph, MIPS_V2HI_FTYPE_V2HI_SI, dsp),
8689 + DIRECT_BUILTIN (shra_r_ph, MIPS_V2HI_FTYPE_V2HI_SI, dsp),
8690 + DIRECT_BUILTIN (shra_r_w, MIPS_SI_FTYPE_SI_SI, dsp),
8691 + DIRECT_BUILTIN (muleu_s_ph_qbl, MIPS_V2HI_FTYPE_V4QI_V2HI, dsp),
8692 + DIRECT_BUILTIN (muleu_s_ph_qbr, MIPS_V2HI_FTYPE_V4QI_V2HI, dsp),
8693 + DIRECT_BUILTIN (mulq_rs_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dsp),
8694 + DIRECT_BUILTIN (muleq_s_w_phl, MIPS_SI_FTYPE_V2HI_V2HI, dsp),
8695 + DIRECT_BUILTIN (muleq_s_w_phr, MIPS_SI_FTYPE_V2HI_V2HI, dsp),
8696 + DIRECT_BUILTIN (bitrev, MIPS_SI_FTYPE_SI, dsp),
8697 + DIRECT_BUILTIN (insv, MIPS_SI_FTYPE_SI_SI, dsp),
8698 + DIRECT_BUILTIN (repl_qb, MIPS_V4QI_FTYPE_SI, dsp),
8699 + DIRECT_BUILTIN (repl_ph, MIPS_V2HI_FTYPE_SI, dsp),
8700 + DIRECT_NO_TARGET_BUILTIN (cmpu_eq_qb, MIPS_VOID_FTYPE_V4QI_V4QI, dsp),
8701 + DIRECT_NO_TARGET_BUILTIN (cmpu_lt_qb, MIPS_VOID_FTYPE_V4QI_V4QI, dsp),
8702 + DIRECT_NO_TARGET_BUILTIN (cmpu_le_qb, MIPS_VOID_FTYPE_V4QI_V4QI, dsp),
8703 + DIRECT_BUILTIN (cmpgu_eq_qb, MIPS_SI_FTYPE_V4QI_V4QI, dsp),
8704 + DIRECT_BUILTIN (cmpgu_lt_qb, MIPS_SI_FTYPE_V4QI_V4QI, dsp),
8705 + DIRECT_BUILTIN (cmpgu_le_qb, MIPS_SI_FTYPE_V4QI_V4QI, dsp),
8706 + DIRECT_NO_TARGET_BUILTIN (cmp_eq_ph, MIPS_VOID_FTYPE_V2HI_V2HI, dsp),
8707 + DIRECT_NO_TARGET_BUILTIN (cmp_lt_ph, MIPS_VOID_FTYPE_V2HI_V2HI, dsp),
8708 + DIRECT_NO_TARGET_BUILTIN (cmp_le_ph, MIPS_VOID_FTYPE_V2HI_V2HI, dsp),
8709 + DIRECT_BUILTIN (pick_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, dsp),
8710 + DIRECT_BUILTIN (pick_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dsp),
8711 + DIRECT_BUILTIN (packrl_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dsp),
8712 + DIRECT_NO_TARGET_BUILTIN (wrdsp, MIPS_VOID_FTYPE_SI_SI, dsp),
8713 + DIRECT_BUILTIN (rddsp, MIPS_SI_FTYPE_SI, dsp),
8714 + DIRECT_BUILTIN (lbux, MIPS_SI_FTYPE_POINTER_SI, dsp),
8715 + DIRECT_BUILTIN (lhx, MIPS_SI_FTYPE_POINTER_SI, dsp),
8716 + DIRECT_BUILTIN (lwx, MIPS_SI_FTYPE_POINTER_SI, dsp),
8717 + BPOSGE_BUILTIN (32, dsp),
8718 +
8719 + /* The following are for the MIPS DSP ASE REV 2 (32-bit and 64-bit). */
8720 + DIRECT_BUILTIN (absq_s_qb, MIPS_V4QI_FTYPE_V4QI, dspr2),
8721 + DIRECT_BUILTIN (addu_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
8722 + DIRECT_BUILTIN (addu_s_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
8723 + DIRECT_BUILTIN (adduh_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, dspr2),
8724 + DIRECT_BUILTIN (adduh_r_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, dspr2),
8725 + DIRECT_BUILTIN (append, MIPS_SI_FTYPE_SI_SI_SI, dspr2),
8726 + DIRECT_BUILTIN (balign, MIPS_SI_FTYPE_SI_SI_SI, dspr2),
8727 + DIRECT_BUILTIN (cmpgdu_eq_qb, MIPS_SI_FTYPE_V4QI_V4QI, dspr2),
8728 + DIRECT_BUILTIN (cmpgdu_lt_qb, MIPS_SI_FTYPE_V4QI_V4QI, dspr2),
8729 + DIRECT_BUILTIN (cmpgdu_le_qb, MIPS_SI_FTYPE_V4QI_V4QI, dspr2),
8730 + DIRECT_BUILTIN (mul_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
8731 + DIRECT_BUILTIN (mul_s_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
8732 + DIRECT_BUILTIN (mulq_rs_w, MIPS_SI_FTYPE_SI_SI, dspr2),
8733 + DIRECT_BUILTIN (mulq_s_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
8734 + DIRECT_BUILTIN (mulq_s_w, MIPS_SI_FTYPE_SI_SI, dspr2),
8735 + DIRECT_BUILTIN (precr_qb_ph, MIPS_V4QI_FTYPE_V2HI_V2HI, dspr2),
8736 + DIRECT_BUILTIN (precr_sra_ph_w, MIPS_V2HI_FTYPE_SI_SI_SI, dspr2),
8737 + DIRECT_BUILTIN (precr_sra_r_ph_w, MIPS_V2HI_FTYPE_SI_SI_SI, dspr2),
8738 + DIRECT_BUILTIN (prepend, MIPS_SI_FTYPE_SI_SI_SI, dspr2),
8739 + DIRECT_BUILTIN (shra_qb, MIPS_V4QI_FTYPE_V4QI_SI, dspr2),
8740 + DIRECT_BUILTIN (shra_r_qb, MIPS_V4QI_FTYPE_V4QI_SI, dspr2),
8741 + DIRECT_BUILTIN (shrl_ph, MIPS_V2HI_FTYPE_V2HI_SI, dspr2),
8742 + DIRECT_BUILTIN (subu_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
8743 + DIRECT_BUILTIN (subu_s_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
8744 + DIRECT_BUILTIN (subuh_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, dspr2),
8745 + DIRECT_BUILTIN (subuh_r_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, dspr2),
8746 + DIRECT_BUILTIN (addqh_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
8747 + DIRECT_BUILTIN (addqh_r_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
8748 + DIRECT_BUILTIN (addqh_w, MIPS_SI_FTYPE_SI_SI, dspr2),
8749 + DIRECT_BUILTIN (addqh_r_w, MIPS_SI_FTYPE_SI_SI, dspr2),
8750 + DIRECT_BUILTIN (subqh_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
8751 + DIRECT_BUILTIN (subqh_r_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, dspr2),
8752 + DIRECT_BUILTIN (subqh_w, MIPS_SI_FTYPE_SI_SI, dspr2),
8753 + DIRECT_BUILTIN (subqh_r_w, MIPS_SI_FTYPE_SI_SI, dspr2),
8754 +
8755 + /* Built-in functions for the DSP ASE (32-bit only). */
8756 + DIRECT_BUILTIN (dpau_h_qbl, MIPS_DI_FTYPE_DI_V4QI_V4QI, dsp_32),
8757 + DIRECT_BUILTIN (dpau_h_qbr, MIPS_DI_FTYPE_DI_V4QI_V4QI, dsp_32),
8758 + DIRECT_BUILTIN (dpsu_h_qbl, MIPS_DI_FTYPE_DI_V4QI_V4QI, dsp_32),
8759 + DIRECT_BUILTIN (dpsu_h_qbr, MIPS_DI_FTYPE_DI_V4QI_V4QI, dsp_32),
8760 + DIRECT_BUILTIN (dpaq_s_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dsp_32),
8761 + DIRECT_BUILTIN (dpsq_s_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dsp_32),
8762 + DIRECT_BUILTIN (mulsaq_s_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dsp_32),
8763 + DIRECT_BUILTIN (dpaq_sa_l_w, MIPS_DI_FTYPE_DI_SI_SI, dsp_32),
8764 + DIRECT_BUILTIN (dpsq_sa_l_w, MIPS_DI_FTYPE_DI_SI_SI, dsp_32),
8765 + DIRECT_BUILTIN (maq_s_w_phl, MIPS_DI_FTYPE_DI_V2HI_V2HI, dsp_32),
8766 + DIRECT_BUILTIN (maq_s_w_phr, MIPS_DI_FTYPE_DI_V2HI_V2HI, dsp_32),
8767 + DIRECT_BUILTIN (maq_sa_w_phl, MIPS_DI_FTYPE_DI_V2HI_V2HI, dsp_32),
8768 + DIRECT_BUILTIN (maq_sa_w_phr, MIPS_DI_FTYPE_DI_V2HI_V2HI, dsp_32),
8769 + DIRECT_BUILTIN (extr_w, MIPS_SI_FTYPE_DI_SI, dsp_32),
8770 + DIRECT_BUILTIN (extr_r_w, MIPS_SI_FTYPE_DI_SI, dsp_32),
8771 + DIRECT_BUILTIN (extr_rs_w, MIPS_SI_FTYPE_DI_SI, dsp_32),
8772 + DIRECT_BUILTIN (extr_s_h, MIPS_SI_FTYPE_DI_SI, dsp_32),
8773 + DIRECT_BUILTIN (extp, MIPS_SI_FTYPE_DI_SI, dsp_32),
8774 + DIRECT_BUILTIN (extpdp, MIPS_SI_FTYPE_DI_SI, dsp_32),
8775 + DIRECT_BUILTIN (shilo, MIPS_DI_FTYPE_DI_SI, dsp_32),
8776 + DIRECT_BUILTIN (mthlip, MIPS_DI_FTYPE_DI_SI, dsp_32),
8777 +
8778 + /* The following are for the MIPS DSP ASE REV 2 (32-bit only). */
8779 + DIRECT_BUILTIN (dpa_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32),
8780 + DIRECT_BUILTIN (dps_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32),
8781 + DIRECT_BUILTIN (madd, MIPS_DI_FTYPE_DI_SI_SI, dspr2_32),
8782 + DIRECT_BUILTIN (maddu, MIPS_DI_FTYPE_DI_USI_USI, dspr2_32),
8783 + DIRECT_BUILTIN (msub, MIPS_DI_FTYPE_DI_SI_SI, dspr2_32),
8784 + DIRECT_BUILTIN (msubu, MIPS_DI_FTYPE_DI_USI_USI, dspr2_32),
8785 + DIRECT_BUILTIN (mulsa_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32),
8786 + DIRECT_BUILTIN (mult, MIPS_DI_FTYPE_SI_SI, dspr2_32),
8787 + DIRECT_BUILTIN (multu, MIPS_DI_FTYPE_USI_USI, dspr2_32),
8788 + DIRECT_BUILTIN (dpax_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32),
8789 + DIRECT_BUILTIN (dpsx_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32),
8790 + DIRECT_BUILTIN (dpaqx_s_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32),
8791 + DIRECT_BUILTIN (dpaqx_sa_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32),
8792 + DIRECT_BUILTIN (dpsqx_s_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32),
8793 + DIRECT_BUILTIN (dpsqx_sa_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32),
8794
8795 -/* Define __builtin_mips_bposge<VALUE>. <VALUE> is 32 for the MIPS32 DSP
8796 - branch instruction. TARGET_FLAGS is a mips_builtin_description field. */
8797 -#define BPOSGE_BUILTIN(VALUE, TARGET_FLAGS) \
8798 - { CODE_FOR_mips_bposge, 0, "__builtin_mips_bposge" #VALUE, \
8799 - MIPS_BUILTIN_BPOSGE ## VALUE, MIPS_SI_FTYPE_VOID, TARGET_FLAGS }
8800 -
8801 -static const struct mips_builtin_description mips_dsp_bdesc[] = {
8802 - DIRECT_BUILTIN (addq_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSP),
8803 - DIRECT_BUILTIN (addq_s_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSP),
8804 - DIRECT_BUILTIN (addq_s_w, MIPS_SI_FTYPE_SI_SI, MASK_DSP),
8805 - DIRECT_BUILTIN (addu_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, MASK_DSP),
8806 - DIRECT_BUILTIN (addu_s_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, MASK_DSP),
8807 - DIRECT_BUILTIN (subq_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSP),
8808 - DIRECT_BUILTIN (subq_s_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSP),
8809 - DIRECT_BUILTIN (subq_s_w, MIPS_SI_FTYPE_SI_SI, MASK_DSP),
8810 - DIRECT_BUILTIN (subu_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, MASK_DSP),
8811 - DIRECT_BUILTIN (subu_s_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, MASK_DSP),
8812 - DIRECT_BUILTIN (addsc, MIPS_SI_FTYPE_SI_SI, MASK_DSP),
8813 - DIRECT_BUILTIN (addwc, MIPS_SI_FTYPE_SI_SI, MASK_DSP),
8814 - DIRECT_BUILTIN (modsub, MIPS_SI_FTYPE_SI_SI, MASK_DSP),
8815 - DIRECT_BUILTIN (raddu_w_qb, MIPS_SI_FTYPE_V4QI, MASK_DSP),
8816 - DIRECT_BUILTIN (absq_s_ph, MIPS_V2HI_FTYPE_V2HI, MASK_DSP),
8817 - DIRECT_BUILTIN (absq_s_w, MIPS_SI_FTYPE_SI, MASK_DSP),
8818 - DIRECT_BUILTIN (precrq_qb_ph, MIPS_V4QI_FTYPE_V2HI_V2HI, MASK_DSP),
8819 - DIRECT_BUILTIN (precrq_ph_w, MIPS_V2HI_FTYPE_SI_SI, MASK_DSP),
8820 - DIRECT_BUILTIN (precrq_rs_ph_w, MIPS_V2HI_FTYPE_SI_SI, MASK_DSP),
8821 - DIRECT_BUILTIN (precrqu_s_qb_ph, MIPS_V4QI_FTYPE_V2HI_V2HI, MASK_DSP),
8822 - DIRECT_BUILTIN (preceq_w_phl, MIPS_SI_FTYPE_V2HI, MASK_DSP),
8823 - DIRECT_BUILTIN (preceq_w_phr, MIPS_SI_FTYPE_V2HI, MASK_DSP),
8824 - DIRECT_BUILTIN (precequ_ph_qbl, MIPS_V2HI_FTYPE_V4QI, MASK_DSP),
8825 - DIRECT_BUILTIN (precequ_ph_qbr, MIPS_V2HI_FTYPE_V4QI, MASK_DSP),
8826 - DIRECT_BUILTIN (precequ_ph_qbla, MIPS_V2HI_FTYPE_V4QI, MASK_DSP),
8827 - DIRECT_BUILTIN (precequ_ph_qbra, MIPS_V2HI_FTYPE_V4QI, MASK_DSP),
8828 - DIRECT_BUILTIN (preceu_ph_qbl, MIPS_V2HI_FTYPE_V4QI, MASK_DSP),
8829 - DIRECT_BUILTIN (preceu_ph_qbr, MIPS_V2HI_FTYPE_V4QI, MASK_DSP),
8830 - DIRECT_BUILTIN (preceu_ph_qbla, MIPS_V2HI_FTYPE_V4QI, MASK_DSP),
8831 - DIRECT_BUILTIN (preceu_ph_qbra, MIPS_V2HI_FTYPE_V4QI, MASK_DSP),
8832 - DIRECT_BUILTIN (shll_qb, MIPS_V4QI_FTYPE_V4QI_SI, MASK_DSP),
8833 - DIRECT_BUILTIN (shll_ph, MIPS_V2HI_FTYPE_V2HI_SI, MASK_DSP),
8834 - DIRECT_BUILTIN (shll_s_ph, MIPS_V2HI_FTYPE_V2HI_SI, MASK_DSP),
8835 - DIRECT_BUILTIN (shll_s_w, MIPS_SI_FTYPE_SI_SI, MASK_DSP),
8836 - DIRECT_BUILTIN (shrl_qb, MIPS_V4QI_FTYPE_V4QI_SI, MASK_DSP),
8837 - DIRECT_BUILTIN (shra_ph, MIPS_V2HI_FTYPE_V2HI_SI, MASK_DSP),
8838 - DIRECT_BUILTIN (shra_r_ph, MIPS_V2HI_FTYPE_V2HI_SI, MASK_DSP),
8839 - DIRECT_BUILTIN (shra_r_w, MIPS_SI_FTYPE_SI_SI, MASK_DSP),
8840 - DIRECT_BUILTIN (muleu_s_ph_qbl, MIPS_V2HI_FTYPE_V4QI_V2HI, MASK_DSP),
8841 - DIRECT_BUILTIN (muleu_s_ph_qbr, MIPS_V2HI_FTYPE_V4QI_V2HI, MASK_DSP),
8842 - DIRECT_BUILTIN (mulq_rs_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSP),
8843 - DIRECT_BUILTIN (muleq_s_w_phl, MIPS_SI_FTYPE_V2HI_V2HI, MASK_DSP),
8844 - DIRECT_BUILTIN (muleq_s_w_phr, MIPS_SI_FTYPE_V2HI_V2HI, MASK_DSP),
8845 - DIRECT_BUILTIN (bitrev, MIPS_SI_FTYPE_SI, MASK_DSP),
8846 - DIRECT_BUILTIN (insv, MIPS_SI_FTYPE_SI_SI, MASK_DSP),
8847 - DIRECT_BUILTIN (repl_qb, MIPS_V4QI_FTYPE_SI, MASK_DSP),
8848 - DIRECT_BUILTIN (repl_ph, MIPS_V2HI_FTYPE_SI, MASK_DSP),
8849 - DIRECT_NO_TARGET_BUILTIN (cmpu_eq_qb, MIPS_VOID_FTYPE_V4QI_V4QI, MASK_DSP),
8850 - DIRECT_NO_TARGET_BUILTIN (cmpu_lt_qb, MIPS_VOID_FTYPE_V4QI_V4QI, MASK_DSP),
8851 - DIRECT_NO_TARGET_BUILTIN (cmpu_le_qb, MIPS_VOID_FTYPE_V4QI_V4QI, MASK_DSP),
8852 - DIRECT_BUILTIN (cmpgu_eq_qb, MIPS_SI_FTYPE_V4QI_V4QI, MASK_DSP),
8853 - DIRECT_BUILTIN (cmpgu_lt_qb, MIPS_SI_FTYPE_V4QI_V4QI, MASK_DSP),
8854 - DIRECT_BUILTIN (cmpgu_le_qb, MIPS_SI_FTYPE_V4QI_V4QI, MASK_DSP),
8855 - DIRECT_NO_TARGET_BUILTIN (cmp_eq_ph, MIPS_VOID_FTYPE_V2HI_V2HI, MASK_DSP),
8856 - DIRECT_NO_TARGET_BUILTIN (cmp_lt_ph, MIPS_VOID_FTYPE_V2HI_V2HI, MASK_DSP),
8857 - DIRECT_NO_TARGET_BUILTIN (cmp_le_ph, MIPS_VOID_FTYPE_V2HI_V2HI, MASK_DSP),
8858 - DIRECT_BUILTIN (pick_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, MASK_DSP),
8859 - DIRECT_BUILTIN (pick_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSP),
8860 - DIRECT_BUILTIN (packrl_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSP),
8861 - DIRECT_NO_TARGET_BUILTIN (wrdsp, MIPS_VOID_FTYPE_SI_SI, MASK_DSP),
8862 - DIRECT_BUILTIN (rddsp, MIPS_SI_FTYPE_SI, MASK_DSP),
8863 - DIRECT_BUILTIN (lbux, MIPS_SI_FTYPE_POINTER_SI, MASK_DSP),
8864 - DIRECT_BUILTIN (lhx, MIPS_SI_FTYPE_POINTER_SI, MASK_DSP),
8865 - DIRECT_BUILTIN (lwx, MIPS_SI_FTYPE_POINTER_SI, MASK_DSP),
8866 - BPOSGE_BUILTIN (32, MASK_DSP),
8867 -
8868 - /* The following are for the MIPS DSP ASE REV 2. */
8869 - DIRECT_BUILTIN (absq_s_qb, MIPS_V4QI_FTYPE_V4QI, MASK_DSPR2),
8870 - DIRECT_BUILTIN (addu_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSPR2),
8871 - DIRECT_BUILTIN (addu_s_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSPR2),
8872 - DIRECT_BUILTIN (adduh_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, MASK_DSPR2),
8873 - DIRECT_BUILTIN (adduh_r_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, MASK_DSPR2),
8874 - DIRECT_BUILTIN (append, MIPS_SI_FTYPE_SI_SI_SI, MASK_DSPR2),
8875 - DIRECT_BUILTIN (balign, MIPS_SI_FTYPE_SI_SI_SI, MASK_DSPR2),
8876 - DIRECT_BUILTIN (cmpgdu_eq_qb, MIPS_SI_FTYPE_V4QI_V4QI, MASK_DSPR2),
8877 - DIRECT_BUILTIN (cmpgdu_lt_qb, MIPS_SI_FTYPE_V4QI_V4QI, MASK_DSPR2),
8878 - DIRECT_BUILTIN (cmpgdu_le_qb, MIPS_SI_FTYPE_V4QI_V4QI, MASK_DSPR2),
8879 - DIRECT_BUILTIN (mul_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSPR2),
8880 - DIRECT_BUILTIN (mul_s_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSPR2),
8881 - DIRECT_BUILTIN (mulq_rs_w, MIPS_SI_FTYPE_SI_SI, MASK_DSPR2),
8882 - DIRECT_BUILTIN (mulq_s_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSPR2),
8883 - DIRECT_BUILTIN (mulq_s_w, MIPS_SI_FTYPE_SI_SI, MASK_DSPR2),
8884 - DIRECT_BUILTIN (precr_qb_ph, MIPS_V4QI_FTYPE_V2HI_V2HI, MASK_DSPR2),
8885 - DIRECT_BUILTIN (precr_sra_ph_w, MIPS_V2HI_FTYPE_SI_SI_SI, MASK_DSPR2),
8886 - DIRECT_BUILTIN (precr_sra_r_ph_w, MIPS_V2HI_FTYPE_SI_SI_SI, MASK_DSPR2),
8887 - DIRECT_BUILTIN (prepend, MIPS_SI_FTYPE_SI_SI_SI, MASK_DSPR2),
8888 - DIRECT_BUILTIN (shra_qb, MIPS_V4QI_FTYPE_V4QI_SI, MASK_DSPR2),
8889 - DIRECT_BUILTIN (shra_r_qb, MIPS_V4QI_FTYPE_V4QI_SI, MASK_DSPR2),
8890 - DIRECT_BUILTIN (shrl_ph, MIPS_V2HI_FTYPE_V2HI_SI, MASK_DSPR2),
8891 - DIRECT_BUILTIN (subu_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSPR2),
8892 - DIRECT_BUILTIN (subu_s_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSPR2),
8893 - DIRECT_BUILTIN (subuh_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, MASK_DSPR2),
8894 - DIRECT_BUILTIN (subuh_r_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, MASK_DSPR2),
8895 - DIRECT_BUILTIN (addqh_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSPR2),
8896 - DIRECT_BUILTIN (addqh_r_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSPR2),
8897 - DIRECT_BUILTIN (addqh_w, MIPS_SI_FTYPE_SI_SI, MASK_DSPR2),
8898 - DIRECT_BUILTIN (addqh_r_w, MIPS_SI_FTYPE_SI_SI, MASK_DSPR2),
8899 - DIRECT_BUILTIN (subqh_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSPR2),
8900 - DIRECT_BUILTIN (subqh_r_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSPR2),
8901 - DIRECT_BUILTIN (subqh_w, MIPS_SI_FTYPE_SI_SI, MASK_DSPR2),
8902 - DIRECT_BUILTIN (subqh_r_w, MIPS_SI_FTYPE_SI_SI, MASK_DSPR2)
8903 -};
8904 -
8905 -static const struct mips_builtin_description mips_dsp_32only_bdesc[] = {
8906 - DIRECT_BUILTIN (dpau_h_qbl, MIPS_DI_FTYPE_DI_V4QI_V4QI, MASK_DSP),
8907 - DIRECT_BUILTIN (dpau_h_qbr, MIPS_DI_FTYPE_DI_V4QI_V4QI, MASK_DSP),
8908 - DIRECT_BUILTIN (dpsu_h_qbl, MIPS_DI_FTYPE_DI_V4QI_V4QI, MASK_DSP),
8909 - DIRECT_BUILTIN (dpsu_h_qbr, MIPS_DI_FTYPE_DI_V4QI_V4QI, MASK_DSP),
8910 - DIRECT_BUILTIN (dpaq_s_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSP),
8911 - DIRECT_BUILTIN (dpsq_s_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSP),
8912 - DIRECT_BUILTIN (mulsaq_s_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSP),
8913 - DIRECT_BUILTIN (dpaq_sa_l_w, MIPS_DI_FTYPE_DI_SI_SI, MASK_DSP),
8914 - DIRECT_BUILTIN (dpsq_sa_l_w, MIPS_DI_FTYPE_DI_SI_SI, MASK_DSP),
8915 - DIRECT_BUILTIN (maq_s_w_phl, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSP),
8916 - DIRECT_BUILTIN (maq_s_w_phr, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSP),
8917 - DIRECT_BUILTIN (maq_sa_w_phl, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSP),
8918 - DIRECT_BUILTIN (maq_sa_w_phr, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSP),
8919 - DIRECT_BUILTIN (extr_w, MIPS_SI_FTYPE_DI_SI, MASK_DSP),
8920 - DIRECT_BUILTIN (extr_r_w, MIPS_SI_FTYPE_DI_SI, MASK_DSP),
8921 - DIRECT_BUILTIN (extr_rs_w, MIPS_SI_FTYPE_DI_SI, MASK_DSP),
8922 - DIRECT_BUILTIN (extr_s_h, MIPS_SI_FTYPE_DI_SI, MASK_DSP),
8923 - DIRECT_BUILTIN (extp, MIPS_SI_FTYPE_DI_SI, MASK_DSP),
8924 - DIRECT_BUILTIN (extpdp, MIPS_SI_FTYPE_DI_SI, MASK_DSP),
8925 - DIRECT_BUILTIN (shilo, MIPS_DI_FTYPE_DI_SI, MASK_DSP),
8926 - DIRECT_BUILTIN (mthlip, MIPS_DI_FTYPE_DI_SI, MASK_DSP),
8927 -
8928 - /* The following are for the MIPS DSP ASE REV 2. */
8929 - DIRECT_BUILTIN (dpa_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSPR2),
8930 - DIRECT_BUILTIN (dps_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSPR2),
8931 - DIRECT_BUILTIN (madd, MIPS_DI_FTYPE_DI_SI_SI, MASK_DSPR2),
8932 - DIRECT_BUILTIN (maddu, MIPS_DI_FTYPE_DI_USI_USI, MASK_DSPR2),
8933 - DIRECT_BUILTIN (msub, MIPS_DI_FTYPE_DI_SI_SI, MASK_DSPR2),
8934 - DIRECT_BUILTIN (msubu, MIPS_DI_FTYPE_DI_USI_USI, MASK_DSPR2),
8935 - DIRECT_BUILTIN (mulsa_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSPR2),
8936 - DIRECT_BUILTIN (mult, MIPS_DI_FTYPE_SI_SI, MASK_DSPR2),
8937 - DIRECT_BUILTIN (multu, MIPS_DI_FTYPE_USI_USI, MASK_DSPR2),
8938 - DIRECT_BUILTIN (dpax_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSPR2),
8939 - DIRECT_BUILTIN (dpsx_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSPR2),
8940 - DIRECT_BUILTIN (dpaqx_s_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSPR2),
8941 - DIRECT_BUILTIN (dpaqx_sa_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSPR2),
8942 - DIRECT_BUILTIN (dpsqx_s_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSPR2),
8943 - DIRECT_BUILTIN (dpsqx_sa_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSPR2)
8944 -};
8945 -
8946 -/* This structure describes an array of mips_builtin_description entries. */
8947 -struct mips_bdesc_map {
8948 - /* The array that this entry describes. */
8949 - const struct mips_builtin_description *bdesc;
8950 -
8951 - /* The number of entries in BDESC. */
8952 - unsigned int size;
8953 -
8954 - /* The target processor that supports the functions in BDESC.
8955 - PROCESSOR_MAX means we enable them for all processors. */
8956 - enum processor_type proc;
8957 -
8958 - /* The functions in BDESC are not supported if any of these
8959 - target flags are set. */
8960 - int unsupported_target_flags;
8961 -};
8962 -
8963 -/* All MIPS-specific built-in functions. */
8964 -static const struct mips_bdesc_map mips_bdesc_arrays[] = {
8965 - { mips_ps_bdesc, ARRAY_SIZE (mips_ps_bdesc), PROCESSOR_MAX, 0 },
8966 - { mips_sb1_bdesc, ARRAY_SIZE (mips_sb1_bdesc), PROCESSOR_SB1, 0 },
8967 - { mips_dsp_bdesc, ARRAY_SIZE (mips_dsp_bdesc), PROCESSOR_MAX, 0 },
8968 - { mips_dsp_32only_bdesc, ARRAY_SIZE (mips_dsp_32only_bdesc),
8969 - PROCESSOR_MAX, MASK_64BIT }
8970 + /* Sundry other built-in functions. */
8971 + DIRECT_NO_TARGET_BUILTIN (cache, MIPS_VOID_FTYPE_SI_CVPOINTER, cache)
8972 };
8973
8974 /* MODE is a vector mode whose elements have type TYPE. Return the type
8975 @@ -10235,10 +10254,25 @@ mips_builtin_vector_type (tree type, enu
8976 return types[(int) mode];
8977 }
8978
8979 +/* Return a type for 'const volatile void *'. */
8980 +
8981 +static tree
8982 +mips_build_cvpointer_type (void)
8983 +{
8984 + static tree cache;
8985 +
8986 + if (cache == NULL_TREE)
8987 + cache = build_pointer_type (build_qualified_type
8988 + (void_type_node,
8989 + TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE));
8990 + return cache;
8991 +}
8992 +
8993 /* Source-level argument types. */
8994 #define MIPS_ATYPE_VOID void_type_node
8995 #define MIPS_ATYPE_INT integer_type_node
8996 #define MIPS_ATYPE_POINTER ptr_type_node
8997 +#define MIPS_ATYPE_CVPOINTER mips_build_cvpointer_type ()
8998
8999 /* Standard mode-based argument types. */
9000 #define MIPS_ATYPE_SI intSI_type_node
9001 @@ -10298,25 +10332,17 @@ static void
9002 mips_init_builtins (void)
9003 {
9004 const struct mips_builtin_description *d;
9005 - const struct mips_bdesc_map *m;
9006 - unsigned int offset;
9007 + unsigned int i;
9008
9009 /* Iterate through all of the bdesc arrays, initializing all of the
9010 builtin functions. */
9011 - offset = 0;
9012 - for (m = mips_bdesc_arrays;
9013 - m < &mips_bdesc_arrays[ARRAY_SIZE (mips_bdesc_arrays)];
9014 - m++)
9015 - {
9016 - if ((m->proc == PROCESSOR_MAX || m->proc == mips_arch)
9017 - && (m->unsupported_target_flags & target_flags) == 0)
9018 - for (d = m->bdesc; d < &m->bdesc[m->size]; d++)
9019 - if ((d->target_flags & target_flags) == d->target_flags)
9020 - add_builtin_function (d->name,
9021 - mips_build_function_type (d->function_type),
9022 - d - m->bdesc + offset,
9023 - BUILT_IN_MD, NULL, NULL);
9024 - offset += m->size;
9025 + for (i = 0; i < ARRAY_SIZE (mips_builtins); i++)
9026 + {
9027 + d = &mips_builtins[i];
9028 + if (d->avail ())
9029 + add_builtin_function (d->name,
9030 + mips_build_function_type (d->function_type),
9031 + i, BUILT_IN_MD, NULL, NULL);
9032 }
9033 }
9034
9035 @@ -10335,7 +10361,13 @@ mips_prepare_builtin_arg (enum insn_code
9036 mode = insn_data[icode].operand[opno].mode;
9037 if (!insn_data[icode].operand[opno].predicate (value, mode))
9038 {
9039 - value = copy_to_mode_reg (mode, value);
9040 + /* Cope with address operands, where MODE is not the mode of
9041 + VALUE itself. */
9042 + if (GET_MODE (value) == VOIDmode)
9043 + value = copy_to_mode_reg (mode, value);
9044 + else
9045 + value = copy_to_reg (value);
9046 +
9047 /* Check the predicate again. */
9048 if (!insn_data[icode].operand[opno].predicate (value, mode))
9049 {
9050 @@ -10561,41 +10593,6 @@ mips_expand_builtin_bposge (enum mips_bu
9051 const1_rtx, const0_rtx);
9052 }
9053
9054 -/* EXP is a CALL_EXPR that calls the function described by BDESC.
9055 - Expand the call and return an rtx for its return value.
9056 - TARGET, if nonnull, suggests a good place to put this value. */
9057 -
9058 -static rtx
9059 -mips_expand_builtin_1 (const struct mips_builtin_description *bdesc,
9060 - tree exp, rtx target)
9061 -{
9062 - switch (bdesc->builtin_type)
9063 - {
9064 - case MIPS_BUILTIN_DIRECT:
9065 - return mips_expand_builtin_direct (bdesc->icode, target, exp, true);
9066 -
9067 - case MIPS_BUILTIN_DIRECT_NO_TARGET:
9068 - return mips_expand_builtin_direct (bdesc->icode, target, exp, false);
9069 -
9070 - case MIPS_BUILTIN_MOVT:
9071 - case MIPS_BUILTIN_MOVF:
9072 - return mips_expand_builtin_movtf (bdesc->builtin_type, bdesc->icode,
9073 - bdesc->cond, target, exp);
9074 -
9075 - case MIPS_BUILTIN_CMP_ANY:
9076 - case MIPS_BUILTIN_CMP_ALL:
9077 - case MIPS_BUILTIN_CMP_UPPER:
9078 - case MIPS_BUILTIN_CMP_LOWER:
9079 - case MIPS_BUILTIN_CMP_SINGLE:
9080 - return mips_expand_builtin_compare (bdesc->builtin_type, bdesc->icode,
9081 - bdesc->cond, target, exp);
9082 -
9083 - case MIPS_BUILTIN_BPOSGE32:
9084 - return mips_expand_builtin_bposge (bdesc->builtin_type, target);
9085 - }
9086 - gcc_unreachable ();
9087 -}
9088 -
9089 /* Implement TARGET_EXPAND_BUILTIN. */
9090
9091 static rtx
9092 @@ -10604,25 +10601,44 @@ mips_expand_builtin (tree exp, rtx targe
9093 int ignore ATTRIBUTE_UNUSED)
9094 {
9095 tree fndecl;
9096 - unsigned int fcode;
9097 - const struct mips_bdesc_map *m;
9098 + unsigned int fcode, avail;
9099 + const struct mips_builtin_description *d;
9100
9101 fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0);
9102 fcode = DECL_FUNCTION_CODE (fndecl);
9103 + gcc_assert (fcode < ARRAY_SIZE (mips_builtins));
9104 + d = &mips_builtins[fcode];
9105 + avail = d->avail ();
9106 + gcc_assert (avail != 0);
9107 if (TARGET_MIPS16)
9108 {
9109 error ("built-in function %qs not supported for MIPS16",
9110 IDENTIFIER_POINTER (DECL_NAME (fndecl)));
9111 return const0_rtx;
9112 }
9113 + switch (d->builtin_type)
9114 + {
9115 + case MIPS_BUILTIN_DIRECT:
9116 + return mips_expand_builtin_direct (d->icode, target, exp, true);
9117 +
9118 + case MIPS_BUILTIN_DIRECT_NO_TARGET:
9119 + return mips_expand_builtin_direct (d->icode, target, exp, false);
9120 +
9121 + case MIPS_BUILTIN_MOVT:
9122 + case MIPS_BUILTIN_MOVF:
9123 + return mips_expand_builtin_movtf (d->builtin_type, d->icode,
9124 + d->cond, target, exp);
9125 +
9126 + case MIPS_BUILTIN_CMP_ANY:
9127 + case MIPS_BUILTIN_CMP_ALL:
9128 + case MIPS_BUILTIN_CMP_UPPER:
9129 + case MIPS_BUILTIN_CMP_LOWER:
9130 + case MIPS_BUILTIN_CMP_SINGLE:
9131 + return mips_expand_builtin_compare (d->builtin_type, d->icode,
9132 + d->cond, target, exp);
9133
9134 - for (m = mips_bdesc_arrays;
9135 - m < &mips_bdesc_arrays[ARRAY_SIZE (mips_bdesc_arrays)];
9136 - m++)
9137 - {
9138 - if (fcode < m->size)
9139 - return mips_expand_builtin_1 (m->bdesc + fcode, exp, target);
9140 - fcode -= m->size;
9141 + case MIPS_BUILTIN_BPOSGE32:
9142 + return mips_expand_builtin_bposge (d->builtin_type, target);
9143 }
9144 gcc_unreachable ();
9145 }
9146 @@ -10896,6 +10912,378 @@ mips16_lay_out_constants (void)
9147 mips16_emit_constants (pool.first, get_last_insn ());
9148 }
9149
9150 +/* Return true if it is worth r10k_simplify_address's while replacing
9151 + an address with X. We are looking for constants, and for addresses
9152 + at a known offset from the incoming stack pointer. */
9153 +
9154 +static bool
9155 +r10k_simplified_address_p (rtx x)
9156 +{
9157 + if (GET_CODE (x) == PLUS && CONST_INT_P (XEXP (x, 1)))
9158 + x = XEXP (x, 0);
9159 + return x == virtual_incoming_args_rtx || CONSTANT_P (x);
9160 +}
9161 +
9162 +/* X is an expression that appears in INSN. Try to use the UD chains
9163 + to simplify it, returning the simplified form on success and the
9164 + original form otherwise. Replace the incoming value of $sp with
9165 + virtual_incoming_args_rtx (which should never occur in X otherwise). */
9166 +
9167 +static rtx
9168 +r10k_simplify_address (rtx x, rtx insn)
9169 +{
9170 + rtx newx, op0, op1, set, def_insn, note;
9171 + struct df_ref *use, *def;
9172 + struct df_link *defs;
9173 +
9174 + newx = NULL_RTX;
9175 + if (UNARY_P (x))
9176 + {
9177 + op0 = r10k_simplify_address (XEXP (x, 0), insn);
9178 + if (op0 != XEXP (x, 0))
9179 + newx = simplify_gen_unary (GET_CODE (x), GET_MODE (x),
9180 + op0, GET_MODE (XEXP (x, 0)));
9181 + }
9182 + else if (BINARY_P (x))
9183 + {
9184 + op0 = r10k_simplify_address (XEXP (x, 0), insn);
9185 + op1 = r10k_simplify_address (XEXP (x, 1), insn);
9186 + if (op0 != XEXP (x, 0) || op1 != XEXP (x, 1))
9187 + newx = simplify_gen_binary (GET_CODE (x), GET_MODE (x), op0, op1);
9188 + }
9189 + else if (GET_CODE (x) == LO_SUM)
9190 + {
9191 + /* LO_SUMs can be offset from HIGHs, if we know they won't
9192 + overflow. See mips_classify_address for the rationale behind
9193 + the lax check. */
9194 + op0 = r10k_simplify_address (XEXP (x, 0), insn);
9195 + if (GET_CODE (op0) == HIGH)
9196 + newx = XEXP (x, 1);
9197 + }
9198 + else if (REG_P (x))
9199 + {
9200 + /* Uses are recorded by regno_reg_rtx, not X itself. */
9201 + use = df_find_use (insn, regno_reg_rtx[REGNO (x)]);
9202 + gcc_assert (use);
9203 + defs = DF_REF_CHAIN (use);
9204 +
9205 + /* Require a single definition. */
9206 + if (defs && defs->next == NULL)
9207 + {
9208 + def = defs->ref;
9209 + if (DF_REF_IS_ARTIFICIAL (def))
9210 + {
9211 + /* Replace the incoming value of $sp with
9212 + virtual_incoming_args_rtx. */
9213 + if (x == stack_pointer_rtx
9214 + && DF_REF_BB (def) == ENTRY_BLOCK_PTR)
9215 + newx = virtual_incoming_args_rtx;
9216 + }
9217 + else if (dominated_by_p (CDI_DOMINATORS, DF_REF_BB (use),
9218 + DF_REF_BB (def)))
9219 + {
9220 + /* Make sure that DEF_INSN is a single set of REG. */
9221 + def_insn = DF_REF_INSN (def);
9222 + if (NONJUMP_INSN_P (def_insn))
9223 + {
9224 + set = single_set (def_insn);
9225 + if (set && rtx_equal_p (SET_DEST (set), x))
9226 + {
9227 + /* Prefer to use notes, since the def-use chains
9228 + are often shorter. */
9229 + note = find_reg_equal_equiv_note (def_insn);
9230 + if (note)
9231 + newx = XEXP (note, 0);
9232 + else
9233 + newx = SET_SRC (set);
9234 + newx = r10k_simplify_address (newx, def_insn);
9235 + }
9236 + }
9237 + }
9238 + }
9239 + }
9240 + if (newx && r10k_simplified_address_p (newx))
9241 + return newx;
9242 + return x;
9243 +}
9244 +
9245 +/* Return true if ADDRESS is known to be an uncached address
9246 + on R10K systems. */
9247 +
9248 +static bool
9249 +r10k_uncached_address_p (unsigned HOST_WIDE_INT address)
9250 +{
9251 + unsigned HOST_WIDE_INT upper;
9252 +
9253 + /* Check for KSEG1. */
9254 + if (address + 0x60000000 < 0x20000000)
9255 + return true;
9256 +
9257 + /* Check for uncached XKPHYS addresses. */
9258 + if (Pmode == DImode)
9259 + {
9260 + upper = (address >> 40) & 0xf9ffff;
9261 + if (upper == 0x900000 || upper == 0xb80000)
9262 + return true;
9263 + }
9264 + return false;
9265 +}
9266 +
9267 +/* Return true if we can prove that an access to address X in instruction
9268 + INSN would be safe from R10K speculation. This X is a general
9269 + expression; it might not be a legitimate address. */
9270 +
9271 +static bool
9272 +r10k_safe_address_p (rtx x, rtx insn)
9273 +{
9274 + rtx base, offset;
9275 + HOST_WIDE_INT offset_val;
9276 +
9277 + x = r10k_simplify_address (x, insn);
9278 +
9279 + /* Check for references to the stack frame. It doesn't really matter
9280 + how much of the frame has been allocated at INSN; -mr10k-cache-barrier
9281 + allows us to assume that accesses to any part of the eventual frame
9282 + is safe from speculation at any point in the function. */
9283 + mips_split_plus (x, &base, &offset_val);
9284 + if (base == virtual_incoming_args_rtx
9285 + && offset_val >= -cfun->machine->frame.total_size
9286 + && offset_val < cfun->machine->frame.args_size)
9287 + return true;
9288 +
9289 + /* Check for uncached addresses. */
9290 + if (CONST_INT_P (x))
9291 + return r10k_uncached_address_p (INTVAL (x));
9292 +
9293 + /* Check for accesses to a static object. */
9294 + split_const (x, &base, &offset);
9295 + return offset_within_block_p (base, INTVAL (offset));
9296 +}
9297 +
9298 +/* Return true if a MEM with MEM_EXPR EXPR and MEM_OFFSET OFFSET is
9299 + an in-range access to an automatic variable, or to an object with
9300 + a link-time-constant address. */
9301 +
9302 +static bool
9303 +r10k_safe_mem_expr_p (tree expr, rtx offset)
9304 +{
9305 + if (expr == NULL_TREE
9306 + || offset == NULL_RTX
9307 + || !CONST_INT_P (offset)
9308 + || INTVAL (offset) < 0
9309 + || INTVAL (offset) >= int_size_in_bytes (TREE_TYPE (expr)))
9310 + return false;
9311 +
9312 + while (TREE_CODE (expr) == COMPONENT_REF)
9313 + {
9314 + expr = TREE_OPERAND (expr, 0);
9315 + if (expr == NULL_TREE)
9316 + return false;
9317 + }
9318 +
9319 + return DECL_P (expr);
9320 +}
9321 +
9322 +/* A for_each_rtx callback for which DATA points to the instruction
9323 + containing *X. Stop the search if we find a MEM that is not safe
9324 + from R10K speculation. */
9325 +
9326 +static int
9327 +r10k_needs_protection_p_1 (rtx *loc, void *data)
9328 +{
9329 + rtx mem;
9330 +
9331 + mem = *loc;
9332 + if (!MEM_P (mem))
9333 + return 0;
9334 +
9335 + if (r10k_safe_mem_expr_p (MEM_EXPR (mem), MEM_OFFSET (mem)))
9336 + return -1;
9337 +
9338 + if (r10k_safe_address_p (XEXP (mem, 0), (rtx) data))
9339 + return -1;
9340 +
9341 + return 1;
9342 +}
9343 +
9344 +/* A note_stores callback for which DATA points to an instruction pointer.
9345 + If *DATA is nonnull, make it null if it X contains a MEM that is not
9346 + safe from R10K speculation. */
9347 +
9348 +static void
9349 +r10k_needs_protection_p_store (rtx x, const_rtx pat ATTRIBUTE_UNUSED,
9350 + void *data)
9351 +{
9352 + rtx *insn_ptr;
9353 +
9354 + insn_ptr = (rtx *) data;
9355 + if (*insn_ptr && for_each_rtx (&x, r10k_needs_protection_p_1, *insn_ptr))
9356 + *insn_ptr = NULL_RTX;
9357 +}
9358 +
9359 +/* A for_each_rtx callback that iterates over the pattern of a CALL_INSN.
9360 + Return nonzero if the call is not to a declared function. */
9361 +
9362 +static int
9363 +r10k_needs_protection_p_call (rtx *loc, void *data ATTRIBUTE_UNUSED)
9364 +{
9365 + rtx x;
9366 +
9367 + x = *loc;
9368 + if (!MEM_P (x))
9369 + return 0;
9370 +
9371 + x = XEXP (x, 0);
9372 + if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_DECL (x))
9373 + return -1;
9374 +
9375 + return 1;
9376 +}
9377 +
9378 +/* Return true if instruction INSN needs to be protected by an R10K
9379 + cache barrier. */
9380 +
9381 +static bool
9382 +r10k_needs_protection_p (rtx insn)
9383 +{
9384 + if (CALL_P (insn))
9385 + return for_each_rtx (&PATTERN (insn), r10k_needs_protection_p_call, NULL);
9386 +
9387 + if (mips_r10k_cache_barrier == R10K_CACHE_BARRIER_STORE)
9388 + {
9389 + note_stores (PATTERN (insn), r10k_needs_protection_p_store, &insn);
9390 + return insn == NULL_RTX;
9391 + }
9392 +
9393 + return for_each_rtx (&PATTERN (insn), r10k_needs_protection_p_1, insn);
9394 +}
9395 +
9396 +/* Return true if BB is only reached by blocks in PROTECTED_BBS and if every
9397 + edge is unconditional. */
9398 +
9399 +static bool
9400 +r10k_protected_bb_p (basic_block bb, sbitmap protected_bbs)
9401 +{
9402 + edge_iterator ei;
9403 + edge e;
9404 +
9405 + FOR_EACH_EDGE (e, ei, bb->preds)
9406 + if (!single_succ_p (e->src)
9407 + || !TEST_BIT (protected_bbs, e->src->index)
9408 + || (e->flags & EDGE_COMPLEX) != 0)
9409 + return false;
9410 + return true;
9411 +}
9412 +
9413 +/* Implement -mr10k-cache-barrier= for the current function. */
9414 +
9415 +static void
9416 +r10k_insert_cache_barriers (void)
9417 +{
9418 + int *rev_post_order;
9419 + unsigned int i, n;
9420 + basic_block bb;
9421 + sbitmap protected_bbs;
9422 + rtx insn, end, unprotected_region;
9423 +
9424 + if (TARGET_MIPS16)
9425 + {
9426 + sorry ("%qs does not support MIPS16 code", "-mr10k-cache-barrier");
9427 + return;
9428 + }
9429 +
9430 + /* Restore the BLOCK_FOR_INSN pointers, which are needed by DF. */
9431 + compute_bb_for_insn ();
9432 +
9433 + /* Create def-use chains. */
9434 + df_set_flags (DF_EQ_NOTES);
9435 + df_chain_add_problem (DF_UD_CHAIN);
9436 + df_analyze ();
9437 +
9438 + /* Calculate dominators. */
9439 + calculate_dominance_info (CDI_DOMINATORS);
9440 +
9441 + /* Bit X of PROTECTED_BBS is set if the last operation in basic block
9442 + X is protected by a cache barrier. */
9443 + protected_bbs = sbitmap_alloc (last_basic_block);
9444 + sbitmap_zero (protected_bbs);
9445 +
9446 + /* Iterate over the basic blocks in reverse post-order. */
9447 + rev_post_order = XNEWVEC (int, last_basic_block);
9448 + n = pre_and_rev_post_order_compute (NULL, rev_post_order, false);
9449 + for (i = 0; i < n; i++)
9450 + {
9451 + bb = BASIC_BLOCK (rev_post_order[i]);
9452 +
9453 + /* If this block is only reached by unconditional edges, and if the
9454 + source of every edge is protected, the beginning of the block is
9455 + also protected. */
9456 + if (r10k_protected_bb_p (bb, protected_bbs))
9457 + unprotected_region = NULL_RTX;
9458 + else
9459 + unprotected_region = pc_rtx;
9460 + end = NEXT_INSN (BB_END (bb));
9461 +
9462 + /* UNPROTECTED_REGION is:
9463 +
9464 + - null if we are processing a protected region,
9465 + - pc_rtx if we are processing an unprotected region but have
9466 + not yet found the first instruction in it
9467 + - the first instruction in an unprotected region otherwise. */
9468 + for (insn = BB_HEAD (bb); insn != end; insn = NEXT_INSN (insn))
9469 + {
9470 + if (unprotected_region && INSN_P (insn))
9471 + {
9472 + if (recog_memoized (insn) == CODE_FOR_mips_cache)
9473 + /* This CACHE instruction protects the following code. */
9474 + unprotected_region = NULL_RTX;
9475 + else
9476 + {
9477 + /* See if INSN is the first instruction in this
9478 + unprotected region. */
9479 + if (unprotected_region == pc_rtx)
9480 + unprotected_region = insn;
9481 +
9482 + /* See if INSN needs to be protected. If so,
9483 + we must insert a cache barrier somewhere between
9484 + PREV_INSN (UNPROTECTED_REGION) and INSN. It isn't
9485 + clear which position is better performance-wise,
9486 + but as a tie-breaker, we assume that it is better
9487 + to allow delay slots to be back-filled where
9488 + possible, and that it is better not to insert
9489 + barriers in the middle of already-scheduled code.
9490 + We therefore insert the barrier at the beginning
9491 + of the region. */
9492 + if (r10k_needs_protection_p (insn))
9493 + {
9494 + emit_insn_before (gen_r10k_cache_barrier (),
9495 + unprotected_region);
9496 + unprotected_region = NULL_RTX;
9497 + }
9498 + }
9499 + }
9500 +
9501 + if (CALL_P (insn))
9502 + /* The called function is not required to protect the exit path.
9503 + The code that follows a call is therefore unprotected. */
9504 + unprotected_region = pc_rtx;
9505 + }
9506 +
9507 + /* Record whether the end of this block is protected. */
9508 + if (unprotected_region == NULL_RTX)
9509 + SET_BIT (protected_bbs, bb->index);
9510 + }
9511 + XDELETEVEC (rev_post_order);
9512 +
9513 + sbitmap_free (protected_bbs);
9514 +
9515 + free_dominance_info (CDI_DOMINATORS);
9516 +
9517 + df_finish_pass (false);
9518 +
9519 + free_bb_for_insn ();
9520 +}
9521 +
9522 /* A temporary variable used by for_each_rtx callbacks, etc. */
9523 static rtx mips_sim_insn;
9524
9525 @@ -11542,6 +11930,13 @@ mips_reorg_process_insns (void)
9526 orphaned high-part relocation. */
9527 if (mips_orphaned_high_part_p (htab, insn))
9528 delete_insn (insn);
9529 + /* Also delete cache barriers if the last instruction
9530 + was an annulled branch. INSN will not be speculatively
9531 + executed. */
9532 + else if (recog_memoized (insn) == CODE_FOR_r10k_cache_barrier
9533 + && last_insn
9534 + && INSN_ANNULLED_BRANCH_P (SEQ_BEGIN (last_insn)))
9535 + delete_insn (insn);
9536 else
9537 {
9538 mips_avoid_hazard (last_insn, insn, &hilo_delay,
9539 @@ -11561,6 +11956,8 @@ static void
9540 mips_reorg (void)
9541 {
9542 mips16_lay_out_constants ();
9543 + if (mips_r10k_cache_barrier != R10K_CACHE_BARRIER_NONE)
9544 + r10k_insert_cache_barriers ();
9545 if (mips_base_delayed_branch)
9546 dbr_schedule (get_insns ());
9547 mips_reorg_process_insns ();
9548 @@ -11979,6 +12376,17 @@ mips_handle_option (size_t code, const c
9549 return false;
9550 return true;
9551
9552 + case OPT_mr10k_cache_barrier_:
9553 + if (strcmp (arg, "load-store") == 0)
9554 + mips_r10k_cache_barrier = R10K_CACHE_BARRIER_LOAD_STORE;
9555 + else if (strcmp (arg, "store") == 0)
9556 + mips_r10k_cache_barrier = R10K_CACHE_BARRIER_STORE;
9557 + else if (strcmp (arg, "none") == 0)
9558 + mips_r10k_cache_barrier = R10K_CACHE_BARRIER_NONE;
9559 + else
9560 + return false;
9561 + return true;
9562 +
9563 default:
9564 return true;
9565 }
9566 @@ -12216,6 +12624,14 @@ mips_override_options (void)
9567 warning (0, "the %qs architecture does not support paired-single"
9568 " instructions", mips_arch_info->name);
9569
9570 + if (mips_r10k_cache_barrier != R10K_CACHE_BARRIER_NONE
9571 + && !TARGET_CACHE_BUILTIN)
9572 + {
9573 + error ("%qs requires a target that provides the %qs instruction",
9574 + "-mr10k-cache-barrier", "cache");
9575 + mips_r10k_cache_barrier = R10K_CACHE_BARRIER_NONE;
9576 + }
9577 +
9578 /* If TARGET_DSPR2, enable MASK_DSP. */
9579 if (TARGET_DSPR2)
9580 target_flags |= MASK_DSP;
9581 --- gcc-4.3.2/gcc/config/mips/mips.h
9582 +++ gcc-4.3.2/gcc/config/mips/mips.h
9583 @@ -520,6 +520,9 @@ enum mips_code_readable_setting {
9584 \
9585 if (mips_abi == ABI_EABI) \
9586 builtin_define ("__mips_eabi"); \
9587 + \
9588 + if (TARGET_CACHE_BUILTIN) \
9589 + builtin_define ("__GCC_HAVE_BUILTIN_MIPS_CACHE"); \
9590 } \
9591 while (0)
9592
9593 @@ -916,6 +919,12 @@ enum mips_code_readable_setting {
9594 ? TARGET_LLSC && !TARGET_MIPS16 \
9595 : ISA_HAS_LL_SC)
9596
9597 +/* The CACHE instruction is available in non-MIPS16 code. */
9598 +#define TARGET_CACHE_BUILTIN (mips_isa >= 3)
9599 +
9600 +/* The CACHE instruction is available. */
9601 +#define ISA_HAS_CACHE (TARGET_CACHE_BUILTIN && !TARGET_MIPS16)
9602 +
9603 /* Add -G xx support. */
9604
9605 #undef SWITCH_TAKES_ARG
9606 --- gcc-4.3.2/gcc/config/mips/mips.md
9607 +++ gcc-4.3.2/gcc/config/mips/mips.md
9608 @@ -210,6 +210,9 @@
9609 (UNSPEC_DPAQX_SA_W_PH 446)
9610 (UNSPEC_DPSQX_S_W_PH 447)
9611 (UNSPEC_DPSQX_SA_W_PH 448)
9612 +
9613 + (UNSPEC_MIPS_CACHE 600)
9614 + (UNSPEC_R10K_CACHE_BARRIER 601)
9615 ]
9616 )
9617
9618 @@ -3980,6 +3983,25 @@
9619 (set_attr "mode" "SF")
9620 (set_attr "length" "4,4,4,*,*")])
9621
9622 +;; Cache operations for R4000-style caches.
9623 +(define_insn "mips_cache"
9624 + [(set (mem:BLK (scratch))
9625 + (unspec:BLK [(match_operand:SI 0 "const_int_operand")
9626 + (match_operand:QI 1 "address_operand" "p")]
9627 + UNSPEC_MIPS_CACHE))]
9628 + "ISA_HAS_CACHE"
9629 + "cache\t%X0,%a1")
9630 +
9631 +;; Similar, but with the operands hard-coded to an R10K cache barrier
9632 +;; operation. We keep the pattern distinct so that we can identify
9633 +;; cache operations inserted by -mr10k-cache-barrier=, and so that
9634 +;; the operation is never inserted into a delay slot.
9635 +(define_insn "r10k_cache_barrier"
9636 + [(set (mem:BLK (scratch))
9637 + (unspec:BLK [(const_int 0)] UNSPEC_R10K_CACHE_BARRIER))]
9638 + "ISA_HAS_CACHE"
9639 + "cache\t0x14,0(%$)"
9640 + [(set_attr "can_delay" "no")])
9641
9642 ;; 64-bit floating point moves
9643
9644 --- gcc-4.3.2/gcc/config/mips/mips.opt
9645 +++ gcc-4.3.2/gcc/config/mips/mips.opt
9646 @@ -232,6 +232,10 @@ mpaired-single
9647 Target Report Mask(PAIRED_SINGLE_FLOAT)
9648 Use paired-single floating-point instructions
9649
9650 +mr10k-cache-barrier=
9651 +Target Joined RejectNegative
9652 +-mr10k-cache-barrier=SETTING Specify when r10k cache barriers should be inserted
9653 +
9654 mshared
9655 Target Report Var(TARGET_SHARED) Init(1)
9656 When generating -mabicalls code, make the code suitable for use in shared libraries
9657 --- gcc-4.3.2/gcc/doc/extend.texi
9658 +++ gcc-4.3.2/gcc/doc/extend.texi
9659 @@ -6713,6 +6713,7 @@ instructions, but allow the compiler to
9660 * X86 Built-in Functions::
9661 * MIPS DSP Built-in Functions::
9662 * MIPS Paired-Single Support::
9663 +* Other MIPS Built-in Functions::
9664 * PowerPC AltiVec Built-in Functions::
9665 * SPARC VIS Built-in Functions::
9666 * SPU Built-in Functions::
9667 @@ -8830,6 +8831,18 @@ else
9668 @end smallexample
9669 @end table
9670
9671 +@node Other MIPS Built-in Functions
9672 +@subsection Other MIPS Built-in Functions
9673 +
9674 +GCC provides other MIPS-specific built-in functions:
9675 +
9676 +@table @code
9677 +@item void __builtin_mips_cache (int @var{op}, const volatile void *@var{addr})
9678 +Insert a @samp{cache} instruction with operands @var{op} and @var{addr}.
9679 +GCC defines the preprocessor macro @code{___GCC_HAVE_BUILTIN_MIPS_CACHE}
9680 +when this function is available.
9681 +@end table
9682 +
9683 @node PowerPC AltiVec Built-in Functions
9684 @subsection PowerPC AltiVec Built-in Functions
9685
9686 --- gcc-4.3.2/gcc/doc/invoke.texi
9687 +++ gcc-4.3.2/gcc/doc/invoke.texi
9688 @@ -12459,6 +12459,73 @@ Work around certain SB-1 CPU core errata
9689 (This flag currently works around the SB-1 revision 2
9690 ``F1'' and ``F2'' floating point errata.)
9691
9692 +@item -mr10k-cache-barrier=@var{setting}
9693 +@opindex mr10k-cache-barrier
9694 +Specify whether GCC should insert cache barriers to avoid the
9695 +side-effects of speculation on R10K processors.
9696 +
9697 +In common with many processors, the R10K tries to predict the outcome
9698 +of a conditional branch and speculatively executes instructions from
9699 +the ``taken'' branch. It later aborts these instructions if the
9700 +predicted outcome was wrong. However, on the R10K, even aborted
9701 +instructions can have side effects.
9702 +
9703 +This problem only affects kernel stores and, depending on the system,
9704 +kernel loads. As an example, a speculatively-executed store may load
9705 +the target memory into cache and mark the cache line as dirty, even if
9706 +the store itself is later aborted. If a DMA operation writes to the
9707 +same area of memory before the ``dirty'' line is flushed, the cached
9708 +data will overwrite the DMA-ed data. See the R10K processor manual
9709 +for a full description, including other potential problems.
9710 +
9711 +One workaround is to insert cache barrier instructions before every memory
9712 +access that might be speculatively executed and that might have side
9713 +effects even if aborted. @option{-mr10k-cache-barrier=@var{setting}}
9714 +controls GCC's implementation of this workaround. It assumes that
9715 +aborted accesses to any byte in the following regions will not have
9716 +side effects:
9717 +
9718 +@enumerate
9719 +@item
9720 +the memory occupied by the current function's stack frame;
9721 +
9722 +@item
9723 +the memory occupied by an incoming stack argument;
9724 +
9725 +@item
9726 +the memory occupied by an object with a link-time-constant address.
9727 +@end enumerate
9728 +
9729 +It is the kernel's responsibility to ensure that speculative
9730 +accesses to these regions are indeed safe.
9731 +
9732 +If the input program contains a function declaration such as:
9733 +
9734 +@smallexample
9735 +void foo (void);
9736 +@end smallexample
9737 +
9738 +then the implementation of @code{foo} must allow @code{j foo} and
9739 +@code{jal foo} to be executed speculatively. GCC honors this
9740 +restriction for functions it compiles itself. It expects non-GCC
9741 +functions (such as hand-written assembly code) to do the same.
9742 +
9743 +The option has three forms:
9744 +
9745 +@table @gcctabopt
9746 +@item -mr10k-cache-barrier=load-store
9747 +Insert a cache barrier before a load or store that might be
9748 +speculatively executed and that might have side effects even
9749 +if aborted.
9750 +
9751 +@item -mr10k-cache-barrier=store
9752 +Insert a cache barrier before a store that might be speculatively
9753 +executed and that might have side effects even if aborted.
9754 +
9755 +@item -mr10k-cache-barrier=none
9756 +Disable the insertion of cache barriers. This is the default setting.
9757 +@end table
9758 +
9759 @item -mflush-func=@var{func}
9760 @itemx -mno-flush-func
9761 @opindex mflush-func
9762 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/cache-1.c
9763 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/cache-1.c
9764 @@ -0,0 +1,30 @@
9765 +/* { dg-mips-options "-O2" } */
9766 +
9767 +void
9768 +f1 (int *area)
9769 +{
9770 + __builtin_mips_cache (20, area);
9771 +}
9772 +
9773 +void
9774 +f2 (const short *area)
9775 +{
9776 + __builtin_mips_cache (24, area + 10);
9777 +}
9778 +
9779 +void
9780 +f3 (volatile unsigned int *area, int offset)
9781 +{
9782 + __builtin_mips_cache (0, area + offset);
9783 +}
9784 +
9785 +void
9786 +f4 (const volatile unsigned char *area)
9787 +{
9788 + __builtin_mips_cache (4, area - 80);
9789 +}
9790 +
9791 +/* { dg-final { scan-assembler "\tcache\t0x14,0\\(\\\$4\\)" } } */
9792 +/* { dg-final { scan-assembler "\tcache\t0x18,20\\(\\\$4\\)" } } */
9793 +/* { dg-final { scan-assembler "\tcache\t0x0,0\\(\\\$.\\)" } } */
9794 +/* { dg-final { scan-assembler "\tcache\t0x4,-80\\(\\\$4\\)" } } */
9795 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/mips.exp
9796 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/mips.exp
9797 @@ -238,6 +238,10 @@ proc dg-mips-options {args} {
9798 } else {
9799 append flags " -msoft-float"
9800 }
9801 + } elseif {[regexp -- {^-mr10k-cache-barrier=(load|store)} $flag]
9802 + && $mips_isa < 3
9803 + && [lsearch -regexp $flags {^(-mips|-march)}] < 0} {
9804 + append flags " -mips3"
9805 }
9806 }
9807 foreach flag $flags {
9808 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-1.c
9809 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-1.c
9810 @@ -0,0 +1,45 @@
9811 +/* { dg-mips-options "-O2 -mabi=64 -mr10k-cache-barrier=store" } */
9812 +
9813 +/* Test that stores to uncached addresses do not get unnecessary
9814 + cache barriers. */
9815 +
9816 +#define TEST(ADDR) \
9817 + NOMIPS16 void \
9818 + test_##ADDR (int n) \
9819 + { \
9820 + while (n--) \
9821 + { \
9822 + *(volatile char *) (0x##ADDR##UL) = 1; \
9823 + *(volatile short *) (0x##ADDR##UL + 2) = 2; \
9824 + *(volatile int *) (0x##ADDR##UL + 4) = 0; \
9825 + } \
9826 + }
9827 +
9828 +TEST (9000000000000000)
9829 +TEST (900000fffffffff8)
9830 +
9831 +TEST (9200000000000000)
9832 +TEST (920000fffffffff8)
9833 +
9834 +TEST (9400000000000000)
9835 +TEST (940000fffffffff8)
9836 +
9837 +TEST (9600000000000000)
9838 +TEST (960000fffffffff8)
9839 +
9840 +TEST (b800000000000000)
9841 +TEST (b80000fffffffff8)
9842 +
9843 +TEST (ba00000000000000)
9844 +TEST (ba0000fffffffff8)
9845 +
9846 +TEST (bc00000000000000)
9847 +TEST (bc0000fffffffff8)
9848 +
9849 +TEST (be00000000000000)
9850 +TEST (be0000fffffffff8)
9851 +
9852 +TEST (ffffffffa0000000)
9853 +TEST (ffffffffbffffff8)
9854 +
9855 +/* { dg-final { scan-assembler-not "\tcache\t" } } */
9856 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-10.c
9857 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-10.c
9858 @@ -0,0 +1,18 @@
9859 +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store -mips4 -mbranch-likely -mno-abicalls" } */
9860 +int bar (int);
9861 +
9862 +/* Test that code after a branch-likely does not get an unnecessary
9863 + cache barrier. */
9864 +
9865 +NOMIPS16 void
9866 +foo (int n, int *x)
9867 +{
9868 + do
9869 + n = bar (n * 4 + 1);
9870 + while (n);
9871 + /* The preceding branch should be a branch likely, with the shift as
9872 + its delay slot. We therefore don't need a cache barrier here. */
9873 + x[0] = 0;
9874 +}
9875 +
9876 +/* { dg-final { scan-assembler-not "\tcache\t" } } */
9877 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-11.c
9878 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-11.c
9879 @@ -0,0 +1,13 @@
9880 +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store -mno-abicalls" } */
9881 +
9882 +/* Test that loads are not unnecessarily protected. */
9883 +
9884 +int bar (int);
9885 +
9886 +NOMIPS16 void
9887 +foo (int *ptr)
9888 +{
9889 + *ptr = bar (*ptr);
9890 +}
9891 +
9892 +/* { dg-final { scan-assembler-times "\tcache\t" 1 } } */
9893 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-12.c
9894 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-12.c
9895 @@ -0,0 +1,13 @@
9896 +/* { dg-mips-options "-O2 -mr10k-cache-barrier=load-store -mno-abicalls" } */
9897 +
9898 +/* Test that loads are correctly protected. */
9899 +
9900 +int bar (int);
9901 +
9902 +NOMIPS16 void
9903 +foo (int *ptr)
9904 +{
9905 + *ptr = bar (*ptr);
9906 +}
9907 +
9908 +/* { dg-final { scan-assembler-times "\tcache\t" 2 } } */
9909 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-13.c
9910 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-13.c
9911 @@ -0,0 +1,14 @@
9912 +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store" } */
9913 +
9914 +/* Test that indirect calls are protected. */
9915 +
9916 +int bar (int);
9917 +
9918 +NOMIPS16 void
9919 +foo (void (*fn) (void), int x)
9920 +{
9921 + if (x)
9922 + (*fn) ();
9923 +}
9924 +
9925 +/* { dg-final { scan-assembler-times "\tcache\t" 1 } } */
9926 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-14.c
9927 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-14.c
9928 @@ -0,0 +1,7 @@
9929 +/* { dg-do compile { target mips16_attribute } } */
9930 +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store" } */
9931 +/* { dg-add-options mips16_attribute } */
9932 +
9933 +/* Test that indirect calls are protected. */
9934 +
9935 +MIPS16 void foo (void) { } /* { dg-message "sorry, unimplemented" } */
9936 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-15.c
9937 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-15.c
9938 @@ -0,0 +1,2 @@
9939 +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store -mips2" } */
9940 +/* { dg-error "requires.*cache.*instruction" "" { target *-*-* } 0 } */
9941 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-2.c
9942 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-2.c
9943 @@ -0,0 +1,40 @@
9944 +/* { dg-mips-options "-O2 -mabi=64 -mr10k-cache-barrier=store" } */
9945 +
9946 +/* Test that stores to constant cached addresses are protected
9947 + by cache barriers. */
9948 +
9949 +#define TEST(ADDR) \
9950 + NOMIPS16 void \
9951 + test_##ADDR (int n) \
9952 + { \
9953 + *(volatile int *) (0x##ADDR##UL) = 1; \
9954 + }
9955 +
9956 +TEST (8ffffffffffffffc)
9957 +TEST (9000010000000000)
9958 +
9959 +TEST (91fffffffffffffc)
9960 +TEST (9200010000000000)
9961 +
9962 +TEST (93fffffffffffffc)
9963 +TEST (9500010000000000)
9964 +
9965 +TEST (95fffffffffffffc)
9966 +TEST (9600010000000000)
9967 +
9968 +TEST (b7fffffffffffffc)
9969 +TEST (b800010000000000)
9970 +
9971 +TEST (b9fffffffffffffc)
9972 +TEST (ba00010000000000)
9973 +
9974 +TEST (bbfffffffffffffc)
9975 +TEST (bc00010000000000)
9976 +
9977 +TEST (bdfffffffffffffc)
9978 +TEST (be00010000000000)
9979 +
9980 +TEST (ffffffff9ffffffc)
9981 +TEST (ffffffffc0000000)
9982 +
9983 +/* { dg-final { scan-assembler-times "\tcache\t" 18 } } */
9984 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-3.c
9985 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-3.c
9986 @@ -0,0 +1,17 @@
9987 +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store -mno-abicalls" } */
9988 +
9989 +/* Test that in-range stores to the frame are not protected by
9990 + cache barriers. */
9991 +
9992 +void bar (int *x);
9993 +
9994 +NOMIPS16 void
9995 +foo (int v)
9996 +{
9997 + int x[0x100000];
9998 + bar (x);
9999 + x[0x20] = v;
10000 + bar (x);
10001 +}
10002 +
10003 +/* { dg-final { scan-assembler-not "\tcache\t" } } */
10004 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-4.c
10005 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-4.c
10006 @@ -0,0 +1,20 @@
10007 +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store -mno-abicalls" } */
10008 +
10009 +void bar (int *x);
10010 +
10011 +/* Test that out-of-range stores to the frame are protected by cache
10012 + barriers. */
10013 +
10014 +NOMIPS16 void
10015 +foo (int v)
10016 +{
10017 + int x[8];
10018 + bar (x);
10019 + if (v & 1)
10020 + x[0x100] = 0;
10021 + if (v & 2)
10022 + x[-0x100] = 0;
10023 + bar (x);
10024 +}
10025 +
10026 +/* { dg-final { scan-assembler-times "\tcache\t" 2 } } */
10027 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-5.c
10028 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-5.c
10029 @@ -0,0 +1,19 @@
10030 +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store -mno-abicalls -mabi=64" } */
10031 +
10032 +/* Test that in-range stores to static objects do not get an unnecessary
10033 + cache barrier. */
10034 +
10035 +int x[4];
10036 +void bar (void);
10037 +
10038 +NOMIPS16 void
10039 +foo (int n)
10040 +{
10041 + while (n--)
10042 + {
10043 + x[3] = 1;
10044 + bar ();
10045 + }
10046 +}
10047 +
10048 +/* { dg-final { scan-assembler-not "\tcache\t" } } */
10049 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-6.c
10050 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-6.c
10051 @@ -0,0 +1,19 @@
10052 +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store -mabi=64" } */
10053 +
10054 +int x[4];
10055 +void bar (void);
10056 +
10057 +/* Test that out-of-range stores to static objects are protected by a
10058 + cache barrier. */
10059 +
10060 +NOMIPS16 void
10061 +foo (int n)
10062 +{
10063 + while (n--)
10064 + {
10065 + x[4] = 1;
10066 + bar ();
10067 + }
10068 +}
10069 +
10070 +/* { dg-final { scan-assembler "\tcache\t" } } */
10071 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-7.c
10072 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-7.c
10073 @@ -0,0 +1,27 @@
10074 +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store -mno-abicalls" } */
10075 +
10076 +void bar1 (void);
10077 +void bar2 (void);
10078 +void bar3 (void);
10079 +
10080 +NOMIPS16 void
10081 +foo (int *x, int sel, int n)
10082 +{
10083 + if (sel)
10084 + {
10085 + bar1 ();
10086 + x[0] = 1;
10087 + }
10088 + else
10089 + {
10090 + bar2 ();
10091 + x[1] = 0;
10092 + }
10093 + /* If there is one copy of this code, reached by two unconditional edges,
10094 + then it shouldn't need a third cache barrier. */
10095 + x[2] = 2;
10096 + while (n--)
10097 + bar3 ();
10098 +}
10099 +
10100 +/* { dg-final { scan-assembler-times "\tcache\t" 2 } } */
10101 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-8.c
10102 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-8.c
10103 @@ -0,0 +1,15 @@
10104 +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store -G8" } */
10105 +
10106 +/* Test that in-range stores to components of static objects
10107 + do not get an unnecessary cache barrier. */
10108 +
10109 +struct { struct { char i[4]; } a; struct { char j[4]; } b; } s;
10110 +
10111 +NOMIPS16 void
10112 +foo (int sel)
10113 +{
10114 + s.a.i[0] = 1;
10115 + s.b.j[3] = 100;
10116 +}
10117 +
10118 +/* { dg-final { scan-assembler-not "\tcache\t" } } */
10119 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-9.c
10120 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-9.c
10121 @@ -0,0 +1,19 @@
10122 +/* { dg-mips-options "-O2 -mr10k-cache-barrier=store -G8" } */
10123 +
10124 +/* Test that out-of-range stores to components of static objects
10125 + are protected by a cache barrier. */
10126 +
10127 +struct { struct { char i[4]; } a; struct { char j[4]; } b; } s;
10128 +
10129 +NOMIPS16 void
10130 +foo (int sel1, int sel2, int sel3)
10131 +{
10132 + if (sel1)
10133 + s.a.i[8] = 1;
10134 + if (sel2)
10135 + s.b.j[4] = 100;
10136 + if (sel3)
10137 + s.a.i[-1] = 0;
10138 +}
10139 +
10140 +/* { dg-final { scan-assembler-times "\tcache\t" 3 } } */
10141
10142
10143
10144 1.1 src/patchsets/gcc/4.3.6/gentoo/76_all_mips-r10k-scheduling-support.patch
10145
10146 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/76_all_mips-r10k-scheduling-support.patch?rev=1.1&view=markup
10147 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/76_all_mips-r10k-scheduling-support.patch?rev=1.1&content-type=text/plain
10148
10149 Index: 76_all_mips-r10k-scheduling-support.patch
10150 ===================================================================
10151 backport from gcc-4.4
10152
10153 http://bugs.gentoo.org/233230
10154
10155 --- gcc-4.3.2/gcc/config/mips/10000.md
10156 +++ gcc-4.3.2/gcc/config/mips/10000.md
10157 @@ -0,0 +1,254 @@
10158 +;; DFA-based pipeline description for the VR1x000.
10159 +;; Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
10160 +;;
10161 +;; This file is part of GCC.
10162 +
10163 +;; GCC is free software; you can redistribute it and/or modify it
10164 +;; under the terms of the GNU General Public License as published
10165 +;; by the Free Software Foundation; either version 3, or (at your
10166 +;; option) any later version.
10167 +
10168 +;; GCC is distributed in the hope that it will be useful, but WITHOUT
10169 +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10170 +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
10171 +;; License for more details.
10172 +
10173 +;; You should have received a copy of the GNU General Public License
10174 +;; along with GCC; see the file COPYING3. If not see
10175 +;; <http://www.gnu.org/licenses/>.
10176 +
10177 +
10178 +;; R12K/R14K/R16K are derivatives of R10K, thus copy its description
10179 +;; until specific tuning for each is added.
10180 +
10181 +;; R10000 has an int queue, fp queue, address queue.
10182 +;; The int queue feeds ALU1 and ALU2.
10183 +;; The fp queue feeds the fp-adder and fp-multiplier.
10184 +;; The addr queue feeds the Load/Store unit.
10185 +;;
10186 +;; However, we define the fp-adder and fp-multiplier as
10187 +;; separate automatons, because the fp-multiplier is
10188 +;; divided into fp-multiplier, fp-division, and
10189 +;; fp-squareroot units, all of which share the same
10190 +;; issue and completion logic, yet can operate in
10191 +;; parallel.
10192 +;;
10193 +;; This is based on the model described in the R10K Manual
10194 +;; and it helps to reduce the size of the automata.
10195 +(define_automaton "r10k_a_int, r10k_a_fpadder, r10k_a_addr,
10196 + r10k_a_fpmpy, r10k_a_fpdiv, r10k_a_fpsqrt")
10197 +
10198 +(define_cpu_unit "r10k_alu1" "r10k_a_int")
10199 +(define_cpu_unit "r10k_alu2" "r10k_a_int")
10200 +(define_cpu_unit "r10k_fpadd" "r10k_a_fpadder")
10201 +(define_cpu_unit "r10k_fpmpy" "r10k_a_fpmpy")
10202 +(define_cpu_unit "r10k_fpdiv" "r10k_a_fpdiv")
10203 +(define_cpu_unit "r10k_fpsqrt" "r10k_a_fpsqrt")
10204 +(define_cpu_unit "r10k_loadstore" "r10k_a_addr")
10205 +
10206 +
10207 +;; R10k Loads and Stores.
10208 +(define_insn_reservation "r10k_load" 2
10209 + (and (eq_attr "cpu" "r10000")
10210 + (eq_attr "type" "load,prefetch,prefetchx"))
10211 + "r10k_loadstore")
10212 +
10213 +(define_insn_reservation "r10k_store" 0
10214 + (and (eq_attr "cpu" "r10000")
10215 + (eq_attr "type" "store,fpstore,fpidxstore"))
10216 + "r10k_loadstore")
10217 +
10218 +(define_insn_reservation "r10k_fpload" 3
10219 + (and (eq_attr "cpu" "r10000")
10220 + (eq_attr "type" "fpload,fpidxload"))
10221 + "r10k_loadstore")
10222 +
10223 +
10224 +;; Integer add/sub + logic ops, and mt hi/lo can be done by alu1 or alu2.
10225 +;; Miscellaneous arith goes here too (this is a guess).
10226 +(define_insn_reservation "r10k_arith" 1
10227 + (and (eq_attr "cpu" "r10000")
10228 + (eq_attr "type" "arith,mthilo,slt,clz,const,nop,trap,logical"))
10229 + "r10k_alu1 | r10k_alu2")
10230 +
10231 +;; We treat mfhilo differently, because we need to know when
10232 +;; it's HI and when it's LO.
10233 +(define_insn_reservation "r10k_mfhi" 1
10234 + (and (eq_attr "cpu" "r10000")
10235 + (and (eq_attr "type" "mfhilo")
10236 + (not (match_operand 1 "lo_operand"))))
10237 + "r10k_alu1 | r10k_alu2")
10238 +
10239 +(define_insn_reservation "r10k_mflo" 1
10240 + (and (eq_attr "cpu" "r10000")
10241 + (and (eq_attr "type" "mfhilo")
10242 + (match_operand 1 "lo_operand")))
10243 + "r10k_alu1 | r10k_alu2")
10244 +
10245 +
10246 +;; ALU1 handles shifts, branch eval, and condmove.
10247 +;;
10248 +;; Brancher is separate, but part of ALU1, but can only
10249 +;; do one branch per cycle (is this even implementable?).
10250 +;;
10251 +;; Unsure if the brancher handles jumps and calls as well, but since
10252 +;; they're related, we'll add them here for now.
10253 +(define_insn_reservation "r10k_brancher" 1
10254 + (and (eq_attr "cpu" "r10000")
10255 + (eq_attr "type" "shift,branch,jump,call"))
10256 + "r10k_alu1")
10257 +
10258 +(define_insn_reservation "r10k_int_cmove" 1
10259 + (and (eq_attr "cpu" "r10000")
10260 + (and (eq_attr "type" "condmove")
10261 + (eq_attr "mode" "SI,DI")))
10262 + "r10k_alu1")
10263 +
10264 +
10265 +;; Coprocessor Moves.
10266 +;; mtc1/dmtc1 are handled by ALU1.
10267 +;; mfc1/dmfc1 are handled by the fp-multiplier.
10268 +(define_insn_reservation "r10k_mt_xfer" 3
10269 + (and (eq_attr "cpu" "r10000")
10270 + (eq_attr "type" "mtc"))
10271 + "r10k_alu1")
10272 +
10273 +(define_insn_reservation "r10k_mf_xfer" 2
10274 + (and (eq_attr "cpu" "r10000")
10275 + (eq_attr "type" "mfc"))
10276 + "r10k_fpmpy")
10277 +
10278 +
10279 +;; Only ALU2 does int multiplications and divisions.
10280 +;;
10281 +;; According to the Vr10000 series user manual,
10282 +;; integer mult and div insns can be issued one
10283 +;; cycle earlier if using register Lo. We model
10284 +;; this by using the Lo value by default, as it
10285 +;; is the more common value, and use a bypass
10286 +;; for the Hi value when needed.
10287 +;;
10288 +;; Also of note, There are different latencies
10289 +;; for MULT/DMULT (Lo 5/Hi 6) and MULTU/DMULTU (Lo 6/Hi 7).
10290 +;; However, gcc does not have separate types
10291 +;; for these insns. Thus to strike a balance,
10292 +;; we use the Hi latency value for imul
10293 +;; operations until the imul type can be split.
10294 +(define_insn_reservation "r10k_imul_single" 6
10295 + (and (eq_attr "cpu" "r10000")
10296 + (and (eq_attr "type" "imul,imul3")
10297 + (eq_attr "mode" "SI")))
10298 + "r10k_alu2 * 6")
10299 +
10300 +(define_insn_reservation "r10k_imul_double" 10
10301 + (and (eq_attr "cpu" "r10000")
10302 + (and (eq_attr "type" "imul,imul3")
10303 + (eq_attr "mode" "DI")))
10304 + "r10k_alu2 * 10")
10305 +
10306 +;; Divides keep ALU2 busy.
10307 +(define_insn_reservation "r10k_idiv_single" 34
10308 + (and (eq_attr "cpu" "r10000")
10309 + (and (eq_attr "type" "idiv")
10310 + (eq_attr "mode" "SI")))
10311 + "r10k_alu2 * 35")
10312 +
10313 +(define_insn_reservation "r10k_idiv_double" 66
10314 + (and (eq_attr "cpu" "r10000")
10315 + (and (eq_attr "type" "idiv")
10316 + (eq_attr "mode" "DI")))
10317 + "r10k_alu2 * 67")
10318 +
10319 +(define_bypass 35 "r10k_idiv_single" "r10k_mfhi")
10320 +(define_bypass 67 "r10k_idiv_double" "r10k_mfhi")
10321 +
10322 +
10323 +;; Floating point add/sub, mul, abs value, neg, comp, & moves.
10324 +(define_insn_reservation "r10k_fp_miscadd" 2
10325 + (and (eq_attr "cpu" "r10000")
10326 + (eq_attr "type" "fadd,fabs,fneg,fcmp"))
10327 + "r10k_fpadd")
10328 +
10329 +(define_insn_reservation "r10k_fp_miscmul" 2
10330 + (and (eq_attr "cpu" "r10000")
10331 + (eq_attr "type" "fmul,fmove"))
10332 + "r10k_fpmpy")
10333 +
10334 +(define_insn_reservation "r10k_fp_cmove" 2
10335 + (and (eq_attr "cpu" "r10000")
10336 + (and (eq_attr "type" "condmove")
10337 + (eq_attr "mode" "SF,DF")))
10338 + "r10k_fpmpy")
10339 +
10340 +
10341 +;; The fcvt.s.[wl] insn has latency 4, repeat 2.
10342 +;; All other fcvt insns have latency 2, repeat 1.
10343 +(define_insn_reservation "r10k_fcvt_single" 4
10344 + (and (eq_attr "cpu" "r10000")
10345 + (and (eq_attr "type" "fcvt")
10346 + (eq_attr "cnv_mode" "I2S")))
10347 + "r10k_fpadd * 2")
10348 +
10349 +(define_insn_reservation "r10k_fcvt_other" 2
10350 + (and (eq_attr "cpu" "r10000")
10351 + (and (eq_attr "type" "fcvt")
10352 + (eq_attr "cnv_mode" "!I2S")))
10353 + "r10k_fpadd")
10354 +
10355 +
10356 +;; Run the fmadd insn through fp-adder first, then fp-multiplier.
10357 +;;
10358 +;; The latency for fmadd is 2 cycles if the result is used
10359 +;; by another fmadd instruction.
10360 +(define_insn_reservation "r10k_fmadd" 4
10361 + (and (eq_attr "cpu" "r10000")
10362 + (eq_attr "type" "fmadd"))
10363 + "r10k_fpadd, r10k_fpmpy")
10364 +
10365 +(define_bypass 2 "r10k_fmadd" "r10k_fmadd")
10366 +
10367 +
10368 +;; Floating point Divisions & square roots.
10369 +(define_insn_reservation "r10k_fdiv_single" 12
10370 + (and (eq_attr "cpu" "r10000")
10371 + (and (eq_attr "type" "fdiv,frdiv")
10372 + (eq_attr "mode" "SF")))
10373 + "r10k_fpdiv * 14")
10374 +
10375 +(define_insn_reservation "r10k_fdiv_double" 19
10376 + (and (eq_attr "cpu" "r10000")
10377 + (and (eq_attr "type" "fdiv,frdiv")
10378 + (eq_attr "mode" "DF")))
10379 + "r10k_fpdiv * 21")
10380 +
10381 +(define_insn_reservation "r10k_fsqrt_single" 18
10382 + (and (eq_attr "cpu" "r10000")
10383 + (and (eq_attr "type" "fsqrt")
10384 + (eq_attr "mode" "SF")))
10385 + "r10k_fpsqrt * 20")
10386 +
10387 +(define_insn_reservation "r10k_fsqrt_double" 33
10388 + (and (eq_attr "cpu" "r10000")
10389 + (and (eq_attr "type" "fsqrt")
10390 + (eq_attr "mode" "DF")))
10391 + "r10k_fpsqrt * 35")
10392 +
10393 +(define_insn_reservation "r10k_frsqrt_single" 30
10394 + (and (eq_attr "cpu" "r10000")
10395 + (and (eq_attr "type" "frsqrt")
10396 + (eq_attr "mode" "SF")))
10397 + "r10k_fpsqrt * 20")
10398 +
10399 +(define_insn_reservation "r10k_frsqrt_double" 52
10400 + (and (eq_attr "cpu" "r10000")
10401 + (and (eq_attr "type" "frsqrt")
10402 + (eq_attr "mode" "DF")))
10403 + "r10k_fpsqrt * 35")
10404 +
10405 +
10406 +;; Handle unknown/multi insns here (this is a guess).
10407 +(define_insn_reservation "r10k_unknown" 1
10408 + (and (eq_attr "cpu" "r10000")
10409 + (eq_attr "type" "unknown,multi"))
10410 + "r10k_alu1 + r10k_alu2")
10411 +
10412 --- gcc-4.3.2/gcc/config/mips/mips.c
10413 +++ gcc-4.3.2/gcc/config/mips/mips.c
10414 @@ -597,6 +597,10 @@ static const struct mips_cpu_info mips_c
10415
10416 /* MIPS IV processors. */
10417 { "r8000", PROCESSOR_R8000, 4, 0 },
10418 + { "r10000", PROCESSOR_R10000, 4, 0 },
10419 + { "r12000", PROCESSOR_R10000, 4, 0 },
10420 + { "r14000", PROCESSOR_R10000, 4, 0 },
10421 + { "r16000", PROCESSOR_R10000, 4, 0 },
10422 { "vr5000", PROCESSOR_R5000, 4, 0 },
10423 { "vr5400", PROCESSOR_R5400, 4, 0 },
10424 { "vr5500", PROCESSOR_R5500, 4, PTF_AVOID_BRANCHLIKELY },
10425 @@ -985,6 +989,19 @@ static const struct mips_rtx_cost_data m
10426 1, /* branch_cost */
10427 4 /* memory_latency */
10428 },
10429 + { /* R1x000 */
10430 + COSTS_N_INSNS (2), /* fp_add */
10431 + COSTS_N_INSNS (2), /* fp_mult_sf */
10432 + COSTS_N_INSNS (2), /* fp_mult_df */
10433 + COSTS_N_INSNS (12), /* fp_div_sf */
10434 + COSTS_N_INSNS (19), /* fp_div_df */
10435 + COSTS_N_INSNS (5), /* int_mult_si */
10436 + COSTS_N_INSNS (9), /* int_mult_di */
10437 + COSTS_N_INSNS (34), /* int_div_si */
10438 + COSTS_N_INSNS (66), /* int_div_di */
10439 + 1, /* branch_cost */
10440 + 4 /* memory_latency */
10441 + },
10442 { /* SB1 */
10443 /* These costs are the same as the SB-1A below. */
10444 COSTS_N_INSNS (4), /* fp_add */
10445 @@ -9554,7 +9571,10 @@ mips_issue_rate (void)
10446 but in reality only a maximum of 3 insns can be issued as
10447 floating-point loads and stores also require a slot in the
10448 AGEN pipe. */
10449 - return 4;
10450 + case PROCESSOR_R10000:
10451 + /* All R10K Processors are quad-issue (being the first MIPS
10452 + processors to support this feature). */
10453 + return 4;
10454
10455 case PROCESSOR_20KC:
10456 case PROCESSOR_R4130:
10457 --- gcc-4.3.2/gcc/config/mips/mips.h
10458 +++ gcc-4.3.2/gcc/config/mips/mips.h
10459 @@ -64,6 +64,7 @@ enum processor_type {
10460 PROCESSOR_R7000,
10461 PROCESSOR_R8000,
10462 PROCESSOR_R9000,
10463 + PROCESSOR_R10000,
10464 PROCESSOR_SB1,
10465 PROCESSOR_SB1A,
10466 PROCESSOR_SR71000,
10467 --- gcc-4.3.2/gcc/config/mips/mips.md
10468 +++ gcc-4.3.2/gcc/config/mips/mips.md
10469 @@ -415,7 +415,7 @@
10470 ;; Attribute describing the processor. This attribute must match exactly
10471 ;; with the processor_type enumeration in mips.h.
10472 (define_attr "cpu"
10473 - "r3000,4kc,4kp,5kc,5kf,20kc,24kc,24kf2_1,24kf1_1,74kc,74kf2_1,74kf1_1,74kf3_2,m4k,r3900,r6000,r4000,r4100,r4111,r4120,r4130,r4300,r4600,r4650,r5000,r5400,r5500,r7000,r8000,r9000,sb1,sb1a,sr71000"
10474 + "r3000,4kc,4kp,5kc,5kf,20kc,24kc,24kf2_1,24kf1_1,74kc,74kf2_1,74kf1_1,74kf3_2,m4k,r3900,r6000,r4000,r4100,r4111,r4120,r4130,r4300,r4600,r4650,r5000,r5400,r5500,r7000,r8000,r9000,r10000,sb1,sb1a,sr71000"
10475 (const (symbol_ref "mips_tune")))
10476
10477 ;; The type of hardware hazard associated with this instruction.
10478 @@ -722,6 +722,7 @@
10479 (include "6000.md")
10480 (include "7000.md")
10481 (include "9000.md")
10482 +(include "10000.md")
10483 (include "sb1.md")
10484 (include "sr71k.md")
10485 (include "generic.md")
10486 --- gcc-4.3.2/gcc/doc/invoke.texi
10487 +++ gcc-4.3.2/gcc/doc/invoke.texi
10488 @@ -11875,6 +11875,7 @@ The processor names are:
10489 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
10490 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
10491 @samp{rm7000}, @samp{rm9000},
10492 +@samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
10493 @samp{sb1},
10494 @samp{sr71000},
10495 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
10496
10497
10498
10499 1.1 src/patchsets/gcc/4.3.6/gentoo/77_all_mips-r10k-support-for-atomic-memory-fixes.patch
10500
10501 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/77_all_mips-r10k-support-for-atomic-memory-fixes.patch?rev=1.1&view=markup
10502 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/77_all_mips-r10k-support-for-atomic-memory-fixes.patch?rev=1.1&content-type=text/plain
10503
10504 Index: 77_all_mips-r10k-support-for-atomic-memory-fixes.patch
10505 ===================================================================
10506 backport from gcc-4.4
10507
10508 http://bugs.gentoo.org/247129
10509
10510 --- gcc-4.3.2/gcc/config/mips/mips-protos.h
10511 +++ gcc-4.3.2/gcc/config/mips/mips-protos.h
10512 @@ -278,6 +278,7 @@ extern const char *mips_output_load_labe
10513 extern const char *mips_output_conditional_branch (rtx, rtx *, const char *,
10514 const char *);
10515 extern const char *mips_output_order_conditional_branch (rtx, rtx *, bool);
10516 +extern const char *mips_output_sync_loop (const char *);
10517 extern const char *mips_output_division (const char *, rtx *);
10518 extern unsigned int mips_hard_regno_nregs (int, enum machine_mode);
10519 extern bool mips_linked_madd_p (rtx, rtx);
10520 --- gcc-4.3.2/gcc/config/mips/mips.c
10521 +++ gcc-4.3.2/gcc/config/mips/mips.c
10522 @@ -6253,6 +6253,7 @@ mips_print_operand_reloc (FILE *file, rt
10523 '#' Print a nop if in a ".set noreorder" block.
10524 '/' Like '#', but do nothing within a delayed-branch sequence.
10525 '?' Print "l" if mips_branch_likely is true
10526 + '~' Print a nop if mips_branch_likely is true
10527 '.' Print the name of the register with a hard-wired zero (zero or $0).
10528 '@' Print the name of the assembler temporary register (at or $1).
10529 '^' Print the name of the pic call-through register (t9 or $25).
10530 @@ -6327,6 +6328,11 @@ mips_print_operand_punctuation (FILE *fi
10531 putc ('l', file);
10532 break;
10533
10534 + case '~':
10535 + if (mips_branch_likely)
10536 + fputs ("\n\tnop", file);
10537 + break;
10538 +
10539 case '.':
10540 fputs (reg_names[GP_REG_FIRST + 0], file);
10541 break;
10542 @@ -6370,7 +6376,7 @@ mips_init_print_operand_punct (void)
10543 {
10544 const char *p;
10545
10546 - for (p = "()[]<>*#/?.@^+$|-"; *p; p++)
10547 + for (p = "()[]<>*#/?~.@^+$|-"; *p; p++)
10548 mips_print_operand_punct[(unsigned char) *p] = true;
10549 }
10550
10551 @@ -9375,6 +9381,17 @@ mips_output_order_conditional_branch (rt
10552 return mips_output_conditional_branch (insn, operands, branch[1], branch[0]);
10553 }
10554
10555 +/* Return the assembly code for __sync_*() loop LOOP. The loop should support
10556 + both normal and likely branches, using %? and %~ where appropriate. */
10557 +
10558 +const char *
10559 +mips_output_sync_loop (const char *loop)
10560 +{
10561 + /* Use branch-likely instructions to work around the LL/SC R10000 errata. */
10562 + mips_branch_likely = TARGET_FIX_R10000;
10563 + return loop;
10564 +}
10565 +
10566 /* Return the assembly code for DIV or DDIV instruction DIVISION, which has
10567 the operands given by OPERANDS. Add in a divide-by-zero check if needed.
10568
10569 @@ -12710,6 +12727,24 @@ mips_override_options (void)
10570 && mips_matching_cpu_name_p (mips_arch_info->name, "r4400"))
10571 target_flags |= MASK_FIX_R4400;
10572
10573 + /* Default to working around R10000 errata only if the processor
10574 + was selected explicitly. */
10575 + if ((target_flags_explicit & MASK_FIX_R10000) == 0
10576 + && mips_matching_cpu_name_p (mips_arch_info->name, "r10000"))
10577 + target_flags |= MASK_FIX_R10000;
10578 +
10579 + /* Make sure that branch-likely instructions available when using
10580 + -mfix-r10000. The instructions are not available if either:
10581 +
10582 + 1. -mno-branch-likely was passed.
10583 + 2. The selected ISA does not support branch-likely and
10584 + the command line does not include -mbranch-likely. */
10585 + if (TARGET_FIX_R10000
10586 + && ((target_flags_explicit & MASK_BRANCHLIKELY) == 0
10587 + ? !ISA_HAS_BRANCHLIKELY
10588 + : !TARGET_BRANCHLIKELY))
10589 + sorry ("%qs requires branch-likely instructions", "-mfix-r10000");
10590 +
10591 /* Save base state of options. */
10592 mips_base_mips16 = TARGET_MIPS16;
10593 mips_base_target_flags = target_flags;
10594 --- gcc-4.3.2/gcc/config/mips/mips.h
10595 +++ gcc-4.3.2/gcc/config/mips/mips.h
10596 @@ -2911,7 +2911,7 @@ while (0)
10597 "\tbne\t%0,%z2,2f\n" \
10598 "\t" OP "\t%@,%3\n" \
10599 "\tsc" SUFFIX "\t%@,%1\n" \
10600 - "\tbeq\t%@,%.,1b\n" \
10601 + "\tbeq%?\t%@,%.,1b\n" \
10602 "\tnop\n" \
10603 "2:\tsync%-%]%>%)"
10604
10605 @@ -2926,7 +2926,7 @@ while (0)
10606 "1:\tll" SUFFIX "\t%@,%0\n" \
10607 "\t" INSN "\t%@,%@,%1\n" \
10608 "\tsc" SUFFIX "\t%@,%0\n" \
10609 - "\tbeq\t%@,%.,1b\n" \
10610 + "\tbeq%?\t%@,%.,1b\n" \
10611 "\tnop\n" \
10612 "\tsync%-%]%>%)"
10613
10614 @@ -2943,7 +2943,7 @@ while (0)
10615 "1:\tll" SUFFIX "\t%0,%1\n" \
10616 "\t" INSN "\t%@,%0,%2\n" \
10617 "\tsc" SUFFIX "\t%@,%1\n" \
10618 - "\tbeq\t%@,%.,1b\n" \
10619 + "\tbeq%?\t%@,%.,1b\n" \
10620 "\tnop\n" \
10621 "\tsync%-%]%>%)"
10622
10623 @@ -2960,7 +2960,7 @@ while (0)
10624 "1:\tll" SUFFIX "\t%0,%1\n" \
10625 "\t" INSN "\t%@,%0,%2\n" \
10626 "\tsc" SUFFIX "\t%@,%1\n" \
10627 - "\tbeq\t%@,%.,1b\n" \
10628 + "\tbeq%?\t%@,%.,1b%~\n" \
10629 "\t" INSN "\t%0,%0,%2\n" \
10630 "\tsync%-%]%>%)"
10631
10632 @@ -2977,7 +2977,7 @@ while (0)
10633 "\tnor\t%@,%@,%.\n" \
10634 "\t" INSN "\t%@,%@,%1\n" \
10635 "\tsc" SUFFIX "\t%@,%0\n" \
10636 - "\tbeq\t%@,%.,1b\n" \
10637 + "\tbeq%?\t%@,%.,1b\n" \
10638 "\tnop\n" \
10639 "\tsync%-%]%>%)"
10640
10641 @@ -2996,7 +2996,7 @@ while (0)
10642 "\tnor\t%@,%0,%.\n" \
10643 "\t" INSN "\t%@,%@,%2\n" \
10644 "\tsc" SUFFIX "\t%@,%1\n" \
10645 - "\tbeq\t%@,%.,1b\n" \
10646 + "\tbeq%?\t%@,%.,1b\n" \
10647 "\tnop\n" \
10648 "\tsync%-%]%>%)"
10649
10650 @@ -3015,7 +3015,7 @@ while (0)
10651 "\tnor\t%0,%0,%.\n" \
10652 "\t" INSN "\t%@,%0,%2\n" \
10653 "\tsc" SUFFIX "\t%@,%1\n" \
10654 - "\tbeq\t%@,%.,1b\n" \
10655 + "\tbeq%?\t%@,%.,1b%~\n" \
10656 "\t" INSN "\t%0,%0,%2\n" \
10657 "\tsync%-%]%>%)"
10658
10659 @@ -3033,7 +3033,7 @@ while (0)
10660 "1:\tll" SUFFIX "\t%0,%1\n" \
10661 "\t" OP "\t%@,%2\n" \
10662 "\tsc" SUFFIX "\t%@,%1\n" \
10663 - "\tbeq\t%@,%.,1b\n" \
10664 + "\tbeq%?\t%@,%.,1b\n" \
10665 "\tnop\n" \
10666 "\tsync%-%]%>%)"
10667
10668 --- gcc-4.3.2/gcc/config/mips/mips.md
10669 +++ gcc-4.3.2/gcc/config/mips/mips.md
10670 @@ -4449,9 +4449,9 @@
10671 "GENERATE_LL_SC"
10672 {
10673 if (which_alternative == 0)
10674 - return MIPS_COMPARE_AND_SWAP ("<d>", "li");
10675 + return mips_output_sync_loop (MIPS_COMPARE_AND_SWAP ("<d>", "li"));
10676 else
10677 - return MIPS_COMPARE_AND_SWAP ("<d>", "move");
10678 + return mips_output_sync_loop (MIPS_COMPARE_AND_SWAP ("<d>", "move"));
10679 }
10680 [(set_attr "length" "32")])
10681
10682 @@ -4464,9 +4464,9 @@
10683 "GENERATE_LL_SC"
10684 {
10685 if (which_alternative == 0)
10686 - return MIPS_SYNC_OP ("<d>", "<d>addiu");
10687 + return mips_output_sync_loop (MIPS_SYNC_OP ("<d>", "<d>addiu"));
10688 else
10689 - return MIPS_SYNC_OP ("<d>", "<d>addu");
10690 + return mips_output_sync_loop (MIPS_SYNC_OP ("<d>", "<d>addu"));
10691 }
10692 [(set_attr "length" "28")])
10693
10694 @@ -4478,7 +4478,7 @@
10695 UNSPEC_SYNC_OLD_OP))]
10696 "GENERATE_LL_SC"
10697 {
10698 - return MIPS_SYNC_OP ("<d>", "<d>subu");
10699 + return mips_output_sync_loop (MIPS_SYNC_OP ("<d>", "<d>subu"));
10700 }
10701 [(set_attr "length" "28")])
10702
10703 @@ -4493,9 +4493,9 @@
10704 "GENERATE_LL_SC"
10705 {
10706 if (which_alternative == 0)
10707 - return MIPS_SYNC_OLD_OP ("<d>", "<d>addiu");
10708 + return mips_output_sync_loop (MIPS_SYNC_OLD_OP ("<d>", "<d>addiu"));
10709 else
10710 - return MIPS_SYNC_OLD_OP ("<d>", "<d>addu");
10711 + return mips_output_sync_loop (MIPS_SYNC_OLD_OP ("<d>", "<d>addu"));
10712 }
10713 [(set_attr "length" "28")])
10714
10715 @@ -4509,7 +4509,7 @@
10716 UNSPEC_SYNC_OLD_OP))]
10717 "GENERATE_LL_SC"
10718 {
10719 - return MIPS_SYNC_OLD_OP ("<d>", "<d>subu");
10720 + return mips_output_sync_loop (MIPS_SYNC_OLD_OP ("<d>", "<d>subu"));
10721 }
10722 [(set_attr "length" "28")])
10723
10724 @@ -4524,9 +4524,9 @@
10725 "GENERATE_LL_SC"
10726 {
10727 if (which_alternative == 0)
10728 - return MIPS_SYNC_NEW_OP ("<d>", "<d>addiu");
10729 + return mips_output_sync_loop (MIPS_SYNC_NEW_OP ("<d>", "<d>addiu"));
10730 else
10731 - return MIPS_SYNC_NEW_OP ("<d>", "<d>addu");
10732 + return mips_output_sync_loop (MIPS_SYNC_NEW_OP ("<d>", "<d>addu"));
10733 }
10734 [(set_attr "length" "28")])
10735
10736 @@ -4540,7 +4540,7 @@
10737 UNSPEC_SYNC_NEW_OP))]
10738 "GENERATE_LL_SC"
10739 {
10740 - return MIPS_SYNC_NEW_OP ("<d>", "<d>subu");
10741 + return mips_output_sync_loop (MIPS_SYNC_NEW_OP ("<d>", "<d>subu"));
10742 }
10743 [(set_attr "length" "28")])
10744
10745 @@ -4553,9 +4553,9 @@
10746 "GENERATE_LL_SC"
10747 {
10748 if (which_alternative == 0)
10749 - return MIPS_SYNC_OP ("<d>", "<immediate_insn>");
10750 + return mips_output_sync_loop (MIPS_SYNC_OP ("<d>", "<immediate_insn>"));
10751 else
10752 - return MIPS_SYNC_OP ("<d>", "<insn>");
10753 + return mips_output_sync_loop (MIPS_SYNC_OP ("<d>", "<insn>"));
10754 }
10755 [(set_attr "length" "28")])
10756
10757 @@ -4570,9 +4570,9 @@
10758 "GENERATE_LL_SC"
10759 {
10760 if (which_alternative == 0)
10761 - return MIPS_SYNC_OLD_OP ("<d>", "<immediate_insn>");
10762 + return mips_output_sync_loop (MIPS_SYNC_OLD_OP ("<d>", "<immediate_insn>"));
10763 else
10764 - return MIPS_SYNC_OLD_OP ("<d>", "<insn>");
10765 + return mips_output_sync_loop (MIPS_SYNC_OLD_OP ("<d>", "<insn>"));
10766 }
10767 [(set_attr "length" "28")])
10768
10769 @@ -4587,9 +4587,10 @@
10770 "GENERATE_LL_SC"
10771 {
10772 if (which_alternative == 0)
10773 - return MIPS_SYNC_NEW_OP ("<d>", "<immediate_insn>");
10774 + return (mips_output_sync_loop
10775 + (MIPS_SYNC_NEW_OP ("<d>", "<immediate_insn>")));
10776 else
10777 - return MIPS_SYNC_NEW_OP ("<d>", "<insn>");
10778 + return mips_output_sync_loop (MIPS_SYNC_NEW_OP ("<d>", "<insn>"));
10779 }
10780 [(set_attr "length" "28")])
10781
10782 @@ -4600,9 +4601,9 @@
10783 "GENERATE_LL_SC"
10784 {
10785 if (which_alternative == 0)
10786 - return MIPS_SYNC_NAND ("<d>", "andi");
10787 + return mips_output_sync_loop (MIPS_SYNC_NAND ("<d>", "andi"));
10788 else
10789 - return MIPS_SYNC_NAND ("<d>", "and");
10790 + return mips_output_sync_loop (MIPS_SYNC_NAND ("<d>", "and"));
10791 }
10792 [(set_attr "length" "32")])
10793
10794 @@ -4615,9 +4616,9 @@
10795 "GENERATE_LL_SC"
10796 {
10797 if (which_alternative == 0)
10798 - return MIPS_SYNC_OLD_NAND ("<d>", "andi");
10799 + return mips_output_sync_loop (MIPS_SYNC_OLD_NAND ("<d>", "andi"));
10800 else
10801 - return MIPS_SYNC_OLD_NAND ("<d>", "and");
10802 + return mips_output_sync_loop (MIPS_SYNC_OLD_NAND ("<d>", "and"));
10803 }
10804 [(set_attr "length" "32")])
10805
10806 @@ -4630,9 +4631,9 @@
10807 "GENERATE_LL_SC"
10808 {
10809 if (which_alternative == 0)
10810 - return MIPS_SYNC_NEW_NAND ("<d>", "andi");
10811 + return mips_output_sync_loop (MIPS_SYNC_NEW_NAND ("<d>", "andi"));
10812 else
10813 - return MIPS_SYNC_NEW_NAND ("<d>", "and");
10814 + return mips_output_sync_loop (MIPS_SYNC_NEW_NAND ("<d>", "and"));
10815 }
10816 [(set_attr "length" "32")])
10817
10818 @@ -4645,9 +4646,9 @@
10819 "GENERATE_LL_SC"
10820 {
10821 if (which_alternative == 0)
10822 - return MIPS_SYNC_EXCHANGE ("<d>", "li");
10823 + return mips_output_sync_loop (MIPS_SYNC_EXCHANGE ("<d>", "li"));
10824 else
10825 - return MIPS_SYNC_EXCHANGE ("<d>", "move");
10826 + return mips_output_sync_loop (MIPS_SYNC_EXCHANGE ("<d>", "move"));
10827 }
10828 [(set_attr "length" "24")])
10829
10830 --- gcc-4.3.2/gcc/config/mips/mips.opt
10831 +++ gcc-4.3.2/gcc/config/mips/mips.opt
10832 @@ -112,6 +112,10 @@ mfix-r4400
10833 Target Report Mask(FIX_R4400)
10834 Work around certain R4400 errata
10835
10836 +mfix-r10000
10837 +Target Report Mask(FIX_R10000)
10838 +Work around certain R10000 errata
10839 +
10840 mfix-sb1
10841 Target Report Var(TARGET_FIX_SB1)
10842 Work around errata for early SB-1 revision 2 cores
10843 --- gcc-4.3.2/gcc/doc/invoke.texi
10844 +++ gcc-4.3.2/gcc/doc/invoke.texi
10845 @@ -641,8 +641,8 @@ Objective-C and Objective-C++ Dialects}.
10846 -mmemcpy -mno-memcpy -mlong-calls -mno-long-calls @gol
10847 -mmad -mno-mad -mfused-madd -mno-fused-madd -nocpp @gol
10848 -mfix-r4000 -mno-fix-r4000 -mfix-r4400 -mno-fix-r4400 @gol
10849 --mfix-vr4120 -mno-fix-vr4120 -mfix-vr4130 -mno-fix-vr4130 @gol
10850 --mfix-sb1 -mno-fix-sb1 @gol
10851 +-mfix-r10000 -mno-fix-r10000 -mfix-vr4120 -mno-fix-vr4120 @gol
10852 +-mfix-vr4130 -mno-fix-vr4130 -mfix-sb1 -mno-fix-sb1 @gol
10853 -mflush-func=@var{func} -mno-flush-func @gol
10854 -mbranch-cost=@var{num} -mbranch-likely -mno-branch-likely @gol
10855 -mfp-exceptions -mno-fp-exceptions @gol
10856 @@ -12427,6 +12427,22 @@ A double-word or a variable shift may gi
10857 immediately after starting an integer division.
10858 @end itemize
10859
10860 +@item -mfix-r10000
10861 +@itemx -mno-fix-r10000
10862 +@opindex mfix-r10000
10863 +@opindex mno-fix-r10000
10864 +Work around certain R10000 errata:
10865 +@itemize @minus
10866 +@item
10867 +@code{ll}/@code{sc} sequences may not behave atomically on revisions
10868 +prior to 3.0. They may deadlock on revisions 2.6 and earlier.
10869 +@end itemize
10870 +
10871 +This option can only be used if the target architecture supports
10872 +branch-likely instructions. @option{-mfix-r10000} is the default when
10873 +@option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
10874 +otherwise.
10875 +
10876 @item -mfix-vr4120
10877 @itemx -mno-fix-vr4120
10878 @opindex mfix-vr4120
10879 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-1.c
10880 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-1.c
10881 @@ -0,0 +1,21 @@
10882 +/* { dg-do compile } */
10883 +/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */
10884 +/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
10885 +
10886 +NOMIPS16 int
10887 +f1 (int *z)
10888 +{
10889 + return __sync_fetch_and_add (z, 42);
10890 +}
10891 +
10892 +NOMIPS16 short
10893 +f2 (short *z)
10894 +{
10895 + return __sync_fetch_and_add (z, 42);
10896 +}
10897 +
10898 +NOMIPS16 char
10899 +f3 (char *z)
10900 +{
10901 + return __sync_fetch_and_add (z, 42);
10902 +}
10903 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-10.c
10904 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-10.c
10905 @@ -0,0 +1,21 @@
10906 +/* { dg-do compile } */
10907 +/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */
10908 +/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
10909 +
10910 +NOMIPS16 int
10911 +f1 (int *z)
10912 +{
10913 + return __sync_and_and_fetch (z, 42);
10914 +}
10915 +
10916 +NOMIPS16 short
10917 +f2 (short *z)
10918 +{
10919 + return __sync_and_and_fetch (z, 42);
10920 +}
10921 +
10922 +NOMIPS16 char
10923 +f3 (char *z)
10924 +{
10925 + return __sync_and_and_fetch (z, 42);
10926 +}
10927 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-11.c
10928 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-11.c
10929 @@ -0,0 +1,21 @@
10930 +/* { dg-do compile } */
10931 +/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */
10932 +/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
10933 +
10934 +NOMIPS16 int
10935 +f1 (int *z)
10936 +{
10937 + return __sync_xor_and_fetch (z, 42);
10938 +}
10939 +
10940 +NOMIPS16 short
10941 +f2 (short *z)
10942 +{
10943 + return __sync_xor_and_fetch (z, 42);
10944 +}
10945 +
10946 +NOMIPS16 char
10947 +f3 (char *z)
10948 +{
10949 + return __sync_xor_and_fetch (z, 42);
10950 +}
10951 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-12.c
10952 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-12.c
10953 @@ -0,0 +1,21 @@
10954 +/* { dg-do compile } */
10955 +/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */
10956 +/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
10957 +
10958 +NOMIPS16 int
10959 +f1 (int *z)
10960 +{
10961 + return __sync_nand_and_fetch (z, 42);
10962 +}
10963 +
10964 +NOMIPS16 short
10965 +f2 (short *z)
10966 +{
10967 + return __sync_nand_and_fetch (z, 42);
10968 +}
10969 +
10970 +NOMIPS16 char
10971 +f3 (char *z)
10972 +{
10973 + return __sync_nand_and_fetch (z, 42);
10974 +}
10975 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-13.c
10976 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-13.c
10977 @@ -0,0 +1,21 @@
10978 +/* { dg-do compile } */
10979 +/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */
10980 +/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
10981 +
10982 +NOMIPS16 int
10983 +f1 (int *z)
10984 +{
10985 + return __sync_bool_compare_and_swap (z, 0, 42);
10986 +}
10987 +
10988 +NOMIPS16 short
10989 +f2 (short *z)
10990 +{
10991 + return __sync_bool_compare_and_swap (z, 0, 42);
10992 +}
10993 +
10994 +NOMIPS16 char
10995 +f3 (char *z)
10996 +{
10997 + return __sync_bool_compare_and_swap (z, 0, 42);
10998 +}
10999 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-14.c
11000 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-14.c
11001 @@ -0,0 +1,21 @@
11002 +/* { dg-do compile } */
11003 +/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */
11004 +/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
11005 +
11006 +NOMIPS16 int
11007 +f1 (int *z)
11008 +{
11009 + return __sync_val_compare_and_swap (z, 0, 42);
11010 +}
11011 +
11012 +NOMIPS16 short
11013 +f2 (short *z)
11014 +{
11015 + return __sync_val_compare_and_swap (z, 0, 42);
11016 +}
11017 +
11018 +NOMIPS16 char
11019 +f3 (char *z)
11020 +{
11021 + return __sync_val_compare_and_swap (z, 0, 42);
11022 +}
11023 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-15.c
11024 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-15.c
11025 @@ -0,0 +1,33 @@
11026 +/* { dg-do compile } */
11027 +/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */
11028 +/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
11029 +
11030 +NOMIPS16 int
11031 +f1 (int *z)
11032 +{
11033 + int result;
11034 +
11035 + result = __sync_lock_test_and_set (z, 42);
11036 + __sync_lock_release (z);
11037 + return result;
11038 +}
11039 +
11040 +NOMIPS16 short
11041 +f2 (short *z)
11042 +{
11043 + short result;
11044 +
11045 + result = __sync_lock_test_and_set (z, 42);
11046 + __sync_lock_release (z);
11047 + return result;
11048 +}
11049 +
11050 +NOMIPS16 char
11051 +f3 (char *z)
11052 +{
11053 + char result;
11054 +
11055 + result = __sync_lock_test_and_set (z, 42);
11056 + __sync_lock_release (z);
11057 + return result;
11058 +}
11059 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-2.c
11060 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-2.c
11061 @@ -0,0 +1,21 @@
11062 +/* { dg-do compile } */
11063 +/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */
11064 +/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
11065 +
11066 +NOMIPS16 int
11067 +f1 (int *z, int amt)
11068 +{
11069 + return __sync_fetch_and_sub (z, amt);
11070 +}
11071 +
11072 +NOMIPS16 short
11073 +f2 (short *z, short amt)
11074 +{
11075 + return __sync_fetch_and_sub (z, amt);
11076 +}
11077 +
11078 +NOMIPS16 char
11079 +f3 (char *z, char amt)
11080 +{
11081 + return __sync_fetch_and_sub (z, amt);
11082 +}
11083 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-3.c
11084 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-3.c
11085 @@ -0,0 +1,21 @@
11086 +/* { dg-do compile } */
11087 +/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */
11088 +/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
11089 +
11090 +NOMIPS16 int
11091 +f1 (int *z)
11092 +{
11093 + return __sync_fetch_and_or (z, 42);
11094 +}
11095 +
11096 +NOMIPS16 short
11097 +f2 (short *z)
11098 +{
11099 + return __sync_fetch_and_or (z, 42);
11100 +}
11101 +
11102 +NOMIPS16 char
11103 +f3 (char *z)
11104 +{
11105 + return __sync_fetch_and_or (z, 42);
11106 +}
11107 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-4.c
11108 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-4.c
11109 @@ -0,0 +1,21 @@
11110 +/* { dg-do compile } */
11111 +/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */
11112 +/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
11113 +
11114 +NOMIPS16 int
11115 +f1 (int *z)
11116 +{
11117 + return __sync_fetch_and_and (z, 42);
11118 +}
11119 +
11120 +NOMIPS16 short
11121 +f2 (short *z)
11122 +{
11123 + return __sync_fetch_and_and (z, 42);
11124 +}
11125 +
11126 +NOMIPS16 char
11127 +f3 (char *z)
11128 +{
11129 + return __sync_fetch_and_and (z, 42);
11130 +}
11131 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-5.c
11132 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-5.c
11133 @@ -0,0 +1,21 @@
11134 +/* { dg-do compile } */
11135 +/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */
11136 +/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
11137 +
11138 +NOMIPS16 int
11139 +f1 (int *z)
11140 +{
11141 + return __sync_fetch_and_xor (z, 42);
11142 +}
11143 +
11144 +NOMIPS16 short
11145 +f2 (short *z)
11146 +{
11147 + return __sync_fetch_and_xor (z, 42);
11148 +}
11149 +
11150 +NOMIPS16 char
11151 +f3 (char *z)
11152 +{
11153 + return __sync_fetch_and_xor (z, 42);
11154 +}
11155 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-6.c
11156 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-6.c
11157 @@ -0,0 +1,21 @@
11158 +/* { dg-do compile } */
11159 +/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */
11160 +/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
11161 +
11162 +NOMIPS16 int
11163 +f1 (int *z)
11164 +{
11165 + return __sync_fetch_and_nand (z, 42);
11166 +}
11167 +
11168 +NOMIPS16 short
11169 +f2 (short *z)
11170 +{
11171 + return __sync_fetch_and_nand (z, 42);
11172 +}
11173 +
11174 +NOMIPS16 char
11175 +f3 (char *z)
11176 +{
11177 + return __sync_fetch_and_nand (z, 42);
11178 +}
11179 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-7.c
11180 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-7.c
11181 @@ -0,0 +1,21 @@
11182 +/* { dg-do compile } */
11183 +/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */
11184 +/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
11185 +
11186 +NOMIPS16 int
11187 +f1 (int *z)
11188 +{
11189 + return __sync_add_and_fetch (z, 42);
11190 +}
11191 +
11192 +NOMIPS16 short
11193 +f2 (short *z)
11194 +{
11195 + return __sync_add_and_fetch (z, 42);
11196 +}
11197 +
11198 +NOMIPS16 char
11199 +f3 (char *z)
11200 +{
11201 + return __sync_add_and_fetch (z, 42);
11202 +}
11203 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-8.c
11204 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-8.c
11205 @@ -0,0 +1,21 @@
11206 +/* { dg-do compile } */
11207 +/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */
11208 +/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
11209 +
11210 +NOMIPS16 int
11211 +f1 (int *z, int amt)
11212 +{
11213 + return __sync_sub_and_fetch (z, amt);
11214 +}
11215 +
11216 +NOMIPS16 short
11217 +f2 (short *z, short amt)
11218 +{
11219 + return __sync_sub_and_fetch (z, amt);
11220 +}
11221 +
11222 +NOMIPS16 char
11223 +f3 (char *z, char amt)
11224 +{
11225 + return __sync_sub_and_fetch (z, amt);
11226 +}
11227 --- gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-9.c
11228 +++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-9.c
11229 @@ -0,0 +1,21 @@
11230 +/* { dg-do compile } */
11231 +/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */
11232 +/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
11233 +
11234 +NOMIPS16 int
11235 +f1 (int *z)
11236 +{
11237 + return __sync_or_and_fetch (z, 42);
11238 +}
11239 +
11240 +NOMIPS16 short
11241 +f2 (short *z)
11242 +{
11243 + return __sync_or_and_fetch (z, 42);
11244 +}
11245 +
11246 +NOMIPS16 char
11247 +f3 (char *z)
11248 +{
11249 + return __sync_or_and_fetch (z, 42);
11250 +}
11251
11252
11253
11254 1.1 src/patchsets/gcc/4.3.6/gentoo/78_all_mips-constant-addr.patch
11255
11256 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/78_all_mips-constant-addr.patch?rev=1.1&view=markup
11257 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/78_all_mips-constant-addr.patch?rev=1.1&content-type=text/plain
11258
11259 Index: 78_all_mips-constant-addr.patch
11260 ===================================================================
11261 http://bugs.gentoo.org/257054
11262
11263 MIPS: smarter code for constant addresses
11264
11265 See http://gcc.gnu.org/ml/gcc/2008-11/msg00231.html
11266
11267 Backport of the original patch (by Richard Sandiford) to 4.3.2/4.3.3
11268
11269 --- a/gcc/config/mips/mips.c.orig 2009-01-21 08:54:56.526374343 +0100
11270 +++ b/gcc/config/mips/mips.c 2009-01-21 08:55:03.229865079 +0100
11271 @@ -2481,7 +2481,26 @@ mips_legitimize_tls_address (rtx loc)
11272 }
11273 return dest;
11274 }
11275 -
11276 +
11277 +/* Return true if, for every base register BASE_REG, (plus BASE_REG X)
11278 + can address a value of mode MODE. */
11279 +
11280 +static bool
11281 +mips_valid_offset_p (rtx x, enum machine_mode mode)
11282 +{
11283 + /* Check that X is a signed 16-bit number. */
11284 + if (!const_arith_operand (x, Pmode))
11285 + return false;
11286 +
11287 + /* We may need to split multiword moves, so make sure that every word
11288 + is accessible. */
11289 + if (GET_MODE_SIZE (mode) > UNITS_PER_WORD
11290 + && !SMALL_OPERAND (INTVAL (x) + GET_MODE_SIZE (mode) - UNITS_PER_WORD))
11291 + return false;
11292 +
11293 + return true;
11294 +}
11295 +
11296 /* This function is used to implement LEGITIMIZE_ADDRESS. If *XLOC can
11297 be legitimized in a way that the generic machinery might not expect,
11298 put the new address in *XLOC and return true. MODE is the mode of
11299 @@ -2491,7 +2510,7 @@ bool
11300 mips_legitimize_address (rtx *xloc, enum machine_mode mode)
11301 {
11302 rtx base;
11303 - HOST_WIDE_INT offset;
11304 + HOST_WIDE_INT intval, high, offset;
11305
11306 if (mips_tls_symbol_p (*xloc))
11307 {
11308 @@ -2512,6 +2531,33 @@ mips_legitimize_address (rtx *xloc, enum
11309 *xloc = mips_add_offset (NULL, base, offset);
11310 return true;
11311 }
11312 +
11313 + /* Handle references to constant addresses by loading the high part
11314 + into a register and using an offset for the low part. */
11315 + if (GET_CODE (base) == CONST_INT)
11316 + {
11317 + intval = INTVAL (base);
11318 + high = trunc_int_for_mode (CONST_HIGH_PART (intval), Pmode);
11319 + offset = CONST_LOW_PART (intval);
11320 + /* Ignore cases in which a positive address would be accessed by a
11321 + negative offset from a negative address. The required wraparound
11322 + does not occur for 32-bit addresses on 64-bit targets, and it is
11323 + very unlikely that such an access would occur in real code anyway.
11324 +
11325 + If the low offset is not legitimate for MODE, prefer to load
11326 + the constant normally, instead of using mips_force_address on
11327 + the legitimized address. The latter option would cause us to
11328 + use (D)ADDIU unconditionally, but LUI/ORI is more efficient
11329 + than LUI/ADDIU on some targets. */
11330 + if ((intval < 0 || high > 0)
11331 + && mips_valid_offset_p (GEN_INT (offset), mode))
11332 + {
11333 + base = mips_force_temporary (NULL, GEN_INT (high));
11334 + *xloc = plus_constant (base, offset);
11335 + return true;
11336 + }
11337 + }
11338 +
11339 return false;
11340 }
11341
11342
11343
11344
11345 1.1 src/patchsets/gcc/4.3.6/gentoo/79_all_arm_PR37436.patch
11346
11347 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/79_all_arm_PR37436.patch?rev=1.1&view=markup
11348 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/79_all_arm_PR37436.patch?rev=1.1&content-type=text/plain
11349
11350 Index: 79_all_arm_PR37436.patch
11351 ===================================================================
11352 Backport from gcc-4.4 to fix bug #265367
11353
11354 http://gcc.gnu.org/PR37436
11355
11356 Index: gcc/config/arm/arm.c
11357 ===================================================================
11358 --- gcc/config/arm/arm.c (revision 142777)
11359 +++ gcc/config/arm/arm.c (revision 142778)
11360 @@ -3844,6 +3844,7 @@
11361 rtx xop1 = XEXP (x, 1);
11362
11363 return ((arm_address_register_rtx_p (xop0, strict_p)
11364 + && GET_CODE(xop1) == CONST_INT
11365 && arm_legitimate_index_p (mode, xop1, outer, strict_p))
11366 || (arm_address_register_rtx_p (xop1, strict_p)
11367 && arm_legitimate_index_p (mode, xop0, outer, strict_p)));
11368 Index: gcc/config/arm/predicates.md
11369 ===================================================================
11370 --- gcc/config/arm/predicates.md (revision 142777)
11371 +++ gcc/config/arm/predicates.md (revision 142778)
11372 @@ -234,6 +234,10 @@
11373 (match_test "arm_legitimate_address_p (mode, XEXP (op, 0), SIGN_EXTEND,
11374 0)")))
11375
11376 +(define_special_predicate "arm_reg_or_extendqisi_mem_op"
11377 + (ior (match_operand 0 "arm_extendqisi_mem_op")
11378 + (match_operand 0 "s_register_operand")))
11379 +
11380 (define_predicate "power_of_two_operand"
11381 (match_code "const_int")
11382 {
11383 Index: gcc/config/arm/arm.md
11384 ===================================================================
11385 --- gcc/config/arm/arm.md (revision 142777)
11386 +++ gcc/config/arm/arm.md (revision 142778)
11387 @@ -4299,7 +4299,7 @@
11388
11389 (define_expand "extendqihi2"
11390 [(set (match_dup 2)
11391 - (ashift:SI (match_operand:QI 1 "general_operand" "")
11392 + (ashift:SI (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "")
11393 (const_int 24)))
11394 (set (match_operand:HI 0 "s_register_operand" "")
11395 (ashiftrt:SI (match_dup 2)
11396 @@ -4324,7 +4324,7 @@
11397
11398 (define_insn "*arm_extendqihi_insn"
11399 [(set (match_operand:HI 0 "s_register_operand" "=r")
11400 - (sign_extend:HI (match_operand:QI 1 "memory_operand" "Uq")))]
11401 + (sign_extend:HI (match_operand:QI 1 "arm_extendqisi_mem_op" "Uq")))]
11402 "TARGET_ARM && arm_arch4"
11403 "ldr%(sb%)\\t%0, %1"
11404 [(set_attr "type" "load_byte")
11405 @@ -4335,7 +4335,7 @@
11406
11407 (define_expand "extendqisi2"
11408 [(set (match_dup 2)
11409 - (ashift:SI (match_operand:QI 1 "general_operand" "")
11410 + (ashift:SI (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "")
11411 (const_int 24)))
11412 (set (match_operand:SI 0 "s_register_operand" "")
11413 (ashiftrt:SI (match_dup 2)
11414 @@ -4367,7 +4367,7 @@
11415
11416 (define_insn "*arm_extendqisi"
11417 [(set (match_operand:SI 0 "s_register_operand" "=r")
11418 - (sign_extend:SI (match_operand:QI 1 "memory_operand" "Uq")))]
11419 + (sign_extend:SI (match_operand:QI 1 "arm_extendqisi_mem_op" "Uq")))]
11420 "TARGET_ARM && arm_arch4 && !arm_arch6"
11421 "ldr%(sb%)\\t%0, %1"
11422 [(set_attr "type" "load_byte")
11423 @@ -4378,7 +4378,8 @@
11424
11425 (define_insn "*arm_extendqisi_v6"
11426 [(set (match_operand:SI 0 "s_register_operand" "=r,r")
11427 - (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,Uq")))]
11428 + (sign_extend:SI
11429 + (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "r,Uq")))]
11430 "TARGET_ARM && arm_arch6"
11431 "@
11432 sxtb%?\\t%0, %1
11433
11434
11435
11436 1.1 src/patchsets/gcc/4.3.6/gentoo/80_all_sparc-biarch.patch
11437
11438 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/80_all_sparc-biarch.patch?rev=1.1&view=markup
11439 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/80_all_sparc-biarch.patch?rev=1.1&content-type=text/plain
11440
11441 Index: 80_all_sparc-biarch.patch
11442 ===================================================================
11443 add support for "--enable-targets=all" to sparc*-*-linux-* just like for
11444 powerpc and x86
11445
11446 http://bugs.gentoo.org/214765
11447
11448 the bulk of this patch is removing the duplicated linux bits from the sparc
11449 headers and using the gcc/linux.h work
11450
11451 --- gcc/config.gcc
11452 +++ gcc/config.gcc
11453 @@ -355,7 +355,7 @@
11454 score*-*-*)
11455 cpu_type=score
11456 ;;
11457 -sparc64*-*-*)
11458 +sparc*-*-*)
11459 cpu_type=sparc
11460 need_64bit_hwint=yes
11461 ;;
11462 @@ -2337,9 +2337,15 @@
11463 use_fixproto=yes
11464 ;;
11465 sparc-*-linux*) # SPARC's running GNU/Linux, libc6
11466 - tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/gas.h sparc/linux.h"
11467 + tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/gas.h linux.h"
11468 extra_options="${extra_options} sparc/long-double-switch.opt"
11469 - tmake_file="${tmake_file} sparc/t-linux sparc/t-crtfm"
11470 + if test x$enable_targets = xall; then
11471 + tm_file="sparc/biarch64.h ${tm_file} sparc/linux64.h"
11472 + tmake_file="${tmake_file} sparc/t-linux64 sparc/t-crtfm"
11473 + else
11474 + tm_file="${tm_file} sparc/linux.h"
11475 + tmake_file="${tmake_file} sparc/t-linux sparc/t-crtfm"
11476 + fi
11477 ;;
11478 sparc-*-rtems*)
11479 tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h"
11480 @@ -2471,7 +2477,7 @@
11481 need_64bit_hwint=yes
11482 ;;
11483 sparc64-*-linux*) # 64-bit SPARC's running GNU/Linux
11484 - tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/gas.h sparc/linux64.h"
11485 + tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/gas.h linux.h sparc/linux64.h"
11486 extra_options="${extra_options} sparc/long-double-switch.opt"
11487 tmake_file="${tmake_file} sparc/t-linux sparc/t-linux64 sparc/t-crtfm"
11488 ;;
11489 --- gcc/config/sparc/linux.h
11490 +++ gcc/config/sparc/linux.h
11491 @@ -22,39 +22,12 @@
11492 #define TARGET_OS_CPP_BUILTINS() \
11493 do \
11494 { \
11495 - builtin_define_std ("unix"); \
11496 - builtin_define_std ("linux"); \
11497 - builtin_define ("__gnu_linux__"); \
11498 - builtin_assert ("system=linux"); \
11499 - builtin_assert ("system=unix"); \
11500 - builtin_assert ("system=posix"); \
11501 + LINUX_TARGET_OS_CPP_BUILTINS(); \
11502 if (TARGET_LONG_DOUBLE_128) \
11503 builtin_define ("__LONG_DOUBLE_128__"); \
11504 } \
11505 while (0)
11506
11507 -/* Don't assume anything about the header files. */
11508 -#define NO_IMPLICIT_EXTERN_C
11509 -
11510 -#undef MD_EXEC_PREFIX
11511 -#undef MD_STARTFILE_PREFIX
11512 -
11513 -/* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
11514 - the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
11515 - provides part of the support for getting C++ file-scope static
11516 - object constructed before entering `main'. */
11517 -
11518 -#undef STARTFILE_SPEC
11519 -#if defined HAVE_LD_PIE
11520 -#define STARTFILE_SPEC \
11521 - "%{!shared: %{pg|p:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}\
11522 - crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
11523 -#else
11524 -#define STARTFILE_SPEC \
11525 - "%{!shared: %{pg|p:gcrt1.o%s;:crt1.o%s}}\
11526 - crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
11527 -#endif
11528 -
11529 /* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on
11530 the GNU/Linux magical crtend.o file (see crtstuff.c) which
11531 provides part of the support for getting C++ file-scope static
11532 @@ -63,8 +36,8 @@
11533
11534 #undef ENDFILE_SPEC
11535 #define ENDFILE_SPEC \
11536 - "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
11537 - %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
11538 + "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s\
11539 + %{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
11540
11541 /* This is for -profile to use -lc_p instead of -lc. */
11542 #undef CC1_SPEC
11543 @@ -75,10 +48,6 @@
11544 %{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \
11545 "
11546
11547 -/* The GNU C++ standard library requires that these macros be defined. */
11548 -#undef CPLUSPLUS_CPP_SPEC
11549 -#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
11550 -
11551 #undef TARGET_VERSION
11552 #define TARGET_VERSION fprintf (stderr, " (sparc GNU/Linux with ELF)");
11553
11554 @@ -98,12 +67,6 @@
11555 #define CPP_SUBTARGET_SPEC \
11556 "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
11557
11558 -#undef LIB_SPEC
11559 -#define LIB_SPEC \
11560 - "%{pthread:-lpthread} \
11561 - %{shared:-lc} \
11562 - %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}"
11563 -
11564 /* Provide a LINK_SPEC appropriate for GNU/Linux. Here we provide support
11565 for the special GCC options -static and -shared, which allow us to
11566 link things in one of these three modes by applying the appropriate
11567 @@ -121,15 +84,6 @@
11568 /* If ELF is the default format, we should not use /lib/elf. */
11569
11570 #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
11571 -#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
11572 -#if UCLIBC_DEFAULT
11573 -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}"
11574 -#else
11575 -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:%{mglibc:%e-mglibc and -muclibc used together}" U ";:" G "}"
11576 -#endif
11577 -#define LINUX_DYNAMIC_LINKER \
11578 - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
11579 -
11580
11581 #undef LINK_SPEC
11582 #define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
11583 @@ -191,10 +145,6 @@
11584
11585 #undef DITF_CONVERSION_LIBFUNCS
11586 #define DITF_CONVERSION_LIBFUNCS 1
11587 -
11588 -#if defined(HAVE_LD_EH_FRAME_HDR)
11589 -#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
11590 -#endif
11591
11592 #ifdef HAVE_AS_TLS
11593 #undef TARGET_SUN_TLS
11594 @@ -203,31 +153,10 @@
11595 #define TARGET_GNU_TLS 1
11596 #endif
11597
11598 -/* Don't be different from other Linux platforms in this regard. */
11599 -#define HANDLE_PRAGMA_PACK_PUSH_POP
11600 -
11601 /* We use GNU ld so undefine this so that attribute((init_priority)) works. */
11602 #undef CTORS_SECTION_ASM_OP
11603 #undef DTORS_SECTION_ASM_OP
11604
11605 -/* Determine whether the entire c99 runtime is present in the
11606 - runtime library. */
11607 -#define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
11608 -
11609 -/* Whether we have sincos that follows the GNU extension. */
11610 -#define TARGET_HAS_SINCOS (OPTION_GLIBC)
11611 -
11612 -#define TARGET_POSIX_IO
11613 -
11614 -#undef LINK_GCC_C_SEQUENCE_SPEC
11615 -#define LINK_GCC_C_SEQUENCE_SPEC \
11616 - "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
11617 -
11618 -/* Use --as-needed -lgcc_s for eh support. */
11619 -#ifdef HAVE_LD_AS_NEEDED
11620 -#define USE_LD_AS_NEEDED 1
11621 -#endif
11622 -
11623 #define MD_UNWIND_SUPPORT "config/sparc/linux-unwind.h"
11624
11625 /* Linux currently uses RMO in uniprocessor mode, which is equivalent to
11626 --- gcc/config/sparc/linux64.h
11627 +++ gcc/config/sparc/linux64.h
11628 @@ -34,12 +34,6 @@
11629 } \
11630 while (0)
11631
11632 -/* Don't assume anything about the header files. */
11633 -#define NO_IMPLICIT_EXTERN_C
11634 -
11635 -#undef MD_EXEC_PREFIX
11636 -#undef MD_STARTFILE_PREFIX
11637 -
11638 #if TARGET_CPU_DEFAULT == TARGET_CPU_v9 \
11639 || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc \
11640 || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc3 \
11641 @@ -54,25 +48,10 @@
11642 + MASK_STACK_BIAS + MASK_APP_REGS + MASK_FPU + MASK_LONG_DOUBLE_128)
11643 #endif
11644
11645 -#undef ASM_CPU_DEFAULT_SPEC
11646 -#define ASM_CPU_DEFAULT_SPEC "-Av9a"
11647 -
11648 -/* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
11649 - the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
11650 - provides part of the support for getting C++ file-scope static
11651 - object constructed before entering `main'. */
11652 -
11653 -#undef STARTFILE_SPEC
11654 -
11655 -#ifdef HAVE_LD_PIE
11656 -#define STARTFILE_SPEC \
11657 - "%{!shared:%{pg|p:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}\
11658 - crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbeginS.o%s}"
11659 -#else
11660 -#define STARTFILE_SPEC \
11661 - "%{!shared:%{pg|p:gcrt1.o%s;:crt1.o%s}}\
11662 - crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbeginS.o%s}"
11663 -#endif
11664 +/* This must be v9a not just v9 because by default we enable
11665 + -mvis. */
11666 +#undef ASM_CPU64_DEFAULT_SPEC
11667 +#define ASM_CPU64_DEFAULT_SPEC "-Av9a"
11668
11669 /* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on
11670 the GNU/Linux magical crtend.o file (see crtstuff.c) which
11671 @@ -80,15 +59,10 @@
11672 GNU/Linux "finalizer" file, `crtn.o'. */
11673
11674 #undef ENDFILE_SPEC
11675 -
11676 #define ENDFILE_SPEC \
11677 "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s\
11678 %{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
11679
11680 -/* The GNU C++ standard library requires that these macros be defined. */
11681 -#undef CPLUSPLUS_CPP_SPEC
11682 -#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
11683 -
11684 #undef TARGET_VERSION
11685 #define TARGET_VERSION fprintf (stderr, " (sparc64 GNU/Linux with ELF)");
11686
11687 @@ -122,12 +96,6 @@
11688 %{pthread:-D_REENTRANT} \
11689 "
11690
11691 -#undef LIB_SPEC
11692 -#define LIB_SPEC \
11693 - "%{pthread:-lpthread} \
11694 - %{shared:-lc} \
11695 - %{!shared: %{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}"
11696 -
11697 /* Provide a LINK_SPEC appropriate for GNU/Linux. Here we provide support
11698 for the special GCC options -static and -shared, which allow us to
11699 link things in one of these three modes by applying the appropriate
11700 @@ -146,17 +114,6 @@
11701
11702 #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
11703 #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2"
11704 -#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
11705 -#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
11706 -#if UCLIBC_DEFAULT
11707 -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}"
11708 -#else
11709 -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:%{mglibc:%e-mglibc and -muclibc used together}" U ";:" G "}"
11710 -#endif
11711 -#define LINUX_DYNAMIC_LINKER32 \
11712 - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
11713 -#define LINUX_DYNAMIC_LINKER64 \
11714 - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
11715
11716 #ifdef SPARC_BI_ARCH
11717
11718 @@ -203,7 +160,7 @@
11719
11720 #undef CC1_SPEC
11721 #if DEFAULT_ARCH32_P
11722 -#define CC1_SPEC "\
11723 +#define CC1_SPEC "%{profile:-p} \
11724 %{sun4:} %{target:} \
11725 %{mcypress:-mcpu=cypress} \
11726 %{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \
11727 @@ -214,7 +171,7 @@
11728 %{!mno-vis:%{!mcpu=v9:-mvis}}} \
11729 "
11730 #else
11731 -#define CC1_SPEC "\
11732 +#define CC1_SPEC "%{profile:-p} \
11733 %{sun4:} %{target:} \
11734 %{mcypress:-mcpu=cypress} \
11735 %{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \
11736 @@ -325,9 +282,6 @@
11737 #undef DITF_CONVERSION_LIBFUNCS
11738 #define DITF_CONVERSION_LIBFUNCS 1
11739
11740 -#if defined(HAVE_LD_EH_FRAME_HDR)
11741 -#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
11742 -#endif
11743
11744 #ifdef HAVE_AS_TLS
11745 #undef TARGET_SUN_TLS
11746 @@ -336,31 +290,10 @@
11747 #define TARGET_GNU_TLS 1
11748 #endif
11749
11750 -/* Don't be different from other Linux platforms in this regard. */
11751 -#define HANDLE_PRAGMA_PACK_PUSH_POP
11752 -
11753 /* We use GNU ld so undefine this so that attribute((init_priority)) works. */
11754 #undef CTORS_SECTION_ASM_OP
11755 #undef DTORS_SECTION_ASM_OP
11756
11757 -/* Determine whether the entire c99 runtime is present in the
11758 - runtime library. */
11759 -#define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
11760 -
11761 -/* Whether we have sincos that follows the GNU extension. */
11762 -#define TARGET_HAS_SINCOS (OPTION_GLIBC)
11763 -
11764 -#define TARGET_POSIX_IO
11765 -
11766 -#undef LINK_GCC_C_SEQUENCE_SPEC
11767 -#define LINK_GCC_C_SEQUENCE_SPEC \
11768 - "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
11769 -
11770 -/* Use --as-needed -lgcc_s for eh support. */
11771 -#ifdef HAVE_LD_AS_NEEDED
11772 -#define USE_LD_AS_NEEDED 1
11773 -#endif
11774 -
11775 #define MD_UNWIND_SUPPORT "config/sparc/linux-unwind.h"
11776
11777 /* Linux currently uses RMO in uniprocessor mode, which is equivalent to
11778 --- libcpp/configure
11779 +++ libcpp/configure
11780 @@ -8308,9 +8308,7 @@
11781 powerpc*-*-* | \
11782 rs6000*-*-* | \
11783 s390*-*-* | \
11784 - sparc64*-*-* | ultrasparc-*-freebsd* | \
11785 - sparcv9-*-solaris2* | \
11786 - sparc-*-solaris2.[789] | sparc-*-solaris2.1[0-9]* | \
11787 + sparc*-*-* | \
11788 spu-*-* | \
11789 sh[123456789l]*-*-*)
11790 need_64bit_hwint=yes ;;
11791
11792
11793
11794 1.1 src/patchsets/gcc/4.3.6/gentoo/90_all_gcc-freebsd.patch
11795
11796 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/90_all_gcc-freebsd.patch?rev=1.1&view=markup
11797 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/90_all_gcc-freebsd.patch?rev=1.1&content-type=text/plain
11798
11799 Index: 90_all_gcc-freebsd.patch
11800 ===================================================================
11801 http://bugs.gentoo.org/192403
11802 http://gcc.gnu.org/PR33417
11803
11804 --- gcc-4.3.1/gcc/config/freebsd-spec.h
11805 +++ gcc-4.3.1/gcc/config/freebsd-spec.h
11806 @@ -56,6 +56,8 @@
11807 builtin_assert ("system=unix"); \
11808 builtin_assert ("system=bsd"); \
11809 builtin_assert ("system=FreeBSD"); \
11810 + if(!(flag_iso && (c_dialect_cxx () ? cxx_dialect == cxx98 : !flag_isoc99))) \
11811 + builtin_define("_LONGLONG"); \
11812 FBSD_TARGET_CPU_CPP_BUILTINS(); \
11813 } \
11814 while (0)
11815 --- gcc-4.3.1/gcc/config/t-freebsd-eh
11816 +++ gcc-4.3.1/gcc/config/t-freebsd-eh
11817 @@ -0,0 +1,4 @@
11818 +# Use unwind-dw2-fde-glibc
11819 +LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
11820 + $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c
11821 +LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
11822 --- gcc-4.3.1/gcc/config.gcc
11823 +++ gcc-4.3.1/gcc/config.gcc
11824 @@ -462,7 +462,7 @@
11825 # pleases around the provided core setting.
11826 gas=yes
11827 gnu_ld=yes
11828 - extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
11829 + extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
11830 fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
11831 tm_defines="${tm_defines} FBSD_MAJOR=${fbsd_major}"
11832 tmake_file="t-slibgcc-elf-ver t-freebsd"
11833 @@ -1116,6 +1116,10 @@
11834 ;;
11835 i[34567]86-*-freebsd*)
11836 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h"
11837 + fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
11838 + if test ${fbsd_major} -ge 7; then
11839 + tmake_file="${tmake_file} t-freebsd-eh"
11840 + fi
11841 ;;
11842 x86_64-*-freebsd*)
11843 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
11844 --- gcc-4.3.1/gcc/crtstuff.c
11845 +++ gcc-4.3.1/gcc/crtstuff.c
11846 @@ -90,13 +90,15 @@
11847 && !defined(OBJECT_FORMAT_FLAT) \
11848 && defined(HAVE_LD_EH_FRAME_HDR) \
11849 && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
11850 - && defined(__GLIBC__) && __GLIBC__ >= 2
11851 + && ((defined(__GLIBC__) && __GLIBC__ >= 2) \
11852 + || (defined(__FreeBSD_version) && __FreeBSD_version >= 700022))
11853 #include <link.h>
11854 /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h.
11855 But it doesn't use PT_GNU_EH_FRAME ELF segment currently. */
11856 # if !defined(__UCLIBC__) \
11857 - && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
11858 - || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
11859 + || (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
11860 + || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) \
11861 + || (__FreeBSD_version >= 700022)
11862 # define USE_PT_GNU_EH_FRAME
11863 # endif
11864 #endif
11865 --- gcc-4.3.1/gcc/unwind-dw2-fde-glibc.c
11866 +++ gcc-4.3.1/gcc/unwind-dw2-fde-glibc.c
11867 @@ -49,8 +49,9 @@
11868 #include "gthr.h"
11869
11870 #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
11871 - && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
11872 - || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
11873 + && ((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
11874 + || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) \
11875 + || (__FreeBSD_version >= 700022 ))
11876
11877 #ifndef __RELOC_POINTER
11878 # define __RELOC_POINTER(ptr, base) ((ptr) + (base))
11879 @@ -66,6 +67,13 @@
11880 #define PT_GNU_EH_FRAME (PT_LOOS + 0x474e550)
11881 #endif
11882
11883 +/* Support FreeBSD */
11884 +#ifndef ElfW
11885 +# ifdef __ElfN
11886 +# define ElfW __ElfN
11887 +# endif
11888 +#endif
11889 +
11890 struct unw_eh_callback_data
11891 {
11892 _Unwind_Ptr pc;
11893
11894
11895
11896 1.1 src/patchsets/gcc/4.3.6/gentoo/91_all_gcc-freebsd.patch
11897
11898 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/91_all_gcc-freebsd.patch?rev=1.1&view=markup
11899 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/91_all_gcc-freebsd.patch?rev=1.1&content-type=text/plain
11900
11901 Index: 91_all_gcc-freebsd.patch
11902 ===================================================================
11903 http://bugs.gentoo.org/192403
11904 http://gcc.gnu.org/PR33417
11905
11906 --- gcc-4.3.1/gcc/config/freebsd-spec.h
11907 +++ gcc-4.3.1/gcc/config/freebsd-spec.h
11908 @@ -79,9 +81,10 @@
11909 #define FBSD_STARTFILE_SPEC \
11910 "%{!shared: \
11911 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
11912 - %{!p:%{profile:gcrt1.o%s} \
11913 - %{!profile:crt1.o%s}}}} \
11914 - crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
11915 + %{!p:%{profile:gcrt1.o%s} \
11916 + %{!profile:crt1.o%s}}}} \
11917 + crti.o%s \
11918 + %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}"
11919
11920 /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
11921 the magical crtend.o file (see crtstuff.c) which provides part of
11922 @@ -119,7 +122,8 @@
11923 %{pg: -lc_p} \
11924 }"
11925 #else
11926 -#if FBSD_MAJOR < 5
11927 +#include <sys/param.h>
11928 +#if __FreeBSD_version < 500016
11929 #define FBSD_LIB_SPEC " \
11930 %{!shared: \
11931 %{!pg: \
11932 @@ -129,17 +133,34 @@
11933 %{!pthread:-lc_p} \
11934 %{pthread:-lc_r_p}} \
11935 }"
11936 -#else
11937 +#elif __FreeBSD_version < 700022
11938 #define FBSD_LIB_SPEC " \
11939 %{!shared: \
11940 %{!pg: %{pthread:-lpthread} -lc} \
11941 %{pg: %{pthread:-lpthread_p} -lc_p} \
11942 }"
11943 +#else
11944 +#define FBSD_LIB_SPEC " \
11945 + %{!shared: \
11946 + %{!pg: %{pthread:-lpthread} -lc} \
11947 + %{pg: %{pthread:-lpthread_p} -lc_p}} \
11948 + %{shared: \
11949 + %{pthread:-lpthread} -lc} \
11950 + "
11951 #endif
11952 #endif
11953
11954 -#if FBSD_MAJOR < 6
11955 +#if FBSD_MAJOR < 5
11956 #define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
11957 #else
11958 #define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1"
11959 #endif
11960 +
11961 +#if defined(HAVE_LD_EH_FRAME_HDR)
11962 +#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
11963 +#endif
11964 +
11965 +/* Use --as-needed -lgcc_s for eh support. */
11966 +#ifdef HAVE_LD_AS_NEEDED
11967 +#define USE_LD_AS_NEEDED 1
11968 +#endif
11969
11970
11971
11972 1.1 src/patchsets/gcc/4.3.6/gentoo/README.history
11973
11974 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/README.history?rev=1.1&view=markup
11975 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.3.6/gentoo/README.history?rev=1.1&content-type=text/plain
11976
11977 Index: README.history
11978 ===================================================================
11979 1.0 01.07.2011
11980 + 00_all_gcc-4.1-alpha-mieee-default.patch
11981 + 00_all_gcc-trampolinewarn.patch
11982 + 01_all_gcc-4.1-alpha-asm-mcpu.patch
11983 + 03_all_gcc43-java-nomulti.patch
11984 + 05_all_pr40010-manpages.patch
11985 + 08_all_gcc-4.1-cross-compile.patch
11986 + 10_all_gcc-default-format-security.patch
11987 + 10_all_gcc-default-fortify-source.patch
11988 + 11_all_gcc-netbsd-symbolic.patch
11989 + 14_all_gcc-sparc64-bsd.patch
11990 + 15_all_gcc-libgomp-no-werror.patch
11991 + 18_all_904-flatten-switch-stmt-00.patch
11992 + 20_all_mudflap-setuid-env.patch
11993 + 20_all_s390-gcc-4.3.2-z10-complete.patch
11994 + 40_all_gcc-4.4-libiberty.h-asprintf.patch
11995 + 45_all_arm-pic-ssp-segv-pr35965.patch
11996 + 46_all_armel-hilo-union-class.patch
11997 + 47_all_arm-unbreak-armv4t.patch
11998 + 48_all_gfortran-armel-updates.patch
11999 + 49_all_arm_v7-config.patch
12000 + 51_all_gcc-3.4-libiberty-pic.patch
12001 + 53_all_gcc4-superh-default-multilib.patch
12002 + 61_all_gcc43-pr24170.patch
12003 + 61_all_gcc4-ia64-noteGNUstack.patch
12004 + 62_all_gcc4-noteGNUstack.patch
12005 + 66_all_gcc43-pr25343.patch
12006 + 68_all_gcc43-pr37661.patch
12007 + 70_all_gcc43-libjava-headers.patch
12008 + 73_all_sh-libgcc-stacks.patch
12009 + 74_all_sh-pr24836.patch
12010 + 75_all_mips-r10k-cache-barriers.patch
12011 + 76_all_mips-r10k-scheduling-support.patch
12012 + 77_all_mips-r10k-support-for-atomic-memory-fixes.patch
12013 + 78_all_mips-constant-addr.patch
12014 + 79_all_arm_PR37436.patch
12015 + 80_all_sparc-biarch.patch
12016 + 90_all_gcc-freebsd.patch
12017 + 91_all_gcc-freebsd.patch